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

    Interface Module<I, R>

    A module: call it with its inputs, get its result.

    interface Module<I extends Rec = Rec, R = unknown> {
        interface: Interface;
        interfaceId: string;
        module: string;
        name: string;
        settings: Settings;
        uses: readonly (AnyAIFunction | AnyModule)[];
        version: string;
        conversation(
            id?: string | null,
            options?: ConversationOptions,
        ): Conversation & (...args: CallArgs<I, TurnOptions>) => Promise<R>;
        map(inputs: Iterable<CallArgs<I>[0]>, options?: MapOptions): Promise<R[]>;
        mapSettled(
            inputs: Iterable<CallArgs<I>[0]>,
            options?: MapOptions,
        ): Promise<PromiseSettledResult<R>[]>;
        stream(...args: CallArgs<I>): Stream<R>;
        using(settings: Settings): Module<I, R>;
        (...args: CallArgs<I>): Promise<R>;
    }

    Type Parameters

    • I extends Rec = Rec
    • R = unknown
    • Parameters

      • ...args: CallArgs<I>

      Returns Promise<R>

    Index
    interface: Interface

    What it takes and gives, as data (the same JSON in every language).

    interfaceId: string

    The interface's signature: the call log's program.interface.

    module: string

    The code module the call log files it under.

    name: string
    settings: Settings
    uses: readonly (AnyAIFunction | AnyModule)[]
    version: string

    A fingerprint of its code, the AI functions it uses and its interface (contract/calls.md, "Versions").

    • A conversation with this module: its calls remember each other, kept in a store. Its code reads the conversation so far with earlier(); the AI functions it calls remember nothing unless remembers says so.

      Parameters

      Returns Conversation & (...args: CallArgs<I, TurnOptions>) => Promise<R>

    • Each item's result, in order, concurrency calls at once. Rejects with the first failure, and stops starting new calls.

      Parameters

      • inputs: Iterable<CallArgs<I>[0]>
      • Optionaloptions: MapOptions

      Returns Promise<R[]>

    • Each item's outcome, in order, failures included (as Promise.allSettled gives them).

      Parameters

      • inputs: Iterable<CallArgs<I>[0]>
      • Optionaloptions: MapOptions

      Returns Promise<PromiseSettledResult<R>[]>

    • Call it and watch it being made: every event of its call and the calls inside it.

      Parameters

      • ...args: CallArgs<I>

      Returns Stream<R>