more logging

This commit is contained in:
Sean Goedecke
2025-04-07 22:31:16 +00:00
parent cb41259270
commit 786ceefcbc
+5 -4
View File
@@ -25,6 +25,7 @@ export async function run(): Promise<void> {
const endpoint = core.getInput('endpoint')
const client = ModelClient(endpoint, new AzureKeyCredential(token))
core.debug('Endpoint: ' + endpoint)
const response = await client.path('/chat/completions').post({
body: {
@@ -43,13 +44,13 @@ export async function run(): Promise<void> {
})
if (isUnexpected(response)) {
console.log('Unexpected response: ', response)
core.debug('Unexpected response: ' + response)
throw response.body.error
}
console.log('Response: ', response.body)
console.log('Choices: ', response.body.choices)
console.log('Message: ', response.body.choices[0].message)
core.debug('Response: ' + response.body)
core.debug('Choices: ' + response.body.choices)
core.debug('Message: ' + response.body.choices[0].message)
const modelResponse: string | null =
response.body.choices[0].message.content