-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathagents.py
More file actions
23 lines (18 loc) · 718 Bytes
/
agents.py
File metadata and controls
23 lines (18 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import json
from typing import Optional
from anthill import Agent
def get_weather(location, time="now"):
"""Get the current weather in a given location. Location MUST be a city."""
return json.dumps({"location": location, "temperature": "65", "time": time})
def send_email(recipient, subject, body):
print("Sending email...")
print(f"To: {recipient}")
print(f"Subject: {subject}")
print(f"Body: {body}")
return "Sent!"
weather_agent = Agent(
name="Weather Agent",
model="groq/llama-3.3-70b-versatile",
instructions="You are a helpful agent which help user with weather. Answer the user about weather or just say: I DO NOT KNOW!",
functions=[get_weather, send_email],
)