MultiProviderMap (models/multi_provider.py)

openai-agents-python · src/agents/models/multi_provider.py · python · MIT
ai, AI / Agents

Maps model name prefixes to providers for multi-backend support.

# Source: https://github.com/openai/openai-agents-python | License: MIT | Copyright 2025 OpenAI
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import asyncio
from typing import Any, Literal, cast

from openai import AsyncOpenAI

from ..exceptions import UserError
from .interface import Model, ModelProvider
from .openai_agent_registration import OpenAIAgentRegistrationConfig
from .openai_provider import OpenAIProvider
from .openai_responses import OpenAIResponsesWebSocketOptions

MultiProviderOpenAIPrefixMode = Literal["alias", "model_id"]
MultiProviderUnknownPrefixMode = Literal["error", "model_id"]


class MultiProviderMap:
    """A map of model name prefixes to ModelProviders."""

    def __init__(self):
        self._mapping: dict[str

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key