Module generic

Source
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§

GenericMessage
Lightweight container representing a single chat message that is independent of any specific LLM provider.

Enums§

GenericRole
High-level chat roles recognised by most LLM providers.