Bluestep JS Documentation
    Preparing search index...

    Interface AiCallOptions<Schemas>

    Options for B.ai.call(). Extends AiClientOptions with a single-call message. At least one of message or chatHistory must be provided. 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 AiCallOptions<
        Schemas extends readonly JSONSchema[] = readonly JSONSchema[],
    > {
        apiKey?: string;
        chatHistory?: AiChatHistoryEntry[];
        flag?: string;
        message?: string;
        model?: string;
        onTurn?: (response: AiCallResult) => AiTurnDecision;
        provider?: string;
        systemPrompt?: string;
        tools?: { [K in string | number | symbol]: AiToolLiteral<Schemas[K]> };
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    experimental

    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.

    message?: string

    User message to send to the model. Appended after chatHistory when both are provided.

    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.

    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.