query_with_config

Function query_with_config 

Source
pub async fn query_with_config(
    prompt: &str,
    options: IFlowOptions,
) -> Result<String>
Expand description

Simple synchronous query to iFlow with custom options

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
  • options - Configuration options for the query

§Returns

  • Ok(String) containing the response from iFlow
  • Err(IFlowError) if there was an error

§Example

use iflow_cli_sdk_rust::{query_with_config, IFlowOptions};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let options = IFlowOptions::new().with_timeout(120.0);
    let response = query_with_config("What is 2 + 2?", options).await?;
    println!("{}", response);
    Ok(())
}