managarten/services/mana-llm/src
Till JS 4b8fede7fc fix(mana-llm): surface Gemini finish_reason errors instead of returning ""
The google provider called response.text after a chat completion and
passed the resulting string downstream unchanged. When Gemini's content
filter, recitation guard, or max_tokens ceiling fired, response.text
quietly returned "" — which the planner then reported as "no JSON block
found", masking the real cause. Empirically this failed in 45 ms on a
simple Quiz mission.

Introduces providers/errors.py with a small ProviderError hierarchy
(Blocked / Truncated / Auth / RateLimit / Capability). google.py now
inspects response.candidates[0].finish_reason and raises the matching
structured error; the non-streaming path maps it to 422/502/429 via a
new except-branch in main.py, and the streaming path surfaces the kind
as the SSE error type. Capability is wired but not yet used — it lands
with the tool-schema passthrough in the next commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:15:37 +02:00
..
models fix(mana-llm): add response_format to ChatCompletionRequest model 2026-04-09 18:50:54 +02:00
providers fix(mana-llm): surface Gemini finish_reason errors instead of returning "" 2026-04-20 15:15:37 +02:00
streaming fix(mana-llm): surface Gemini finish_reason errors instead of returning "" 2026-04-20 15:15:37 +02:00
utils feat(mana-llm): add central LLM abstraction service 2026-01-29 22:01:00 +01:00
__init__.py feat(mana-llm): add central LLM abstraction service 2026-01-29 22:01:00 +01:00
api_auth.py chore(ai-services): adopt Windows GPU as source of truth for llm/stt/tts 2026-04-08 12:46:03 +02:00
config.py chore(cloud-tier): upgrade default model gemini-2.0-flash → gemini-2.5-flash 2026-04-16 12:32:03 +02:00
main.py fix(mana-llm): surface Gemini finish_reason errors instead of returning "" 2026-04-20 15:15:37 +02:00