Rooni commited on
Commit
7528ecc
·
verified ·
1 Parent(s): d661f99

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +4 -2
server.js CHANGED
@@ -82,9 +82,11 @@ app.post('/gen', async (req, res) => {
82
  });
83
 
84
  if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
85
- const content = JSON.parse(response.data);
86
  console.log(response.data);
87
- res.json({ content.candidates[0].content.parts.map(part => part.text).join(''); });
 
 
 
88
  } else {
89
  const content = response;
90
  console.log(content);
 
82
  });
83
 
84
  if (response.data.choices && response.data.choices.length > 0 && response.data.choices[0].message) {
 
85
  console.log(response.data);
86
+
87
+ const content = JSON.parse(response.data);
88
+ res.json({ content.candidates[0].content.parts.map(part => part.text).join('') });
89
+
90
  } else {
91
  const content = response;
92
  console.log(content);