agentai 0.3.0

AgentAI is a Rust library designed to simplify the creation of AI agents.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! # Streaming Example
//!
//! This example streams a run with [`Agent::run_stream`](crate::Agent::run_stream) and prints
//! the answer as the model writes it. The stream also reports the tool calls the agent makes
//! and their results, and ends with [`AgentEvent::Finished`](crate::AgentEvent::Finished),
//! which holds the same [`AgentResult`](crate::AgentResult) as an awaited run. The new messages
//! are then added to the history.
//!
//! To run this example from the terminal, enter:
//! ```bash
//! cargo run --example streaming
//! ```
//!
//! ## Source Code
//!
//! ```rust
#![doc = include_str!("../../examples/streaming.rs")]
//! ```