Skip to content

Commit

Permalink
Fix handling of OpenAI API key
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Sep 12, 2023
1 parent ccbb1fb commit bda7f80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/plugin/vector/embed/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (o *openAIClient) Embed(ctx context.Context, model string, payload string)
return nil, fmt.Errorf("create request: %w", err)
}
req.Header.Set("Content-Type", "application/json")
if o.apiKey == "" {
if o.apiKey != "" {
req.Header.Set("Authorization", "Bearer "+o.apiKey)
}
resp, err := o.client.Do(req)
Expand Down

0 comments on commit bda7f80

Please sign in to comment.