Skip to content

MultiProvider not exported in public API but used as default in RunConfig #1325

@kobol

Description

@kobol

Please read this first

  • Have you read the docs?Agents SDK docs
  • Have you searched for related issues? Others may have faced similar issues.

Describe the bug

The MultiProvider class is used as the default factory for RunConfig.model_provider but is not exported in the public API (__init__.py). This creates an inconsistency where users cannot directly access the class that's used internally as the default.

Current Behavior

# In run.py
model_provider: ModelProvider = field(default_factory=MultiProvider)

# But in __init__.py, MultiProvider is not exported
# Users cannot do:
from agents import MultiProvider  # This fails

Expected Behavior

Users should be able to access MultiProvider directly since it's used as the default model provider.

Impact

  1. API Inconsistency: The default behavior uses a class that's not publicly accessible
  2. User Confusion: Users might want to customize the default provider but can't access the class
  3. Limited Flexibility: Users cannot create custom MultiProvider instances with specific configurations

Proposed Solutions

Export MultiProvider directly

Add MultiProvider to the __all__ list in __init__.py:

from .models.multi_provider import MultiProvider

__all__ = [
    # ... existing exports
    "MultiProvider",
    # ...
]

Debug information

  • Agents SDK version: (e.g. v0.2.2)
  • Python version (e.g. Python 3.12)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions