Repository navigation
Expand file tree
/
Copy pathshared.ts
More file actions
665 lines (516 loc) · 13.7 KB
/
Copy pathshared.ts
File metadata and controls
665 lines (516 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
/**
* Cloud AstraDB Vector Store.
*
* This class is used to store the configuration for an AstraDB vector store, so
* that it can be created and used in LlamaCloud.
*
* Args: token (str): The Astra DB Application Token to use. api_endpoint (str):
* The Astra DB JSON API endpoint for your database. collection_name (str):
* Collection name to use. If not existing, it will be created. embedding_dimension
* (int): Length of the embedding vectors in use. keyspace (optional[str]): The
* keyspace to use. If not provided, 'default_keyspace'
*/
export interface CloudAstraDBVectorStore {
/**
* The Astra DB JSON API endpoint for your database
*/
api_endpoint: string;
/**
* Collection name to use. If not existing, it will be created
*/
collection_name: string;
/**
* Length of the embedding vectors in use
*/
embedding_dimension: number;
class_name?: string;
/**
* The keyspace to use. If not provided, 'default_keyspace'
*/
keyspace?: string | null;
supports_nested_metadata_filters?: true;
}
export interface CloudAzStorageBlobDataSource {
/**
* The Azure Storage Blob account URL to use for authentication.
*/
account_url: string;
/**
* The name of the Azure Storage Blob container to read from.
*/
container_name: string;
/**
* The Azure Storage Blob account name to use for authentication.
*/
account_name?: string | null;
/**
* The blob name to read from.
*/
blob?: string | null;
class_name?: string;
/**
* The Azure AD client ID to use for authentication.
*/
client_id?: string | null;
/**
* The prefix of the Azure Storage Blob objects to read from.
*/
prefix?: string | null;
supports_access_control?: boolean;
/**
* The Azure AD tenant ID to use for authentication.
*/
tenant_id?: string | null;
}
/**
* Cloud Azure AI Search Vector Store.
*/
export interface CloudAzureAISearchVectorStore {
search_service_endpoint: string;
class_name?: string;
client_id?: string | null;
embedding_dimension?: number | null;
filterable_metadata_field_keys?: { [key: string]: unknown } | null;
index_name?: string | null;
search_service_api_version?: string | null;
supports_nested_metadata_filters?: true;
tenant_id?: string | null;
}
export interface CloudBoxDataSource {
/**
* The type of authentication to use (Developer Token or CCG)
*/
authentication_mechanism: 'ccg' | 'developer_token';
class_name?: string;
/**
* Box API key used for identifying the application the user is authenticating with
*/
client_id?: string | null;
/**
* Box Enterprise ID, if provided authenticates as service.
*/
enterprise_id?: string | null;
/**
* The ID of the Box folder to read from.
*/
folder_id?: string | null;
supports_access_control?: boolean;
/**
* Box User ID, if provided authenticates as user.
*/
user_id?: string | null;
}
export interface CloudConfluenceDataSource {
/**
* Type of Authentication for connecting to Confluence APIs.
*/
authentication_mechanism: string;
/**
* The server URL of the Confluence instance.
*/
server_url: string;
class_name?: string;
/**
* The CQL query to use for fetching pages.
*/
cql?: string | null;
/**
* Configuration for handling failures during processing. Key-value object
* controlling failure handling behaviors.
*
* Example: { "skip_list_failures": true }
*
* Currently supports:
*
* - skip_list_failures: Skip failed batches/lists and continue processing
*/
failure_handling?: FailureHandlingConfig;
/**
* Whether to index restricted pages.
*/
index_restricted_pages?: boolean;
/**
* Whether to keep the markdown format.
*/
keep_markdown_format?: boolean;
/**
* The label to use for fetching pages.
*/
label?: string | null;
/**
* The page IDs of the Confluence to read from.
*/
page_ids?: string | null;
/**
* The space key to read from.
*/
space_key?: string | null;
supports_access_control?: boolean;
/**
* Whether to fetch space-level permissions (allowed users/groups) and attach them
* to document metadata for access control. Disable for Confluence Server/Data
* Center versions whose permission APIs are unavailable (e.g. the JSON-RPC API
* removed in Data Center 9.2.6+), which otherwise surface as 401 errors during
* sync.
*/
sync_permissions?: boolean;
/**
* The username to use for authentication.
*/
user_name?: string | null;
}
export interface CloudGoogleDriveDataSource {
/**
* The ID of the Google Drive folder to read from.
*/
folder_id: string;
class_name?: string;
/**
* Human-readable name of the selected folder, for display.
*/
folder_name?: string | null;
/**
* A dictionary containing secret values
*/
service_account_key?: { [key: string]: string } | null;
supports_access_control?: boolean;
}
/**
* Cloud Jira Data Source integrating JiraReader.
*/
export interface CloudJiraDataSource {
/**
* Type of Authentication for connecting to Jira APIs.
*/
authentication_mechanism: string;
/**
* JQL (Jira Query Language) query to search.
*/
query: string;
class_name?: string;
/**
* The cloud ID, used in case of OAuth2.
*/
cloud_id?: string | null;
/**
* The email address to use for authentication.
*/
email?: string | null;
/**
* The server url for Jira Cloud.
*/
server_url?: string | null;
supports_access_control?: boolean;
}
/**
* Cloud Jira Data Source integrating JiraReaderV2.
*/
export interface CloudJiraDataSourceV2 {
/**
* Type of Authentication for connecting to Jira APIs.
*/
authentication_mechanism: string;
/**
* JQL (Jira Query Language) query to search.
*/
query: string;
/**
* The server url for Jira Cloud.
*/
server_url: string;
/**
* Jira REST API version to use (2 or 3). 3 supports Atlassian Document Format
* (ADF).
*/
api_version?: '2' | '3';
class_name?: string;
/**
* The cloud ID, used in case of OAuth2.
*/
cloud_id?: string | null;
/**
* The email address to use for authentication.
*/
email?: string | null;
/**
* Fields to expand in the response.
*/
expand?: string | null;
/**
* List of fields to retrieve from Jira. If None, retrieves all fields.
*/
fields?: Array<string> | null;
/**
* Whether to fetch project role permissions and issue-level security
*/
get_permissions?: boolean;
/**
* Rate limit for Jira API requests per minute.
*/
requests_per_minute?: number | null;
supports_access_control?: boolean;
}
/**
* Cloud Milvus Vector Store.
*/
export interface CloudMilvusVectorStore {
uri: string;
class_name?: string;
collection_name?: string | null;
embedding_dimension?: number | null;
supports_nested_metadata_filters?: boolean;
}
/**
* Cloud MongoDB Atlas Vector Store.
*
* This class is used to store the configuration for a MongoDB Atlas vector store,
* so that it can be created and used in LlamaCloud.
*
* Args: mongodb_uri (str): URI for connecting to MongoDB Atlas db_name (str): name
* of the MongoDB database collection_name (str): name of the MongoDB collection
* vector_index_name (str): name of the MongoDB Atlas vector index
* fulltext_index_name (str): name of the MongoDB Atlas full-text index
*/
export interface CloudMongoDBAtlasVectorSearch {
collection_name: string;
db_name: string;
class_name?: string;
embedding_dimension?: number | null;
fulltext_index_name?: string | null;
supports_nested_metadata_filters?: boolean;
vector_index_name?: string | null;
}
export interface CloudNotionPageDataSource {
class_name?: string;
/**
* The Notion Database Id to read content from.
*/
database_ids?: string | null;
/**
* The Page ID's of the Notion to read from.
*/
page_ids?: string | null;
supports_access_control?: boolean;
}
export interface CloudOneDriveDataSource {
/**
* The client ID to use for authentication.
*/
client_id: string;
/**
* The tenant ID to use for authentication.
*/
tenant_id: string;
/**
* The user principal name to use for authentication.
*/
user_principal_name: string;
class_name?: string;
/**
* The ID of the OneDrive folder to read from.
*/
folder_id?: string | null;
/**
* The path of the OneDrive folder to read from.
*/
folder_path?: string | null;
/**
* The list of required file extensions.
*/
required_exts?: Array<string> | null;
supports_access_control?: true;
}
/**
* Cloud Pinecone Vector Store.
*
* This class is used to store the configuration for a Pinecone vector store, so
* that it can be created and used in LlamaCloud.
*
* Args: api_key (str): API key for authenticating with Pinecone index_name (str):
* name of the Pinecone index namespace (optional[str]): namespace to use in the
* Pinecone index insert_kwargs (optional[dict]): additional kwargs to pass during
* insertion
*/
export interface CloudPineconeVectorStore {
index_name: string;
class_name?: string;
insert_kwargs?: { [key: string]: unknown } | null;
namespace?: string | null;
supports_nested_metadata_filters?: true;
}
export interface CloudPostgresVectorStore {
database: string;
embed_dim: number;
host: string;
port: number;
schema_name: string;
table_name: string;
user: string;
class_name?: string;
/**
* HNSW settings for PGVector.
*/
hnsw_settings?: PgVectorHnswSettings | null;
hybrid_search?: boolean | null;
perform_setup?: boolean;
supports_nested_metadata_filters?: boolean;
}
/**
* Cloud Qdrant Vector Store.
*
* This class is used to store the configuration for a Qdrant vector store, so that
* it can be created and used in LlamaCloud.
*
* Args: collection_name (str): name of the Qdrant collection url (str): url of the
* Qdrant instance api_key (str): API key for authenticating with Qdrant
* max_retries (int): maximum number of retries in case of a failure. Defaults to 3
* client_kwargs (dict): additional kwargs to pass to the Qdrant client
*/
export interface CloudQdrantVectorStore {
collection_name: string;
url: string;
class_name?: string;
client_kwargs?: { [key: string]: unknown };
max_retries?: number;
supports_nested_metadata_filters?: true;
}
export interface CloudS3DataSource {
/**
* The name of the S3 bucket to read from.
*/
bucket: string;
/**
* The AWS access ID to use for authentication.
*/
aws_access_id?: string | null;
class_name?: string;
/**
* The prefix of the S3 objects to read from.
*/
prefix?: string | null;
/**
* The regex pattern to filter S3 objects. Must be a valid regex pattern.
*/
regex_pattern?: string | null;
/**
* The S3 endpoint URL to use for authentication.
*/
s3_endpoint_url?: string | null;
supports_access_control?: boolean;
}
export interface CloudSharepointDataSource {
/**
* The client ID to use for authentication.
*/
client_id: string;
/**
* The tenant ID to use for authentication.
*/
tenant_id: string;
class_name?: string;
/**
* The name of the Sharepoint drive to read from.
*/
drive_name?: string | null;
/**
* List of regex patterns for file paths to exclude. Files whose paths (including
* filename) match any pattern will be excluded. Example: ['/temp/', '/backup/',
* '\.git/', '\.tmp$', '^~']
*/
exclude_path_patterns?: Array<string> | null;
/**
* The ID of the Sharepoint folder to read from.
*/
folder_id?: string | null;
/**
* The path of the Sharepoint folder to read from.
*/
folder_path?: string | null;
/**
* Whether to get permissions for the sharepoint site.
*/
get_permissions?: boolean;
/**
* List of regex patterns for file paths to include. Full paths (including
* filename) must match at least one pattern to be included. Example: ['/reports/',
* '/docs/.*\.pdf$', '^Report.*\.pdf$']
*/
include_path_patterns?: Array<string> | null;
/**
* The list of required file extensions.
*/
required_exts?: Array<string> | null;
/**
* The ID of the SharePoint site to download from.
*/
site_id?: string | null;
/**
* The name of the SharePoint site to download from.
*/
site_name?: string | null;
supports_access_control?: true;
}
export interface CloudSlackDataSource {
/**
* Slack Channel.
*/
channel_ids?: string | null;
/**
* Slack Channel name pattern.
*/
channel_patterns?: string | null;
class_name?: string;
/**
* Earliest date.
*/
earliest_date?: string | null;
/**
* Earliest date timestamp.
*/
earliest_date_timestamp?: number | null;
/**
* Latest date.
*/
latest_date?: string | null;
/**
* Latest date timestamp.
*/
latest_date_timestamp?: number | null;
supports_access_control?: boolean;
}
/**
* Configuration for handling different types of failures during data source
* processing.
*/
export interface FailureHandlingConfig {
/**
* Whether to skip failed batches/lists and continue processing
*/
skip_list_failures?: boolean;
}
/**
* HNSW settings for PGVector.
*/
export interface PgVectorHnswSettings {
/**
* The distance method to use.
*/
distance_method?: 'cosine' | 'hamming' | 'ip' | 'jaccard' | 'l1' | 'l2';
/**
* The number of edges to use during the construction phase.
*/
ef_construction?: number;
/**
* The number of edges to use during the search phase.
*/
ef_search?: number;
/**
* The number of bi-directional links created for each new element.
*/
m?: number;
/**
* The type of vector to use.
*/
vector_type?: 'bit' | 'half_vec' | 'sparse_vec' | 'vector';
}