Spaces:
Running
Running
Add algumas infos adicionais para debug
Browse files
server.js
CHANGED
|
@@ -319,7 +319,7 @@ async function Prompt(opts){
|
|
| 319 |
|
| 320 |
console.log("PromptLength: ", prompt.length, prompt);
|
| 321 |
let answer = await GetModelAnswer(model, prompt);
|
| 322 |
-
return answer
|
| 323 |
}
|
| 324 |
|
| 325 |
app.get('/error', async (req, res) => {
|
|
@@ -342,16 +342,19 @@ app.get('/error', async (req, res) => {
|
|
| 342 |
if(tentativas)
|
| 343 |
tentativas = tentativas.split(",").map(Number).join(",");
|
| 344 |
|
| 345 |
-
|
| 346 |
-
|
| 347 |
error:req.query.error
|
| 348 |
,tentativas
|
| 349 |
,model:req.query.model
|
| 350 |
,max
|
| 351 |
});
|
|
|
|
|
|
|
| 352 |
|
| 353 |
-
console.log("Respondido",
|
| 354 |
|
|
|
|
| 355 |
if(!resp || !Array.isArray(resp)){
|
| 356 |
res.json({text:":("});
|
| 357 |
return;
|
|
@@ -369,7 +372,7 @@ app.get('/error', async (req, res) => {
|
|
| 369 |
|
| 370 |
console.log("FullResp:"+gentext);
|
| 371 |
console.log("Final:"+txtFinal);
|
| 372 |
-
res.json({text:txtFinal})
|
| 373 |
})
|
| 374 |
|
| 375 |
app.get('/test', async (req, res) => {
|
|
|
|
| 319 |
|
| 320 |
console.log("PromptLength: ", prompt.length, prompt);
|
| 321 |
let answer = await GetModelAnswer(model, prompt);
|
| 322 |
+
return answer;
|
| 323 |
}
|
| 324 |
|
| 325 |
app.get('/error', async (req, res) => {
|
|
|
|
| 342 |
if(tentativas)
|
| 343 |
tentativas = tentativas.split(",").map(Number).join(",");
|
| 344 |
|
| 345 |
+
let StartTime = new Date();
|
| 346 |
+
let result = await Prompt({
|
| 347 |
error:req.query.error
|
| 348 |
,tentativas
|
| 349 |
,model:req.query.model
|
| 350 |
,max
|
| 351 |
});
|
| 352 |
+
let EndTime = new Date();
|
| 353 |
+
let TotalMs = EndTime.getTime() - StartTime.getTime();
|
| 354 |
|
| 355 |
+
console.log("Respondido", TotalMs, result);
|
| 356 |
|
| 357 |
+
let resp = result.result;
|
| 358 |
if(!resp || !Array.isArray(resp)){
|
| 359 |
res.json({text:":("});
|
| 360 |
return;
|
|
|
|
| 372 |
|
| 373 |
console.log("FullResp:"+gentext);
|
| 374 |
console.log("Final:"+txtFinal);
|
| 375 |
+
res.json({text:txtFinal, model:result.model, TotalMs})
|
| 376 |
})
|
| 377 |
|
| 378 |
app.get('/test', async (req, res) => {
|