mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-21 22:54:00 +08:00
- Change JSON field names from camelCase to snake_case as required by Gemini API (generation_config, max_output_tokens, system_instruction) - Improve message handling to ensure proper role alternation (user/model) - Add safety checks for empty contents and ensure first message is always from user - Implement robust error handling and response parsing - Handle edge cases where candidatesTokenCount might be returned as a list Fixes #6