Skip to content

Commit 1ab5365

Browse files
committed
Update SDK branch to latest with corresponding changes
1 parent 136b40a commit 1ab5365

3 files changed

Lines changed: 381 additions & 361 deletions

File tree

openai_agents/run_worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import concurrent.futures
5+
from datetime import timedelta
56

67
from temporalio import workflow
78
from temporalio.client import Client
@@ -28,7 +29,9 @@
2829

2930

3031
async def main():
31-
with set_open_ai_agent_temporal_overrides():
32+
with set_open_ai_agent_temporal_overrides(
33+
start_to_close_timeout=timedelta(seconds=60),
34+
):
3235
# Create client connected to server at the given address
3336
client = await Client.connect(
3437
"localhost:7233",

openai_agents/workflows/tools_workflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from datetime import timedelta
4+
35
from temporalio import workflow
46
from temporalio.contrib.openai_agents.temporal_tools import activity_as_tool
57

@@ -17,7 +19,7 @@ async def run(self, question: str) -> str:
1719
agent = Agent(
1820
name="Hello world",
1921
instructions="You are a helpful agent.",
20-
tools=[activity_as_tool(get_weather)],
22+
tools=[activity_as_tool(get_weather, start_to_close_timeout=timedelta(seconds=60))],
2123
)
2224

2325
result = await Runner.run(agent, input=question)

0 commit comments

Comments
 (0)