Skip to content

[Bug]: Logprobs property is missing in Chat\CreateResponseChoice #455

@GubaEvgeniy

Description

@GubaEvgeniy

Description

As you can see in the legacy Completion method, support for logprobs is included:

public readonly ?CreateResponseChoiceLogprobs $logprobs,

However, in the current Chat method, support for logprobs is completely missing:

final class CreateResponseChoice

Please rectify this situation and add support for logprobs to Chat.
Thank you.

Steps To Reproduce

  1. Define a chat request as documented, specifying support for logprobs:
$response = $client->chat()->create([
    'model' => 'gpt-3.5-turbo',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello!'],
    ],
    'logprobs' => true,
]);
  1. Receive a response from the API that includes a logprobs array in choices.
Снимок экрана 2024-07-22 в 14 52 40
  1. This attribute is missing from the CreateResponseChoice object -
    final class CreateResponseChoice

OpenAI PHP Client Version

0.10.1

PHP Version

8.2

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions