functai for TypeScript - v0.1.0
    Preparing search index...

    Interface ConversationOptions

    The options of a conversation, besides settings for every turn.

    interface ConversationOptions {
        adapter?: unknown;
        apiKey?: string | null;
        apiMaxWait?: number;
        apiRetries?: number;
        approve?: ApproveSetting | null;
        baseUrl?: string | null;
        cacheReplies?: CacheSetting;
        caller?: Record<string, unknown> | null;
        capabilities?: Capabilities | null;
        config?: Partial<Config> | null;
        context?: ContextRule;
        earlierWithout?: readonly string[];
        escalateBelow?: number | null;
        escalateTo?: string | object | null;
        includeFnName?: boolean;
        journal?: Journal | null;
        lm?: string | null;
        logCalls?: string | boolean | null;
        logContent?: LogContent | null;
        maxSteps?: number;
        maxTokens?: number | null;
        module?: "predict" | "cot" | null;
        observers?: readonly Observer[] | null;
        onUnreadable?: "raise" | "record";
        plugins?: readonly Plugin[] | null;
        programObservers?: boolean | null;
        programPlugins?: boolean | null;
        remembers?:
            | Map<object, unknown>
            | Iterable<readonly [object, unknown], any, any>;
        replicate?: number | null;
        retries?: number;
        router?: Router | null;
        seed?: number | null;
        sends?: "queue" | "refuse" | "branch";
        stop?: readonly string[] | null;
        store?: string | boolean | ConversationStore | null;
        temperature?: number | null;
        template?: readonly Record<string, unknown>[] | null;
        toolErrors?: "raise" | "report";
        topP?: number | null;
    }

    Hierarchy (View Summary)

    Index
    adapter?: unknown

    The layout: "xml" (default), "chat", "json", an lmcc adapter, or an artifact.

    apiKey?: string | null

    A key for the provider lm routes to: it beats saved logins and the environment. Never saved with a function.

    apiMaxWait?: number

    The longest a provider may ask to wait before a re-send, in seconds (default 60). A longer retryAfter (a spent subscription window) raises at once, saying until when.

    apiRetries?: number

    Re-sends after a transient provider error (default 3).

    approve?: ApproveSetting | null

    Who answers a tool call before it runs (contract/tools.md): a function asked at once, or a rule a person answers later ("changes", "all", a list of tool names or approval paths). No approval by default.

    baseUrl?: string | null

    Where that provider is reached: a server of your own that speaks its API (lm: "openai:qwen3" with baseUrl: "http://localhost:8000/v1" for vLLM or Ollama), a gateway. Saved with a function, as its model is.

    cacheReplies?: CacheSetting

    Answer an identical request with the reply it got before (true: in this process's memory; or a store: a Map, Redis, …). Off by default. It returns identical samples too: leave it off where you want different ones.

    caller?: Record<string, unknown> | null

    Who is calling, added to FUNCTAI_CALLER: { kind: "agent", conversation: "…" }.

    capabilities?: Capabilities | null
    config?: Partial<Config> | null

    Any other lm15 Config fields.

    context?: ContextRule

    Which earlier turns are shown: allTurns() (default) or lastTurns(10), each with without.

    earlierWithout?: readonly string[]

    Outputs the program now writes that earlier turns lack (reasoning turned on, a first tool): earlier turns are shown without them.

    escalateBelow?: number | null
    escalateTo?: string | object | null

    When the first model is less sure of its answer than escalateBelow (default 0.9), another answers instead: a model, or an AI function. The first needs to measure its confidence (a baked model, TypeSafe's Jev, config: { probabilities: "required" }).

    includeFnName?: boolean
    journal?: Journal | null

    Where each call tree's kept log is written while it runs: a store (best effort: the call never waits), or { store, mode: "required" } (the call waits until its events are kept, before its code runs, before each tool and before it returns; at most timeout ms, 30 s by default). null: none. A program's own setting cannot replace or remove a host's journal (JournalError journal-policy).

    lm?: string | null

    The model: "gpt-4.1-mini", "claude-haiku-4-5", "groq:openai/gpt-oss-120b", …

    logCalls?: string | boolean | null

    The call log: a folder, true (the default folder), or false. Unset: FUNCTAI_LOG_CALLS decides.

    logContent?: LogContent | null

    Which values the call log and the kept form of events keep: true, false (sizes, times and tokens only), or by field ({ transcript: false }; { "*": false, question: true } keeps only the question). It only ever removes: a value is written only when no layer drops it, and FUNCTAI_LOG_CONTENT=0 drops every value.

    maxSteps?: number

    Model calls per tool loop (default 8).

    maxTokens?: number | null
    module?: "predict" | "cot" | null

    "predict" (default) or "cot": reasoning before the answer.

    observers?: readonly Observer[] | null

    Receivers of the kept form of every event of the calls in scope (a page, telemetry). They add up over the layers (configure's replaces configure's: keep your own list to add one). A function is called soon after each event, off the call's own turn, from a bounded queue (an observer 10,000 events behind loses events); it still runs on this thread, so heavy work belongs in a Worker: an object with postMessage is posted each event. One that throws is warned about once and given no more events.

    onUnreadable?: "raise" | "record"

    What a reply that still cannot be read once the re-asks are spent does: "raise" (the default) ends the call with its refusal; "record" ends it well with no answer (undefined; prediction.refusal says why), recorded with outputs: {} and the refusal as its error, and a conversation goes on past it. For runs that must not stop at one bad reply. A provider error still raises.

    plugins?: readonly Plugin[] | null

    Plugins around the calls in scope (contract/plugins.md): they add up over the layers, the program's own first, the host's last.

    programObservers?: boolean | null

    false (a host's block or configure): the observers a program sets for itself are given no event; the host's still are. It only removes: a program's own true does not undo it.

    programPlugins?: boolean | null

    false (a host's layer): the program's own plugins do not run.

    remembers?:
        | Map<object, unknown>
        | Iterable<readonly [object, unknown], any, any>

    A module's helpers' memory: [[answer, "conversation"]], "turn", remember(...), or "own" for a conversation used inside it.

    replicate?: number | null

    The n-th independent answer to the same request (default 0): part of the reply cache's key, and nothing else.

    retries?: number

    Re-asks after an unreadable reply (default 1).

    router?: Router | null

    The lm15 router calls go through (keys, base URLs, a fake for tests). It wins over apiKey and baseUrl.

    seed?: number | null
    sends?: "queue" | "refuse" | "branch"

    Two sends at once: "queue" (default: the second waits and continues from the first), "refuse" (conversation-busy), or "branch".

    stop?: readonly string[] | null
    store?: string | boolean | ConversationStore | null

    Where it is kept: null (this process's memory), a folder, true (the default folder), or any store with append and read.

    temperature?: number | null
    template?: readonly Record<string, unknown>[] | null

    A chat template of lmcc messages, instead of a named layout.

    toolErrors?: "raise" | "report"

    "report" (the model sees a tool's error) or "raise".

    topP?: number | null