forked from temporalio/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_workflow.py
More file actions
28 lines (19 loc) · 722 Bytes
/
Copy pathrun_workflow.py
File metadata and controls
28 lines (19 loc) · 722 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
"""Start the ReAct agent workflow (Functional API)."""
import asyncio
import os
from temporalio.client import Client
from langgraph_plugin.functional_api.react_agent.workflow import (
ReactAgentFunctionalWorkflow,
)
async def main() -> None:
client = await Client.connect(os.environ.get("TEMPORAL_ADDRESS", "localhost:7233"))
result = await client.execute_workflow(
ReactAgentFunctionalWorkflow.run,
"Tell me about San Francisco",
id="react-agent-functional-workflow",
task_queue="langgraph-react-agent-functional",
)
print(f"Agent answer: {result['answer']}")
print(f"Tool calls made: {result['steps']}")
if __name__ == "__main__":
asyncio.run(main())