twilio-ccai-fulfillment-tools
Version:
A collection of tools to assist in the creation of Twilio CCAI Integration cards via fulfillment scripts
17 lines (14 loc) • 466 B
text/typescript
import { WebhookClient } from 'dialogflow-fulfillment';
import { IStringKeyMap } from '../DynamicContextPanel';
export const addTaskAttributesContext = (
attributes: IStringKeyMap<unknown>
) => (agent: WebhookClient): void => {
agent.setContext({
name: 'task-attributes',
lifespan: 99,
parameters: {
// eslint-disable-next-line @typescript-eslint/camelcase
task_attributes: attributes,
},
});
};