@squidcloud/client
    Preparing search index...

    Interface BaseAiChatOptions

    The base AI agent chat options, should not be used directly.

    interface BaseAiChatOptions {
        agentContext?: Record<string, unknown>;
        connectedAgents?: AiConnectedAgentMetadata[];
        connectedIntegrations?: AiConnectedIntegrationMetadata<unknown>[];
        connectedKnowledgeBases?: AiConnectedKnowledgeBaseMetadata[];
        contextMetadataFilter?: AiContextMetadataFilter;
        contextMetadataFilterForKnowledgeBase?: Record<
            string,
            AiContextMetadataFilter,
        >;
        disableContext?: boolean;
        enablePromptRewriteForRag?: boolean;
        executionPlanOptions?: AiAgentExecutionPlanOptions;
        fileIds?: string[];
        fileUrls?: AiFileUrl[];
        functions?: (string | AiFunctionIdWithContext)[];
        guardrails?: GuardrailsOptions;
        includeMetadata?: boolean;
        includeReference?: boolean;
        instructions?: string;
        legacyKnowledgeBaseContext?: boolean;
        maxOutputTokens?: number;
        maxTokens?: number;
        maxToolIterations?: number;
        memoryOptions?: AiAgentMemoryOptions;
        metricAnnotations?: Record<string, string>;
        model?: AiChatModelSelection;
        quotas?: AiChatPromptQuotas;
        reasoningEffort?: AiReasoningEffort;
        rerankProvider?: "cohere" | "none";
        responseFormat?: AiAgentResponseFormat;
        smoothTyping?: boolean;
        temperature?: number;
        timeoutMs?: number;
        useCodeInterpreter?: "none" | "llm";
        verbosity?: AiVerbosityLevel;
        voiceOptions?: OpenAiCreateSpeechOptions;
        workspaceId?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    agentContext?: Record<string, unknown>

    Global context passed to the agent and all AI functions of the agent.

    connectedAgents?: AiConnectedAgentMetadata[]

    List of connected AI agents can be called by the current agent. Overrides the stored value.

    connectedIntegrations?: AiConnectedIntegrationMetadata<unknown>[]

    List of connected AI agents can be called by the current agent. Overrides the stored value.

    connectedKnowledgeBases?: AiConnectedKnowledgeBaseMetadata[]

    List of connected AiKnowlegeBases that can be called by the current agent

    contextMetadataFilter?: AiContextMetadataFilter

    A set of filters that will limit the context the AI can access.

    use contextMetadataFilterForKnowledgeBase instead.

    contextMetadataFilterForKnowledgeBase?: Record<string, AiContextMetadataFilter>

    A set of filters that will limit the context the AI can access.

    disableContext?: boolean

    Whether to disable the whole context for the request. Default to false.

    enablePromptRewriteForRag?: boolean

    Rewrite prompt for RAG - defaults to false

    executionPlanOptions?: AiAgentExecutionPlanOptions

    Options for AI agent execution plan, allowing the agent to perform an execution plan before invoking connected agents, connected integrations, or functions.

    fileIds?: string[]

    File IDs to include in the chat context. These are IDs returned from the AI provider's Files API after uploading files. Files are attached to the conversation and can be read/analyzed by the AI.

    fileUrls?: AiFileUrl[]

    An array of file URLs to include in the chat context.

    functions?: (string | AiFunctionIdWithContext)[]

    Functions to expose to the AI. Either a function name or a name with an extra function context passed only to this function. The parameter values must be valid serializable JSON values. Overrides the stored value.

    guardrails?: GuardrailsOptions

    Preset instruction options that can be toggled on

    includeMetadata?: boolean

    Include metadata in the context.

    Use includeMetadata on individual AiConnectedKnowledgeBaseMetadata entries in connectedKnowledgeBases instead.

    includeReference?: boolean

    Whether to include references from the source context in the response. Default to false.

    instructions?: string

    Instructions to include with the prompt.

    legacyKnowledgeBaseContext?: boolean

    Whether to use the legacy knowledge base context mode, where KB results are fetched upfront and appended directly to the prompt. When false (default), the KB is exposed as a callable tool that the LLM can invoke on demand.

    maxOutputTokens?: number

    The maximum number of tokens the model should output. Passed directly to the AI model. Can be used to control the output verbosity.

    maxTokens?: number

    The maximum number of input tokens that Squid can use when making the request to the AI model. Defaults to the max tokens the model can accept.

    maxToolIterations?: number

    Maximum number of tool-call iterations the model may perform in a single chat turn. Defaults to 50.

    memoryOptions?: AiAgentMemoryOptions

    The context ID to use for the request. If not provided, the agent's default context will be used.

    metricAnnotations?: Record<string, string>

    Arbitrary client-defined annotations attached to this AI call for usage tracking. Reported as annotation.<key> tags on Squid AI usage metrics, so token usage can later be filtered and grouped by these values (e.g. { feature: 'support-bot', requestSource: 'mobile' }). Inherited by nested calls to connected agents made while serving this call. Limits: at most 10 entries, keys up to 64 characters, values up to 256 characters; entries beyond the limits are dropped or truncated.

    The LLM model to use. Can be a vendor model name (string) or an integration-based model (object).

    Current budget for nested or recursive AI chat calls per single prompt.

    reasoningEffort?: AiReasoningEffort

    The level of reasoning effort to apply; defaults to model-specific value. Effective only for models with reasoning.

    rerankProvider?: "cohere" | "none"

    Which provider's reranker to use for reranking the context. Defaults to 'cohere'.

    responseFormat?: AiAgentResponseFormat

    The format of the response from the AI model. Note that not all models support JSON format. Default to 'text'.

    smoothTyping?: boolean

    Whether to response in a "smooth typing" way, beneficial when the chat result is displayed in a UI. Default to true.

    temperature?: number

    The temperature to use when sampling from the model. Default to 0.5.

    timeoutMs?: number

    Timeout in milliseconds for the entire chat request. Defaults to 240,000 (4 minutes).

    useCodeInterpreter?: "none" | "llm"

    Enable LLMs built-in code interpreter for executing Python code.

    • 'none': Code interpreter is disabled (default).
    • 'llm': Use LLM's native code interpreter to run Python code.

    Note: Only supported by OpenAI, Anthropic and Gemini models. Ignored for other providers.

    verbosity?: AiVerbosityLevel

    Controls response length and detail level. Use low for brief responses, medium for balanced detail, or high for comprehensive explanations. Default: 'medium'.

    Note: this parameter is only supported by OpenAI plain text responses and is ignored for others. For other providers ask about verbosity in prompt and using maxOutputTokens.

    The options to use for the response in voice.

    workspaceId?: string

    Names a persistent working directory for CLI-backed agents (claude-code, codex). When set, the agent runs in a directory keyed by this id, synced across pod replicas via the shared workspace server, so files created in one ask persist and are visible to later asks reusing the same id — including across providers.

    Pass the same id consistently for a conversation; changing it points the agent at a different directory (and, for Claude Code, starts a fresh transcript). Must match [A-Za-z0-9_-] (1-200 chars). Ignored by non-CLI agents and when the workspace server is unconfigured (falls back to a pod-local, non-synced, ephemeral dir).