Skip to content

Commit

Permalink
Fix fake ai client pre-programmed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tygern committed Jun 5, 2024
1 parent 50064d0 commit 9167ac4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/app/query_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ type fakeAi struct {
}

func (f fakeAi) CreateEmbedding(_ context.Context, _ string) ([]float32, error) {
if f.completionError != nil {
return nil, f.completionError
if f.embeddingError != nil {
return nil, f.embeddingError
}

return testsupport.CreateVector(0), nil
}

func (f fakeAi) GetChatCompletion(_ context.Context, _ []ai.ChatMessage) (chan string, error) {
if f.embeddingError != nil {
return nil, f.embeddingError
if f.completionError != nil {
return nil, f.completionError
}

response := make(chan string)
Expand Down

0 comments on commit 9167ac4

Please sign in to comment.