A unique name for your plugin
A function that creates your plugin definition
A conversation plugin that can be used in the Conversation
constructor
// Since the "pluginData" parameter cannot be inferred by the returned definition, you must specify it yourself.
export default createConversationPlugin("example-plugin", ({}, pluginData?: number) => {
return {
onPostInit: () => {},
getPluginData: () => 1,
out: {} as StatsPluginOutput,
};
});
Generated using TypeDoc
Convenience utility to create a conversation plugin with strict typing.
This is the recommended way to create a type safe plugin, since it takes care of specifying generic exact type parameters of the
ConversationPlugin
interface. For example, this will make your plugin appear in the intellisense of theConversation.getPlugin
method.Your can also type the generic parameters yourself, or even use the
ConversationPlugin
interface directly instead of this utility.