wingbot 3.76.4 → 3.76.5
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/LLMRouter.js +15 -4
package/package.json
CHANGED
package/src/LLMRouter.js
CHANGED
|
@@ -185,10 +185,21 @@ class LLMRouter {
|
|
|
185
185
|
.setData(routing)
|
|
186
186
|
.systemPrompt(prompt);
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
// Load recent conversation history so the router classifies the last
|
|
189
|
+
// user message in context (e.g. an answer to a bot question) rather
|
|
190
|
+
// than in isolation, where a bare "the protocol is wrong" reads as an
|
|
191
|
+
// intent to reject. Length/flag come from the 'routing' preset;
|
|
192
|
+
// getTranscript already includes this turn's user message as the
|
|
193
|
+
// final entry, so it is not appended separately.
|
|
194
|
+
const { transcriptLength, transcriptFlag } = llm.llmOptions('routing');
|
|
195
|
+
const transcript = await llm.res.getTranscript(
|
|
196
|
+
Math.abs(transcriptLength),
|
|
197
|
+
transcriptFlag
|
|
198
|
+
);
|
|
199
|
+
transcript.forEach((turn) => {
|
|
200
|
+
if (turn.fromBot) session.assistant(turn.text);
|
|
201
|
+
else session.user(turn.text);
|
|
202
|
+
});
|
|
192
203
|
|
|
193
204
|
let res;
|
|
194
205
|
try {
|