mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-18 10:02:16 +00:00
update notification service
This commit is contained in:
@@ -18,12 +18,12 @@
|
|||||||
"gemini": {
|
"gemini": {
|
||||||
"models": [
|
"models": [
|
||||||
"gemini-2.5-flash",
|
"gemini-2.5-flash",
|
||||||
"gemini-2.5-pro",
|
"gemini-2.5-flash-lite",
|
||||||
"gemini-1.5-flash"
|
"gemini-2.5-pro"
|
||||||
],
|
],
|
||||||
"recommended": "gemini-1.5-flash",
|
"recommended": "gemini-2.5-flash",
|
||||||
"_note": "gemini-2.5-* may have availability issues. gemini-1.5-flash is more stable.",
|
"_note": "gemini-2.5-flash-lite is cheaper but may struggle with complex prompts. Use with simple/custom prompts.",
|
||||||
"_deprecated": ["gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-1.0-pro", "gemini-pro"]
|
"_deprecated": ["gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-1.5-flash", "gemini-1.0-pro", "gemini-pro"]
|
||||||
},
|
},
|
||||||
|
|
||||||
"openai": {
|
"openai": {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class AIProvider(ABC):
|
|||||||
response = self.generate(
|
response = self.generate(
|
||||||
system_prompt="You are a test assistant. Respond with exactly: CONNECTION_OK",
|
system_prompt="You are a test assistant. Respond with exactly: CONNECTION_OK",
|
||||||
user_message="Test connection",
|
user_message="Test connection",
|
||||||
max_tokens=20
|
max_tokens=50 # Some providers (Gemini) need more tokens to return any content
|
||||||
)
|
)
|
||||||
if response:
|
if response:
|
||||||
# Check if response contains our expected text
|
# Check if response contains our expected text
|
||||||
|
|||||||
@@ -166,8 +166,15 @@ class GeminiProvider(AIProvider):
|
|||||||
if text:
|
if text:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
# No text content - provide detailed error
|
# No text content - check if it's a known issue
|
||||||
raise AIProviderError(f"No text in response (finishReason: {finish_reason})")
|
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.")
|
||||||
|
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})")
|
||||||
except AIProviderError:
|
except AIProviderError:
|
||||||
raise
|
raise
|
||||||
except (KeyError, IndexError) as e:
|
except (KeyError, IndexError) as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user