Skip to content

Restrict Agent name to string only, raise TypeError for int/boolean #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

AsnaSiddiqui
Copy link

Description

Restricted the Agent name parameter to only accept str types, raising a TypeError for int or boolean inputs. Changes:

  • Updated agent.py to enforce str type using __post_init__ and raise TypeError for invalid types.
  • Updated tests in test_agent_name.py to verify str acceptance and TypeError for int and bool inputs.

Testing

  • Run pytest tests/test_agent_name.py successfully (1 passed, 2 failed with TypeError).

Checklist

  • Code changes
  • Tests added

@seratch seratch added the duplicate This issue or pull request already exists label Jul 30, 2025
@seratch
Copy link
Member

seratch commented Jul 30, 2025

Thanks for sending this! however, we are going to add this validation at #998 ; so let me close this one.

@seratch seratch closed this Jul 30, 2025
@AsnaSiddiqui
Copy link
Author

@openai/maintainers Thanks for the update! I had submitted #1314 for the same validation. Glad to know it's being handled in #998. Can I contribute or track the progress here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants