Skip to content

Support int and boolean types for Agent name parameter #1285

@AsnaSiddiqui

Description

@AsnaSiddiqui

Feature Request

Description:
The OpenAI Agents SDK documentation states that the Agent name parameter must be a string. However, when using third-party LLMs (e.g., LiteLLM with Anthropic’s Claude model), name=123 (integer) and name=True (boolean) work without errors due to Pydantic coercion to strings (e.g., 123 becomes "123", True becomes "True"). I propose:

  • Updating the SDK code to explicitly support int and boolean types for the name parameter with automatic string conversion.
  • Updating the documentation to clarify that int and boolean are valid inputs.
  • Adding tests to verify this behavior across OpenAI and third-party LLMs.

Example:

from agents import Agent
agent = Agent(name=123, model="anthropic/claude-3.5-sonnet", instructions="Test")
print(agent.name)  # Outputs: "123"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions