Plaintext data (e.g., from a .txt or .md document).
A PlainTextContentBlock existed in langchain-core<1.0.0. Although the
name has carried over, the structure has changed significantly. The only shared
keys between the old and new versions are type and text, though the
type value has changed from 'text' to 'text-plain'.
Title and context are optional fields that may be passed to the model. See Anthropic example.
create_plaintext_block may also be used as a factory to create a
PlainTextContentBlock. Benefits include:
PlainTextContentBlock()Type of the content block. Used for discrimination.
Unique identifier for this content block.
Either:
UUID4 prefixed with 'lc_'))Reference to the plaintext file in an external file storage system.
For example, OpenAI or Anthropic's Files API.
MIME type of the file.
Required for base64 data.
Index of block in aggregate response. Used during streaming.
URL of the plaintext.
Data as a base64 string.
Plaintext content. This is optional if the data is provided as base64.
Title of the text data, e.g., the title of a document.
Context for the text, e.g., a description or summary of the text's content.
Provider-specific metadata. This shouldn't be used for the data itself.