Skip to main content

troupekit_kit/agent/
start.rs

1use super::Agent;
2use crate::built::{BuiltAgent, Input};
3use crate::error::KitError;
4use troupekit_core::ids::RunId;
5
6impl Agent {
7    /// Builds the agent and starts a run on `input` with no model call.
8    /// Returns the built agent and the run id to store for `resume` or
9    /// `resume_for`. Fails like `build`, then like `BuiltAgent::start`.
10    pub async fn start(self, input: impl Into<Input>) -> Result<(BuiltAgent, RunId), KitError> {
11        let built = self.build().await?;
12        let run_id = built.start(input).await?;
13        Ok((built, run_id))
14    }
15}