api key integration
This commit is contained in:
@@ -214,7 +214,7 @@ func (c *openAIChat) Complete(ctx context.Context, req ChatRequest) (ChatReply,
|
||||
if c.cfg.APIKey != "" {
|
||||
auth = "Bearer " + c.cfg.APIKey
|
||||
}
|
||||
if err := postJSON(ctx, c.client, c.base+"/chat/completions", auth, body, &out); err != nil {
|
||||
if err := postJSON(ctx, c.client, "assistant", c.base+"/chat/completions", auth, body, &out); err != nil {
|
||||
return ChatReply{}, err
|
||||
}
|
||||
if out.Error != nil {
|
||||
|
||||
Reference in New Issue
Block a user