Skip to content

Commit 602a91a

Browse files
committed
ci: support GEMINI_MODEL repository variable in triage-issue workflow
1 parent aec06f3 commit 602a91a

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/scripts/answer_issue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def validate_response(response_text: str) -> bool:
4646
return True
4747

4848
def get_gemini_response(api_key, system_instruction, user_content):
49-
# Using gemini-3.5-flash for fast and reliable answering
50-
url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key={api_key}"
49+
model = os.getenv("GEMINI_MODEL", "gemini-3.8-flash")
50+
url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}"
5151
headers = {'Content-Type': 'application/json'}
5252
data = {
5353
"system_instruction": {

.github/scripts/triage_issue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def sanitize_content(text: str) -> str:
3535
return text.replace("</issue_content>", "&lt;/issue_content&gt;").replace("<issue_content>", "&lt;issue_content&gt;")
3636

3737
def get_gemini_response(api_key, system_instruction, user_content):
38-
# Using the stable Gemini 3.5 Flash
39-
url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key={api_key}"
38+
model = os.getenv("GEMINI_MODEL", "gemini-3.8-flash")
39+
url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}"
4040
headers = {'Content-Type': 'application/json'}
4141
data = {
4242
"system_instruction": {

.github/workflows/triage-issue.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
id: run_script
5252
env:
5353
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
54+
GEMINI_MODEL: ${{ vars.GEMINI_MODEL }}
5455
ISSUE_TITLE: ${{ github.event.issue.title || github.event.inputs.title }}
5556
ISSUE_BODY: ${{ github.event.issue.body || github.event.inputs.body }}
5657
run: |
@@ -85,6 +86,7 @@ jobs:
8586
if: github.event_name == 'workflow_dispatch' || github.event.action == 'opened'
8687
env:
8788
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
89+
GEMINI_MODEL: ${{ vars.GEMINI_MODEL }}
8890
ISSUE_TITLE: ${{ github.event.issue.title || github.event.inputs.title }}
8991
ISSUE_BODY: ${{ github.event.issue.body || github.event.inputs.body }}
9092
run: |

0 commit comments

Comments
 (0)