Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/Responses/Responses/Input/InputMessageContentInputFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use OpenAI\Testing\Responses\Concerns\Fakeable;

/**
* @phpstan-type ContentInputFileType array{type: 'input_file', file_data: string, file_id: string, filename: string}
* @phpstan-type ContentInputFileType array{type: 'input_file', file_data: ?string, file_id: ?string, filename: string}
*
* @implements ResponseContract<ContentInputFileType>
*/
Expand All @@ -27,8 +27,8 @@ final class InputMessageContentInputFile implements ResponseContract
*/
private function __construct(
public readonly string $type,
public readonly string $fileData,
public readonly string $fileId,
public readonly ?string $fileData,
public readonly ?string $fileId,
public readonly string $filename,
) {}

Expand All @@ -39,8 +39,8 @@ public static function from(array $attributes): self
{
return new self(
type: $attributes['type'],
fileData: $attributes['file_data'],
fileId: $attributes['file_id'],
fileData: $attributes['file_data'] ?? null,
fileId: $attributes['file_id'] ?? null,
filename: $attributes['filename'],
);
}
Expand Down