-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
Undefined array key "openai-version" #201
Comments
Looks like OpenAI on Azure does not return the same headers as the standard API. I try to figure out what the differences are and how to tackle them. Meanwhile the only thing you can do is to downgrade to v0.6.X |
@gehrisandro Hi, thanks for the response. Here are the headers from the completions endpoint over Azure:
] And we cannot used the 0.6.* version as for the chat endpoint response 'content' is always expected and throws an error when there is no content in the response. It was fixed in 0.7.0 with |
Thank you @TarikHusovicContentoo I am going to make a new release which fixes this issue in the next couple of hours. |
Fixed in v0.7.2 @TarikHusovicContentoo could you please provide a feedback if this now works for you? |
@gehrisandro Works like a charm, thanks! |
After upgrading to version 0.7.1 I get the following message.
My call that call the API is:
ErrorException {#1365 // app/Services/OpenAIService.php:311 #message: "Undefined array key "openai-version"" #code: 0 #file: "/home/labs/vendor/openai-php/client/src/Responses/Meta/MetaInformation.php" #line: 36 #severity: E_WARNING trace: { /home/labs/vendor/openai-php/client/src/Responses/Meta/MetaInformation.php:36 { Illuminate\Foundation\Bootstrap\HandleExceptions->handleError($level, $message, $file = '', $line = 0, $context = []) … › 'organization' => $headers['openai-organization'][0] ?? null, › 'version' => $headers['openai-version'][0], › 'processingMs' => (int) $headers['openai-processing-ms'][0], } /home/labs/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:270 { Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure} … › return fn (...$arguments) => static::$app › ? $this->{$method}(...$arguments) › : false; } /home/labs/vendor/openai-php/client/src/Responses/Meta/MetaInformation.php:36 { OpenAI\Responses\Meta\MetaInformation::from(array $headers): self … › 'organization' => $headers['openai-organization'][0] ?? null, › 'version' => $headers['openai-version'][0], › 'processingMs' => (int) $headers['openai-processing-ms'][0], }....
Same thing happens on chat resource. I have tried with gpt3 and gpt4 models.
The text was updated successfully, but these errors were encountered: