A file attached to a message (phoenix_kit_agent_attachments). The bytes live
in Storage, in the module's hidden library (file_uuid); the row keeps what
the model reads: the extracted text of a PDF or a sheet, truncated to a limit.
status goes pending → ready | failed; a failed row keeps a code in
error (see PhoenixKitAgent.Attachments.Processor), never text of the file.
A ready picture or scanned PDF has no extracted_text: the model is shown
its pixels in the turn that sends it.
conversation_uuid, message_uuid, user_uuid and file_uuid are set by the
caller, never cast.
Summary
Functions
Builds an attachment from its file description and processing state.
The kinds of attachment: image, pdf, sheet, text.
Types
@type t() :: %PhoenixKitAgent.Schemas.Attachment{ __meta__: term(), content_type: term(), conversation: term(), conversation_uuid: term(), error: term(), extracted_text: term(), file: term(), file_uuid: term(), filename: term(), inserted_at: term(), kind: term(), message: term(), message_uuid: term(), pages: term(), size_bytes: term(), status: term(), truncated: term(), user: term(), user_uuid: term(), uuid: term() }
Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Builds an attachment from its file description and processing state.
@spec kinds() :: [String.t()]
The kinds of attachment: image, pdf, sheet, text.