fix: martwe Assistants API nie może wyłączać całego coga AI #27
@@ -114,6 +114,25 @@ class Events(commands.Cog):
|
|||||||
"OPENAICLIENT niedostępny - osobiści asystenci (OpenAI Assistants API) wyłączeni"
|
"OPENAICLIENT niedostępny - osobiści asystenci (OpenAI Assistants API) wyłączeni"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
# The bootstrap below must NEVER take the cog down with it. It calls the
|
||||||
|
# OpenAI Assistants API (beta threads/runs), which is a legacy surface -
|
||||||
|
# it now answers 404, and that exception propagated out of cog_load,
|
||||||
|
# failed the whole extension, and took EVERY AI command with it
|
||||||
|
# ($gadaj_teraz, $modele_ai, the conversation handler). Personal
|
||||||
|
# assistants are one optional feature; losing them must not disable the
|
||||||
|
# AI cog, which otherwise works fine on Claude and Ollama.
|
||||||
|
try:
|
||||||
|
await self._start_personal_assistants()
|
||||||
|
except Exception as exc: # pylint: disable=broad-exception-caught
|
||||||
|
self.logger.warning(
|
||||||
|
"Osobiści asystenci (OpenAI Assistants API) wyłączeni - %s: %s. "
|
||||||
|
"Reszta AI (rozmowy, $gadaj_teraz, $modele_ai) działa normalnie.",
|
||||||
|
type(exc).__name__, exc,
|
||||||
|
)
|
||||||
|
|
||||||
|
async def _start_personal_assistants(self):
|
||||||
|
"""Bootstrap the per-user OpenAI Assistants threads. Optional feature:
|
||||||
|
callers must treat a failure here as non-fatal (see cog_load)."""
|
||||||
for superfryta_id, superfryta in SPECJALNE_ZIEMNIACZKI.items():
|
for superfryta_id, superfryta in SPECJALNE_ZIEMNIACZKI.items():
|
||||||
|
|
||||||
if superfryta[4] != "":
|
if superfryta[4] != "":
|
||||||
|
|||||||
Reference in New Issue
Block a user