Skip to content

Commit

Permalink
Fix prefix trimming in stream handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Aug 3, 2023
1 parent 595c329 commit 5cb8efe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/plugin/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (a *App) runOpenAIChatCompletionsStream(ctx context.Context, req *backend.R
if err != nil {
return err
}
path := strings.TrimPrefix(req.Path, "/openai")
path := strings.TrimPrefix(req.Path, "openai")
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, settings.OpenAIURL+path, bytes.NewReader(outgoingBody))
httpReq.Header.Set("Authorization", fmt.Sprintf("Bearer %s", settings.openAIKey))
httpReq.Header.Set("OpenAI-Organization", settings.OpenAIOrganizationID)
Expand Down

0 comments on commit 5cb8efe

Please sign in to comment.