Bluestep JS Documentation
    Preparing search index...

    Interface AiClientOptions<Schemas>

    Shared options for B.ai.agent(options) and B.ai.call's AiCallOptions. The type parameter Schemas carries the literal types of each tool's input_schema so inline tool literals get a typed executor args parameter without an explicit cast — see B.ai.call.

    interface AiClientOptions<
        Schemas extends readonly JSONSchema[] = readonly JSONSchema[],
    > {
        apiKey?: string;
        chatHistory?: AiChatHistoryEntry[];
        flag?: string;
        model?: string;
        onTurn?: (response: AiCallResult) => AiTurnDecision;
        provider?: string;
        repos?: (GitRepo | GitMountSpec)[];
        systemPrompt?: string;
        tools?: { [K in string | number | symbol]: AiToolLiteral<Schemas[K]> };
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    apiKey?: string

    Optional API key to call the provider directly. When present, the call bypasses the web-global usage gate entirely (no preflight, no metering).

    chatHistory?: AiChatHistoryEntry[]

    Conversation history to seed the model with. Each entry is {role: "user"|"assistant"|"tool", content: string}. Overrides any server-side session.

    flag?: string

    Custom tracking flag (e.g. "marketingModule"). Reported to the usage gate so superusers can scope limits and reporting by flag.

    model?: string

    AI model identifier to use. Falls back to the provider's configured default when omitted.

    onTurn?: (response: AiCallResult) => AiTurnDecision

    Continuation callback for script-driven multi-turn conversations. After each assistant turn (no outstanding tool calls), the callback is invoked with the response. Return an AiTurnDecision with a message to continue, or {done: true} / null to stop.

    provider?: string

    AI provider name (e.g. "anthropic"). Falls back to the configured tenant default when omitted.

    repos?: (GitRepo | GitMountSpec)[]

    Git repositories the model may read, as mount specs or as repos already opened with B.git.repo. Each mount is pinned to one commit when the call begins, and the model is given an alias and nothing else — never a url, a host, an organization, a repository name, or a credential. A repo with no history (one constructed from live content) is simply not offered the history tools rather than being offered tools that always fail.

    systemPrompt?: string

    System prompt. When provided, replaces the configured tenant default; per-call agent directives are still appended.

    tools?: { [K in string | number | symbol]: AiToolLiteral<Schemas[K]> }

    Tool definitions exposed to the model. Each tool combines a JSON schema with a JS executor invoked when the model emits a tool_use block. Inline literals get their executor's args type derived from their own input_schema; tools produced by B.ai.tool.custom()/forNewEntry/forExistingEntry pass through as AiTool.