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

Update CreateResponseFixture.php #145

Merged
merged 1 commit into from
Jun 15, 2023
Merged

Conversation

benbjurstrom
Copy link
Contributor

Thanks so much for getting the new function stuff added so quickly!

Found this minor issue while trying to write some tests using CreateResponse::fake. Without the function_call key in the fixture the content of functionCall in the faked response will always be null.

Tested with:

    $client = new ClientFake([
        CreateResponse::fake([
            'choices' => [
                [
                    'message' => [
                        'function_call' => [
                            'name' => 'get_current_weather',
                            'arguments' => "{\n  \"location\": \"Boston, MA\"\n}",
                        ],
                    ],
                    'finish_reason' => 'function_call'
                ],
            ],
        ]),
    ]);

@gehrisandro
Copy link
Collaborator

Thank you for the PR. 🚀

@gehrisandro gehrisandro merged commit 3173e08 into openai-php:main Jun 15, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants