@relevanceai/sdk 2.0.0 → 2.0.1

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 (37) hide show
  1. package/dist-cjs/generated/VecDBApi.js +1682 -0
  2. package/dist-cjs/generated/_VecDBApiSchemaTypes.js +3 -0
  3. package/dist-cjs/generated/index.js +17 -0
  4. package/dist-cjs/index.js +18 -0
  5. package/dist-cjs/services/discovery/Dataset.js +126 -0
  6. package/dist-cjs/services/discovery/index.js +159 -0
  7. package/dist-cjs/services/index.js +18 -0
  8. package/dist-cjs/services/vecdb/Dataset.js +137 -0
  9. package/dist-cjs/services/vecdb/index.js +137 -0
  10. package/dist-cjs/shared/BaseClient.js +35 -0
  11. package/dist-cjs/shared/generate.js +90 -0
  12. package/dist-cjs/shared/serviceConfigs.js +10 -0
  13. package/dist-es/generated/VecDBApi.js +2579 -0
  14. package/dist-es/generated/_VecDBApiSchemaTypes.js +2 -0
  15. package/dist-es/generated/index.js +1 -0
  16. package/dist-es/index.js +2 -0
  17. package/dist-es/services/discovery/Dataset.js +126 -0
  18. package/dist-es/services/discovery/index.js +159 -0
  19. package/dist-es/services/index.js +2 -0
  20. package/dist-es/services/vecdb/Dataset.js +356 -0
  21. package/dist-es/services/vecdb/index.js +184 -0
  22. package/dist-es/shared/BaseClient.js +82 -0
  23. package/dist-es/shared/generate.js +224 -0
  24. package/dist-es/shared/serviceConfigs.js +7 -0
  25. package/dist-types/generated/VecDBApi.d.ts +632 -0
  26. package/dist-types/generated/_VecDBApiSchemaTypes.d.ts +22299 -0
  27. package/dist-types/generated/index.d.ts +1 -0
  28. package/dist-types/index.d.ts +2 -0
  29. package/dist-types/services/discovery/Dataset.d.ts +0 -0
  30. package/dist-types/services/discovery/index.d.ts +0 -0
  31. package/dist-types/services/index.d.ts +1 -0
  32. package/dist-types/services/vecdb/Dataset.d.ts +52 -0
  33. package/dist-types/services/vecdb/index.d.ts +44 -0
  34. package/dist-types/shared/BaseClient.d.ts +28 -0
  35. package/dist-types/shared/generate.d.ts +1 -0
  36. package/dist-types/shared/serviceConfigs.d.ts +8 -0
  37. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export * from "./VecDBApi";
@@ -0,0 +1,2 @@
1
+ export * from './generated';
2
+ export * from './services';
File without changes
File without changes
@@ -0,0 +1 @@
1
+ export * from './vecdb';
@@ -0,0 +1,52 @@
1
+ /// <reference types="node" />
2
+ import { VecDBClient, _QueryBuilder } from ".";
3
+ import { DeleteDocumentOutput, DeleteWhereOutput, GetDocumentOutput, SimpleSearchPostOutput, BulkInsertOutput, UpdateWhereOutput, BulkUpdateOutput } from "../..";
4
+ import { _GenericMethodOptions } from "../../shared/BaseClient";
5
+ interface searchOptions {
6
+ debounce?: number;
7
+ rawPayload?: any;
8
+ }
9
+ export declare class Dataset {
10
+ client: VecDBClient;
11
+ name: string;
12
+ config: any;
13
+ debounceTimer?: NodeJS.Timeout;
14
+ constructor(client: VecDBClient, name: string, options: any);
15
+ get datasetName(): string;
16
+ createIfNotExist(): Promise<boolean>;
17
+ recreateIfExists(): Promise<boolean>;
18
+ insertDocument(document: any, options?: _GenericMethodOptions): Promise<unknown>;
19
+ search(): Promise<SimpleSearchPostOutput>;
20
+ search(query?: _QueryBuilder): Promise<SimpleSearchPostOutput>;
21
+ search(options?: searchOptions): Promise<SimpleSearchPostOutput>;
22
+ search(query?: _QueryBuilder, options?: searchOptions): Promise<SimpleSearchPostOutput>;
23
+ insertDocuments(documents: any, encoders?: any, options?: _GenericMethodOptions & {
24
+ batchSize?: number;
25
+ retryCount?: number;
26
+ progressCallback?: (progress: BulkInsertOutput[]) => any;
27
+ }): Promise<BulkInsertOutput>;
28
+ _GenericBulkOperation<InputItem, OutputItem>({ data, batchSize, fn, retryCount }: {
29
+ data: InputItem[];
30
+ fn: (data: InputItem[]) => Promise<OutputItem>;
31
+ batchSize?: number;
32
+ retryCount?: number;
33
+ progressCallback?: (progress: OutputItem[]) => any;
34
+ }): Promise<OutputItem[]>;
35
+ updateDocument(documentId: string, partialUpdates: any): Promise<{
36
+ status: string;
37
+ message: string;
38
+ }>;
39
+ updateDocuments(updates: any, options?: _GenericMethodOptions & {
40
+ batchSize?: number;
41
+ retryCount?: number;
42
+ progressCallback?: (progress: BulkUpdateOutput[]) => any;
43
+ }): Promise<BulkUpdateOutput>;
44
+ updateDocumentsWhere(filters: _QueryBuilder, partialUpdates: {
45
+ [id: string]: any;
46
+ }): Promise<UpdateWhereOutput>;
47
+ getDocument(documentId: string): Promise<GetDocumentOutput>;
48
+ deleteDocument(documentId: string): Promise<DeleteDocumentOutput>;
49
+ deleteDocuments(documentIds: [string]): Promise<DeleteWhereOutput>;
50
+ deleteDocumentsWhere(filters: _QueryBuilder): Promise<DeleteWhereOutput>;
51
+ }
52
+ export {};
@@ -0,0 +1,44 @@
1
+ import { VecDBApiClient } from '../../';
2
+ import { _ClientInput } from '../../shared/BaseClient';
3
+ import { components } from '../../generated/_VecDBApiSchemaTypes';
4
+ import { Dataset } from './Dataset';
5
+ declare type bodyType = any;
6
+ export declare function QueryBuilder(): _QueryBuilder;
7
+ export declare function FilterBuilder(): _FilterBuilder;
8
+ export declare class _FilterBuilder {
9
+ body: bodyType;
10
+ constructor();
11
+ buildFilters(): any;
12
+ rawFilter(filter: components['schemas']['simpleSearchAndFlatFilterItem']): this;
13
+ filter(type: string, key: string, value: string, ...options: any): this;
14
+ match(field: string, value: any): this;
15
+ wildcard(field: string, value: any): this;
16
+ range(field: string, options: Omit<components['schemas']['simpleSearchAndFlatFilterItem']['range'], 'field'>): this;
17
+ or(filters: _FilterBuilder[]): this;
18
+ }
19
+ export declare class _QueryBuilder extends _FilterBuilder {
20
+ defaultQueryValue?: string;
21
+ shouldPerformTextQuery: boolean;
22
+ constructor();
23
+ build(): any;
24
+ vector(field: string, weight?: number): _QueryBuilder;
25
+ vector(field: string, options?: any): _QueryBuilder;
26
+ vector(field: string, weight?: number, options?: any): _QueryBuilder;
27
+ sort(field: string, direction: 'asc' | 'desc'): this;
28
+ rawOption(key: string, value: any): this;
29
+ minimumRelevance(value: bodyType['minimumRelevance']): this;
30
+ page(value: bodyType['page']): this;
31
+ pageSize(value: bodyType['pageSize']): this;
32
+ includeFields(fields: bodyType['includeFields']): this;
33
+ ask(query: string, field: string, options: {
34
+ preset?: any;
35
+ titleReferenceField?: string;
36
+ urlReferenceField?: string;
37
+ }): this;
38
+ }
39
+ export declare class VecDBClient {
40
+ apiClient: VecDBApiClient;
41
+ constructor(config?: _ClientInput);
42
+ dataset(name: string, options?: any): Dataset;
43
+ }
44
+ export {};
@@ -0,0 +1,28 @@
1
+ import { serviceConfig } from './serviceConfigs';
2
+ export declare type CommandInput<A> = A;
3
+ export interface CommandOutput<output> {
4
+ body: output;
5
+ }
6
+ export interface _ClientInput {
7
+ endpoint?: string;
8
+ api_key?: string;
9
+ project?: string;
10
+ dataset_id?: string;
11
+ }
12
+ export declare type _GenericClientInput = _ClientInput & {
13
+ service_name: string;
14
+ };
15
+ export interface _GenericMethodOptions {
16
+ dataset_id?: string;
17
+ }
18
+ export declare class _GenericClient {
19
+ config: _GenericClientInput;
20
+ serviceConfig: serviceConfig;
21
+ constructor(config: _GenericClientInput);
22
+ SendRequest({ input, path, method, options }: {
23
+ input: any;
24
+ path: string;
25
+ method: string;
26
+ options?: _GenericMethodOptions;
27
+ }): Promise<CommandOutput<any>>;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface serviceConfig {
2
+ schema_url: string;
3
+ endpoint: string;
4
+ name: string;
5
+ }
6
+ export declare const serviceConfigs: {
7
+ [id: string]: serviceConfig;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relevanceai/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Javascript client for RelevanceAI APIs. Browser, Node.js and typescript support.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "types": "./dist-types/index.d.ts",