troupekit_kit/agent/stream.rs
1use super::Agent;
2use crate::built::{Input, RunStream};
3use crate::error::KitError;
4
5impl Agent {
6 /// Builds the agent and starts a streamed run on `input`.
7 /// Output: the stream once the run id is known, or the first build
8 /// or setup error. Keep a `BuiltAgent` and call its `stream` instead
9 /// to run many times.
10 pub async fn stream(self, input: impl Into<Input>) -> Result<RunStream, KitError> {
11 let built = self.build().await?;
12 built.stream(input).await
13 }
14}