Skip to content

Commit f0bd341

Browse files
OpenAI - Fix generics is instance (#1261)
* bump version to 1.21.1 * Restrict tool type check to reject callable because of the inability to check against generic type. --------- Co-authored-by: Alex Mazzeo <[email protected]>
1 parent 772050e commit f0bd341

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "temporalio"
3-
version = "1.21.0"
3+
version = "1.21.1"
44
description = "Temporal.io Python SDK"
55
authors = [{ name = "Temporal Technologies Inc", email = "[email protected]" }]
66
requires-python = ">=3.10"

temporalio/contrib/openai_agents/_openai_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ async def run(
9898
**kwargs,
9999
)
100100

101-
tool_types = typing.get_args(Tool)
102101
for t in starting_agent.tools:
103-
if not isinstance(t, tool_types):
102+
if callable(t):
104103
raise ValueError(
105104
"Provided tool is not a tool type. If using an activity, make sure to wrap it with openai_agents.workflow.activity_as_tool."
106105
)

temporalio/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import temporalio.exceptions
2424
import temporalio.runtime
2525

26-
__version__ = "1.21.0"
26+
__version__ = "1.21.1"
2727

2828
ServiceRequest = TypeVar("ServiceRequest", bound=google.protobuf.message.Message)
2929
ServiceResponse = TypeVar("ServiceResponse", bound=google.protobuf.message.Message)

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)