kagi_fastgpt: fix issue when there are no more tk.

This commit is contained in:
Adrien Abraham 2024-03-08 18:22:56 +01:00
parent bc2666085c
commit a2de02b0eb

View file

@ -49,7 +49,10 @@ class KagiFastgptPlugin(Plugin):
self.bot.log_e(f"Request error: {exc}")
return None, []
data = response.json().get("data", {})
data = response.json().get("data")
if not data:
self.bot.log_w("No data at all, no more tokens available?")
return None, []
self.bot.log_d(f"Data received: {json.dumps(data)}")
output = data.get("output", "")
if not output: