From f13572e7f4b28340a0c7e5367648def629efa8e8 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Thu, 4 Jun 2026 18:01:13 +0530 Subject: [PATCH] feat: Replace hardcoded query with user input --- src/main.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 879b90b..67c7e3a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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> { 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.