From 54ded0d9fb16793d280cc17126453d3b87ed977c Mon Sep 17 00:00:00 2001 From: Pramodh Gopalan V Date: Fri, 19 Apr 2024 02:31:08 +0530 Subject: [PATCH] Fix OpenAI createChat bug (#759) Co-authored-by: Pramodh-G --- llms/openai/internal/openaiclient/chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llms/openai/internal/openaiclient/chat.go b/llms/openai/internal/openaiclient/chat.go index 4aec4ffd3..41fcbdcf4 100644 --- a/llms/openai/internal/openaiclient/chat.go +++ b/llms/openai/internal/openaiclient/chat.go @@ -327,7 +327,7 @@ func (c *Client) createChat(ctx context.Context, payload *ChatRequest) (*ChatCom if c.baseURL == "" { c.baseURL = defaultBaseURL } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.buildURL("/chat/completions", c.Model), body) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.buildURL("/chat/completions", payload.Model), body) if err != nil { return nil, err }