Skip to content

Add argument validation for the types of provided tools - #985

Merged
tconley1428 merged 6 commits into
mainfrom
openai/tool_type_check
Jul 22, 2025
Merged

tconley1428 merged 6 commits into
mainfrom
openai/tool_type_check

Conversation

@tconley1428

Copy link
Copy Markdown
Contributor

What was changed

If a tool is provided to an Agent that is not a tool type, raise an early exception.

Why?

This can happen easily if a user passes an activity without wrapping in activity_as_tool

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@tconley1428
tconley1428 requested a review from a team as a code owner July 21, 2025 22:23
@tconley1428
tconley1428 merged commit 8b727e5 into main Jul 22, 2025
@tconley1428
tconley1428 deleted the openai/tool_type_check branch July 22, 2025 19:17
tconley1428 added a commit that referenced this pull request Aug 28, 2025
* Add argument validation for the types of provided tools

* Specifically check if it is a callable, as Union isn't supported in isinstance

* Fix type check with typing.get_args

* Fix check
brianstrauch pushed a commit to temporalio/ai-integrations that referenced this pull request Sep 3, 2026
…dk-python#985)

* Add argument validation for the types of provided tools

* Specifically check if it is a callable, as Union isn't supported in isinstance

* Fix type check with typing.get_args

* Fix check

Migrated-From: temporalio/sdk-python@8b727e5
brianstrauch pushed a commit to temporalio/ai-integrations that referenced this pull request Sep 3, 2026
…dk-python#985)

* Add argument validation for the types of provided tools

* Specifically check if it is a callable, as Union isn't supported in isinstance

* Fix type check with typing.get_args

* Fix check

Migrated-From: temporalio/sdk-python@8b727e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants