Skip to content

Commit 129bc5c

Browse files
committed
Remove validatoriterator workarounds
1 parent 607641b commit 129bc5c

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ opentelemetry = [
2626
]
2727
pydantic = ["pydantic>=2.0.0,<3"]
2828
openai-agents = [
29-
"openai-agents >= 0.2.3,<0.3",
29+
"openai-agents >= 0.2.9,<0.3",
3030
"eval-type-backport>=0.2.2; python_version < '3.10'"
3131
]
3232

temporalio/contrib/openai_agents/_invoke_model_activity.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ async def empty_on_invoke_handoff(
172172
) -> Any:
173173
return None
174174

175-
# workaround for https://github.com/pydantic/pydantic/issues/9541
176-
# ValidatorIterator returned
177-
input_json = to_json(input["input"])
178-
input_input = json.loads(input_json)
179-
180175
def make_tool(tool: ToolInput) -> Tool:
181176
if isinstance(
182177
tool,
@@ -219,7 +214,7 @@ def make_tool(tool: ToolInput) -> Tool:
219214
try:
220215
return await model.get_response(
221216
system_instructions=input.get("system_instructions"),
222-
input=input_input,
217+
input=input["input"],
223218
model_settings=input["model_settings"],
224219
tools=tools,
225220
output_schema=input.get("output_schema"),

temporalio/contrib/openai_agents/_openai_runner.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ async def run(
6161
"Temporal OpenAI agent does not support on demand MCP servers."
6262
)
6363

64-
# workaround for https://github.com/pydantic/pydantic/issues/9541
65-
# ValidatorIterator returned
66-
input_json = to_json(input)
67-
input = json.loads(input_json)
68-
6964
context = kwargs.get("context")
7065
max_turns = kwargs.get("max_turns", DEFAULT_MAX_TURNS)
7166
hooks = kwargs.get("hooks")

uv.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)