Closed birdhouses closed 4 months ago
The meta information is not on the CreateResponse object. I could not find how to obtain the metainformation on a ChatCompletion response in the documentation.
Getting the metainformation only works for legacy completions, not for Chat
completions
$client = \OpenAI::client(env('OPENAI_API_KEY')); $response = $client->chat()->create([ 'model' => $model, 'temperature' => 0, 'top_p' => 0, 'messages' => [ [ "role" => "user", "content" => $generatedPrompt->prompt ] ], ]); Log::info(json_encode($response->meta()));
Call to undefined method OpenAI\Responses\Chat\CreateResponse::meta() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method OpenAI\\Responses\\Chat\\CreateResponse::meta()
"openai-php/laravel": "^0.6.3", "php": "^8.1",
Hi @birdhouses
Please upgrade to the latest version, it is available there.
The meta information is not on the CreateResponse object. I could not find how to obtain the metainformation on a ChatCompletion response in the documentation.
Getting the metainformation only works for legacy
completions
, not for ChatCall to undefined method OpenAI\Responses\Chat\CreateResponse::meta() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method OpenAI\\Responses\\Chat\\CreateResponse::meta()