Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Each element of the header is in array format #331

Closed
rkgo55 opened this issue Feb 7, 2024 · 1 comment · Fixed by #332
Closed

[Bug]: Each element of the header is in array format #331

rkgo55 opened this issue Feb 7, 2024 · 1 comment · Fixed by #332
Labels
bug Something isn't working

Comments

@rkgo55
Copy link

rkgo55 commented Feb 7, 2024

Description

Thank you for all your help
It may need to be modified as follows

# https://github.com/openai-php/client/blob/f6b47acbe326851a790d158a56e6bedb4e533f67/src/Testing/Responses/Concerns/Fakeable.php#L50
    public static function fakeResponseMetaInformation(): MetaInformation
    {
        return MetaInformation::from([
            'openai-model' => ['gpt-3.5-turbo-instruct'],
            'openai-organization' => ['org-1234'],
            'openai-processing-ms' => ['410'],
            'openai-version' => ['2020-10-01'],
            'x-ratelimit-limit-requests' => ['3000'],
            'x-ratelimit-limit-tokens' => ['250000'],
            'x-ratelimit-remaining-requests' => ['2999'],
            'x-ratelimit-remaining-tokens' => ['249989'],
            'x-ratelimit-reset-requests' => ['20ms'],
            'x-ratelimit-reset-tokens' => ['2ms'],
            'x-request-id' => ['3813fa4fa3f17bdf0d7654f0f49ebab4'],
        ]);
    }

Steps To Reproduce

    $meta = (new ClientFake([CreateResponse::fake()]))->chat()->create([
        'messages' => [
            ['role' => 'system', 'content' => 'hello'],
        ],
    ])->meta();
    dump($meta);

OpenAI PHP Client Version

0.8.0

PHP Version

8.1.13

Notes

No response

@rkgo55 rkgo55 added the bug Something isn't working label Feb 7, 2024
@rkgo55
Copy link
Author

rkgo55 commented Feb 7, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant