openai-php / laravel

⚡️ OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with OpenAI API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined array key "file_id"

latrell opened this issue · comments

I added a message with a picture to the thread and an exception occurred

$message_content = [
    ['type' => 'text', 'text' => '666'],
    ['type' => 'image_url', 'image_url' => ['url' => 'https://www.xxx.xxx/xxx.jpg']],
];

OpenAI::threads()->messages()->create($thread_id, [
    'role' => 'user',
    'content' => $message_content,
]);
Undefined array key "file_id" {"exception":"[object] (ErrorException(code: 0): Undefined array key \"file_id\" at /var/www/html/vendor/openai-php/client/src/Responses/Threads/Messages/ThreadMessageResponseContentImageUrl.php:37)

I found this file and printed $attributes and got the following

{"url":"https://www.xxx.xxx/xxx.jpg","detail":"auto"}