tests
This commit is contained in:
parent
2bd7333233
commit
46a4374e69
|
|
@ -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) {
|
func (m *mockLLM) GetEmbeddings(ctx context.Context, input string) ([]float64, error) {
|
||||||
return m.embeddings, m.embeddingErr
|
return m.embeddings, m.embeddingErr
|
||||||
}
|
}
|
||||||
|
func (m *mockLLM) TranslateToEnglish(ctx context.Context, msg string) (string, error) {
|
||||||
|
return msg, nil
|
||||||
|
}
|
||||||
|
|
||||||
// --- Test VisitDB ---
|
// --- Test VisitDB ---
|
||||||
type testVisitDB struct {
|
type testVisitDB struct {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ func (m *mockHandleChatLLM) DisambiguateBestMatch(ctx context.Context, msg strin
|
||||||
func (m *mockHandleChatLLM) GetEmbeddings(ctx context.Context, input string) ([]float64, error) {
|
func (m *mockHandleChatLLM) GetEmbeddings(ctx context.Context, input string) ([]float64, error) {
|
||||||
return m.embeddings, m.embeddingErr
|
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.
|
// mapChatRepo is an in-memory implementation of ChatRepositoryAPI for tests.
|
||||||
type mapChatRepo struct {
|
type mapChatRepo struct {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ func (m *MockLLMClient) GetEmbeddings(ctx context.Context, input string) ([]floa
|
||||||
return []float64{0.1, 0.2, 0.3}, nil
|
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) {
|
func TestNewLLMClientFromEnv(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue