Closed
Description
Hi OpenAI team 👋
I noticed something while working with the Agent
class in the OpenAI Agent SDK.
According to the SDK, the name
field in the Agent
class is typed as str
, like this:
class Agent(...):
name: str
However, when I pass an integer like 1 to the name
parameter, it still works without raising any validation error:
agent = Agent(name=1)
print(agent.name) # Output: 1
🔍 My Questions:
- Is this expected behavior due to Pydantic's automatic type coercion?
- Should this be allowed in strict type-checking scenarios?
- Is there a way to enforce stricter typing for critical fields like
name
?
Thanks for your great work on this amazing SDK! 🙏