Skip to content

Commit db835a0

Browse files
committed
fix test issues
1 parent e5c0819 commit db835a0

5 files changed

Lines changed: 165 additions & 169 deletions

File tree

openai_agents/run_hello_world_workflow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
from datetime import timedelta
23

34
from temporalio.client import Client
45
from temporalio.common import WorkflowIDReusePolicy
@@ -13,7 +14,9 @@ async def main():
1314
# Create client connected to server at the given address
1415
client = await Client.connect("localhost:7233")
1516

16-
with set_open_ai_agent_temporal_overrides():
17+
with set_open_ai_agent_temporal_overrides(
18+
start_to_close_timeout=timedelta(seconds=10)
19+
):
1720
# Execute a workflow
1821
result = await client.execute_workflow(
1922
HelloWorldAgent.run,

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: 7 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,11 @@ 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=[
23+
activity_as_tool(
24+
get_weather, start_to_close_timeout=timedelta(seconds=10)
25+
)
26+
],
2127
)
2228

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

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ open-telemetry = [
4848
"temporalio[opentelemetry]",
4949
"opentelemetry-exporter-otlp-proto-grpc==1.18.0",
5050
]
51-
openai = [
52-
"openai-agents @ git+https://github.com/openai/openai-agents-python@83251c385483cfdf89121ecf313880f6076f8917",
53-
"temporalio[openai] @ git+https://github.com/temporalio/sdk-python@openai-agents-tests",
51+
openai-agents = [
52+
"openai-agents >= 0.0.19",
53+
"temporalio[openai-agents] @ git+https://github.com/temporalio/sdk-python@openai-agents-tests",
5454
"rich>=14.0.0",
5555
]
5656
pydantic-converter = ["pydantic>=2.10.6,<3"]

0 commit comments

Comments
 (0)