OptionalcontextThe id of the context. Optional: when omitted, the server generates one and rejects the upload if another context in the knowledge base already holds identical content (content-level dedup). Provide an explicit id to address a specific context — that overwrites it unconditionally and allows duplicate content across different ids.
OptionalextractWhether to extract images embedded in markdown/HTML text. Defaults to FALSE — deliberately the
opposite of AiKnowledgeBaseFileContextRequest.extractImages. A pasted blob's inline images
are usually layout chrome, whereas an uploaded document's images are part of its content. Uploading
the same markdown as a .md file is therefore the file case, and defaults to images ON.
When true and the text is detected as (or declared to be) markdown/HTML, image references inside the
text ( or <img src="...">) are fetched, stored, and have descriptions generated
just like images extracted from a PDF.
Has no effect for plain text.
OptionalformatHint about the format of the text. If omitted (or 'auto'), the format is sniffed from the content.
Only 'markdown' and 'html' (or 'auto' with content that looks like markdown/HTML) participate in
image extraction when extractImages is true.
OptionalimageThe AI model to use for generating image descriptions, if specified.
OptionalimageMinimum width/height (in pixels) for an image to be kept. Smaller images are skipped.
OptionalmetadataOptional metadata associated with the context item.
OptionaloptionsGeneral options for how to process the text.
OptionalscopesAccess scopes granting read access to this context, stamped onto every chunk it produces. Only
meaningful on a knowledge base with accessControl.mode: 'enforced', where a caller retrieves the
context only if they hold at least one of these scopes.
Supplied here rather than through a follow-up call so a restricted context is never briefly readable by everyone between being indexed and being scoped. Omitted on a re-ingest keeps whatever scopes the context already had; an empty array makes it visible to every caller.
Scopes are opaque strings the resolver and the ingest side agree on. The __ prefix is reserved.
The text content to add to the context.
A title for the text context.
Specifies the context type as 'text'.
Request structure for adding text-based context to an AI agent.