zakerytclarke commited on
Commit
06e7d9e
·
verified ·
1 Parent(s): d11e749

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -80,7 +80,8 @@ class Calculator(BaseModel):
80
 
81
 
82
  ### Weather Tool
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)
@@ -127,7 +128,7 @@ class ImageGen(BaseModel):
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
 
 
80
 
81
 
82
  ### Weather Tool
83
+ def get_weather(weather):
84
+ city_name = weather.city_name
85
  # OpenWeatherMap API endpoint
86
  url = f'https://api.openweathermap.org/data/2.5/weather?appid={WEATHER_API_KEY}&units=imperial&q={city_name}'
87
  print(url)
 
128
 
129
  def generate_image(prompt):
130
  print(prompt.prompt)
131
+ if "teapot" in prompt.prompt.lower():
132
  return "I generated an image of a teapot for you: https://teapotai.com/assets/teapotsmile.png"
133
  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"
134