Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions openai_agents/run_worker.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ug, I really wish we had tests for these samples so we'd know if the code still works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd like to make that possible.

Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
from __future__ import annotations

import asyncio
import concurrent.futures
from datetime import timedelta

from temporalio import workflow
from temporalio.client import Client
from temporalio.contrib.openai_agents.invoke_model_activity import ModelActivity
from temporalio.contrib.openai_agents.open_ai_data_converter import (
open_ai_data_converter,
)
from temporalio.contrib.openai_agents.model_parameters import ModelActivityParameters
from temporalio.contrib.openai_agents.temporal_openai_agents import (
set_open_ai_agent_temporal_overrides,
)
from temporalio.contrib.pydantic import pydantic_data_converter
from temporalio.worker import Worker

from openai_agents.workflows.agents_as_tools_workflow import AgentsAsToolsWorkflow
Expand All @@ -25,12 +22,14 @@

async def main():
with set_open_ai_agent_temporal_overrides(
start_to_close_timeout=timedelta(seconds=60),
model_params=ModelActivityParameters(
start_to_close_timeout=timedelta(seconds=60),
),
):
# Create client connected to server at the given address
client = await Client.connect(
"localhost:7233",
data_converter=open_ai_data_converter,
data_converter=pydantic_data_converter,
)

model_activity = ModelActivity(model_provider=None)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [{ name = "Temporal Technologies Inc", email = "sdk@temporal.io" }]
requires-python = "~=3.9"
readme = "README.md"
license = "MIT"
dependencies = ["temporalio>=1.13.0,<2"]
dependencies = ["temporalio>=1.14.0,<2"]

[project.urls]
Homepage = "https://github.com/temporalio/samples-python"
Expand Down
Loading
Loading