-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
The Agent class allows non-string types (like int) to be passed as the name, even though the documentation specifies that name should be a str.
I tested this by passing an integer to name, and the agent still worked without throwing any error. This may lead to confusion or bugs when users expect strict type validation.
#name is an integer here instead of a string
agent = Agent(name=1, instructions="You are a helpful assistant.")
result = await Runner.run(agent, "Write a 5-line haiku about AI")
The SDK should raise a validation error if name is not a str, matching what the documentation says.
If the SDK is not using Pydantic or any strict type-checking internally, then either that should be added, or the documentation should clarify that it's loosely enforced.This would help avoid confusion for developers expecting strongly typed input.
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists