Skip to content

Commit

Permalink
Merge pull request #471 from datashaman/attachments-error
Browse files Browse the repository at this point in the history
Fix 'attachments' key exception on thread message modify
  • Loading branch information
gehrisandro authored Nov 12, 2024
2 parents 5bfb908 + d7a346e commit c9e4fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Responses/Threads/Messages/ThreadMessageResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function from(array $attributes, MetaInformation $meta): self

$attachments = array_map(
fn (array $attachment): ThreadMessageResponseAttachment => ThreadMessageResponseAttachment::from($attachment),
$attributes['attachments']
$attributes['attachments'] ?? []

Check failure on line 64 in src/Responses/Threads/Messages/ThreadMessageResponse.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-lowest

Offset 'attachments' on array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: string|null, run_id: string|null, ...} on left side of ?? always exists and is not nullable.

Check failure on line 64 in src/Responses/Threads/Messages/ThreadMessageResponse.php

View workflow job for this annotation

GitHub Actions / Formats P8.1 - ubuntu-latest - prefer-stable

Offset 'attachments' on array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: string|null, run_id: string|null, ...} on left side of ?? always exists and is not nullable.
);

return new self(
Expand Down

0 comments on commit c9e4fa9

Please sign in to comment.