-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: Modify the Gemini account verification logic #12155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,11 +69,21 @@ | |
| request.URL = base + "/v1/models" | ||
| } | ||
| case "gemini": | ||
| request.Method = http.MethodPost | ||
| if strings.Contains(base, "/v1beta") { | ||
| request.URL = fmt.Sprintf("%s/models?key=%s", base, apiKey) | ||
| request.URL = base + "/models/gemini-3-flash-preview:generateContent" | ||
| } else { | ||
| request.URL = fmt.Sprintf("%s/v1beta/models?key=%s", base, apiKey) | ||
| request.URL = base + "/v1beta/models/gemini-3-flash-preview:generateContent" | ||
|
Comment on lines
+74
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This verification flow hard-codes Useful? React with 👍 / 👎. |
||
| } | ||
| headers["x-goog-api-key"] = apiKey | ||
| headers["Content-Type"] = "application/json" | ||
|
Check failure on line 79 in agent/app/provider/verify.go
|
||
| request.Body = mustJSON(map[string]interface{}{ | ||
| "contents": []map[string]interface{}{{ | ||
| "parts": []map[string]string{{ | ||
| "text": "Explain how AI works in a few words", | ||
| }}, | ||
| }}, | ||
| }) | ||
| case "zai": | ||
| headers["Authorization"] = fmt.Sprintf("Bearer %s", apiKey) | ||
| request.URL = base + "/models" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Gemini patch no longer includes
Models, andwriteOpenclawConfigonly rewritesconf["models"]whenpatch.Modelsis non-nil. For upgraded agents that already havemodels.providers.googlefrom the previous behavior, changing Gemini accounts now leaves stale API/baseURL values inopenclaw.json, so runtime credentials can remain out of sync with the selected account.Useful? React with 👍 / 👎.