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

Fix function call responses from Azure throwing errors #184

Conversation

karlerss-teamdash
Copy link

The responses from Azure for gpt-35-turbo-16k don't seem to have the content attribute (with OpenAI it's set to null).

This PR fixes the ErrorException: Undefined array key "content" error.

@ukkok
Copy link

ukkok commented Aug 21, 2023

Just faced same issue and fixed with exactly same solution. Can confirm that this works.

From Azure documentation, content should not be returned by default:

In some cases, the model may generate both content and a function_call.

https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling#using-function-in-the-chat-completions-api

@gehrisandro gehrisandro merged commit 6b09676 into openai-php:main Aug 28, 2023
@gehrisandro
Copy link
Collaborator

@karlerss-teamdash Many thanks for the PR!

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.

4 participants