wingbot 3.76.4-alpha.10 → 3.76.4-alpha.12
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/BuildRouter.js +11 -4
- package/src/LLM.js +5 -5
package/package.json
CHANGED
package/src/BuildRouter.js
CHANGED
|
@@ -865,13 +865,20 @@ class BuildRouter extends Router {
|
|
|
865
865
|
_createBlockLlmRouter (block) {
|
|
866
866
|
const { llmRouting } = block;
|
|
867
867
|
|
|
868
|
-
if (!llmRouting
|
|
868
|
+
if (!llmRouting) {
|
|
869
869
|
return null;
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
-
const routeResolver =
|
|
873
|
-
|
|
874
|
-
|
|
872
|
+
const routeResolver = llmRouting.prompt && llmRouting.prompt.trim()
|
|
873
|
+
? LLMRouter.defaultRoute(
|
|
874
|
+
async (resolvedData) => compileWithState(
|
|
875
|
+
null,
|
|
876
|
+
null,
|
|
877
|
+
llmRouting.prompt,
|
|
878
|
+
resolvedData
|
|
879
|
+
)
|
|
880
|
+
)
|
|
881
|
+
: null;
|
|
875
882
|
const options = llmRouting.bounce === 'keepAllow'
|
|
876
883
|
? { keepUserInInteractionsWithBounceAllowed: true }
|
|
877
884
|
: {};
|
package/src/LLM.js
CHANGED
|
@@ -162,7 +162,7 @@ const LLMSession = require('./LLMSession');
|
|
|
162
162
|
* @prop {VectorSearchResult} [vectorSearchResult]
|
|
163
163
|
* @prop {ToolFunction[]} [tools]
|
|
164
164
|
* @prop {number} [durationMs]
|
|
165
|
-
* @prop {
|
|
165
|
+
* @prop {LLMCallOptions} [options]
|
|
166
166
|
*/
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -437,7 +437,7 @@ class LLM {
|
|
|
437
437
|
logOptions.vectorSearchResult,
|
|
438
438
|
session.tools,
|
|
439
439
|
durationMs,
|
|
440
|
-
opts
|
|
440
|
+
opts
|
|
441
441
|
);
|
|
442
442
|
return result;
|
|
443
443
|
}
|
|
@@ -449,9 +449,9 @@ class LLM {
|
|
|
449
449
|
* @param {VectorSearchResult} [vectorSearchResult]
|
|
450
450
|
* @param {ToolFunction[]} [tools]
|
|
451
451
|
* @param {number} [durationMs]
|
|
452
|
-
* @param {
|
|
452
|
+
* @param {LLMCallOptions} [options]
|
|
453
453
|
*/
|
|
454
|
-
logPrompt (prompt, result, vectorSearchResult, tools, durationMs,
|
|
454
|
+
logPrompt (prompt, result, vectorSearchResult, tools, durationMs, options) {
|
|
455
455
|
this._lastResult = result;
|
|
456
456
|
this._configuration.logger.logPrompt({
|
|
457
457
|
prompt,
|
|
@@ -459,7 +459,7 @@ class LLM {
|
|
|
459
459
|
vectorSearchResult,
|
|
460
460
|
tools,
|
|
461
461
|
durationMs,
|
|
462
|
-
...(
|
|
462
|
+
...(options != null && { options })
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
|