wingbot 3.73.9 → 3.73.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/resolvers/message.js +16 -5
package/package.json
CHANGED
package/src/resolvers/message.js
CHANGED
|
@@ -449,14 +449,25 @@ function message (params, context = {}) {
|
|
|
449
449
|
if (params.type === 'prompt' && !res.llm.configuration.disableLLM) {
|
|
450
450
|
res.typingOn()
|
|
451
451
|
.wait(1000);
|
|
452
|
-
const session = await res.llmSessionWithHistory(params.llmContextType);
|
|
453
452
|
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
let session;
|
|
454
|
+
let evaluation;
|
|
455
|
+
let discard;
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
try {
|
|
458
|
+
session = await res.llmSessionWithHistory(params.llmContextType);
|
|
458
459
|
|
|
459
|
-
|
|
460
|
+
await session.systemPrompt(text)
|
|
461
|
+
.generate();
|
|
462
|
+
|
|
463
|
+
evaluation = await res.llmEvaluate(session, params.llmContextType);
|
|
464
|
+
({ discard } = evaluation);
|
|
465
|
+
} catch (e) {
|
|
466
|
+
(context.log || console).error(`LLM ERR: ${e.message} [${req.senderId}]`, e);
|
|
467
|
+
discard = true;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (discard) {
|
|
460
471
|
canaryLog(context.log, context.canaryLogs, 'LLM discarded', {
|
|
461
472
|
evaluation,
|
|
462
473
|
session
|