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

    Class Conversation

    Index
    context: ContextRule
    earlierWithout: readonly string[]
    id: string
    sends: "queue" | "refuse" | "branch"
    settings: Settings
    • One turn: the program's answer. (The conversation is also callable: await chat(input).)

      Parameters

      Returns Promise<unknown>

    • This conversation, continuing after turn (a Turn or its id): the next turn is a new branch. Nothing is deleted.

      Parameters

      • turn: string | Turn

      Returns this

    • A plugin's entries of a kind on the branch through branch (default: this view's head), oldest first: { turn, data, at }.

      Parameters

      • plugin: string
      • kind: string
      • opts: { branch?: string | null } = {}

      Returns Rec[]

    • A turn after this conversation's head made from several branches by another AI function (fn): its answer becomes this program's answer, recorded as a turn (madeBy fn, reads the branches), so the next turn sees it. inputs: fn's; when fn has one input and none is given, it is given the branches' answers ([{ model, ...inputs, ...outputs }]).

      Parameters

      • branches: readonly (string | Turn)[]
      • fn: {
            interface: Interface;
            name: string;
            version: string;
            predict(i: unknown): Promise<{ answer: unknown; callId: string }>;
        }
      • Optionalinputs: Rec

      Returns Promise<Turn>

    • One turn of an AI function: the whole call (every output, the lmcc turn; p.callId is the turn's id).

      Parameters

      Returns Promise<unknown>

    • Keep a plugin's entry in this conversation, at a turn (it then belongs to the branches through that turn): what the plugin needs later, never shown to the model by itself.

      Parameters

      • plugin: string
      • kind: string
      • data: unknown
      • opts: { turn?: string | null } = {}

      Returns Promise<void>

    • The exact request the next turn would send (nothing is sent or recorded). call: helper: the request that helper would get, with the memory the conversation gives it (the inputs are then the helper's).

      Parameters

      • input: unknown
      • opts: {
            call?: object & {
                module: string;
                name: string;
                signatureId?: string;
                render(i: unknown, s?: Settings): unknown;
            };
        } & Settings = {}

      Returns Promise<unknown>

    • Make a turn the conversation's head, for everyone who opens it.

      Parameters

      • turn: string | number | Turn

      Returns Promise<void>

    • Stop a running turn, wherever it runs: in this process or another that opened the same store. It ends stopped within about a second. A turn that waits or was interrupted has nothing running it: stopping it ends it abandoned. A turn that already ended is left as it is.

      Parameters

      • turn: string | Turn

      Returns Promise<void>

    • One turn, by its id (or a Turn, or its index in turns()).

      Parameters

      • turn: string | number | Turn

      Returns Promise<Turn>