wingbot 3.70.0 → 3.70.2

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.70.0",
3
+ "version": "3.70.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/src/ChatGpt.js CHANGED
@@ -180,10 +180,10 @@ class ChatGpt {
180
180
  /** @type {Required<DefaultRequestOptions>} */
181
181
  this._options = {
182
182
  requestTokens: 256,
183
- tokensLimit: 4096,
183
+ tokensLimit: 128000,
184
184
  presencePenalty: 0.0, // -2.0-2.0
185
185
  temperature: 1.0,
186
- model: 'gpt-3.5-turbo',
186
+ model: 'gpt-4o-mini',
187
187
  transcriptLength: -5,
188
188
  ...rest
189
189
  };
@@ -278,7 +278,6 @@ class ChatGpt {
278
278
  };
279
279
 
280
280
  let messages = chat;
281
- const maxTokens = Math.min(requestTokens, tokensLimit);
282
281
 
283
282
  let body;
284
283
  try {
@@ -309,7 +308,7 @@ class ChatGpt {
309
308
  model,
310
309
  frequency_penalty: 0,
311
310
  presence_penalty: presencePenalty,
312
- max_tokens: maxTokens,
311
+ max_tokens: requestTokens,
313
312
  temperature,
314
313
  messages
315
314
  };
package/src/LLM.js CHANGED
@@ -123,7 +123,7 @@ class LLM {
123
123
  async generate (session, options = {}) {
124
124
  /** @type {LLMProviderOptions} */
125
125
  const opts = {
126
- model: this._configuration.model,
126
+ ...(this._configuration.model && { model: this._configuration.model }),
127
127
  ...options
128
128
  };
129
129
 
@@ -141,8 +141,9 @@ class LLM {
141
141
  static toMessages (result) {
142
142
  let filtered = result.content
143
143
  .replace(/\n\n+/g, '\n')
144
- .split(/\n+(?!-)/g)
145
- .map((t) => t.trim())
144
+ .split(/\n+(?!\s*-)/g)
145
+ .map((t) => t.replace(/\n\s+/g, '\n')
146
+ .trim())
146
147
  .filter((t) => !!t);
147
148
 
148
149
  if (result.finishReason === 'length' && filtered.length <= 0) {
package/src/Responder.js CHANGED
@@ -237,7 +237,9 @@ class Responder {
237
237
 
238
238
  this.LLM_CTX_DEFAULT = 'default';
239
239
 
240
- /** @type {Map<string,(PromptSource|Promise<string>)[]>} */
240
+ /** @typedef {PromptSource|Promise<string>} PromptContextItem */
241
+
242
+ /** @type {Map<string,PromptContextItem[]>} */
241
243
  this._llmContext = new Map([
242
244
  [this.LLM_CTX_DEFAULT, []]
243
245
  ]);
@@ -295,7 +297,8 @@ class Responder {
295
297
  return [];
296
298
  }
297
299
 
298
- /** @type {Promise<string>[]} */
300
+ /** @typedef {Promise<string>} PromisedString */
301
+ /** @type {PromisedString[]} */
299
302
  const promiseStrings = this._llmContext.get(contextType)
300
303
  .map(async (p) => (typeof p === 'function' ? p(this) : p));
301
304
  this._llmContext.set(contextType, promiseStrings);