Capabilities
Capabilities
What a chat-rs model can do, and how each capability is exposed.
A capability is something a model can do that chat-rs exposes the same way across every provider that supports it. You opt into a capability on the builder, and the type system makes sure you only call what you set up.
| Capability | Opt in with | You call |
|---|---|---|
| Streaming | the stream feature | chat.stream(&mut messages) |
| Multimodal | nothing, it is built in | parts!["text", file] |
| Structured output | .with_structured_output::<T>() | chat.complete(&mut messages) returns T |
| Embeddings | .with_embeddings() | chat.embed(&mut messages) |
| Transports | .with_transport(...) | swap HTTP for WebSocket or your own |
Not every provider supports every capability. The providers section lists what each one can do. Capabilities are backed by traits: a provider advertises a capability by implementing the matching trait.