feat: Replace hardcoded query with user input

This commit is contained in:
2026-06-04 18:01:13 +05:30
parent d3e60a2702
commit f13572e7f4

View File

@@ -2,6 +2,7 @@ mod trace;
use serde::{Deserialize, Serialize};
use serde_json::json;
use std::io::{self, Write};
use std::process::Command;
use std::time::Instant;
use trace::Trace;
@@ -320,14 +321,22 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let tools = build_tools();
print!("> ");
io::stdout().flush()?;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
let input = input.trim();
if input.is_empty() {
return Ok(());
}
let messages = vec![
ChatMessage::system(
"You are a concise system assistant. Use the provided tools to gather \
real-time information when needed. Do not guess at live data.",
),
ChatMessage::user(
"Check if wttr.in/Delhi is accessible and give me a one-line weather summary.",
),
ChatMessage::user(input),
];
// Capture the task before messages ownership moves into run_agent.