pub struct StreamingFunctionCallingAgent { /* private fields */ }Expand description
Streaming Function Calling Agent
Streams LLM text (token by token), then emits FinalAnswer at the end.
Tool-call state is exposed via AgentStreamEvent::ToolCall.
Works with any LLM provider implementing BaseChatModel.
Implementations§
Source§impl StreamingFunctionCallingAgent
impl StreamingFunctionCallingAgent
Sourcepub fn new<L>(llm: L) -> Self
pub fn new<L>(llm: L) -> Self
Creates a new Streaming Function Calling Agent
§Backward compatibility
Old code StreamingFunctionCallingAgent::new(openai_chat) still works.
Sourcepub fn from_arc(
llm: Arc<dyn BaseChatModel<Error = ProviderError> + Send + Sync>,
) -> Self
pub fn from_arc( llm: Arc<dyn BaseChatModel<Error = ProviderError> + Send + Sync>, ) -> Self
Creates an agent from a wrapped Arc<dyn BaseChatModel>
Sourcepub async fn invoke_stream(
&self,
input: String,
) -> Pin<Box<dyn Stream<Item = AgentStreamEvent> + Send>>
pub async fn invoke_stream( &self, input: String, ) -> Pin<Box<dyn Stream<Item = AgentStreamEvent> + Send>>
Streams execution: returns an event stream
Auto Trait Implementations§
impl !RefUnwindSafe for StreamingFunctionCallingAgent
impl !UnwindSafe for StreamingFunctionCallingAgent
impl Freeze for StreamingFunctionCallingAgent
impl Send for StreamingFunctionCallingAgent
impl Sync for StreamingFunctionCallingAgent
impl Unpin for StreamingFunctionCallingAgent
impl UnsafeUnpin for StreamingFunctionCallingAgent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more