-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart_workflow.py
More file actions
33 lines (25 loc) · 930 Bytes
/
start_workflow.py
File metadata and controls
33 lines (25 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# ABOUTME: Client script to start the agent workflow.
# Submits a user query to the agentic loop workflow for processing.
import asyncio
import sys
import uuid
from temporalio.client import Client
from temporalio.contrib.pydantic import pydantic_data_converter
async def main():
client = await Client.connect(
"localhost:7233",
data_converter=pydantic_data_converter,
)
query = sys.argv[1] if len(sys.argv) > 1 else "Tell me about recursion"
# Submit the agent workflow for execution
# Using string-based workflow name to avoid importing workflow module
# (which requires GOOGLE_API_KEY for tool generation)
result = await client.execute_workflow(
"AgentWorkflow",
query,
id=f"gemini-agent-id-{uuid.uuid4()}",
task_queue="gemini-agent-python-task-queue",
)
print(f"\nResult:\n{result}")
if __name__ == "__main__":
asyncio.run(main())