Pepguy commited on
Commit
718dd82
·
verified ·
1 Parent(s): 42558a5

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +2 -2
app.js CHANGED
@@ -130,11 +130,11 @@ app.post('/api/generate', async (req, res) => {
130
  // ONLY CHANGE THIS — everything else in /api/generate stays identical
131
 
132
  // BEFORE — stops at first block, returns undefined if thinking block comes first
133
- const text = response.output.message.content.find(b => b.text)?.text;
134
 
135
  // AFTER — scans all blocks, concatenates every text block found, ignores reasoning blocks
136
  const contentBlocks = response.output?.message?.content || [];
137
- const text = contentBlocks
138
  .filter(b => b.text)
139
  .map(b => b.text)
140
  .join("") || null;
 
130
  // ONLY CHANGE THIS — everything else in /api/generate stays identical
131
 
132
  // BEFORE — stops at first block, returns undefined if thinking block comes first
133
+ let text = response.output.message.content.find(b => b.text)?.text;
134
 
135
  // AFTER — scans all blocks, concatenates every text block found, ignores reasoning blocks
136
  const contentBlocks = response.output?.message?.content || [];
137
+ text = contentBlocks
138
  .filter(b => b.text)
139
  .map(b => b.text)
140
  .join("") || null;