mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-05 20:03:48 +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
|
||||
if finish_reason == 'MAX_TOKENS':
|
||||
# MAX_TOKENS with no content means the prompt itself was too long
|
||||
raise AIProviderError("Prompt too long - no space for response. Try a shorter system prompt or message.")
|
||||
# MAX_TOKENS with no content could mean prompt too long OR model overload
|
||||
raise AIProviderError("No response generated (MAX_TOKENS). Model may be overloaded - try again.")
|
||||
elif finish_reason == 'STOP':
|
||||
# Normal stop but no content - unusual
|
||||
raise AIProviderError("Model returned empty response")
|
||||
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:
|
||||
raise
|
||||
except (KeyError, IndexError) as e:
|
||||
|
||||
Reference in New Issue
Block a user