NODEDC_1C/llm_normalizer/backend/tests/assistantMcpDiscoveryTurnIn...

34 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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("движениям");
});
});