File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from temporalio .client import Client
44from temporalio .common import WorkflowIDReusePolicy
5+ from temporalio .contrib .openai_agents .open_ai_data_converter import (
6+ open_ai_data_converter ,
7+ )
58
6- # from openai_agents.adapters.open_ai_converter import open_ai_data_converter
79from openai_agents .workflows .agents_as_tools_workflow import AgentsAsToolsWorkflow
810
911
1012async def main ():
1113 # Create client connected to server at the given address
12- client = await Client .connect ("localhost:7233" )
14+ client = await Client .connect (
15+ "localhost:7233" ,
16+ data_converter = open_ai_data_converter ,
17+ )
1318
1419 # Execute a workflow
1520 result = await client .execute_workflow (
Original file line number Diff line number Diff line change 11import argparse
22import asyncio
33
4- from temporalio import workflow
54from temporalio .client import (
65 Client ,
76 WorkflowQueryRejectedError ,
87 WorkflowUpdateFailedError ,
98)
109from temporalio .common import QueryRejectCondition , WorkflowIDReusePolicy
10+ from temporalio .contrib .openai_agents .open_ai_data_converter import (
11+ open_ai_data_converter ,
12+ )
1113from temporalio .service import RPCError , RPCStatusCode
1214
13- with workflow .unsafe .imports_passed_through ():
14- from temporalio .contrib .openai_agents .open_ai_data_converter import (
15- open_ai_data_converter ,
16- )
17-
18- from openai_agents .workflows .customer_service_workflow import (
19- CustomerServiceWorkflow ,
20- ProcessUserMessageInput ,
21- )
15+ from openai_agents .workflows .customer_service_workflow import (
16+ CustomerServiceWorkflow ,
17+ ProcessUserMessageInput ,
18+ )
2219
2320
2421async def main ():
Original file line number Diff line number Diff line change 11import asyncio
22
3- from temporalio import workflow
43from temporalio .client import Client
54from temporalio .common import WorkflowIDReusePolicy
5+ from temporalio .contrib .openai_agents .open_ai_data_converter import (
6+ open_ai_data_converter ,
7+ )
68
79from openai_agents .workflows .hello_world_workflow import HelloWorldAgent
810
9- with workflow .unsafe .imports_passed_through ():
10- from temporalio .contrib .openai_agents .open_ai_data_converter import (
11- open_ai_data_converter ,
12- )
13-
1411
1512async def main ():
1613 # Create client connected to server at the given address
Original file line number Diff line number Diff line change 22
33from temporalio .client import Client
44from temporalio .common import WorkflowIDReusePolicy
5+ from temporalio .contrib .openai_agents .open_ai_data_converter import (
6+ open_ai_data_converter ,
7+ )
58
69from openai_agents .workflows .research_bot_workflow import ResearchWorkflow
710
@@ -10,6 +13,7 @@ async def main():
1013 # Create client connected to server at the given address
1114 client = await Client .connect (
1215 "localhost:7233" ,
16+ data_converter = open_ai_data_converter ,
1317 )
1418
1519 # Execute a workflow
Original file line number Diff line number Diff line change 22
33from temporalio .client import Client
44from temporalio .common import WorkflowIDReusePolicy
5+ from temporalio .contrib .openai_agents .open_ai_data_converter import (
6+ open_ai_data_converter ,
7+ )
58
69from openai_agents .workflows .tools_workflow import ToolsWorkflow
710
811
912async def main ():
1013 # Create client connected to server at the given address
11- client = await Client .connect ("localhost:7233" )
14+ client = await Client .connect (
15+ "localhost:7233" ,
16+ data_converter = open_ai_data_converter ,
17+ )
1218
1319 # Execute a workflow
1420 result = await client .execute_workflow (
You can’t perform that action at this time.
0 commit comments