Skip to main content

chat_stream

AsyncMethod
This is a method of the LlmProvider class in the llm module.
Stream a chat completion (returns chunks)

Signature

async def chat_stream(
        &self,
        messages: &[Message],
        tools: Option<&[ToolDefinition]>,
    ) -> Result<Box<dyn futures::Stream<Item = Result<String>> + Send + Unpin>>

Parameters

messages
&
required
No description available.
tools
Option<&
required
No description available.

Returns

Returns
Result<Box<dyn futures::Stream<Item = Result<String>> + Send + Unpin>>
The result of the operation.