Inception provider agent example

This commit is contained in:
Collin Brittain 2025-04-11 11:18:32 -05:00
parent 391e6c87d3
commit bffb245eed
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
use std::env;
use rig::{completion::Prompt, providers::inception::client::ClientBuilder};
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
// Create Inception Labs client
let client =
ClientBuilder::new(&env::var("INCEPTION_API_KEY").expect("INCEPTION_API_KEY not set"))
.build();
// Create agent with a single context prompt
let agent = client
.agent("mercury-coder-small")
.preamble("You are a helpful AI assistant.")
.temperature(0.0)
.build();
// Prompt the agent and print the response
let response = agent.prompt("Hello, how are you?").await?;
println!("{}", response);
Ok(())
}