Refine topic context and purchase followup guards

This commit is contained in:
2026-03-12 20:24:50 +04:00
parent 120c6cf96d
commit 401bbbdcca
8 changed files with 522 additions and 12 deletions

View File

@@ -0,0 +1,17 @@
import { describe, expect, test } from 'bun:test'
import { shouldLoadExpandedChatHistory } from './topic-history'
describe('shouldLoadExpandedChatHistory', () => {
test('recognizes broader russian dialogue-memory prompts', () => {
expect(shouldLoadExpandedChatHistory('У тебя есть контекст диалога?')).toBe(true)
expect(
shouldLoadExpandedChatHistory('Это вопрос, что я последнее купил, основываясь на диалоге?')
).toBe(true)
expect(shouldLoadExpandedChatHistory('Вопрос выше уже есть')).toBe(true)
})
test('stays false for ordinary purchase chatter', () => {
expect(shouldLoadExpandedChatHistory('Купил молоко за 6 лари')).toBe(false)
})
})