Update pr-agent.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Alexa Amundson
2026-02-27 01:45:45 -06:00
committed by GitHub
parent 4c01769a17
commit 42eb3caf46

View File

@@ -101,11 +101,15 @@ Be rigorous, constructive, and precise. Keep the tone academic and professional.
let analysisText;
if (response.ok) {
const data = await response.json();
if (data.choices && data.choices.length > 0 && data.choices[0].message) {
analysisText = data.choices[0].message.content;
} else {
console.log('Unexpected response structure from GitHub Models API:', JSON.stringify(data));
try {
const data = await response.json();
if (data.choices && data.choices.length > 0 && data.choices[0].message) {
analysisText = data.choices[0].message.content;
} else {
console.log('Unexpected response structure from GitHub Models API:', JSON.stringify(data));
}
} catch (error) {
console.log('Failed to parse JSON response from GitHub Models API:', error);
}
} else {
console.log(`GitHub Models API returned ${response.status}: ${await response.text()}`);