wingbot 3.76.4-alpha.5 → 3.76.4-alpha.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 +1 -1
- package/src/LLM.js +7 -3
- package/src/graphApi/schema.gql +8 -0
package/package.json
CHANGED
package/src/LLM.js
CHANGED
|
@@ -160,6 +160,7 @@ const LLMSession = require('./LLMSession');
|
|
|
160
160
|
* @prop {LLMMessage} result
|
|
161
161
|
* @prop {VectorSearchResult} [vectorSearchResult]
|
|
162
162
|
* @prop {ToolFunction[]} [tools]
|
|
163
|
+
* @prop {number} [durationMs]
|
|
163
164
|
*/
|
|
164
165
|
|
|
165
166
|
/**
|
|
@@ -425,8 +426,10 @@ class LLM {
|
|
|
425
426
|
async generate (session, preset = {}, logOptions = {}) {
|
|
426
427
|
const opts = this.llmOptions(preset);
|
|
427
428
|
const prompt = await session.toArray(true);
|
|
429
|
+
const startTime = Date.now();
|
|
428
430
|
const result = await this._provider.requestChat(prompt, opts, session.tools);
|
|
429
|
-
|
|
431
|
+
const durationMs = Date.now() - startTime;
|
|
432
|
+
this.logPrompt(prompt, result, logOptions.vectorSearchResult, session.tools, durationMs);
|
|
430
433
|
return result;
|
|
431
434
|
}
|
|
432
435
|
|
|
@@ -436,11 +439,12 @@ class LLM {
|
|
|
436
439
|
* @param {LLMMessage} result
|
|
437
440
|
* @param {VectorSearchResult} [vectorSearchResult]
|
|
438
441
|
* @param {ToolFunction[]} [tools]
|
|
442
|
+
* @param {number} [durationMs]
|
|
439
443
|
*/
|
|
440
|
-
logPrompt (prompt, result, vectorSearchResult, tools) {
|
|
444
|
+
logPrompt (prompt, result, vectorSearchResult, tools, durationMs) {
|
|
441
445
|
this._lastResult = result;
|
|
442
446
|
this._configuration.logger.logPrompt({
|
|
443
|
-
prompt, result, vectorSearchResult, tools
|
|
447
|
+
prompt, result, vectorSearchResult, tools, durationMs
|
|
444
448
|
});
|
|
445
449
|
}
|
|
446
450
|
|
package/src/graphApi/schema.gql
CHANGED
|
@@ -123,10 +123,18 @@ type VectorSearchResult {
|
|
|
123
123
|
resultDocuments: [VectorSearchDocument!]!
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
type ToolFunction {
|
|
127
|
+
name: String!
|
|
128
|
+
description: String
|
|
129
|
+
parameters: Any
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
type PromptInfo {
|
|
127
133
|
prompt: [LLMMessage!]!
|
|
128
134
|
result: LLMMessage!
|
|
129
135
|
vectorSearchResult: VectorSearchResult
|
|
136
|
+
tools: [ToolFunction!]
|
|
137
|
+
durationMs: Float
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
type UserInteraction {
|