@bavard/agent-config
Advanced tools
Comparing version 0.0.56 to 0.0.57
@@ -20,3 +20,3 @@ import { AgentConfig } from '../agent-config'; | ||
constructor(config: AgentConfig, nluService: INLUService, emailService: IEmailService); | ||
processUserAction(userAction: IUserAction, conversation: IConversation): Promise<IConversation>; | ||
processUserAction(userAction: IUserAction | undefined, conversation: IConversation): Promise<IConversation>; | ||
private isRawUtterance; | ||
@@ -23,0 +23,0 @@ /** |
@@ -32,3 +32,3 @@ "use strict"; | ||
// Preprocess the action. | ||
if (this.isRawUtterance(userAction)) { | ||
if (userAction && this.isRawUtterance(userAction)) { | ||
userAction = yield this.parseUtterance(userAction); | ||
@@ -60,3 +60,3 @@ } | ||
// Perform any follow-up work still needed on the action. | ||
if (userAction.type == user_1.EUserActionType.EMAIL_ACTION) { | ||
if ((userAction === null || userAction === void 0 ? void 0 : userAction.type) == user_1.EUserActionType.EMAIL_ACTION) { | ||
this.handleEmailAction(userAction); | ||
@@ -63,0 +63,0 @@ } |
import { AgentConfig } from '../..'; | ||
import { IUserAction } from '../../actions/user'; | ||
import { IConversation } from '../conversation'; | ||
export declare const defaultPolicyExecutor: (config: AgentConfig, userAction: IUserAction, conversation: IConversation) => IConversation; | ||
export declare const defaultPolicyExecutor: (config: AgentConfig, userAction: IUserAction | undefined, conversation: IConversation) => IConversation; |
import { IUserAction } from '../../actions/user'; | ||
import { AgentConfig } from '../../agent-config'; | ||
import { IConversation } from '../conversation'; | ||
export declare const graphPolicyExecutor: (config: AgentConfig, userAction: IUserAction, conversation: IConversation) => IConversation; | ||
export declare const graphPolicyExecutor: (config: AgentConfig, userAction: IUserAction | undefined, conversation: IConversation) => IConversation; |
@@ -120,9 +120,6 @@ "use strict"; | ||
case email_node_1.default.typename: | ||
console.log('EmailNode'); | ||
return EmailNodeSchema; | ||
case utterance_node_1.default.typename: | ||
console.log('UtteranceNode'); | ||
return UtteranceNodeSchema; | ||
case form_node_1.FormNode.typename: | ||
console.log('FormNode'); | ||
return exports.FormNodeShema; | ||
@@ -129,0 +126,0 @@ default: |
{ | ||
"name": "@bavard/agent-config", | ||
"version": "0.0.56", | ||
"version": "0.0.57", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -29,7 +29,7 @@ import { AgentConfig, EPolicyType } from '../agent-config'; | ||
async processUserAction( | ||
userAction: IUserAction, | ||
userAction: IUserAction | undefined, | ||
conversation: IConversation, | ||
): Promise<IConversation> { | ||
// Preprocess the action. | ||
if (this.isRawUtterance(userAction)) { | ||
if (userAction && this.isRawUtterance(userAction)) { | ||
userAction = await this.parseUtterance(userAction as IUtteranceUserAction); | ||
@@ -59,3 +59,3 @@ } | ||
// Perform any follow-up work still needed on the action. | ||
if (userAction.type == EUserActionType.EMAIL_ACTION) { | ||
if (userAction?.type == EUserActionType.EMAIL_ACTION) { | ||
this.handleEmailAction(userAction); | ||
@@ -62,0 +62,0 @@ } |
@@ -10,3 +10,3 @@ import _ from 'lodash'; | ||
config: AgentConfig, | ||
userAction: IUserAction, | ||
userAction: IUserAction | undefined, | ||
conversation: IConversation | ||
@@ -13,0 +13,0 @@ ): IConversation => { |
@@ -11,3 +11,3 @@ import _ from 'lodash'; | ||
config: AgentConfig, | ||
userAction: IUserAction, | ||
userAction: IUserAction | undefined, | ||
conversation: IConversation, | ||
@@ -14,0 +14,0 @@ ): IConversation => { |
@@ -133,11 +133,6 @@ import * as yup from './yup'; | ||
case EmailNode.typename: | ||
console.log('EmailNode'); | ||
return EmailNodeSchema; | ||
case UtteranceNode.typename: | ||
console.log('UtteranceNode'); | ||
return UtteranceNodeSchema; | ||
case FormNode.typename: | ||
console.log('FormNode'); | ||
return FormNodeShema; | ||
@@ -144,0 +139,0 @@ default: |
207069
5822