api key integration

This commit is contained in:
2026-09-24 11:01:16 +05:30
parent 697b77f8c1
commit 9698de32d5
9 changed files with 503 additions and 10 deletions

View File

@@ -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 {