@squidcloud/client 1.0.307 → 1.0.309
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/cjs/index.js +1 -1
- package/dist/internal-common/src/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +12 -3
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.public-types.d.ts +1 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +21 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +18 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +123 -0
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +58 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +34 -0
- package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/observability.types.d.ts +71 -0
- package/dist/internal-common/src/types/query.types.d.ts +10 -0
- package/dist/internal-common/src/types/secret.types.d.ts +2 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/time-units.d.ts +1 -0
- package/dist/internal-common/src/utils/array.d.ts +1 -0
- package/dist/internal-common/src/utils/assert.d.ts +1 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
- package/dist/internal-common/src/utils/http.d.ts +1 -0
- package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +49 -0
- package/dist/internal-common/src/utils/serialization.d.ts +5 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +20 -0
- package/dist/internal-common/src/websocket.impl.d.ts +26 -0
- package/dist/typescript-client/src/ai-client.d.ts +69 -0
- package/dist/typescript-client/src/ai.types.d.ts +6 -68
- package/dist/typescript-client/src/index.d.ts +1 -0
- package/dist/typescript-client/src/squid.d.ts +1 -1
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AiAgentReference, AiChatbotClient } from './ai-agent-client';
|
|
2
|
+
import { AiAssistantClient } from './ai-assistant-client';
|
|
3
|
+
import { IntegrationId } from './public-types';
|
|
4
|
+
import { AiImageClient } from './ai-image-client';
|
|
5
|
+
import { AiAudioClient } from './ai-audio-client';
|
|
6
|
+
import { AiMatchMakingClient } from './ai-matchmaking-client';
|
|
7
|
+
import { ExecuteAiApiResponse, ExecuteAiQueryMultiResponse, ExecuteAiQueryOptions, ExecuteAiQueryResponse } from './ai.types';
|
|
8
|
+
/**
|
|
9
|
+
* AiClient class serves as a facade for interacting with different AI services.
|
|
10
|
+
* It provides simplified access to AI chatbot and assistant functionalities
|
|
11
|
+
* through its methods.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AiClient {
|
|
14
|
+
private readonly aiChatbotClientFactory;
|
|
15
|
+
private readonly rpcManager;
|
|
16
|
+
private readonly aiAssistantClient;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves an AI chatbot client for a specific AI integration.
|
|
19
|
+
* @param aiIntegrationId - The identifier for the AI integration.
|
|
20
|
+
* @returns An instance of AiChatbotClient associated with the given AI integration ID.
|
|
21
|
+
*/
|
|
22
|
+
chatbot(aiIntegrationId: IntegrationId): AiChatbotClient;
|
|
23
|
+
agent(agentId: string): AiAgentReference;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the AI assistant client.
|
|
26
|
+
* @returns An instance of AiAssistantClient.
|
|
27
|
+
*/
|
|
28
|
+
assistant(): AiAssistantClient;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves an AI image client.
|
|
31
|
+
*/
|
|
32
|
+
image(): AiImageClient;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves an AI audio client.
|
|
35
|
+
*/
|
|
36
|
+
audio(): AiAudioClient;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves an AI match-making client.
|
|
39
|
+
*/
|
|
40
|
+
matchMaking(): AiMatchMakingClient;
|
|
41
|
+
/**
|
|
42
|
+
* Executes an AI query using a specific DB integration, sending a prompt to the AI and returning its response.
|
|
43
|
+
* This function allows for direct interaction with the AI's capabilities by sending text prompts and receiving
|
|
44
|
+
* the AI's responses, which can be used for various applications such as automating tasks, generating content,
|
|
45
|
+
* or obtaining information.
|
|
46
|
+
*
|
|
47
|
+
* @param integrationId The identifier for the DB integration which is used to direct the query to the
|
|
48
|
+
* appropriate DB.
|
|
49
|
+
* @param prompt The text prompt to send to the AI. This should be formulated in a way that the AI can
|
|
50
|
+
* understand and respond to, taking into account the nature of the task or the information
|
|
51
|
+
* sought.
|
|
52
|
+
* @param options Additional options to customize the query execution.
|
|
53
|
+
* @returns A promise that resolves to an `ExecuteAiQueryResponse`. This response includes the AI's
|
|
54
|
+
* reply to the provided prompt, along with any other relevant information that is part of
|
|
55
|
+
* the AI's response. The promise can be awaited to handle the response asynchronously.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```
|
|
59
|
+
* const response = await ai().executeAiQuery(myDbIntegrationId, "How many transactions ran yesterday?");
|
|
60
|
+
* console.log(response);
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* For more details on the usage and capabilities of the AI Assistant, refer to the documentation provided at
|
|
64
|
+
* {@link https://docs.squid.cloud/docs/ai}.
|
|
65
|
+
*/
|
|
66
|
+
executeAiQuery(integrationId: IntegrationId, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryResponse>;
|
|
67
|
+
executeAiQueryMulti(integrationIds: Array<IntegrationId>, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryMultiResponse>;
|
|
68
|
+
executeAiApiCall(integrationId: IntegrationId, prompt: string, allowedEndpoints?: string[], provideExplanation?: boolean): Promise<ExecuteAiApiResponse>;
|
|
69
|
+
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AiAssistantClient } from './ai-assistant-client';
|
|
3
|
-
import { ApiOptions, IntegrationId } from './public-types';
|
|
4
|
-
import { AiImageClient } from './ai-image-client';
|
|
5
|
-
import { AiAudioClient } from './ai-audio-client';
|
|
6
|
-
import { AiMatchMakingClient } from './ai-matchmaking-client';
|
|
1
|
+
import { AiChatModelName, ApiOptions, IntegrationId } from './public-types';
|
|
7
2
|
export interface ExecuteAiQueryRequest {
|
|
8
3
|
integrationId: IntegrationId;
|
|
9
4
|
prompt: string;
|
|
@@ -23,17 +18,22 @@ export interface ExecuteAiApiRequest {
|
|
|
23
18
|
export interface ExecuteAiQueryOptions {
|
|
24
19
|
instructions?: string;
|
|
25
20
|
collectionsToUse?: Array<string>;
|
|
21
|
+
enableRawResults?: boolean;
|
|
22
|
+
enableCodeInterpreter?: boolean;
|
|
23
|
+
overrideModel?: AiChatModelName;
|
|
26
24
|
}
|
|
27
25
|
export interface ExecuteAiQueryResponse {
|
|
28
26
|
answer: string;
|
|
29
27
|
explanation?: string;
|
|
30
28
|
executedQuery?: string;
|
|
31
29
|
queryMarkdownType?: string;
|
|
30
|
+
rawResultsUrl?: string;
|
|
32
31
|
success: boolean;
|
|
33
32
|
}
|
|
34
33
|
interface ExecutedQuery {
|
|
35
34
|
query: string;
|
|
36
35
|
markdownType: string;
|
|
36
|
+
rawResultsUrl?: string;
|
|
37
37
|
}
|
|
38
38
|
export interface ExecuteAiQueryMultiResponse {
|
|
39
39
|
answer: string;
|
|
@@ -55,66 +55,4 @@ export interface ExecuteAiApiResponse {
|
|
|
55
55
|
queryMarkdownType?: string;
|
|
56
56
|
success: boolean;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
59
|
-
* AiClient class serves as a facade for interacting with different AI services.
|
|
60
|
-
* It provides simplified access to AI chatbot and assistant functionalities
|
|
61
|
-
* through its methods.
|
|
62
|
-
*/
|
|
63
|
-
export declare class AiClient {
|
|
64
|
-
private readonly aiChatbotClientFactory;
|
|
65
|
-
private readonly rpcManager;
|
|
66
|
-
private readonly aiAssistantClient;
|
|
67
|
-
/**
|
|
68
|
-
* Retrieves an AI chatbot client for a specific AI integration.
|
|
69
|
-
* @param aiIntegrationId - The identifier for the AI integration.
|
|
70
|
-
* @returns An instance of AiChatbotClient associated with the given AI integration ID.
|
|
71
|
-
*/
|
|
72
|
-
chatbot(aiIntegrationId: IntegrationId): AiChatbotClient;
|
|
73
|
-
agent(agentId: string): AiAgentReference;
|
|
74
|
-
/**
|
|
75
|
-
* Retrieves the AI assistant client.
|
|
76
|
-
* @returns An instance of AiAssistantClient.
|
|
77
|
-
*/
|
|
78
|
-
assistant(): AiAssistantClient;
|
|
79
|
-
/**
|
|
80
|
-
* Retrieves an AI image client.
|
|
81
|
-
*/
|
|
82
|
-
image(): AiImageClient;
|
|
83
|
-
/**
|
|
84
|
-
* Retrieves an AI audio client.
|
|
85
|
-
*/
|
|
86
|
-
audio(): AiAudioClient;
|
|
87
|
-
/**
|
|
88
|
-
* Retrieves an AI match-making client.
|
|
89
|
-
*/
|
|
90
|
-
matchMaking(): AiMatchMakingClient;
|
|
91
|
-
/**
|
|
92
|
-
* Executes an AI query using a specific DB integration, sending a prompt to the AI and returning its response.
|
|
93
|
-
* This function allows for direct interaction with the AI's capabilities by sending text prompts and receiving
|
|
94
|
-
* the AI's responses, which can be used for various applications such as automating tasks, generating content,
|
|
95
|
-
* or obtaining information.
|
|
96
|
-
*
|
|
97
|
-
* @param integrationId The identifier for the DB integration which is used to direct the query to the
|
|
98
|
-
* appropriate DB.
|
|
99
|
-
* @param prompt The text prompt to send to the AI. This should be formulated in a way that the AI can
|
|
100
|
-
* understand and respond to, taking into account the nature of the task or the information
|
|
101
|
-
* sought.
|
|
102
|
-
* @param options Additional options to customize the query execution.
|
|
103
|
-
* @returns A promise that resolves to an `ExecuteAiQueryResponse`. This response includes the AI's
|
|
104
|
-
* reply to the provided prompt, along with any other relevant information that is part of
|
|
105
|
-
* the AI's response. The promise can be awaited to handle the response asynchronously.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```
|
|
109
|
-
* const response = await ai().executeAiQuery(myDbIntegrationId, "How many transactions ran yesterday?");
|
|
110
|
-
* console.log(response);
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* For more details on the usage and capabilities of the AI Assistant, refer to the documentation provided at
|
|
114
|
-
* {@link https://docs.squid.cloud/docs/ai}.
|
|
115
|
-
*/
|
|
116
|
-
executeAiQuery(integrationId: IntegrationId, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryResponse>;
|
|
117
|
-
executeAiQueryMulti(integrationIds: Array<IntegrationId>, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryMultiResponse>;
|
|
118
|
-
executeAiApiCall(integrationId: IntegrationId, prompt: string, allowedEndpoints?: string[], provideExplanation?: boolean): Promise<ExecuteAiApiResponse>;
|
|
119
|
-
}
|
|
120
58
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AiClient } from './ai.types';
|
|
2
1
|
import { ApiClient } from './api-client';
|
|
3
2
|
import { CollectionReference } from './collection-reference';
|
|
4
3
|
import { ConnectionDetails } from './connection-details';
|
|
@@ -12,6 +11,7 @@ import { ExtractionClient } from './extraction-client';
|
|
|
12
11
|
import { PersonalStorageClient } from './personal-storage-client';
|
|
13
12
|
import { SchedulerClient } from './scheduler-client';
|
|
14
13
|
import { AdminClient } from './admin-client';
|
|
14
|
+
import { AiClient } from './ai-client';
|
|
15
15
|
/** The different options that can be used to initialize a Squid instance. */
|
|
16
16
|
export interface SquidOptions {
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.309";
|