Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix critical issue: parsing messages with image_url #477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
final class ThreadMessageResponseContentImageUrl implements ResponseContract
{
/**
* @use ArrayAccessible<array{file_id: string, detail?: string}>
* @use ArrayAccessible<array{url: string, detail?: string}>
*/
use ArrayAccessible;

use Fakeable;

private function __construct(
public string $url,
public string $imageUrl,
public ?string $detail,
) {}

Expand All @@ -44,7 +44,7 @@ public static function from(array $attributes): self
public function toArray(): array
{
return array_filter([
'url' => $this->url,
'url' => $this->imageUrl,
'detail' => $this->detail,
], fn (?string $value): bool => $value !== null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ThreadMessageResponseContentImageUrlObject implements ResponseContra
*/
private function __construct(
public string $type,
public ThreadMessageResponseContentImageUrl $imageFile,
public ThreadMessageResponseContentImageUrl $imageUrl,
) {}

/**
Expand All @@ -48,7 +48,7 @@ public function toArray(): array
{
return [
'type' => $this->type,
'image_url' => $this->imageFile->toArray(),
'image_url' => $this->imageUrl->toArray(),
];
}
}