open-ai icon indicating copy to clipboard operation
open-ai copied to clipboard

json_object

Open MwSpaceLLC opened this issue 7 months ago • 1 comments

Describe the feature or improvement you're requesting

Please, see at: https://platform.openai.com/docs/guides/text-generation/json-mode

            $chat = json_decode(
                $open_ai->completion([
                    'model' => 'gpt-4-1106-preview',
                    'prompt' => $prompt,
                    'temperature' => 0.7,
                    'max_tokens' => 1024,
                    "top_p" => 1,
                    'frequency_penalty' => 0,
                    'presence_penalty' => 0,
                    'response_format ' => [
                        'type' => "json_object"
                    ]
                ])
            );

Additional context

No response

MwSpaceLLC avatar Nov 20 '23 09:11 MwSpaceLLC