1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-24 04:31:31 +03:00

fix(bridge/nodejs): usage of types from server/core/brain/types

This commit is contained in:
Divlo 2023-05-06 14:03:56 +02:00
parent 673cf0426f
commit 2cb030f47b
No known key found for this signature in database
GPG Key ID: 8F9478F220CE65E9
2 changed files with 11 additions and 21 deletions

View File

@ -1,25 +1,12 @@
/**
* Action types
*/
import type { ActionParams, IntentObject } from '@/core/brain/types'
export type { ActionParams, IntentObject }
export interface ActionParams {
lang: string
utterance: string
current_entities: unknown[] // TODO
entities: unknown[] // TODO
current_resolvers: unknown[] // TODO
resolvers: unknown[] // TODO
slots: Record<string, unknown>[] // TODO
}
export type ActionFunction = (params: ActionParams) => Promise<void>
export interface IntentObject extends ActionParams {
id: string
domain: string
skill: string
action: string
}
/**
* Answer types
*/

View File

@ -45,12 +45,8 @@ export enum SkillActionTypes {
Dialog = 'dialog'
}
export interface IntentObject {
id: string
export interface ActionParams {
lang: ShortLanguageCode
domain: NLPDomain
skill: NLPSkill
action: NLPAction
utterance: NLPUtterance
current_entities: NEREntity[]
entities: NEREntity[]
@ -59,6 +55,13 @@ export interface IntentObject {
slots: { [key: string]: NLUSlot['value'] | undefined }
}
export interface IntentObject extends ActionParams {
id: string
domain: NLPDomain
skill: NLPSkill
action: NLPAction
}
export interface BrainProcessResult extends NLUResult {
speeches: string[]
executionTime: number