|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import asyncio |
4 | | -import concurrent.futures |
5 | 4 | from datetime import timedelta |
6 | 5 |
|
7 | | -from temporalio import workflow |
8 | 6 | from temporalio.client import Client |
9 | 7 | from temporalio.contrib.openai_agents.invoke_model_activity import ModelActivity |
10 | | -from temporalio.contrib.openai_agents.open_ai_data_converter import ( |
11 | | - open_ai_data_converter, |
12 | | -) |
| 8 | +from temporalio.contrib.openai_agents.model_parameters import ModelActivityParameters |
13 | 9 | from temporalio.contrib.openai_agents.temporal_openai_agents import ( |
14 | 10 | set_open_ai_agent_temporal_overrides, |
15 | 11 | ) |
| 12 | +from temporalio.contrib.pydantic import pydantic_data_converter |
16 | 13 | from temporalio.worker import Worker |
17 | 14 |
|
18 | 15 | from openai_agents.workflows.agents_as_tools_workflow import AgentsAsToolsWorkflow |
|
25 | 22 |
|
26 | 23 | async def main(): |
27 | 24 | with set_open_ai_agent_temporal_overrides( |
28 | | - start_to_close_timeout=timedelta(seconds=60), |
| 25 | + model_params=ModelActivityParameters( |
| 26 | + start_to_close_timeout=timedelta(seconds=60), |
| 27 | + ), |
29 | 28 | ): |
30 | 29 | # Create client connected to server at the given address |
31 | 30 | client = await Client.connect( |
32 | 31 | "localhost:7233", |
33 | | - data_converter=open_ai_data_converter, |
| 32 | + data_converter=pydantic_data_converter, |
34 | 33 | ) |
35 | 34 |
|
36 | 35 | model_activity = ModelActivity(model_provider=None) |
|
0 commit comments