#![allow(clippy::print_stdout)]
use futures_util::StreamExt;
use honcho_ai::Honcho;
#[tokio::main]
async fn main() -> honcho_ai::error::Result<()> {
let honcho = Honcho::from_params(
Honcho::builder()
.base_url("http://localhost:8000")
.workspace_id("streaming-demo")
.build(),
)?;
let peer = honcho.peer("user-1", None, None).await?;
let mut stream = peer.chat_stream("Tell me a story").send().await?;
while let Some(chunk) = stream.next().await {
let text = chunk?;
print!("{text}");
}
println!();
Ok(())
}