feat: add semantic WeChat session actions
This commit is contained in:
@@ -425,6 +425,25 @@ test('classifyWithRules bypasses llm router when user selected summarize skill',
|
||||
assert.equal(llmCalls.length, 0);
|
||||
});
|
||||
|
||||
test('chat intent router classifies ambiguous WeChat session actions semantically', async () => {
|
||||
const router = createChatIntentRouter({
|
||||
enabled: true,
|
||||
timeoutMs: 500,
|
||||
llmProviderService: {
|
||||
async createChatCompletion({ messages }) {
|
||||
assert.match(messages[0].content, /微信聊天会话动作分类器/);
|
||||
return {
|
||||
ok: true,
|
||||
reply: '{"action":"reset","confidence":0.91,"reason":"用户要求换一种对话上下文"}',
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
const result = await router.classifySessionAction({ text: '我们换个思路聊' });
|
||||
assert.equal(result.action, 'reset');
|
||||
assert.equal(result.confidence, 0.91);
|
||||
});
|
||||
|
||||
test('classifyWithRules bypasses llm router for explicit web skill prompt', async () => {
|
||||
const llmCalls = [];
|
||||
const router = createChatIntentRouter({
|
||||
|
||||
Reference in New Issue
Block a user