openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.99k stars 523 forks source link

[Bug]: Argument #1 ($attributes) must be of type array, string given #478

Closed bytestream closed 2 weeks ago

bytestream commented 2 months ago

Description

OpenAI\Responses\Models\ListResponse::from(): Argument #1 ($attributes) must be of type array, string given, called in /vendor/openai-php/client/src/Resources/Models.php on line 30

https://github.com/openai-php/client/blob/061a73827795d01a4fab1a580e08bc5b92d90999/src/Resources/Models.php#L30 $response->data() returns array|string but ListResponse::from() only accepts array.

$response->data() is intermittently returning "404 page not found\n"

Steps To Reproduce

OpenAI::client('...')->models()->list()->data

OpenAI PHP Client Version

v0.10.1

PHP Version

8.1.24

Notes

No response

gehrisandro commented 2 weeks ago

Hi @bytestream

I am not able to reproduce the bug. Feel free to reopen the issue, if you can still reproduce the error.