Skip to content

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

Closed
AsnaSiddiqui wants to merge 2 commits into
openai:mainfrom
AsnaSiddiqui:restrict-agent-name-to-string
Closed

Restrict Agent name to string only, raise TypeError for int/boolean#1314
AsnaSiddiqui wants to merge 2 commits into
openai:mainfrom
AsnaSiddiqui:restrict-agent-name-to-string

Conversation

@AsnaSiddiqui

Copy link
Copy Markdown

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

seratch commented Jul 30, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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