File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44from temporalio .client import Client
55from temporalio .common import WorkflowIDReusePolicy
6- from temporalio .contrib .openai_agents .temporal_openai_agents import (
7- set_open_ai_agent_temporal_overrides ,
8- )
96
107from openai_agents .workflows .hello_world_workflow import HelloWorldAgent
118
@@ -14,18 +11,15 @@ async def main():
1411 # Create client connected to server at the given address
1512 client = await Client .connect ("localhost:7233" )
1613
17- with set_open_ai_agent_temporal_overrides (
18- start_to_close_timeout = timedelta (seconds = 10 )
19- ):
20- # Execute a workflow
21- result = await client .execute_workflow (
22- HelloWorldAgent .run ,
23- "Tell me about recursion in programming." ,
24- id = "my-workflow-id" ,
25- task_queue = "my-task-queue" ,
26- id_reuse_policy = WorkflowIDReusePolicy .TERMINATE_IF_RUNNING ,
27- )
28- print (f"Result: { result } " )
14+ # Execute a workflow
15+ result = await client .execute_workflow (
16+ HelloWorldAgent .run ,
17+ "Tell me about recursion in programming." ,
18+ id = "my-workflow-id" ,
19+ task_queue = "my-task-queue" ,
20+ id_reuse_policy = WorkflowIDReusePolicy .TERMINATE_IF_RUNNING ,
21+ )
22+ print (f"Result: { result } " )
2923
3024
3125if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments