6.1.0 • Published 2 months ago

@types/node-wit v6.1.0

Weekly downloads
190
License
MIT
Repository
github
Last release
2 months ago

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.

index.d.ts

// Type definitions for node-wit 6.0
// Project: https://github.com/wit-ai/node-wit#readme
// Definitions by: Julien Dufresne <https://github.com/julienduf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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;
}

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: any;
}

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: Thu, 08 Jul 2021 18:51:29 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Julien Dufresne.

6.1.0

2 months ago

6.0.4

2 months ago

6.0.3

6 months ago

6.0.2

7 months ago

6.0.1

3 years ago

6.0.0

3 years ago

4.2.2

7 years ago

4.2.1

7 years ago

4.2.0

7 years ago