Adding debug stuff
This commit is contained in:
parent
341a68c045
commit
b843a4ef58
@ -229,9 +229,14 @@ class ReginaldCog(PermissionsMixin, BlacklistMixin, MemoryMixin, commands.Cog):
|
||||
# chat message.
|
||||
response = await client.chat.completions.create(**completion_args)
|
||||
|
||||
if response.choices and response.choices[0].message and response.choices[0].message.content:
|
||||
response_text = response.choices[0].message.content.strip()
|
||||
if response_text.startswith("Reginald:"):
|
||||
response_text = response_text[len("Reginald:"):].strip()
|
||||
else:
|
||||
print("DEBUG: OpenAI response was empty or malformed:", response)
|
||||
response_text = "⚠️ No response received from AI."
|
||||
|
||||
return response_text
|
||||
|
||||
except OpenAIError as e:
|
||||
|
||||
@ -18,9 +18,6 @@ def get_current_weather(location: str) -> str:
|
||||
|
||||
def get_weather_forecast(location: str, days: int = 14, dt: str = '2025-03-24') -> str:
|
||||
weather = Weather(location=location)
|
||||
response = weather.forecast(days=days, dt=dt)
|
||||
|
||||
print(f"DEBUG: Forecast API Response: {response}")
|
||||
return json.dumps(weather.forecast(days=days, dt=dt))
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user