From 0425ed090ea8c9a4f900db582e343cfc5997dec0 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 }