dochub-sdk 0.1.383 → 0.1.386

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/interfaces/ai.ts +25 -6
  2. package/package.json +1 -1
package/interfaces/ai.ts CHANGED
@@ -3,6 +3,20 @@ import { DocHubJSONSchema } from '../schemas/basetypes';
3
3
  import { DataLakePath } from './datalake';
4
4
  import { DocHubEditorContext } from './editors';
5
5
 
6
+ /**
7
+ * События AI
8
+ */
9
+ export enum DocHubAIEvents {
10
+ /**
11
+ * Глобальные события
12
+ */
13
+ setDefaultDriver = '$ai-change-default-driver', // Драйвер AI по умолчанию изменился
14
+ /**
15
+ * Локальные события
16
+ */
17
+ registeredDriver = '#ai-registered-driver', // Зарегистрирован драйвер AI
18
+ };
19
+
6
20
  /**
7
21
  * Фрагмент контекста
8
22
  */
@@ -213,7 +227,7 @@ export interface IDocHubComposerProvider {
213
227
  fetchCommands(): Promise<IDocHubAIComposerCommand[]>;
214
228
  }
215
229
 
216
- export enum IDocHubAICapabilityID {
230
+ export enum DocHubAICapabilityID {
217
231
  text = 'text',
218
232
  attachment = 'attachment',
219
233
  contextWindow = 'context-window'
@@ -232,15 +246,15 @@ export interface IDocHubAICapabilities {
232
246
  /**
233
247
  * Способность обрабатывать прикрепленные файлы к сообщению
234
248
  */
235
- [IDocHubAICapabilityID.attachment]?: DocHubAIAttachmentFileContentType[];
249
+ [DocHubAICapabilityID.attachment]?: DocHubAIAttachmentFileContentType[];
236
250
  /**
237
251
  * Способность воспринимать текс в запросе
238
252
  */
239
- [IDocHubAICapabilityID.text]?: boolean;
253
+ [DocHubAICapabilityID.text]?: boolean;
240
254
  /**
241
255
  * Размер контекстного окна
242
256
  */
243
- [IDocHubAICapabilityID.contextWindow]?: number;
257
+ [DocHubAICapabilityID.contextWindow]?: number;
244
258
  }
245
259
 
246
260
 
@@ -311,9 +325,14 @@ export interface IDocHubAI {
311
325
  */
312
326
  registerComposerProvider(alias: string, provider: IDocHubComposerProvider): void;
313
327
  /**
314
- * Возвращает список доступных моделей AI
328
+ * Возвращает список доступных AI драйверов
329
+ */
330
+ fetchDrivers(): string[];
331
+ /**
332
+ * Возвращает интерфейс драйвера по указанному идентификатору.
333
+ * Если alias пусто, то вернет интерфейс к драйверу по умолчанию.
315
334
  */
316
- getDrivers(): string[];
335
+ getDriver(alias?: string): IDocHubAIDriver;
317
336
  /**
318
337
  * Возвращает дефолтный драйвер AI
319
338
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.383",
3
+ "version": "0.1.386",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",