mirror of
https://github.com/blackboxprogramming/simulation-theory.git
synced 2026-03-17 03:57:11 -05:00
Update pr-agent.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
14
.github/workflows/pr-agent.yml
vendored
14
.github/workflows/pr-agent.yml
vendored
@@ -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()}`);
|
||||
|
||||
Reference in New Issue
Block a user