trait MapsAttachments

Methods

array
mapAttachments(Collection $attachments)

Map the given Hypervel attachments to Anthropic content blocks.

array
documentSource(string|null $mimeType, callable $rawResolver, callable $base64Resolver)

Build the Anthropic document source block for the given mime type.

array
remoteDocumentSource(RemoteDocument $document)

Build the Anthropic document source block for the given remote document.

string|null
normalizeMimeType(string|null $mimeType)

Strip any parameters from the given mime type.

bool
isImage(UploadedFile $attachment)

Determine if the given uploaded file is an image.

Details

at line 29
protected array mapAttachments(Collection $attachments)

Map the given Hypervel attachments to Anthropic content blocks.

Parameters

Collection $attachments

Return Value

array

at line 142
protected array documentSource(string|null $mimeType, callable $rawResolver, callable $base64Resolver)

Build the Anthropic document source block for the given mime type.

Parameters

string|null $mimeType
callable $rawResolver
callable $base64Resolver

Return Value

array

at line 178
protected array remoteDocumentSource(RemoteDocument $document)

Build the Anthropic document source block for the given remote document.

Parameters

RemoteDocument $document

Return Value

array

at line 204
protected string|null normalizeMimeType(string|null $mimeType)

Strip any parameters from the given mime type.

Parameters

string|null $mimeType

Return Value

string|null

at line 212
protected bool isImage(UploadedFile $attachment)

Determine if the given uploaded file is an image.

Parameters

UploadedFile $attachment

Return Value

bool