UNPKG

@botonic/plugin-knowledge-bases

Version:

Use a Hubtype to make the bot respond through a knowledge base.

15 lines (14 loc) 1.03 kB
import type { BotContext, Plugin, PluginPreRequest } from '@botonic/core'; import { KnowledgeBaseResponse, PluginKnowledgeBaseOptions } from './types'; export default class BotonicPluginKnowledgeBases implements Plugin { private readonly apiService; private readonly authToken; constructor(options: PluginKnowledgeBaseOptions); pre(_request: PluginPreRequest): Promise<void>; getInference(request: BotContext, sources: string[], instructions: string, messageId: string, memoryLength: number): Promise<KnowledgeBaseResponse>; getTestInference(authToken: string, request: BotContext, instructions: string, sources: string[]): Promise<KnowledgeBaseResponse>; getInferenceV1(authToken: string, request: BotContext, sources: string[]): Promise<KnowledgeBaseResponse>; getInferenceV2(authToken: string, sources: string[], instructions: string, messageId: string, memoryLength: number): Promise<KnowledgeBaseResponse>; private mapApiResponse; } export { PluginKnowledgeBaseOptions } from './types';