wingbot 3.76.5 → 3.76.7

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.76.5",
3
+ "version": "3.76.7",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/src/ChatGpt.js CHANGED
@@ -230,6 +230,15 @@ class ChatGpt {
230
230
  ];
231
231
  }
232
232
 
233
+ /**
234
+ * Model used, when the preset does not specify one
235
+ *
236
+ * @returns {ChatGPTModel}
237
+ */
238
+ get defaultModel () {
239
+ return this._options.model;
240
+ }
241
+
233
242
  _log (msg, ...args) {
234
243
  if (this._logger === console) {
235
244
 
package/src/LLM.js CHANGED
@@ -121,6 +121,7 @@ const LLMSession = require('./LLMSession');
121
121
  /**
122
122
  * @typedef {object} LLMChatProvider
123
123
  * @prop {LLMChatProviderPrompt} requestChat
124
+ * @prop {string} [defaultModel] - model used, when the options don't specify one
124
125
  */
125
126
 
126
127
  /** @typedef {import('node-fetch').default} Fetch */
@@ -387,11 +388,19 @@ class LLM {
387
388
  if (!this._presets.has(preset)) {
388
389
  throw new Error(`LLM Preset '${preset}' does not exist.`);
389
390
  }
390
- return {
391
+ const opts = {
391
392
  ...this._presets.get(preset),
392
393
  ...override,
393
394
  preset
394
395
  };
396
+
397
+ // presets without a model rely on the provider's default - make it
398
+ // visible, so it gets logged within the PromptInfo
399
+ if (opts.model == null) {
400
+ opts.model = this._provider?.defaultModel ?? null;
401
+ }
402
+
403
+ return opts;
395
404
  }
396
405
 
397
406
  /**
@@ -45,6 +45,15 @@ class LLMMockProvider {
45
45
  ];
46
46
  }
47
47
 
48
+ /**
49
+ * Model used, when the preset does not specify one
50
+ *
51
+ * @returns {string}
52
+ */
53
+ get defaultModel () {
54
+ return LLMMockProvider.DEFAULT_MODEL;
55
+ }
56
+
48
57
  /**
49
58
  *
50
59
  * @param {string} preset
@@ -131,10 +131,12 @@ type ToolFunction {
131
131
 
132
132
  type PromptInfo {
133
133
  prompt: [LLMMessage!]!
134
- result: LLMMessage!
134
+ result: LLMMessage
135
135
  vectorSearchResult: VectorSearchResult
136
136
  tools: [ToolFunction!]
137
137
  durationMs: Float
138
+ options: Any
139
+ error: String
138
140
  }
139
141
 
140
142
  type UserInteraction {