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.
OptionaldiscardWhether Squid discards the downloadable original once the file is extracted; the extracted text and
images are stored either way. Defaults to false: the original is kept so the user can download it and
Squid can reprocess it. Without it, querySpreadsheetsWithAi cannot open a workbook context and a
reupsert of the context fails, on the sync and the bulk lane alike.
OptionalextractWhether to extract images from the file, describe them with a vision model, and index those descriptions alongside the text. Defaults to TRUE — a document's charts, diagrams and scanned pages carry content the text layer does not, so a file context captures them unless asked not to.
Note this is the opposite of AiKnowledgeBaseTextContextRequest.extractImages, which defaults to false: images referenced from a pasted markdown/HTML blob are usually layout chrome, and fetching them means following URLs the caller supplied.
OptionalimageThe AI model to use for extraction, if specified.
OptionalimageThe minimum size for extracted images, if applicable.
OptionalmetadataOptional metadata associated with the context item.
OptionaloptionsGeneral options for how to process the file.
OptionalpreferredThe preferred method for extracting data from the document.
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.
Specifies the context type as 'file'.
Request structure for adding file-based context to an AI agent.