mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Fix wit message
This commit is contained in:
7
node-wit/index.d.ts
vendored
7
node-wit/index.d.ts
vendored
@@ -51,14 +51,15 @@ export interface WitOption {
|
||||
}
|
||||
|
||||
export interface MessageResponseEntity {
|
||||
confidence: number;
|
||||
value: string;
|
||||
confidence?: number;
|
||||
value?: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface MessageResponse {
|
||||
msg_id: string;
|
||||
_text: string;
|
||||
entities: MessageResponseEntity[];
|
||||
entities: any;
|
||||
}
|
||||
|
||||
export declare class Wit {
|
||||
|
||||
@@ -23,9 +23,7 @@ var wit = new Wit({
|
||||
wit.message("what is the weather in London?", {}).then((res) => {
|
||||
console.log(res._text);
|
||||
|
||||
for (let entity of res.entities) {
|
||||
console.log(entity.value + ": " + entity.confidence * 100 + "%");
|
||||
}
|
||||
console.log(res.entities);
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
|
||||
Reference in New Issue
Block a user