Expand description
Generic message and role types used by the artificial-core crate.
They deliberately mirror the concepts exposed by most provider APIs: “system”, “user”, “assistant”, and “tool”. By staying minimal and provider-agnostic we can:
- convert them into provider-specific structs via a simple
From/Into, - serialize them without pulling in heavyweight dependencies, and
- use them in unit tests without mocking a full transport layer.
§When to add more fields?
Only if the additional data is required by multiple back-ends or fundamentally provider-independent. Otherwise extend the provider-specific message type instead of bloating this one.
Structs§
- Generic
Chat Completion Response - Generic
Function Call - Generic
Function Call Intent - Generic
Function Spec - Generic
Message - Lightweight container representing a single chat message that is independent of any specific LLM provider.
- Generic
Usage Report
Enums§
- Generic
Role - High-level chat roles recognised by most LLM providers.
- Generic
Straming Chat Chunk - Response
Content - Stream
Event
Traits§
- Streaming
Events Provider - Provider-agnostic trait for streaming structured events (text + tool-calls).
This complements the existing text-only
StreamingChatProvidertrait.