You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: migrate to new genai API and update Gemini provider (#238)
* refactor: migrate to new genai API and update Gemini provider implementation
- Replace deprecated google/generative-ai-go/genai package with google.golang.org/genai and update imports accordingly
- Refactor Gemini provider: update API usage to reflect new genai client structure and methods
- Update completion and function call logic to use explicit content/message structs rather than genai.Text
- Add internal error handling for invalid function call responses
- Improve usage metrics extraction with additional nil checks
- Remove unused imports and update client initialization logic to match new genai API
- Add new indirect dependencies in go.mod (google.golang.org/genai, github.com/google/go-cmp, github.com/gorilla/websocket)
- Remove obsolete and unused dependencies in go.mod
Signed-off-by: appleboy <[email protected]>
* feat: add debug dumping of Gemini API responses using godump
- Add github.com/yassinebenaid/godump v0.11.1 as a new dependency
- Import godump in the gemini provider code
- Dump Gemini API response candidates to console when debug mode is enabled
Signed-off-by: appleboy <[email protected]>
* refactor: refactor error handling and simplify prefix assignment
- Remove the ErrInvalidFunctionCall error declaration
- Refactor error handling in GetSummaryPrefix to provide more granular error messages for missing candidates, content, function calls, or prefix values
- Store the extracted prefix in a variable to simplify assignment to the response object
Signed-off-by: appleboy <[email protected]>
---------
Signed-off-by: appleboy <[email protected]>
0 commit comments