@types/node-wit
TypeScript icon, indicating that this package has built-in type declarations

6.1.0 • Public • Published

Installation

npm install --save @types/node-wit

Summary

This package contains type definitions for node-wit (https://github.com/wit-ai/node-wit#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-wit.

export namespace log {
    class Logger {
        constructor(level: string);
    }

    const DEBUG: string;
    const INFO: string;
    const WARN: string;
    const ERROR: string;
}

export interface WitEntityValue {
    value?: string | undefined;
    expressions?: string[] | undefined;
}

export interface WitEntity {
    id?: string | undefined;
    values?: WitEntityValue[] | undefined;
}

export interface WitContext {
    state?: string[] | undefined;
    reference_time?: string | undefined;
    timezone?: string | undefined;
    entities?: WitEntity[] | undefined;
    location?: string | undefined;
}

export interface WitRequest {
    sessionId?: string | undefined;
    context?: WitContext | undefined;
    text?: string | undefined;
    entities?: WitEntity[] | undefined;
}

export interface WitResponse {
    text?: string | undefined;
    quickReplies?: any;
}

export interface WitOption {
    accessToken: string;
    actions?: any;
    logger?: log.Logger | undefined;
    apiVersion?: number | undefined;
}

export interface MessageResponseEntity {
    confidence?: number | undefined;
    value?: string | undefined;
    type?: string | undefined;
}

export interface WitIntent {
    id: string;
    name: string;
    confidence: number;
}

export interface MessageResponse {
    text: string;
    intents: WitIntent[];
    entities: any;
    traits: { [key: string]: MessageResponseEntity[] };
}

export class Wit {
    constructor(option: WitOption);
    message(message: string, context: WitContext): Promise<MessageResponse>;
    converse(sessionId: string, message: string, context: WitContext, reset?: boolean): Promise<MessageResponse>;
    runActions(sessionId: string, message: string, context: WitContext, maxSteps?: number): Promise<WitContext>;
}

Additional Details

  • Last updated: Mon, 04 Mar 2024 13:07:43 GMT
  • Dependencies: none

Credits

These definitions were written by Julien Dufresne.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-wit

Weekly Downloads

190

Version

6.1.0

License

MIT

Unpacked Size

6.11 kB

Total Files

5

Last publish

Collaborators

  • types