Skip to content

Commit

Permalink
Update OpenAI: max_tokens to max_completion_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
sixlive committed Dec 9, 2024
1 parent 32387ef commit bec26ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Providers/OpenAI/Handlers/Structured.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/OpenAI/Handlers/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bec26ef

Please sign in to comment.