34 lines
1.5 KiB
TypeScript
34 lines
1.5 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
||
import { buildAssistantMcpDiscoveryTurnInput } from "../src/services/assistantMcpDiscoveryTurnInputAdapter";
|
||
|
||
describe("assistant MCP discovery turn input adapter garbage entity regressions", () => {
|
||
it("does not treat document and movement lane words as counterparty candidates", () => {
|
||
const followupContext = {
|
||
previous_intent: "customer_revenue_and_payments" as const,
|
||
previous_discovery_pilot_scope: "counterparty_value_flow_query_movements_v1",
|
||
previous_filters: {
|
||
counterparty: "Группа СВК",
|
||
organization: "ООО Альтернатива Плюс",
|
||
period_from: "2020-01-01",
|
||
period_to: "2020-12-31"
|
||
},
|
||
previous_anchor_type: "counterparty" as const,
|
||
previous_anchor_value: "Группа СВК"
|
||
};
|
||
|
||
const documents = buildAssistantMcpDiscoveryTurnInput({
|
||
userMessage: "а по документам?",
|
||
followupContext
|
||
});
|
||
const movements = buildAssistantMcpDiscoveryTurnInput({
|
||
userMessage: "а по движениям?",
|
||
followupContext
|
||
});
|
||
|
||
expect(documents.turn_meaning_ref?.explicit_entity_candidates).toEqual(["Группа СВК"]);
|
||
expect(movements.turn_meaning_ref?.explicit_entity_candidates).toEqual(["Группа СВК"]);
|
||
expect(documents.turn_meaning_ref?.explicit_entity_candidates).not.toContain("документам");
|
||
expect(movements.turn_meaning_ref?.explicit_entity_candidates).not.toContain("движениям");
|
||
});
|
||
});
|