@squidcloud/client 1.0.407 → 1.0.409
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/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +8 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +2 -2
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +23 -0
- package/dist/typescript-client/src/file-args-transformer.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +2 -0
- package/dist/typescript-client/src/squid.d.ts +39 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/dist/typescript-client/src/webhook.manager.d.ts +10 -0
- package/package.json +1 -1
|
@@ -354,6 +354,14 @@ export interface BaseAiChatOptions {
|
|
|
354
354
|
* For other providers ask about verbosity in prompt and using `maxOutputTokens`.
|
|
355
355
|
*/
|
|
356
356
|
verbosity?: AiVerbosityLevel;
|
|
357
|
+
/**
|
|
358
|
+
* Enable LLMs built-in code interpreter for executing Python code.
|
|
359
|
+
* - 'none': Code interpreter is disabled (default).
|
|
360
|
+
* - 'llm': Use LLM's native code interpreter to run Python code.
|
|
361
|
+
*
|
|
362
|
+
* Note: Only supported by OpenAI and Gemini models. Ignored for other providers.
|
|
363
|
+
*/
|
|
364
|
+
useCodeInterpreter?: 'none' | 'llm';
|
|
357
365
|
}
|
|
358
366
|
/**
|
|
359
367
|
* Chat options specific to Gemini models, extending base options.
|
|
@@ -35,12 +35,12 @@ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "
|
|
|
35
35
|
/**
|
|
36
36
|
* @category AI
|
|
37
37
|
*/
|
|
38
|
-
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
|
|
38
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
|
|
39
39
|
/**
|
|
40
40
|
* The supported AI model names.
|
|
41
41
|
* @category AI
|
|
42
42
|
*/
|
|
43
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
43
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
44
44
|
/**
|
|
45
45
|
* Check if the given model name is a global AI chat model name.
|
|
46
46
|
*/
|
|
@@ -168,6 +168,29 @@ export interface AiKnowledgeBaseContextSizeResponse {
|
|
|
168
168
|
/** Size of context bytes, as a number */
|
|
169
169
|
sizeBytes: number;
|
|
170
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Request structure for getting the values vector of
|
|
173
|
+
* a specific context
|
|
174
|
+
*
|
|
175
|
+
* @category AI
|
|
176
|
+
*/
|
|
177
|
+
export interface AiKnowledgeBaseValueVectorRequest {
|
|
178
|
+
/** The ID of the App */
|
|
179
|
+
appId: AppId;
|
|
180
|
+
/** The ID of the AIKnowledgeBase */
|
|
181
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
182
|
+
/** The ID of the context */
|
|
183
|
+
contextId: AiContextId;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Response structure for getting values vector of a
|
|
187
|
+
* specific context
|
|
188
|
+
* @category AI
|
|
189
|
+
*/
|
|
190
|
+
export interface AiKnowledgeBaseValueVectorResponse {
|
|
191
|
+
/** The vector */
|
|
192
|
+
vector: number[];
|
|
193
|
+
}
|
|
171
194
|
export interface AiKnowledgeBaseChatRequest {
|
|
172
195
|
knowledgeBaseId: AiKnowledgeBaseId;
|
|
173
196
|
prompt?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -27,6 +27,7 @@ export * from './document-reference.factory';
|
|
|
27
27
|
export * from './document-store';
|
|
28
28
|
export * from './execute-function-options';
|
|
29
29
|
export * from './extraction-client';
|
|
30
|
+
export * from './file-args-transformer';
|
|
30
31
|
export * from './file-utils';
|
|
31
32
|
export * from './integration-client';
|
|
32
33
|
export * from './job-client';
|
|
@@ -58,3 +59,4 @@ export * from './squid-http-client';
|
|
|
58
59
|
export * from './storage-client';
|
|
59
60
|
export * from './types';
|
|
60
61
|
export * from './web-client';
|
|
62
|
+
export * from './webhook.manager';
|
|
@@ -16,6 +16,7 @@ import { SchedulerClient } from './scheduler-client';
|
|
|
16
16
|
import { StorageClient } from './storage-client';
|
|
17
17
|
import { TransactionId } from './types';
|
|
18
18
|
import { WebClient } from './web-client';
|
|
19
|
+
import { ExecuteWebhookOptions } from './webhook.manager';
|
|
19
20
|
/**
|
|
20
21
|
* The different options that can be used to initialize a Squid instance.
|
|
21
22
|
* @category Platform
|
|
@@ -105,6 +106,7 @@ export declare class Squid {
|
|
|
105
106
|
private readonly queryBuilderFactory;
|
|
106
107
|
private readonly collectionReferenceFactory;
|
|
107
108
|
private readonly backendFunctionManager;
|
|
109
|
+
private readonly webhookManager;
|
|
108
110
|
private readonly nativeQueryManager;
|
|
109
111
|
private readonly destructManager;
|
|
110
112
|
private readonly documentIdentityService;
|
|
@@ -212,6 +214,43 @@ export declare class Squid {
|
|
|
212
214
|
* @typeParam T - The expected type of the result returned by the backend function.
|
|
213
215
|
*/
|
|
214
216
|
executeFunction<T = any>(functionNameOrOptions: string | ExecuteFunctionOptions<T>, ...params: Array<any | File>): Promise<T>;
|
|
217
|
+
/**
|
|
218
|
+
* Executes a backend function with custom headers, passing the provided parameters, and returns a promise with
|
|
219
|
+
* the result. The headers will be accessible in the backend via `this.context.headers`.
|
|
220
|
+
*
|
|
221
|
+
* For detailed information on backend functions in Squid, see the
|
|
222
|
+
* {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/executables documentation}.
|
|
223
|
+
*
|
|
224
|
+
* Files support:
|
|
225
|
+
* - To send a file to the backend, simply include it as one of the parameters; it will be received as a `SquidFile`
|
|
226
|
+
* on the backend.
|
|
227
|
+
* - Arrays of files can also be passed directly as parameters.
|
|
228
|
+
*
|
|
229
|
+
* @param functionNameOrOptions - The name of the backend function to execute or detailed options which include
|
|
230
|
+
* additional advanced options along with the function name.
|
|
231
|
+
* @param headers - Custom HTTP headers to send with the request. These headers will be available in the backend
|
|
232
|
+
* function via `this.context.headers`.
|
|
233
|
+
* @param params - A list of parameters to pass to the backend function.
|
|
234
|
+
* @returns A promise that resolves to the result of the backend function.
|
|
235
|
+
* @typeParam T - The expected type of the result returned by the backend function.
|
|
236
|
+
*/
|
|
237
|
+
executeFunctionWithHeaders<T = any>(functionNameOrOptions: string | ExecuteFunctionOptions<T>, headers: Record<string, string>, ...params: Array<any | File>): Promise<T>;
|
|
238
|
+
/**
|
|
239
|
+
* Executes a webhook identified by its ID, passing the provided options, and returns a promise with the result.
|
|
240
|
+
*
|
|
241
|
+
* For detailed information on webhooks in Squid, see the
|
|
242
|
+
* {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/webhooks documentation}.
|
|
243
|
+
*
|
|
244
|
+
* Files support:
|
|
245
|
+
* - To send files to the webhook, include them in the options.files array; they will be received as `SquidFile`
|
|
246
|
+
* objects on the backend.
|
|
247
|
+
*
|
|
248
|
+
* @param webhookId - The ID of the webhook to execute.
|
|
249
|
+
* @param options - Optional configuration including headers, query parameters, body, and files.
|
|
250
|
+
* @returns A promise that resolves to the result of the webhook execution.
|
|
251
|
+
* @typeParam T - The expected type of the result returned by the webhook.
|
|
252
|
+
*/
|
|
253
|
+
executeWebhook<T = any>(webhookId: string, options?: ExecuteWebhookOptions): Promise<T>;
|
|
215
254
|
/**
|
|
216
255
|
* Executes a native relational query with the given parameters and returns a promise with the result.
|
|
217
256
|
* See https://docs.getsquid.ai/docs/sdk/client-sdk/database/native-queries.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ExecuteWebhookOptions {
|
|
2
|
+
/** Optional HTTP headers to include in the webhook request. */
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
/** Optional query parameters to include in the webhook request. */
|
|
5
|
+
queryParams?: Record<string, string>;
|
|
6
|
+
/** Optional JSON body to send with the webhook request. */
|
|
7
|
+
body?: any;
|
|
8
|
+
/** Optional files to send with the webhook request. */
|
|
9
|
+
files?: File[];
|
|
10
|
+
}
|