troupekit-kit 0.4.0

Ergonomic API for the Troupekit LLM agent framework: one builder or one macro per agent, tool and graph.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::Agent;
use crate::built::{BuiltAgent, Input};
use crate::error::KitError;
use troupekit_core::ids::RunId;

impl Agent {
    /// Builds the agent and starts a run on `input` with no model call.
    /// Returns the built agent and the run id to store for `resume` or
    /// `resume_for`. Fails like `build`, then like `BuiltAgent::start`.
    pub async fn start(self, input: impl Into<Input>) -> Result<(BuiltAgent, RunId), KitError> {
        let built = self.build().await?;
        let run_id = built.start(input).await?;
        Ok((built, run_id))
    }
}