Skip to content

Commit efbbaa2

Browse files
committed
Use correct Azure inference endpoint
1 parent a57b52e commit efbbaa2

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
endpoint:
2121
description: The endpoint to use
2222
required: false
23-
default: 'https://models.github.ai/inference'
23+
default: 'https://models.inference.ai.azure.com'
2424
system-prompt:
2525
description: The system prompt for the model
2626
required: false

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ export async function run(): Promise<void> {
4343
})
4444

4545
if (isUnexpected(response)) {
46-
throw response.body.error
46+
if (response.body.error) {
47+
throw response.body.error
48+
}
49+
throw new Error(
50+
'An error occurred while fetching the response (' +
51+
response.status +
52+
'): ' +
53+
response.body
54+
)
4755
}
4856

4957
const modelResponse: string | null =
@@ -53,6 +61,10 @@ export async function run(): Promise<void> {
5361
core.setOutput('response', modelResponse || '')
5462
} catch (error) {
5563
// Fail the workflow run if an error occurs
56-
if (error instanceof Error) core.setFailed(error.message)
64+
if (error instanceof Error) {
65+
core.setFailed(error.message)
66+
} else {
67+
core.setFailed('An unexpected error occurred')
68+
}
5769
}
5870
}

0 commit comments

Comments
 (0)