From bec26ef0b4be1fbe63fe680002f9abcbf188931e Mon Sep 17 00:00:00 2001 From: sixlive Date: Mon, 9 Dec 2024 11:41:21 -0500 Subject: [PATCH] Update OpenAI: max_tokens to max_completion_tokens --- src/Providers/OpenAI/Handlers/Structured.php | 2 +- src/Providers/OpenAI/Handlers/Text.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Providers/OpenAI/Handlers/Structured.php b/src/Providers/OpenAI/Handlers/Structured.php index 25e4bb1..9000058 100644 --- a/src/Providers/OpenAI/Handlers/Structured.php +++ b/src/Providers/OpenAI/Handlers/Structured.php @@ -73,7 +73,7 @@ public function sendRequest(Request $request): Response array_merge([ 'model' => $request->model, 'messages' => (new MessageMap($request->messages, $request->systemPrompt ?? ''))(), - 'max_tokens' => $request->maxTokens ?? 2048, + 'max_completion_tokens' => $request->maxTokens ?? 2048, ], array_filter([ 'temperature' => $request->temperature, 'top_p' => $request->topP, diff --git a/src/Providers/OpenAI/Handlers/Text.php b/src/Providers/OpenAI/Handlers/Text.php index 3432097..c840259 100644 --- a/src/Providers/OpenAI/Handlers/Text.php +++ b/src/Providers/OpenAI/Handlers/Text.php @@ -63,7 +63,7 @@ public function sendRequest(Request $request): Response array_merge([ 'model' => $request->model, 'messages' => (new MessageMap($request->messages, $request->systemPrompt ?? ''))(), - 'max_tokens' => $request->maxTokens ?? 2048, + 'max_completion_tokens' => $request->maxTokens ?? 2048, ], array_filter([ 'temperature' => $request->temperature, 'top_p' => $request->topP,