ReqLLM. Message. ContentPart
(ReqLLM v1.19.0)
View Source
ContentPart represents a single piece of content within a message.
Supports multiple content types:
:text- Plain text content:image_url- Image from URL:video_url- Video from URL:image- Image from binary data:file- File attachment or uploaded file reference:thinking- Chain-of-thought thinking content
Provider-owned file references are opt-in through owned_file_id/3. Legacy
file_id/1 values remain unowned and preserve their existing behavior.
See also
ReqLLM.Message- Multi-modal message composition using ContentPart collections
Summary
Functions
Returns redacted provider file metadata suitable for logs and diagnostics.
Returns whether a file reference has explicit provider ownership metadata.
Creates an explicitly provider-owned file reference.
Returns the full metadata record for an explicitly owned provider file.
Returns the Zoi schema for this module
Types
@type t() :: %ReqLLM.Message.ContentPart{ data: nil | nil | any(), file_id: nil | nil | binary(), filename: nil | nil | binary(), media_type: nil | nil | binary(), metadata: map(), text: nil | nil | binary(), type: :text | :image_url | :video_url | :image | :file | :thinking, url: nil | nil | binary() }
Functions
@spec inspect_provider_file(t() | map()) :: {:ok, ReqLLM.ProviderFileReference.t()} | :error
Returns redacted provider file metadata suitable for logs and diagnostics.
Returns whether a file reference has explicit provider ownership metadata.
Creates an explicitly provider-owned file reference.
Ownership is stored in the reserved "req_llm" -> "provider_file" metadata
namespace. Legacy file_id/1 references remain unowned and keep their existing
behavior.
Supported options are :media_type, :metadata, :purpose, :status,
:expires_at, :size, :sha256, and :provider_metadata.
@spec provider_file_reference(t() | map()) :: {:ok, ReqLLM.ProviderFileReference.t()} | :error
Returns the full metadata record for an explicitly owned provider file.
Returns the Zoi schema for this module