Function setProviderPriority

  • Set a custom provider priority order for auto-detection. The first provider in the list whose env var (or CLI binary) is available will be picked. Providers not in the list are skipped entirely — pass the full set you want considered.

    Throws if any provider id is unknown to the runtime (typo guard).

    Parameters

    • Optional providers: readonly string[]

    Returns void

    Example

    import { setProviderPriority, generateText } from '@framers/agentos';

    // Prefer Anthropic over OpenAI even if both keys are set:
    setProviderPriority(['anthropic', 'openai', 'ollama']);

    const { text } = await generateText({ prompt: 'hi' });