AI: backend Ollama + wybór modelu w komendzie przełączania #25
+11
-1
@@ -284,7 +284,17 @@ class Events(commands.Cog):
|
|||||||
others = await ai_functions.list_provider_models(nazwa_konfigu)
|
others = await ai_functions.list_provider_models(nazwa_konfigu)
|
||||||
except ai_functions.AIError:
|
except ai_functions.AIError:
|
||||||
others = []
|
others = []
|
||||||
if len(others) > 1:
|
current = cfg.get("latest_model")
|
||||||
|
if others and current not in others:
|
||||||
|
# The configured/pinned model is not on the server: every
|
||||||
|
# reply would fail with "model not found" and nothing would
|
||||||
|
# say why. Flag it here, where the list is already in hand.
|
||||||
|
message += (
|
||||||
|
f"\n⚠ Uwaga: '{current}' nie jest wgrany na serwerze. "
|
||||||
|
f"Dostępne: {', '.join(others)} "
|
||||||
|
f"(`$gadaj_teraz {nazwa_konfigu} <model>`)."
|
||||||
|
)
|
||||||
|
elif len(others) > 1:
|
||||||
message += (
|
message += (
|
||||||
f"\nDostępne modele: {', '.join(others)} "
|
f"\nDostępne modele: {', '.join(others)} "
|
||||||
f"(`$gadaj_teraz {nazwa_konfigu} <model>`)."
|
f"(`$gadaj_teraz {nazwa_konfigu} <model>`)."
|
||||||
|
|||||||
Reference in New Issue
Block a user