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

    Class Service

    A program as an HTTP service, independent of any server: fetch(request) answers one request (the Web's own Request and Response); serve() runs Node's HTTP server around it.

    Index
    approvals: "caller" | "owner"
    keys: readonly string[]
    lm: string | null
    program: Program
    store: string | boolean | ConversationStore | null | undefined
    • The program, described: { functai_interface: 1, name, kind, version, interface, answer, model, approvals }.

      Returns Rec

    • Answer one request. Mount it anywhere the Web's fetch handlers run.

      Parameters

      • request: Request

      Returns Promise<Response>

    • A form, which asks for the key itself.

      Returns string

    • Run Node's HTTP server around this service. Without keys it listens only on this machine (127.0.0.1, ::1, localhost). Resolves once listening, to the server (server.close() stops it).

      Parameters

      • opts: { host?: string; port?: number } = {}

      Returns Promise<Server<typeof IncomingMessage, typeof ServerResponse>>