19 lines
611 B
Go
19 lines
611 B
Go
package domain_test
|
|
|
|
import (
|
|
"git.cin.su/m/Assistant/contracts/interaction"
|
|
"git.cin.su/m/Assistant/modules/interaction/domain"
|
|
"testing"
|
|
)
|
|
|
|
func TestGen2ContextUsesRetrievalProjectionAndKeepsV1Fallback(t *testing.T) {
|
|
got := domain.BuildGen2Context([]interaction.HumanUtterance{{ID: "u", Content: "Я сейчас в Москве", ReceivedAtUnixMillis: 1}})
|
|
if got.Source != "retrieval:interaction-utterances" || got.UsedPersonalMemoryFallback {
|
|
t.Fatalf("got %#v", got)
|
|
}
|
|
empty := domain.BuildGen2Context(nil)
|
|
if !empty.UsedPersonalMemoryFallback {
|
|
t.Fatalf("fallback missing: %#v", empty)
|
|
}
|
|
}
|