UNPKG

@botonic/plugin-knowledge-bases

Version:

Botonic plugin for **knowledge base** features (retrieval, grounding, etc.) on the **current** framework line.

30 lines 1.07 kB
import { __awaiter } from "tslib"; /* eslint-disable @typescript-eslint/naming-convention */ import axios from 'axios'; const DEFAULT_TIMEOUT = 10000; export class HubtypeApiService { constructor(host, timeout) { this.host = host; this.timeout = timeout || DEFAULT_TIMEOUT; } inferenceV2(authToken, sources, instructions, messageId, memoryLength) { return __awaiter(this, void 0, void 0, function* () { return yield axios({ method: 'POST', url: `${this.host}/external/v2/ai/knowledge_base/inference/`, headers: { Authorization: `Bearer ${authToken}`, 'Content-Type': 'application/json', }, data: { sources, instructions, message: messageId, memory_length: memoryLength, }, timeout: this.timeout, }); }); } } //# sourceMappingURL=hubtype-knowledge-api-service.js.map