pub async fn query(prompt: &str) -> Result<String>Expand description
Simple synchronous query to iFlow
Sends a query to iFlow and waits for a complete response. This is a convenience function for simple request-response interactions.
§Arguments
prompt- The query prompt to send to iFlow
§Returns
Ok(String)containing the response from iFlowErr(IFlowError)if there was an error
§Example
use iflow_cli_sdk_rust::query;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = query("What is 2 + 2?").await?;
println!("{}", response);
Ok(())
}