Enhance Gemini request handling for contents support and improve error logging

- Added conditional logic to process `contents` in Gemini request templates, ensuring fallback behavior.
- Introduced detailed debug logs for quota errors and request issues.
- Updated handling of `rawJson` to construct templates more dynamically.
This commit is contained in:
Luis Pater
2025-08-04 02:51:00 +08:00
parent 3c4dc07980
commit 00f33f5f3a
2 changed files with 25 additions and 8 deletions

View File

@@ -242,6 +242,7 @@ func FixCLIToolResponse(input string) (string, error) {
// Extract the contents array which contains the conversation messages
contents := parsed.Get("request.contents")
if !contents.Exists() {
// log.Debugf(input)
return input, fmt.Errorf("contents not found in input")
}