feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持
This commit is contained in:
1 parent
ac4262cd75
commit
c8ce77199e
183 files changed
+11690
-2300
No files matched your search
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* features/chat/training/trainingWorkspace.utils.test.ts
|
||||
* 用途:锁定培训工作区 Agent 识别契约(content_profile / extra_config,非名称)。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { matchesTrainingAgent } from './trainingWorkspace.utils';
|
||||
|
||||
describe('matchesTrainingAgent', () => {
|
||||
it('matches handler_config.content_profile=training', () => {
|
||||
expect(matchesTrainingAgent({
|
||||
name: '任意名称',
|
||||
handler_config: { content_profile: 'training' },
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
it('matches explicit extra_config training flags', () => {
|
||||
expect(matchesTrainingAgent({
|
||||
name: '普通 Agent',
|
||||
extra_config: { training_workspace_enabled: true },
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
it('does not match generic agent by name alone', () => {
|
||||
expect(matchesTrainingAgent({ name: '新人培训助手' })).toBe(false);
|
||||
});
|
||||
|
||||
it('respects training_workspace_enabled=false override', () => {
|
||||
expect(matchesTrainingAgent({
|
||||
handler_config: { content_profile: 'training' },
|
||||
extra_config: { training_workspace_enabled: false },
|
||||
})).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user