Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,7 @@ class Calculator(BaseModel):
|
|
83 |
def get_weather(city_name):
|
84 |
# OpenWeatherMap API endpoint
|
85 |
url = f'https://api.openweathermap.org/data/2.5/weather?appid={WEATHER_API_KEY}&units=imperial&q={city_name}'
|
86 |
-
|
87 |
|
88 |
# Send GET request to the OpenWeatherMap API
|
89 |
response = requests.get(url)
|
@@ -126,9 +126,10 @@ class ImageGen(BaseModel):
|
|
126 |
prompt: str = Field(..., description="The prompt to use to generate the image")
|
127 |
|
128 |
def generate_image(prompt):
|
|
|
129 |
if "teapot" in prompt.prompt:
|
130 |
return "I generated an image of a teapot for you: https://teapotai.com/assets/teapotsmile.png"
|
131 |
-
return "Ok I can't
|
132 |
|
133 |
### Tool Creation
|
134 |
DEFAULT_TOOLS = [
|
|
|
83 |
def get_weather(city_name):
|
84 |
# OpenWeatherMap API endpoint
|
85 |
url = f'https://api.openweathermap.org/data/2.5/weather?appid={WEATHER_API_KEY}&units=imperial&q={city_name}'
|
86 |
+
print(url)
|
87 |
|
88 |
# Send GET request to the OpenWeatherMap API
|
89 |
response = requests.get(url)
|
|
|
126 |
prompt: str = Field(..., description="The prompt to use to generate the image")
|
127 |
|
128 |
def generate_image(prompt):
|
129 |
+
print(prompt.prompt)
|
130 |
if "teapot" in prompt.prompt:
|
131 |
return "I generated an image of a teapot for you: https://teapotai.com/assets/teapotsmile.png"
|
132 |
+
return "Ok I can't generate images, but you could easily hook up an image gen model to this tool call. Check out this image I did generate for you: https://teapotai.com/assets/teapotsmile.png"
|
133 |
|
134 |
### Tool Creation
|
135 |
DEFAULT_TOOLS = [
|