-
-
Notifications
You must be signed in to change notification settings - Fork 635
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When modifying a thread message's metadata after creation, the call to do so fails with:
ErrorException
Undefined array key "attachments"
at vendor/openai-php/client/src/Responses/Threads/Messages/ThreadMessageResponse.php:64
60▕ );
61▕
62▕ $attachments = array_map(
63▕ fn (array $attachment): ThreadMessageResponseAttachment => ThreadMessageResponseAttachment::from($attachment),
➜ 64▕ $attributes['attachments']
65▕ );
66▕
67▕ return new self(
68▕ $attributes['id'],
Steps To Reproduce
$thread = $client->threads()->create([]);
$message = $client->threads()->messages()->create($thread->id, [
'role' => 'user',
'content' => 'Explain deep learning to a 5 year old.',
]);
$response = $client->threads()->messages()->modify(
threadId: $thread->id,
messageId: $message->id,
parameters: [
'metadata' => [
'key' => 'value',
],
]
);
OpenAI PHP Client Version
dev-main
PHP Version
8.3.9
Notes
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working