From 46a4374e69d79fb63f379fd0bec33cc3e3e57814 Mon Sep 17 00:00:00 2001 From: lehel Date: Wed, 8 Oct 2025 15:09:36 +0200 Subject: [PATCH] tests --- chat_service_integration_test.go | 3 +++ handlechat_integration_test.go | 3 +++ llm_test.go | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/chat_service_integration_test.go b/chat_service_integration_test.go index a7c1e50..db19353 100644 --- a/chat_service_integration_test.go +++ b/chat_service_integration_test.go @@ -32,6 +32,9 @@ func (m *mockLLM) DisambiguateBestMatch(ctx context.Context, msg string, candida func (m *mockLLM) GetEmbeddings(ctx context.Context, input string) ([]float64, error) { return m.embeddings, m.embeddingErr } +func (m *mockLLM) TranslateToEnglish(ctx context.Context, msg string) (string, error) { + return msg, nil +} // --- Test VisitDB --- type testVisitDB struct { diff --git a/handlechat_integration_test.go b/handlechat_integration_test.go index 82e9e95..54249f9 100644 --- a/handlechat_integration_test.go +++ b/handlechat_integration_test.go @@ -33,6 +33,9 @@ func (m *mockHandleChatLLM) DisambiguateBestMatch(ctx context.Context, msg strin func (m *mockHandleChatLLM) GetEmbeddings(ctx context.Context, input string) ([]float64, error) { return m.embeddings, m.embeddingErr } +func (m *mockHandleChatLLM) TranslateToEnglish(ctx context.Context, msg string) (string, error) { + return msg, nil +} // mapChatRepo is an in-memory implementation of ChatRepositoryAPI for tests. type mapChatRepo struct { diff --git a/llm_test.go b/llm_test.go index 83396d5..2a0eed2 100644 --- a/llm_test.go +++ b/llm_test.go @@ -47,6 +47,10 @@ func (m *MockLLMClient) GetEmbeddings(ctx context.Context, input string) ([]floa return []float64{0.1, 0.2, 0.3}, nil } +func (m *MockLLMClient) TranslateToEnglish(ctx context.Context, message string) (string, error) { + return message, nil +} + func TestNewLLMClientFromEnv(t *testing.T) { tests := []struct { name string