@realtimex/sdk 1.1.3 → 1.1.4
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.
- package/dist/index.d.mts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +57 -0
- package/dist/index.mjs +57 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -396,6 +396,36 @@ interface VectorListWorkspacesResponse {
|
|
|
396
396
|
workspaces?: string[];
|
|
397
397
|
error?: string;
|
|
398
398
|
code?: string;
|
|
399
|
+
error_message?: string;
|
|
400
|
+
}
|
|
401
|
+
interface VectorRegisterResponse {
|
|
402
|
+
success: boolean;
|
|
403
|
+
message?: string;
|
|
404
|
+
error?: string;
|
|
405
|
+
code?: string;
|
|
406
|
+
}
|
|
407
|
+
interface VectorConfigResponse {
|
|
408
|
+
success: boolean;
|
|
409
|
+
provider?: string;
|
|
410
|
+
config?: Record<string, any>;
|
|
411
|
+
error?: string;
|
|
412
|
+
code?: string;
|
|
413
|
+
}
|
|
414
|
+
interface VectorProviderField {
|
|
415
|
+
name: string;
|
|
416
|
+
label: string;
|
|
417
|
+
type: 'string' | 'password';
|
|
418
|
+
placeholder?: string;
|
|
419
|
+
}
|
|
420
|
+
interface VectorProviderMetadata {
|
|
421
|
+
name: string;
|
|
422
|
+
label: string;
|
|
423
|
+
description?: string;
|
|
424
|
+
fields: VectorProviderField[];
|
|
425
|
+
}
|
|
426
|
+
interface VectorProvidersResponse {
|
|
427
|
+
success: boolean;
|
|
428
|
+
providers: VectorProviderMetadata[];
|
|
399
429
|
}
|
|
400
430
|
/**
|
|
401
431
|
* @deprecated Use PermissionRequiredError from api module instead
|
|
@@ -468,6 +498,29 @@ declare class VectorStore {
|
|
|
468
498
|
* ```
|
|
469
499
|
*/
|
|
470
500
|
listWorkspaces(): Promise<VectorListWorkspacesResponse>;
|
|
501
|
+
/**
|
|
502
|
+
* Register a custom vector database configuration for this app
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* ```ts
|
|
506
|
+
* await sdk.llm.vectors.registerConfig('lancedb', { });
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
registerConfig(provider: string, config: Record<string, any>): Promise<VectorRegisterResponse>;
|
|
510
|
+
/**
|
|
511
|
+
* List all supported vector database providers and their configuration requirements
|
|
512
|
+
*/
|
|
513
|
+
listProviders(): Promise<VectorProvidersResponse>;
|
|
514
|
+
/**
|
|
515
|
+
* Get the current vector database configuration for this app
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```ts
|
|
519
|
+
* const { provider, config } = await sdk.llm.vectors.getConfig();
|
|
520
|
+
* console.log(`App is using ${provider}`);
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
getConfig(): Promise<VectorConfigResponse>;
|
|
471
524
|
}
|
|
472
525
|
declare class LLMModule {
|
|
473
526
|
private baseUrl;
|
|
@@ -623,6 +676,11 @@ declare class RealtimeXSDK {
|
|
|
623
676
|
appId?: string;
|
|
624
677
|
timestamp: string;
|
|
625
678
|
}>;
|
|
679
|
+
/**
|
|
680
|
+
* Get the absolute path to the data directory for this app.
|
|
681
|
+
* Path: ~/.realtimex.ai/Resources/local-apps/{appId}
|
|
682
|
+
*/
|
|
683
|
+
getAppDataDir(): Promise<string>;
|
|
626
684
|
}
|
|
627
685
|
|
|
628
686
|
export { ActivitiesModule, type Activity, type Agent, ApiModule, type ChatMessage, type ChatOptions, type ChatResponse, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type StreamChunk, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|
package/dist/index.d.ts
CHANGED
|
@@ -396,6 +396,36 @@ interface VectorListWorkspacesResponse {
|
|
|
396
396
|
workspaces?: string[];
|
|
397
397
|
error?: string;
|
|
398
398
|
code?: string;
|
|
399
|
+
error_message?: string;
|
|
400
|
+
}
|
|
401
|
+
interface VectorRegisterResponse {
|
|
402
|
+
success: boolean;
|
|
403
|
+
message?: string;
|
|
404
|
+
error?: string;
|
|
405
|
+
code?: string;
|
|
406
|
+
}
|
|
407
|
+
interface VectorConfigResponse {
|
|
408
|
+
success: boolean;
|
|
409
|
+
provider?: string;
|
|
410
|
+
config?: Record<string, any>;
|
|
411
|
+
error?: string;
|
|
412
|
+
code?: string;
|
|
413
|
+
}
|
|
414
|
+
interface VectorProviderField {
|
|
415
|
+
name: string;
|
|
416
|
+
label: string;
|
|
417
|
+
type: 'string' | 'password';
|
|
418
|
+
placeholder?: string;
|
|
419
|
+
}
|
|
420
|
+
interface VectorProviderMetadata {
|
|
421
|
+
name: string;
|
|
422
|
+
label: string;
|
|
423
|
+
description?: string;
|
|
424
|
+
fields: VectorProviderField[];
|
|
425
|
+
}
|
|
426
|
+
interface VectorProvidersResponse {
|
|
427
|
+
success: boolean;
|
|
428
|
+
providers: VectorProviderMetadata[];
|
|
399
429
|
}
|
|
400
430
|
/**
|
|
401
431
|
* @deprecated Use PermissionRequiredError from api module instead
|
|
@@ -468,6 +498,29 @@ declare class VectorStore {
|
|
|
468
498
|
* ```
|
|
469
499
|
*/
|
|
470
500
|
listWorkspaces(): Promise<VectorListWorkspacesResponse>;
|
|
501
|
+
/**
|
|
502
|
+
* Register a custom vector database configuration for this app
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* ```ts
|
|
506
|
+
* await sdk.llm.vectors.registerConfig('lancedb', { });
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
registerConfig(provider: string, config: Record<string, any>): Promise<VectorRegisterResponse>;
|
|
510
|
+
/**
|
|
511
|
+
* List all supported vector database providers and their configuration requirements
|
|
512
|
+
*/
|
|
513
|
+
listProviders(): Promise<VectorProvidersResponse>;
|
|
514
|
+
/**
|
|
515
|
+
* Get the current vector database configuration for this app
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```ts
|
|
519
|
+
* const { provider, config } = await sdk.llm.vectors.getConfig();
|
|
520
|
+
* console.log(`App is using ${provider}`);
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
getConfig(): Promise<VectorConfigResponse>;
|
|
471
524
|
}
|
|
472
525
|
declare class LLMModule {
|
|
473
526
|
private baseUrl;
|
|
@@ -623,6 +676,11 @@ declare class RealtimeXSDK {
|
|
|
623
676
|
appId?: string;
|
|
624
677
|
timestamp: string;
|
|
625
678
|
}>;
|
|
679
|
+
/**
|
|
680
|
+
* Get the absolute path to the data directory for this app.
|
|
681
|
+
* Path: ~/.realtimex.ai/Resources/local-apps/{appId}
|
|
682
|
+
*/
|
|
683
|
+
getAppDataDir(): Promise<string>;
|
|
626
684
|
}
|
|
627
685
|
|
|
628
686
|
export { ActivitiesModule, type Activity, type Agent, ApiModule, type ChatMessage, type ChatOptions, type ChatResponse, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type StreamChunk, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|
package/dist/index.js
CHANGED
|
@@ -643,6 +643,38 @@ var VectorStore = class {
|
|
|
643
643
|
async listWorkspaces() {
|
|
644
644
|
return this.request("GET", "/sdk/llm/vectors/workspaces");
|
|
645
645
|
}
|
|
646
|
+
/**
|
|
647
|
+
* Register a custom vector database configuration for this app
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```ts
|
|
651
|
+
* await sdk.llm.vectors.registerConfig('lancedb', { });
|
|
652
|
+
* ```
|
|
653
|
+
*/
|
|
654
|
+
async registerConfig(provider, config) {
|
|
655
|
+
return this.request("POST", "/sdk/llm/vectors/register", {
|
|
656
|
+
provider,
|
|
657
|
+
config
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* List all supported vector database providers and their configuration requirements
|
|
662
|
+
*/
|
|
663
|
+
async listProviders() {
|
|
664
|
+
return this.request("GET", "/sdk/llm/vectors/providers");
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Get the current vector database configuration for this app
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* ```ts
|
|
671
|
+
* const { provider, config } = await sdk.llm.vectors.getConfig();
|
|
672
|
+
* console.log(`App is using ${provider}`);
|
|
673
|
+
* ```
|
|
674
|
+
*/
|
|
675
|
+
async getConfig() {
|
|
676
|
+
return this.request("GET", "/sdk/llm/vectors/config");
|
|
677
|
+
}
|
|
646
678
|
};
|
|
647
679
|
var LLMModule = class {
|
|
648
680
|
constructor(baseUrl, appId, appName = "Local App", apiKey) {
|
|
@@ -1034,6 +1066,31 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
1034
1066
|
throw new Error(`Connection failed: ${error.message}`);
|
|
1035
1067
|
}
|
|
1036
1068
|
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Get the absolute path to the data directory for this app.
|
|
1071
|
+
* Path: ~/.realtimex.ai/Resources/local-apps/{appId}
|
|
1072
|
+
*/
|
|
1073
|
+
async getAppDataDir() {
|
|
1074
|
+
try {
|
|
1075
|
+
const headers = { "Content-Type": "application/json" };
|
|
1076
|
+
if (this.apiKey) {
|
|
1077
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1078
|
+
} else if (this.appId) {
|
|
1079
|
+
headers["x-app-id"] = this.appId;
|
|
1080
|
+
}
|
|
1081
|
+
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/local-apps/data-dir`, {
|
|
1082
|
+
method: "GET",
|
|
1083
|
+
headers
|
|
1084
|
+
});
|
|
1085
|
+
const data = await response.json();
|
|
1086
|
+
if (!response.ok) {
|
|
1087
|
+
throw new Error(data.error || "Failed to get data directory");
|
|
1088
|
+
}
|
|
1089
|
+
return data.dataDir;
|
|
1090
|
+
} catch (error) {
|
|
1091
|
+
throw new Error(`Failed to get app data directory: ${error.message}`);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1037
1094
|
};
|
|
1038
1095
|
_RealtimeXSDK.DEFAULT_REALTIMEX_URL = "http://localhost:3001";
|
|
1039
1096
|
var RealtimeXSDK = _RealtimeXSDK;
|
package/dist/index.mjs
CHANGED
|
@@ -596,6 +596,38 @@ var VectorStore = class {
|
|
|
596
596
|
async listWorkspaces() {
|
|
597
597
|
return this.request("GET", "/sdk/llm/vectors/workspaces");
|
|
598
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* Register a custom vector database configuration for this app
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ```ts
|
|
604
|
+
* await sdk.llm.vectors.registerConfig('lancedb', { });
|
|
605
|
+
* ```
|
|
606
|
+
*/
|
|
607
|
+
async registerConfig(provider, config) {
|
|
608
|
+
return this.request("POST", "/sdk/llm/vectors/register", {
|
|
609
|
+
provider,
|
|
610
|
+
config
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* List all supported vector database providers and their configuration requirements
|
|
615
|
+
*/
|
|
616
|
+
async listProviders() {
|
|
617
|
+
return this.request("GET", "/sdk/llm/vectors/providers");
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Get the current vector database configuration for this app
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```ts
|
|
624
|
+
* const { provider, config } = await sdk.llm.vectors.getConfig();
|
|
625
|
+
* console.log(`App is using ${provider}`);
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
async getConfig() {
|
|
629
|
+
return this.request("GET", "/sdk/llm/vectors/config");
|
|
630
|
+
}
|
|
599
631
|
};
|
|
600
632
|
var LLMModule = class {
|
|
601
633
|
constructor(baseUrl, appId, appName = "Local App", apiKey) {
|
|
@@ -987,6 +1019,31 @@ var _RealtimeXSDK = class _RealtimeXSDK {
|
|
|
987
1019
|
throw new Error(`Connection failed: ${error.message}`);
|
|
988
1020
|
}
|
|
989
1021
|
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Get the absolute path to the data directory for this app.
|
|
1024
|
+
* Path: ~/.realtimex.ai/Resources/local-apps/{appId}
|
|
1025
|
+
*/
|
|
1026
|
+
async getAppDataDir() {
|
|
1027
|
+
try {
|
|
1028
|
+
const headers = { "Content-Type": "application/json" };
|
|
1029
|
+
if (this.apiKey) {
|
|
1030
|
+
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
1031
|
+
} else if (this.appId) {
|
|
1032
|
+
headers["x-app-id"] = this.appId;
|
|
1033
|
+
}
|
|
1034
|
+
const response = await fetch(`${this.realtimexUrl.replace(/\/$/, "")}/sdk/local-apps/data-dir`, {
|
|
1035
|
+
method: "GET",
|
|
1036
|
+
headers
|
|
1037
|
+
});
|
|
1038
|
+
const data = await response.json();
|
|
1039
|
+
if (!response.ok) {
|
|
1040
|
+
throw new Error(data.error || "Failed to get data directory");
|
|
1041
|
+
}
|
|
1042
|
+
return data.dataDir;
|
|
1043
|
+
} catch (error) {
|
|
1044
|
+
throw new Error(`Failed to get app data directory: ${error.message}`);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
990
1047
|
};
|
|
991
1048
|
_RealtimeXSDK.DEFAULT_REALTIMEX_URL = "http://localhost:3001";
|
|
992
1049
|
var RealtimeXSDK = _RealtimeXSDK;
|