@squidcloud/client 1.0.306 → 1.0.308

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.
@@ -27,6 +27,7 @@ export type AiChatbotContextMetadata = {
27
27
  text: string;
28
28
  preview: boolean;
29
29
  sizeBytes?: number;
30
+ type?: 'text' | 'url' | 'file';
30
31
  };
31
32
  export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | 'connectedAgents' | 'connectedIntegrations' | 'auditLog'>;
32
33
  /** List of fields that can be updated in runtime via API. */
@@ -1 +1 @@
1
- export {};
1
+ export declare const SOCKET_RECONNECT_TIMEOUT: number;
@@ -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 { AiAgentReference, AiChatbotClient } from './ai-agent-client';
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 {};
@@ -50,3 +50,4 @@ export * from './file-utils';
50
50
  export * from './ai-matchmaking-client';
51
51
  export * from './admin-client';
52
52
  export * from './console-utils';
53
+ export * from './ai-client';
@@ -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.306";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.308";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.306",
3
+ "version": "1.0.308",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",