mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
ci(issue-triage): correct Responses parsing (use first message/output_text); robust JSON extract (no push)
This commit is contained in:
@@ -224,7 +224,17 @@ jobs:
|
||||
const data = await res.json();
|
||||
let json = {};
|
||||
try {
|
||||
json = JSON.parse(data.choices[0].message.content || '{}');
|
||||
// Responses API: find first 'message' item and extract output_text
|
||||
let txt = '';
|
||||
if (Array.isArray(data.output)) {
|
||||
const msg = data.output.find(o => o && o.type === 'message');
|
||||
if (msg && Array.isArray(msg.content)) {
|
||||
const c = msg.content.find(p => p && (p.type === 'output_text' || p.type === 'text'));
|
||||
if (c && typeof c.text === 'string') txt = c.text;
|
||||
}
|
||||
}
|
||||
if (!txt && typeof data.output_text === 'string') txt = data.output_text;
|
||||
json = JSON.parse(txt || '{}');
|
||||
} catch (e) {
|
||||
json = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user