01_basic_agent/
01_basic_agent.rs1use ceylon_next::agent::{Agent, AgentConfig};
9use ceylon_next::tasks::{OutputData, TaskRequest};
10
11#[tokio::main]
12async fn main() {
13 println!("🤖 Ceylon Agent - Basic Example\n");
14
15 let mut agent = Agent::new("Assistant", "ollama::gemma3:latest");
18
19 let config = AgentConfig::new(
21 3, 60, );
24 agent.with_config(config);
25
26 agent.with_system_prompt(
28 "You are a helpful assistant that answers questions accurately and concisely. \
29 Always provide well-structured responses."
30 );
31
32 let mut task = TaskRequest::new("What is the capital of France?");
34 task.with_name("Geography Question")
35 .with_description("A simple geography question")
36 .with_priority(5);
37
38 println!("📋 Task: {}\n", "What is the capital of France?");
40 let response = agent.run(task).await;
41
42 match response.result() {
44 OutputData::Text(answer) => {
45 println!("📝 Agent Response:\n{}\n", answer);
46 }
47 _ => {
48 println!("❌ Unexpected response type");
49 }
50 }
51
52 println!("✅ Example completed successfully!");
53}