client icon indicating copy to clipboard operation
client copied to clipboard

Undefined array key "transient"

Open VitalijOd opened this issue 3 years ago • 7 comments

Since yesterday, I have been receiving an error when using the Whisper model:

Undefined array key "transient" {"exception":"[object] (ErrorException(code: 0): Undefined array key "transient" at /vendor/openai-php/client/src/Responses/Audio/TranscriptionResponseSegment.php:56)

It seems that the API may no longer return the "transient" property.

VitalijOd avatar Jul 07 '23 08:07 VitalijOd

Same problem here. Is there any OpenAI documentation at all that would tell me this before it happens?

thoasty-dev avatar Jul 07 '23 08:07 thoasty-dev

Obviously something changed in the OpenAI API, as a quickfix (to get the library working again) the following diff seems to work:

`diff --git a/html/vendor/openai-php/client/src/Responses/Audio/TranscriptionResponseSegment.php b/html/vendor/openai-php/client/src/Responses/Audio/TranscriptionResponseSegment.php index de31603..0294404 100644 --- a/html/vendor/openai-php/client/src/Responses/Audio/TranscriptionResponseSegment.php +++ b/html/vendor/openai-php/client/src/Responses/Audio/TranscriptionResponseSegment.php @@ -53,7 +53,7 @@ final class TranscriptionResponseSegment implements ResponseContract $attributes['avg_logprob'], $attributes['compression_ratio'], $attributes['no_speech_prob'],

  •        $attributes['transient'],
    
  •        isset($attributes['transient'])?$attributes['transient']:false,
       );
    
    }`

klaja avatar Jul 07 '23 09:07 klaja

Can any of you make a pull request?

nunomaduro avatar Jul 07 '23 10:07 nunomaduro

Same problem here.

KaracsonyMarton avatar Jul 07 '23 11:07 KaracsonyMarton

@KaracsonyMarton @klaja @VitalijOd @thoasty-dev Would be cool to have one of you doing a pull request, so we can tag a new release with it.

nunomaduro avatar Jul 07 '23 12:07 nunomaduro

Thank you for your quick support Nuno, I just opened a PR

thoasty-dev avatar Jul 07 '23 12:07 thoasty-dev

Fixed on v0.6.3. Please consider talking with your bosses to sponsoring our work on GitHub sponsors, because having the availability to simply doing releases during the week is expensive.

nunomaduro avatar Jul 07 '23 12:07 nunomaduro