Repository navigation
ci: pass GEMINI_MODEL repository variable to update-skill workflow #66
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ class GeminiVisualTestHelper { | |
|
|
||
| val fullPrompt = "$systemPrompt\n\nCommand: \"$prompt\"\n\nUI Hierarchy:\n$hierarchyXml" | ||
|
|
||
| val modelName = "gemini-3.5-flash" | ||
| val modelName = System.getenv("GEMINI_MODEL") ?: "gemini-3.8-flash" | ||
|
Collaborator
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 one will silently never do anything. The class already shows the right pattern: every public entry point ( I would follow that: thread the model in the same way it is already done for the key, either as a defaulted parameter or a second suspend fun analyzeImage(
bitmap: Bitmap,
prompt: String,
apiKey: String,
model: String = BuildConfig.GEMINI_MODEL,
)If you prefer to keep the signatures untouched, |
||
|
|
||
| val requestJson = JSONObject().apply { | ||
| put("contents", JSONArray().apply { | ||
|
|
@@ -207,7 +207,8 @@ class GeminiVisualTestHelper { | |
| }) | ||
| } | ||
|
|
||
| val response: HttpResponse = client.post("https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key=$apiKey") { | ||
| val model = System.getenv("GEMINI_MODEL") ?: "gemini-3.8-flash" | ||
|
Collaborator
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. Same as line 85, and it also drifts from the neighbouring code: |
||
| val response: HttpResponse = client.post("https://generativelanguage.googleapis.com/v1beta/models/$model:generateContent?key=$apiKey") { | ||
| contentType(ContentType.Application.Json) | ||
| setBody(requestJson.toString()) | ||
| } | ||
|
|
||
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.
When the
GEMINI_MODELrepository variable is not set,${{ vars.GEMINI_MODEL }}expands to the empty string, and Actions still defines the env var..github/scripts/update_skill.py:21usesos.getenv("GEMINI_MODEL", "gemini-3.8-flash"), whose default only applies when the name is absent, not when it is empty. So it gets"", and line 22 builds.../v1beta/models/:generateContent?key=....Net effect: adding this line breaks
update-skillon every repo that has not set the variable, where before it used a hardcoded model and worked.The fix belongs in the script rather than here,
os.getenv("GEMINI_MODEL") or "gemini-3.8-flash", but since this PR is what introduces the empty value, it should go in together.