chat-rs
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.

CapabilityOpt in withYou call
Streamingthe stream featurechat.stream(&mut messages)
Multimodalnothing, it is built inparts!["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.