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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.73.9",
3
+ "version": "3.73.10",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -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
- await session.systemPrompt(text)
455
- .generate();
453
+ let session;
454
+ let evaluation;
455
+ let discard;
456
456
 
457
- const evaluation = await res.llmEvaluate(session, params.llmContextType);
457
+ try {
458
+ session = await res.llmSessionWithHistory(params.llmContextType);
458
459
 
459
- if (evaluation.discard) {
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