mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-18 10:02:16 +00:00
Update gemini_provider.py
This commit is contained in:
@@ -168,13 +168,13 @@ class GeminiProvider(AIProvider):
|
|||||||
|
|
||||||
# No text content - check if it's a known issue
|
# No text content - check if it's a known issue
|
||||||
if finish_reason == 'MAX_TOKENS':
|
if finish_reason == 'MAX_TOKENS':
|
||||||
# MAX_TOKENS with no content means the prompt itself was too long
|
# MAX_TOKENS with no content could mean prompt too long OR model overload
|
||||||
raise AIProviderError("Prompt too long - no space for response. Try a shorter system prompt or message.")
|
raise AIProviderError("No response generated (MAX_TOKENS). Model may be overloaded - try again.")
|
||||||
elif finish_reason == 'STOP':
|
elif finish_reason == 'STOP':
|
||||||
# Normal stop but no content - unusual
|
# Normal stop but no content - unusual
|
||||||
raise AIProviderError("Model returned empty response")
|
raise AIProviderError("Model returned empty response")
|
||||||
else:
|
else:
|
||||||
raise AIProviderError(f"No text in response (finishReason: {finish_reason})")
|
raise AIProviderError(f"No response from model (reason: {finish_reason}). Try again later.")
|
||||||
except AIProviderError:
|
except AIProviderError:
|
||||||
raise
|
raise
|
||||||
except (KeyError, IndexError) as e:
|
except (KeyError, IndexError) as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user