Skip to content

Commit 1b6b026

Browse files
committed
switch to plugins on the runners
1 parent 92286fd commit 1b6b026

5 files changed

Lines changed: 20 additions & 10 deletions

File tree

openai_agents/run_agents_as_tools_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22

33
from temporalio.client import Client
4-
from temporalio.contrib.pydantic import pydantic_data_converter
4+
from temporalio.contrib.openai_agents import OpenAIAgentsPlugin
55

66
from openai_agents.workflows.agents_as_tools_workflow import AgentsAsToolsWorkflow
77

@@ -10,7 +10,9 @@ async def main():
1010
# Create client connected to server at the given address
1111
client = await Client.connect(
1212
"localhost:7233",
13-
data_converter=pydantic_data_converter,
13+
plugins=[
14+
OpenAIAgentsPlugin(),
15+
],
1416
)
1517

1618
# Execute a workflow

openai_agents/run_customer_service_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
WorkflowUpdateFailedError,
88
)
99
from temporalio.common import QueryRejectCondition
10-
from temporalio.contrib.pydantic import pydantic_data_converter
10+
from temporalio.contrib.openai_agents import OpenAIAgentsPlugin
1111
from temporalio.service import RPCError, RPCStatusCode
1212

1313
from openai_agents.workflows.customer_service_workflow import (
@@ -24,7 +24,9 @@ async def main():
2424
# Create client connected to server at the given address
2525
client = await Client.connect(
2626
"localhost:7233",
27-
data_converter=pydantic_data_converter,
27+
plugins=[
28+
OpenAIAgentsPlugin(),
29+
],
2830
)
2931

3032
handle = client.get_workflow_handle(args.conversation_id)

openai_agents/run_hello_world_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22

33
from temporalio.client import Client
4-
from temporalio.contrib.pydantic import pydantic_data_converter
4+
from temporalio.contrib.openai_agents import OpenAIAgentsPlugin
55

66
from openai_agents.workflows.hello_world_workflow import HelloWorldAgent
77

@@ -10,7 +10,9 @@ async def main():
1010
# Create client connected to server at the given address
1111
client = await Client.connect(
1212
"localhost:7233",
13-
data_converter=pydantic_data_converter,
13+
plugins=[
14+
OpenAIAgentsPlugin(),
15+
],
1416
)
1517

1618
# Execute a workflow

openai_agents/run_research_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22

33
from temporalio.client import Client
4-
from temporalio.contrib.pydantic import pydantic_data_converter
4+
from temporalio.contrib.openai_agents import OpenAIAgentsPlugin
55

66
from openai_agents.workflows.research_bot_workflow import ResearchWorkflow
77

@@ -10,7 +10,9 @@ async def main():
1010
# Create client connected to server at the given address
1111
client = await Client.connect(
1212
"localhost:7233",
13-
data_converter=pydantic_data_converter,
13+
plugins=[
14+
OpenAIAgentsPlugin(),
15+
],
1416
)
1517

1618
# Execute a workflow

openai_agents/run_tools_workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22

33
from temporalio.client import Client
4-
from temporalio.contrib.pydantic import pydantic_data_converter
4+
from temporalio.contrib.openai_agents import OpenAIAgentsPlugin
55

66
from openai_agents.workflows.tools_workflow import ToolsWorkflow
77

@@ -10,7 +10,9 @@ async def main():
1010
# Create client connected to server at the given address
1111
client = await Client.connect(
1212
"localhost:7233",
13-
data_converter=pydantic_data_converter,
13+
plugins=[
14+
OpenAIAgentsPlugin(),
15+
],
1416
)
1517

1618
# Execute a workflow

0 commit comments

Comments
 (0)