librechat-data-provider 0.8.402 → 0.8.403

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 (103) hide show
  1. package/dist/types/accessPermissions.d.ts +744 -0
  2. package/dist/types/actions.d.ts +118 -0
  3. package/dist/types/api-endpoints.d.ts +149 -0
  4. package/dist/types/artifacts.d.ts +97 -0
  5. package/dist/types/azure.d.ts +22 -0
  6. package/dist/types/bedrock.d.ts +1220 -0
  7. package/dist/types/config.d.ts +13916 -0
  8. package/dist/types/config.spec.d.ts +1 -0
  9. package/dist/types/createPayload.d.ts +5 -0
  10. package/dist/types/data-service.d.ts +284 -0
  11. package/dist/types/feedback.d.ts +36 -0
  12. package/dist/types/file-config.d.ts +263 -0
  13. package/dist/types/file-config.spec.d.ts +1 -0
  14. package/dist/types/generate.d.ts +597 -0
  15. package/dist/types/headers-helpers.d.ts +2 -0
  16. package/{src/index.ts → dist/types/index.d.ts} +0 -15
  17. package/dist/types/keys.d.ts +92 -0
  18. package/dist/types/mcp.d.ts +2760 -0
  19. package/dist/types/messages.d.ts +10 -0
  20. package/dist/types/models.d.ts +1677 -0
  21. package/dist/types/parameterSettings.d.ts +69 -0
  22. package/dist/types/parsers.d.ts +110 -0
  23. package/dist/types/permissions.d.ts +522 -0
  24. package/dist/types/react-query/react-query-service.d.ts +85 -0
  25. package/dist/types/request.d.ts +25 -0
  26. package/dist/types/roles.d.ts +554 -0
  27. package/dist/types/roles.spec.d.ts +1 -0
  28. package/dist/types/schemas.d.ts +4815 -0
  29. package/dist/types/schemas.spec.d.ts +1 -0
  30. package/dist/types/types/agents.d.ts +433 -0
  31. package/dist/types/types/assistants.d.ts +547 -0
  32. package/dist/types/types/files.d.ts +172 -0
  33. package/dist/types/types/graph.d.ts +135 -0
  34. package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
  35. package/dist/types/types/mutations.d.ts +209 -0
  36. package/dist/types/types/queries.d.ts +169 -0
  37. package/dist/types/types/runs.d.ts +36 -0
  38. package/dist/types/types/web.d.ts +520 -0
  39. package/dist/types/types.d.ts +503 -0
  40. package/dist/types/utils.d.ts +12 -0
  41. package/package.json +4 -1
  42. package/babel.config.js +0 -4
  43. package/check_updates.sh +0 -52
  44. package/jest.config.js +0 -19
  45. package/react-query/package-lock.json +0 -292
  46. package/react-query/package.json +0 -10
  47. package/rollup.config.js +0 -74
  48. package/server-rollup.config.js +0 -40
  49. package/specs/actions.spec.ts +0 -2533
  50. package/specs/api-endpoints-subdir.spec.ts +0 -140
  51. package/specs/api-endpoints.spec.ts +0 -74
  52. package/specs/azure.spec.ts +0 -844
  53. package/specs/bedrock.spec.ts +0 -862
  54. package/specs/filetypes.spec.ts +0 -175
  55. package/specs/generate.spec.ts +0 -770
  56. package/specs/headers-helpers.spec.ts +0 -24
  57. package/specs/mcp.spec.ts +0 -147
  58. package/specs/openapiSpecs.ts +0 -524
  59. package/specs/parsers.spec.ts +0 -601
  60. package/specs/request-interceptor.spec.ts +0 -304
  61. package/specs/utils.spec.ts +0 -196
  62. package/src/accessPermissions.ts +0 -346
  63. package/src/actions.ts +0 -813
  64. package/src/api-endpoints.ts +0 -440
  65. package/src/artifacts.ts +0 -3104
  66. package/src/azure.ts +0 -328
  67. package/src/bedrock.ts +0 -425
  68. package/src/config.spec.ts +0 -315
  69. package/src/config.ts +0 -2006
  70. package/src/createPayload.ts +0 -46
  71. package/src/data-service.ts +0 -1087
  72. package/src/feedback.ts +0 -141
  73. package/src/file-config.spec.ts +0 -1248
  74. package/src/file-config.ts +0 -764
  75. package/src/generate.ts +0 -634
  76. package/src/headers-helpers.ts +0 -13
  77. package/src/keys.ts +0 -99
  78. package/src/mcp.ts +0 -271
  79. package/src/messages.ts +0 -50
  80. package/src/models.ts +0 -69
  81. package/src/parameterSettings.ts +0 -1111
  82. package/src/parsers.ts +0 -563
  83. package/src/permissions.ts +0 -188
  84. package/src/react-query/react-query-service.ts +0 -566
  85. package/src/request.ts +0 -171
  86. package/src/roles.spec.ts +0 -132
  87. package/src/roles.ts +0 -225
  88. package/src/schemas.spec.ts +0 -355
  89. package/src/schemas.ts +0 -1234
  90. package/src/types/agents.ts +0 -470
  91. package/src/types/assistants.ts +0 -654
  92. package/src/types/files.ts +0 -191
  93. package/src/types/graph.ts +0 -145
  94. package/src/types/mutations.ts +0 -422
  95. package/src/types/queries.ts +0 -208
  96. package/src/types/runs.ts +0 -40
  97. package/src/types/web.ts +0 -588
  98. package/src/types.ts +0 -676
  99. package/src/utils.ts +0 -85
  100. package/tsconfig.json +0 -28
  101. package/tsconfig.spec.json +0 -10
  102. /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
  103. /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
@@ -1,654 +0,0 @@
1
- import type { OpenAPIV3 } from 'openapi-types';
2
- import type { AssistantsEndpoint, AgentProvider } from 'src/schemas';
3
- import type { Agents, GraphEdge } from './agents';
4
- import type { ContentTypes } from './runs';
5
- import type { TFile } from './files';
6
- import { ArtifactModes } from 'src/artifacts';
7
-
8
- export type Schema = OpenAPIV3.SchemaObject & { description?: string };
9
- export type Reference = OpenAPIV3.ReferenceObject & { description?: string };
10
-
11
- export type Metadata = {
12
- avatar?: string;
13
- author?: string;
14
- } & {
15
- [key: string]: unknown;
16
- };
17
-
18
- export enum Tools {
19
- execute_code = 'execute_code',
20
- code_interpreter = 'code_interpreter',
21
- file_search = 'file_search',
22
- web_search = 'web_search',
23
- retrieval = 'retrieval',
24
- function = 'function',
25
- memory = 'memory',
26
- ui_resources = 'ui_resources',
27
- }
28
-
29
- export enum EToolResources {
30
- code_interpreter = 'code_interpreter',
31
- execute_code = 'execute_code',
32
- file_search = 'file_search',
33
- image_edit = 'image_edit',
34
- context = 'context',
35
- ocr = 'ocr',
36
- }
37
-
38
- export type Tool = {
39
- [type: string]: Tools;
40
- };
41
-
42
- export type FunctionTool = {
43
- type: Tools;
44
- function?: {
45
- description: string;
46
- name: string;
47
- parameters: Record<string, unknown>;
48
- strict?: boolean;
49
- additionalProperties?: boolean; // must be false if strict is true https://platform.openai.com/docs/guides/structured-outputs/some-type-specific-keywords-are-not-yet-supported
50
- };
51
- };
52
-
53
- /**
54
- * A set of resources that are used by the assistant's tools. The resources are
55
- * specific to the type of tool. For example, the `code_interpreter` tool requires
56
- * a list of file IDs, while the `file_search` tool requires a list of vector store
57
- * IDs.
58
- */
59
- export interface ToolResources {
60
- code_interpreter?: CodeInterpreterResource;
61
- file_search?: FileSearchResource;
62
- }
63
- export interface CodeInterpreterResource {
64
- /**
65
- * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
66
- * available to the `code_interpreter`` tool. There can be a maximum of 20 files
67
- * associated with the tool.
68
- */
69
- file_ids?: Array<string>;
70
- }
71
-
72
- export interface FileSearchResource {
73
- /**
74
- * The ID of the
75
- * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
76
- * attached to this assistant. There can be a maximum of 1 vector store attached to
77
- * the assistant.
78
- */
79
- vector_store_ids?: Array<string>;
80
- }
81
-
82
- /* Assistant types */
83
-
84
- export type Assistant = {
85
- id: string;
86
- created_at: number;
87
- description: string | null;
88
- file_ids?: string[];
89
- instructions: string | null;
90
- conversation_starters?: string[];
91
- metadata: Metadata | null;
92
- model: string;
93
- name: string | null;
94
- object: string;
95
- tools?: FunctionTool[];
96
- tool_resources?: ToolResources;
97
- };
98
-
99
- export type TAssistantsMap = Record<AssistantsEndpoint, Record<string, Assistant>>;
100
-
101
- export type AssistantCreateParams = {
102
- model: string;
103
- description?: string | null;
104
- file_ids?: string[];
105
- instructions?: string | null;
106
- conversation_starters?: string[];
107
- metadata?: Metadata | null;
108
- name?: string | null;
109
- tools?: Array<FunctionTool | string>;
110
- endpoint: AssistantsEndpoint;
111
- version: number | string;
112
- append_current_datetime?: boolean;
113
- };
114
-
115
- export type AssistantUpdateParams = {
116
- model?: string;
117
- description?: string | null;
118
- file_ids?: string[];
119
- instructions?: string | null;
120
- conversation_starters?: string[] | null;
121
- metadata?: Metadata | null;
122
- name?: string | null;
123
- tools?: Array<FunctionTool | string>;
124
- tool_resources?: ToolResources;
125
- endpoint: AssistantsEndpoint;
126
- append_current_datetime?: boolean;
127
- };
128
-
129
- export type AssistantListParams = {
130
- limit?: number;
131
- before?: string | null;
132
- after?: string | null;
133
- order?: 'asc' | 'desc';
134
- endpoint: AssistantsEndpoint;
135
- };
136
-
137
- export type AssistantListResponse = {
138
- object: string;
139
- data: Assistant[];
140
- first_id: string;
141
- last_id: string;
142
- has_more: boolean;
143
- };
144
-
145
- export type File = {
146
- file_id: string;
147
- id?: string;
148
- temp_file_id?: string;
149
- bytes: number;
150
- created_at: number;
151
- filename: string;
152
- object: string;
153
- purpose: 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output';
154
- };
155
-
156
- /* Agent types */
157
-
158
- export type AgentParameterValue = number | string | null;
159
-
160
- export type AgentModelParameters = {
161
- model?: string;
162
- temperature: AgentParameterValue;
163
- maxContextTokens: AgentParameterValue;
164
- max_context_tokens: AgentParameterValue;
165
- max_output_tokens: AgentParameterValue;
166
- top_p: AgentParameterValue;
167
- frequency_penalty: AgentParameterValue;
168
- presence_penalty: AgentParameterValue;
169
- useResponsesApi?: boolean;
170
- };
171
-
172
- export interface AgentBaseResource {
173
- /**
174
- * A list of file IDs made available to the tool.
175
- */
176
- file_ids?: Array<string>;
177
- /**
178
- * A list of files already fetched.
179
- */
180
- files?: Array<TFile>;
181
- }
182
-
183
- export interface AgentToolResources {
184
- [EToolResources.image_edit]?: AgentBaseResource;
185
- [EToolResources.execute_code]?: ExecuteCodeResource;
186
- [EToolResources.file_search]?: AgentFileResource;
187
- [EToolResources.context]?: AgentBaseResource;
188
- /** @deprecated Use context instead */
189
- [EToolResources.ocr]?: AgentBaseResource;
190
- }
191
- /**
192
- * A resource for the execute_code tool.
193
- * Contains file IDs made available to the tool (max 20 files) and already fetched files.
194
- */
195
- export type ExecuteCodeResource = AgentBaseResource;
196
-
197
- export interface AgentFileResource extends AgentBaseResource {
198
- /**
199
- * The ID of the vector store attached to this agent. There
200
- * can be a maximum of 1 vector store attached to the agent.
201
- */
202
- vector_store_ids?: Array<string>;
203
- }
204
- export type SupportContact = {
205
- name?: string;
206
- email?: string;
207
- };
208
-
209
- /**
210
- * Specifies who can invoke a tool.
211
- * - 'direct': LLM can call directly
212
- * - 'code_execution': Only callable via programmatic tool calling (PTC)
213
- */
214
- export type AllowedCaller = 'direct' | 'code_execution';
215
-
216
- /**
217
- * Per-tool configuration options stored at the agent level.
218
- * Keyed by tool_id (e.g., "search_mcp_github").
219
- */
220
- export type ToolOptions = {
221
- /**
222
- * If true, the tool uses deferred loading (discoverable via tool search).
223
- * @default false
224
- */
225
- defer_loading?: boolean;
226
- /**
227
- * Specifies who can invoke this tool.
228
- * - 'direct': LLM can call directly (default behavior)
229
- * - 'code_execution': Only callable via PTC sandbox
230
- * @default ['direct']
231
- */
232
- allowed_callers?: AllowedCaller[];
233
- };
234
-
235
- /**
236
- * Map of tool_id to its configuration options.
237
- * Used to customize tool behavior per agent.
238
- */
239
- export type AgentToolOptions = Record<string, ToolOptions>;
240
-
241
- export type Agent = {
242
- _id?: string;
243
- id: string;
244
- name: string | null;
245
- author?: string | null;
246
- /** The original custom endpoint name, lowercased */
247
- endpoint?: string | null;
248
- authorName?: string | null;
249
- description: string | null;
250
- created_at: number;
251
- avatar: AgentAvatar | null;
252
- instructions?: string | null;
253
- additional_instructions?: string | null;
254
- tools?: string[];
255
- tool_kwargs?: Record<string, unknown>;
256
- metadata?: Record<string, unknown>;
257
- provider: AgentProvider;
258
- model: string | null;
259
- model_parameters: AgentModelParameters;
260
- conversation_starters?: string[];
261
- tool_resources?: AgentToolResources;
262
- /** @deprecated Use edges instead */
263
- agent_ids?: string[];
264
- edges?: GraphEdge[];
265
- end_after_tools?: boolean;
266
- hide_sequential_outputs?: boolean;
267
- artifacts?: ArtifactModes;
268
- recursion_limit?: number;
269
- isPublic?: boolean;
270
- version?: number;
271
- category?: string;
272
- support_contact?: SupportContact;
273
- /** Per-tool configuration options (deferred loading, allowed callers, etc.) */
274
- tool_options?: AgentToolOptions;
275
- };
276
-
277
- export type TAgentsMap = Record<string, Agent | undefined>;
278
-
279
- export type AgentCreateParams = {
280
- name?: string | null;
281
- description?: string | null;
282
- avatar?: AgentAvatar | null;
283
- file_ids?: string[];
284
- instructions?: string | null;
285
- tools?: Array<FunctionTool | string>;
286
- provider: AgentProvider;
287
- model: string | null;
288
- model_parameters: AgentModelParameters;
289
- } & Pick<
290
- Agent,
291
- | 'agent_ids'
292
- | 'edges'
293
- | 'end_after_tools'
294
- | 'hide_sequential_outputs'
295
- | 'artifacts'
296
- | 'recursion_limit'
297
- | 'category'
298
- | 'support_contact'
299
- | 'tool_options'
300
- >;
301
-
302
- export type AgentUpdateParams = {
303
- name?: string | null;
304
- description?: string | null;
305
- avatar?: AgentAvatar | null;
306
- file_ids?: string[];
307
- instructions?: string | null;
308
- tools?: Array<FunctionTool | string>;
309
- tool_resources?: ToolResources;
310
- provider?: AgentProvider;
311
- model?: string | null;
312
- model_parameters?: AgentModelParameters;
313
- } & Pick<
314
- Agent,
315
- | 'agent_ids'
316
- | 'edges'
317
- | 'end_after_tools'
318
- | 'hide_sequential_outputs'
319
- | 'artifacts'
320
- | 'recursion_limit'
321
- | 'category'
322
- | 'support_contact'
323
- | 'tool_options'
324
- >;
325
-
326
- export type AgentListParams = {
327
- limit?: number;
328
- requiredPermission: number;
329
- category?: string;
330
- search?: string;
331
- cursor?: string;
332
- promoted?: 0 | 1;
333
- };
334
-
335
- export type AgentListResponse = {
336
- object: string;
337
- data: Agent[];
338
- first_id: string;
339
- last_id: string;
340
- has_more: boolean;
341
- after?: string;
342
- };
343
-
344
- export type AgentFile = {
345
- file_id: string;
346
- id?: string;
347
- temp_file_id?: string;
348
- bytes: number;
349
- created_at: number;
350
- filename: string;
351
- object: string;
352
- purpose: 'fine-tune' | 'fine-tune-results' | 'agents' | 'agents_output';
353
- };
354
-
355
- /**
356
- * Details of the Code Interpreter tool call the run step was involved in.
357
- * Includes the tool call ID, the code interpreter definition, and the type of tool call.
358
- */
359
- export type CodeToolCall = {
360
- id: string; // The ID of the tool call.
361
- code_interpreter: {
362
- input: string; // The input to the Code Interpreter tool call.
363
- outputs: Array<Record<string, unknown>>; // The outputs from the Code Interpreter tool call.
364
- };
365
- type: 'code_interpreter'; // The type of tool call, always 'code_interpreter'.
366
- };
367
-
368
- /**
369
- * Details of a Function tool call the run step was involved in.
370
- * Includes the tool call ID, the function definition, and the type of tool call.
371
- */
372
- export type FunctionToolCall = {
373
- id: string; // The ID of the tool call object.
374
- function: {
375
- arguments: string; // The arguments passed to the function.
376
- name: string; // The name of the function.
377
- output: string | null; // The output of the function, null if not submitted.
378
- };
379
- type: 'function'; // The type of tool call, always 'function'.
380
- };
381
-
382
- /**
383
- * Details of a Retrieval tool call the run step was involved in.
384
- * Includes the tool call ID and the type of tool call.
385
- */
386
- export type RetrievalToolCall = {
387
- id: string; // The ID of the tool call object.
388
- retrieval: unknown; // An empty object for now.
389
- type: 'retrieval'; // The type of tool call, always 'retrieval'.
390
- };
391
-
392
- /**
393
- * Details of a Retrieval tool call the run step was involved in.
394
- * Includes the tool call ID and the type of tool call.
395
- */
396
- export type FileSearchToolCall = {
397
- id: string; // The ID of the tool call object.
398
- file_search: unknown; // An empty object for now.
399
- type: 'file_search'; // The type of tool call, always 'retrieval'.
400
- };
401
-
402
- /**
403
- * Details of the tool calls involved in a run step.
404
- * Can be associated with one of three types of tools: `code_interpreter`, `retrieval`, or `function`.
405
- */
406
- export type ToolCallsStepDetails = {
407
- tool_calls: Array<CodeToolCall | RetrievalToolCall | FileSearchToolCall | FunctionToolCall>; // An array of tool calls the run step was involved in.
408
- type: 'tool_calls'; // Always 'tool_calls'.
409
- };
410
-
411
- export type ImageFile = TFile & {
412
- /**
413
- * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
414
- * in the message content.
415
- */
416
- file_id: string;
417
- filename: string;
418
- filepath: string;
419
- height: number;
420
- width: number;
421
- /**
422
- * Prompt used to generate the image if applicable.
423
- */
424
- prompt?: string;
425
- /**
426
- * Additional metadata used to generate or about the image/tool_call.
427
- */
428
- metadata?: Record<string, unknown>;
429
- };
430
-
431
- // FileCitation.ts
432
- export type FileCitation = {
433
- end_index: number;
434
- file_citation: FileCitationDetails;
435
- start_index: number;
436
- text: string;
437
- type: 'file_citation';
438
- };
439
-
440
- export type FileCitationDetails = {
441
- file_id: string;
442
- quote: string;
443
- };
444
-
445
- export type FilePath = {
446
- end_index: number;
447
- file_path: FilePathDetails;
448
- start_index: number;
449
- text: string;
450
- type: 'file_path';
451
- };
452
-
453
- export type FilePathDetails = {
454
- file_id: string;
455
- };
456
-
457
- export type Text = {
458
- annotations?: Array<FileCitation | FilePath>;
459
- value: string;
460
- };
461
-
462
- export enum AnnotationTypes {
463
- FILE_CITATION = 'file_citation',
464
- FILE_PATH = 'file_path',
465
- }
466
-
467
- export enum StepStatus {
468
- IN_PROGRESS = 'in_progress',
469
- CANCELLED = 'cancelled',
470
- FAILED = 'failed',
471
- COMPLETED = 'completed',
472
- EXPIRED = 'expired',
473
- }
474
-
475
- export enum MessageContentTypes {
476
- TEXT = 'text',
477
- IMAGE_FILE = 'image_file',
478
- }
479
-
480
- //enum for RunStatus
481
- // The status of the run: queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired.
482
- export enum RunStatus {
483
- QUEUED = 'queued',
484
- IN_PROGRESS = 'in_progress',
485
- REQUIRES_ACTION = 'requires_action',
486
- CANCELLING = 'cancelling',
487
- CANCELLED = 'cancelled',
488
- FAILED = 'failed',
489
- COMPLETED = 'completed',
490
- EXPIRED = 'expired',
491
- }
492
-
493
- export type PartMetadata = {
494
- progress?: number;
495
- asset_pointer?: string;
496
- status?: string;
497
- action?: boolean;
498
- auth?: string;
499
- expires_at?: number;
500
- /** Index indicating parallel sibling content (same stepIndex in multi-agent runs) */
501
- siblingIndex?: number;
502
- /** Agent ID for parallel agent rendering - identifies which agent produced this content */
503
- agentId?: string;
504
- /** Group ID for parallel content - parts with same groupId are displayed in columns */
505
- groupId?: number;
506
- };
507
-
508
- /** Metadata for parallel content rendering - subset of PartMetadata */
509
- export type ContentMetadata = Pick<PartMetadata, 'agentId' | 'groupId'>;
510
-
511
- export type ContentPart = (
512
- | CodeToolCall
513
- | RetrievalToolCall
514
- | FileSearchToolCall
515
- | FunctionToolCall
516
- | Agents.AgentToolCall
517
- | ImageFile
518
- | Text
519
- ) &
520
- PartMetadata;
521
-
522
- export type TextData = (Text & PartMetadata) | undefined;
523
-
524
- export type SummaryContentPart = {
525
- type: ContentTypes.SUMMARY;
526
- content?: Array<{ type: ContentTypes.TEXT; text: string }>;
527
- tokenCount?: number;
528
- summarizing?: boolean;
529
- summaryVersion?: number;
530
- model?: string;
531
- provider?: string;
532
- createdAt?: string;
533
- boundary?: {
534
- messageId: string;
535
- contentIndex: number;
536
- };
537
- };
538
-
539
- export type TMessageContentParts =
540
- | ({
541
- type: ContentTypes.ERROR;
542
- text?: string | TextData;
543
- error?: string;
544
- } & ContentMetadata)
545
- | ({ type: ContentTypes.THINK; think?: string | TextData } & ContentMetadata)
546
- | ({
547
- type: ContentTypes.TEXT;
548
- text?: string | TextData;
549
- tool_call_ids?: string[];
550
- } & ContentMetadata)
551
- | ({
552
- type: ContentTypes.TOOL_CALL;
553
- tool_call: (
554
- | CodeToolCall
555
- | RetrievalToolCall
556
- | FileSearchToolCall
557
- | FunctionToolCall
558
- | Agents.AgentToolCall
559
- ) &
560
- PartMetadata;
561
- } & ContentMetadata)
562
- | ({ type: ContentTypes.IMAGE_FILE; image_file: ImageFile & PartMetadata } & ContentMetadata)
563
- | (SummaryContentPart & ContentMetadata)
564
- | (Agents.AgentUpdate & ContentMetadata)
565
- | (Agents.MessageContentImageUrl & ContentMetadata)
566
- | (Agents.MessageContentVideoUrl & ContentMetadata)
567
- | (Agents.MessageContentInputAudio & ContentMetadata);
568
-
569
- export type StreamContentData = TMessageContentParts & {
570
- /** The index of the current content part */
571
- index: number;
572
- /** The current text content was already served but edited to replace elements therein */
573
- edited?: boolean;
574
- };
575
-
576
- export type TContentData = StreamContentData & {
577
- messageId: string;
578
- conversationId: string;
579
- userMessageId: string;
580
- thread_id: string;
581
- stream?: boolean;
582
- };
583
-
584
- export const actionDelimiter = '_action_';
585
- export const actionDomainSeparator = '---';
586
- export const hostImageIdSuffix = '_host_copy';
587
- export const hostImageNamePrefix = 'host_copy_';
588
-
589
- export type AssistantAvatar = {
590
- filepath: string;
591
- source: string;
592
- };
593
-
594
- export type AssistantDocument = {
595
- user: string;
596
- assistant_id: string;
597
- conversation_starters?: string[];
598
- avatar?: AssistantAvatar;
599
- access_level?: number;
600
- file_ids?: string[];
601
- actions?: string[];
602
- createdAt?: Date;
603
- updatedAt?: Date;
604
- append_current_datetime?: boolean;
605
- };
606
-
607
- /* Agent types */
608
-
609
- export type AgentAvatar = {
610
- filepath: string;
611
- source: string;
612
- };
613
-
614
- export enum FilePurpose {
615
- Vision = 'vision',
616
- FineTune = 'fine-tune',
617
- FineTuneResults = 'fine-tune-results',
618
- Assistants = 'assistants',
619
- AssistantsOutput = 'assistants_output',
620
- }
621
-
622
- export const defaultOrderQuery: {
623
- order: 'desc';
624
- limit: 100;
625
- } = {
626
- order: 'desc',
627
- limit: 100,
628
- };
629
-
630
- export enum AssistantStreamEvents {
631
- ThreadCreated = 'thread.created',
632
- ThreadRunCreated = 'thread.run.created',
633
- ThreadRunQueued = 'thread.run.queued',
634
- ThreadRunInProgress = 'thread.run.in_progress',
635
- ThreadRunRequiresAction = 'thread.run.requires_action',
636
- ThreadRunCompleted = 'thread.run.completed',
637
- ThreadRunFailed = 'thread.run.failed',
638
- ThreadRunCancelling = 'thread.run.cancelling',
639
- ThreadRunCancelled = 'thread.run.cancelled',
640
- ThreadRunExpired = 'thread.run.expired',
641
- ThreadRunStepCreated = 'thread.run.step.created',
642
- ThreadRunStepInProgress = 'thread.run.step.in_progress',
643
- ThreadRunStepCompleted = 'thread.run.step.completed',
644
- ThreadRunStepFailed = 'thread.run.step.failed',
645
- ThreadRunStepCancelled = 'thread.run.step.cancelled',
646
- ThreadRunStepExpired = 'thread.run.step.expired',
647
- ThreadRunStepDelta = 'thread.run.step.delta',
648
- ThreadMessageCreated = 'thread.message.created',
649
- ThreadMessageInProgress = 'thread.message.in_progress',
650
- ThreadMessageCompleted = 'thread.message.completed',
651
- ThreadMessageIncomplete = 'thread.message.incomplete',
652
- ThreadMessageDelta = 'thread.message.delta',
653
- ErrorEvent = 'error',
654
- }