@squidcloud/client
    Preparing search index...

    Interface AiKnowledgeBaseTextContextRequest

    Request structure for adding text-based context to an AI agent.

    interface AiKnowledgeBaseTextContextRequest {
        contextId?: string;
        extractImages?: boolean;
        format?: AiKnowledgeBaseTextFormat;
        imageExtractionModel?: AiChatModelSelection;
        imageMinSizePixels?: number;
        metadata?: AiContextMetadata;
        options?: AiKnowledgeBaseContextTextOptions;
        scopes?: string[];
        text: string;
        title: string;
        type: "text";
    }

    Hierarchy (View Summary)

    Index
    contextId?: string

    The 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.

    extractImages?: boolean

    Whether 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 (![alt](url) or <img src="...">) are fetched, stored, and have descriptions generated just like images extracted from a PDF.

    Has no effect for plain text.

    Hint 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.

    imageExtractionModel?: AiChatModelSelection

    The AI model to use for generating image descriptions, if specified.

    imageMinSizePixels?: number

    Minimum width/height (in pixels) for an image to be kept. Smaller images are skipped.

    Optional metadata associated with the context item.

    General options for how to process the text.

    scopes?: string[]

    Access 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.

    text: string

    The text content to add to the context.

    title: string

    A title for the text context.

    type: "text"

    Specifies the context type as 'text'.