Skip to main content

run_agent

Function run_agent 

Source
pub fn run_agent(
    endpoint: &str,
    model: &str,
    system_prompt: &str,
    user_message: &str,
    callback: &mut dyn FnMut(&str) -> Result<()>,
) -> Result<String>
Expand description

Run an agent loop using direct HTTP with function calling.

This creates an agent loop where:

  1. Model receives a prompt and thinks about what to do
  2. Model requests tool execution if needed
  3. Runtime executes the tool
  4. Runtime feeds result back to model
  5. Loop continues until task is complete