Closed aneequrrehman closed 1 month ago
I noticed that FilePart
and ImagePart
are already interfaces, and even if you extend those, the conversational APIs seem to work.
Example:
declare module 'ai' {
interface ImagePart {
filePointer: string
width: number
height: number
}
Feature Description
Related to Generic Messages #1180.
Currently,
Attachment
s are not easily extensible. For instance, images may require additional fields such asheight
andwidth
, or attachments may need afile_pointer
depending upon the storage mechanism. And so at the moment, it requires custom projections and types to tackle this.Additional context
While I understand that handling storage details is not the responsibility of the AI SDK itself, introducing such a field as
Record<string, unknown>
or some similar mechanism to allow theAttachment
type extension would simplify integration for consumers.