Set user agent

This commit is contained in:
Sean Goedecke
2025-04-10 02:53:54 +00:00
parent 84fee7a0e6
commit e670dd5178
3 changed files with 7 additions and 7 deletions

6
dist/index.js generated vendored
View File

@@ -33567,7 +33567,9 @@ async function run() {
throw new Error('GITHUB_TOKEN is not set');
}
const endpoint = coreExports.getInput('endpoint');
const client = createClient(endpoint, new AzureKeyCredential(token));
const client = createClient(endpoint, new AzureKeyCredential(token), {
userAgentOptions: { userAgentPrefix: 'github-actions-ai-inference' }
});
const response = await client.path('/chat/completions').post({
body: {
messages: [
@@ -33577,8 +33579,6 @@ async function run() {
},
{ role: 'user', content: prompt }
],
temperature: 1.0,
top_p: 1.0,
max_tokens: maxTokens,
model: modelName
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -25,7 +25,9 @@ export async function run(): Promise<void> {
const endpoint = core.getInput('endpoint')
const client = ModelClient(endpoint, new AzureKeyCredential(token))
const client = ModelClient(endpoint, new AzureKeyCredential(token), {
userAgentOptions: { userAgentPrefix: 'github-actions-ai-inference' }
})
const response = await client.path('/chat/completions').post({
body: {
@@ -36,8 +38,6 @@ export async function run(): Promise<void> {
},
{ role: 'user', content: prompt }
],
temperature: 1.0,
top_p: 1.0,
max_tokens: maxTokens,
model: modelName
}