-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner.py
More file actions
32 lines (26 loc) · 823 Bytes
/
runner.py
File metadata and controls
32 lines (26 loc) · 823 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
import asyncio
from temporal.agent import Agent, Runner, AgentConsole
from textwrap import dedent
async def greet(name: str) -> str:
return f"hi {name}, how's your day been?"
def get_order_status(order_id: str):
return {
"order_id": order_id,
"expected_delivery": "Tomorrow",
}
agent = Agent(
name="Store Support Agent",
model_name="gemini-2.0-flash",
instruction="You are a store support API assistant to help with online orders.",
functions = [greet, get_order_status]
)
async def main():
"""Starts agent runner."""
runner = Runner(app_name="slack_agent_runner", agent=agent)
print("Agent Runner started...")
await runner.run()
if __name__ == "__main__":
try:
asyncio.run(main())
except KeyboardInterrupt:
print("\n👋 Goodbye!")