Skip to content
Open
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
9 changes: 8 additions & 1 deletion openai_agents/run_hello_world_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import sys

from temporalio.client import Client
from temporalio.contrib.pydantic import pydantic_data_converter
Expand All @@ -7,6 +8,12 @@


async def main():
# Get the input string from command line arguments
if len(sys.argv) < 2:
print("Usage: python run_hello_world_workflow.py <input_string>")
sys.exit(1)
input_string = sys.argv[1]

# Create client connected to server at the given address
client = await Client.connect(
"localhost:7233",
Expand All @@ -16,7 +23,7 @@ async def main():
# Execute a workflow
result = await client.execute_workflow(
HelloWorldAgent.run,
"Tell me about recursion in programming.",
input_string,
id="my-workflow-id",
task_queue="openai-agents-task-queue",
)
Expand Down