Skip to content

Commit 97ae703

Browse files
authored
CHORE: Test/fix models api endpoint (#529)
### Work Item / Issue Reference <!-- IMPORTANT: Please follow the PR template guidelines below. For mssql-python maintainers: Insert your ADO Work Item ID below For external contributors: Insert Github Issue number below Only one reference is required - either GitHub issue OR ADO Work Item. --> <!-- mssql-python maintainers: ADO Work Item --> > [AB#44172](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/44172) <!-- External contributors: GitHub Issue --> > GitHub Issue: #<ISSUE_NUMBER> ------------------------------------------------------------------- ### Summary This pull request updates the way the GitHub Models API is called in both the GitHub Actions workflow and the local test script. The main focus is on switching to the new API endpoint and updating the model identifier to the correct format. **API Endpoint and Model Updates:** * Changed the API endpoint from `models.inference.ai.azure.com` to `models.github.ai/inference` in both `.github/workflows/issue-triage.yml` and `test-triage-local.js` to use the new GitHub Models service. [[1]](diffhunk://#diff-4eea6c17da2d79103bcb247f5af47a37abfd43faf9032ea844ddf6c3e18dc81cR29-R37) [[2]](diffhunk://#diff-8920b09e9baab77cdbb09013f8a8e579f466b8148f194e026a94c10d703aea2eL34-R34) * Updated the model identifier from `"gpt-4.1"` to `"openai/gpt-4.1"` in both files to match the expected model naming convention. [[1]](diffhunk://#diff-4eea6c17da2d79103bcb247f5af47a37abfd43faf9032ea844ddf6c3e18dc81cL44-R46) [[2]](diffhunk://#diff-8920b09e9baab77cdbb09013f8a8e579f466b8148f194e026a94c10d703aea2eL43-R43) **Environment Variable Handling:** * Added the `GITHUB_TOKEN` environment variable to the `Triage Analysis` step in the workflow to ensure the token is available for API calls. <!-- Insert your summary of changes below. Minimum 10 characters required. --> <!-- ### PR Title Guide > For feature requests FEAT: (short-description) > For non-feature requests like test case updates, config updates , dependency updates etc CHORE: (short-description) > For Fix requests FIX: (short-description) > For doc update requests DOC: (short-description) > For Formatting, indentation, or styling update STYLE: (short-description) > For Refactor, without any feature changes REFACTOR: (short-description) > For release related changes, without any feature changes RELEASE: #<RELEASE_VERSION> (short-description) ### Contribution Guidelines External contributors: - Create a GitHub issue first: https://github.com/microsoft/mssql-python/issues/new - Link the GitHub issue in the "GitHub Issue" section above - Follow the PR title format and provide a meaningful summary mssql-python maintainers: - Create an ADO Work Item following internal processes - Link the ADO Work Item in the "ADO Work Item" section above - Follow the PR title format and provide a meaningful summary -->
1 parent 070b250 commit 97ae703

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/issue-triage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ jobs:
2626
- name: Triage Analysis
2727
id: triage
2828
uses: actions/github-script@v7
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2931
with:
3032
github-token: ${{ secrets.GITHUB_TOKEN }}
3133
script: |
3234
// --- Helper function for GitHub Models ---
3335
async function callGitHubModels(prompt) {
3436
const token = process.env.GITHUB_TOKEN;
35-
const url = 'https://models.inference.ai.azure.com/chat/completions';
37+
const url = 'https://models.github.ai/inference/chat/completions';
3638
3739
const response = await fetch(url, {
3840
method: "POST",
@@ -41,7 +43,7 @@ jobs:
4143
"Content-Type": "application/json"
4244
},
4345
body: JSON.stringify({
44-
model: "gpt-4.1",
46+
model: "openai/gpt-4.1",
4547
messages: [{ role: "user", content: prompt }],
4648
temperature: 0.1,
4749
response_format: { type: "json_object" }
@@ -292,4 +294,4 @@ jobs:
292294
issue_url: ${{ needs.triage.outputs.issue_url }}
293295
issue_author: ${{ needs.triage.outputs.issue_author }}
294296
secrets:
295-
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
297+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}

test-triage-local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (!issueNumber) {
3131
// --- Helper: GitHub Models ---
3232
async function callGitHubModels(prompt) {
3333
const token = process.env.GH_TOKEN;
34-
const url = "https://models.inference.ai.azure.com/chat/completions";
34+
const url = "https://models.github.ai/inference/chat/completions";
3535

3636
const response = await fetch(url, {
3737
method: "POST",
@@ -40,7 +40,7 @@ async function callGitHubModels(prompt) {
4040
"Content-Type": "application/json",
4141
},
4242
body: JSON.stringify({
43-
model: "gpt-4.1",
43+
model: "openai/gpt-4.1",
4444
messages: [
4545
{ role: "system", content: "You are an expert assistant. Always respond in valid json format." },
4646
{ role: "user", content: prompt },

0 commit comments

Comments
 (0)