Function buildLlmCaller

  • Build an llmCaller function for any AgentOS-supported provider.

    This uses the full provider resolution chain: resolveModelOption → resolveProvider → createProviderManager → getProvider

    Works with all provider types:

    • API providers (openai, anthropic, groq, together, mistral, xai, openrouter)
    • CLI providers (claude-code-cli, gemini-cli) — no API key needed
    • Local providers (ollama) — requires OLLAMA_BASE_URL

    The returned function has the signature (system: string, user: string) => Promise<string>.

    Parameters

    Returns Promise<LlmCallerFn>

    A caller function compatible with PlannerConfig.llmCaller.