File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
temporalio/contrib/openai_agents Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1+ import json
12import typing
23from dataclasses import replace
34from typing import Any , Union
1314 TResponseInputItem ,
1415)
1516from agents .run import DEFAULT_AGENT_RUNNER , DEFAULT_MAX_TURNS , AgentRunner
17+ from pydantic_core import to_json
1618
1719from temporalio import workflow
1820from temporalio .contrib .openai_agents ._model_parameters import ModelActivityParameters
@@ -57,6 +59,11 @@ async def run(
5759 "Temporal OpenAI agent does not support on demand MCP servers."
5860 )
5961
62+ # workaround for https://github.com/pydantic/pydantic/issues/9541
63+ # ValidatorIterator returned
64+ input_json = to_json (input )
65+ input = json .loads (input_json )
66+
6067 context = kwargs .get ("context" )
6168 max_turns = kwargs .get ("max_turns" , DEFAULT_MAX_TURNS )
6269 hooks = kwargs .get ("hooks" )
You can’t perform that action at this time.
0 commit comments