@squidcloud/client 1.0.402 → 1.0.404
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/public-types/ai-knowledge-base.public-types.d.ts +7 -4
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +4 -4
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +3 -3
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +11 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +10 -2
- package/dist/typescript-client/src/ai-client.d.ts +5 -3
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +5 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -260,6 +260,14 @@ export interface AiAgentMemoryOptions {
|
|
|
260
260
|
* direct access to the agent chat history. A good practice is to use a non-trivial and a unique value.
|
|
261
261
|
*/
|
|
262
262
|
memoryId?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Overrides the expiration for the whole chat history.
|
|
265
|
+
* If not provided, the expiration will not be changed.
|
|
266
|
+
*
|
|
267
|
+
* Default: the last provided expiration by user or 1 day if
|
|
268
|
+
* the user didn't provide any expiration.
|
|
269
|
+
*/
|
|
270
|
+
expirationMinutes?: number;
|
|
263
271
|
}
|
|
264
272
|
/**
|
|
265
273
|
* The base AI agent chat options, should not be used directly.
|
|
@@ -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"];
|
|
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"];
|
|
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", "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-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
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentContextRequest, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
2
|
import { AiChatModelName, AiEmbeddingsModelName, AiRerankProvider } from './ai-common.public-types';
|
|
3
|
-
import { AiKnowledgeBaseId } from './communication.public-types';
|
|
3
|
+
import { AiContextId, AiKnowledgeBaseId } from './communication.public-types';
|
|
4
4
|
import { DocumentExtractionMethod } from './extraction.public-types';
|
|
5
5
|
/**
|
|
6
6
|
* Represents an AI knowledge base that can be attached to an AI agent.
|
|
@@ -8,9 +8,7 @@ import { DocumentExtractionMethod } from './extraction.public-types';
|
|
|
8
8
|
*/
|
|
9
9
|
export interface AiKnowledgeBase {
|
|
10
10
|
/** The unique identifier of the knowledge base.*/
|
|
11
|
-
id:
|
|
12
|
-
/** The name of the knowledge base.*/
|
|
13
|
-
name: AiKnowledgeBaseId;
|
|
11
|
+
id: AiKnowledgeBaseId;
|
|
14
12
|
/** The description of the knowledge base - will be used by AI agents.*/
|
|
15
13
|
description: string;
|
|
16
14
|
/** A set of predefined metadata fields for the knowledge base that can be used for filtering.*/
|
|
@@ -187,6 +185,8 @@ export interface AiKnowledgeBaseContextFileOptions extends BaseAiKnowledgeBaseCo
|
|
|
187
185
|
* @category AI
|
|
188
186
|
*/
|
|
189
187
|
export interface AiKnowledgeBaseTextContextRequest extends BaseAiKnowledgeBaseContextRequest {
|
|
188
|
+
/** The id of the context */
|
|
189
|
+
contextId: AiContextId;
|
|
190
190
|
/** Specifies the context type as 'text'. */
|
|
191
191
|
type: 'text';
|
|
192
192
|
/** A title for the text context. */
|
|
@@ -201,6 +201,8 @@ export interface AiKnowledgeBaseTextContextRequest extends BaseAiKnowledgeBaseCo
|
|
|
201
201
|
* @category AI
|
|
202
202
|
*/
|
|
203
203
|
export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseContextRequest {
|
|
204
|
+
/** The id of the context */
|
|
205
|
+
contextId: AiContextId;
|
|
204
206
|
/** Specifies the context type as 'file'. */
|
|
205
207
|
type: 'file';
|
|
206
208
|
/** Whether to extract images from the file; defaults to false. */
|
|
@@ -322,5 +324,6 @@ export interface AiKnowledgeBaseDownloadContextResponse {
|
|
|
322
324
|
*/
|
|
323
325
|
export type AiKnowledgeBaseWithOptionalChatModel = Omit<AiKnowledgeBase, 'chatModel'> & {
|
|
324
326
|
chatModel?: AiKnowledgeBase['chatModel'];
|
|
327
|
+
name?: string;
|
|
325
328
|
};
|
|
326
329
|
export {};
|
|
@@ -6,20 +6,20 @@ import { IntegrationId } from './communication.public-types';
|
|
|
6
6
|
* Supports additional query execution options.
|
|
7
7
|
* @category AI
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface AiQueryRequest {
|
|
10
10
|
/** ID of the integration to execute the AI query. */
|
|
11
11
|
integrationId: IntegrationId;
|
|
12
12
|
/** User-provided prompt for the AI query. */
|
|
13
13
|
prompt: string;
|
|
14
14
|
/** Additional options for query execution. */
|
|
15
|
-
options?:
|
|
15
|
+
options?: AiQueryOptions;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Options for configuring AI query execution.
|
|
19
19
|
* Includes instructions, model overrides, and additional execution settings.
|
|
20
20
|
* @category AI
|
|
21
21
|
*/
|
|
22
|
-
export interface
|
|
22
|
+
export interface AiQueryOptions {
|
|
23
23
|
/**
|
|
24
24
|
* Custom instructions to modify AI query generation behavior.
|
|
25
25
|
* Used for all stages unless there is a per-stage override.
|
|
@@ -84,7 +84,7 @@ export interface AiQueryAnalyzeResultsOptions {
|
|
|
84
84
|
* Contains the generated answer, optional explanation, and executed query details.
|
|
85
85
|
* @category AI
|
|
86
86
|
*/
|
|
87
|
-
export interface
|
|
87
|
+
export interface AiQueryResponse {
|
|
88
88
|
/** AI-generated answer for the query. */
|
|
89
89
|
answer: string;
|
|
90
90
|
/** Optional explanation for the AI-generated answer. */
|
|
@@ -176,8 +176,8 @@ export type CreatePdfRequest = CreatePdfFromUrlRequest | CreatePdfFromHtmlReques
|
|
|
176
176
|
* Response type for the PDF creation operation, containing the URL of the generated PDF.
|
|
177
177
|
*/
|
|
178
178
|
export interface CreatePdfResponse {
|
|
179
|
-
/**
|
|
180
|
-
* The publicly accessible URL where the generated PDF can be downloaded.
|
|
181
|
-
*/
|
|
179
|
+
/** The publicly accessible URL where the generated PDF can be downloaded. */
|
|
182
180
|
url: string;
|
|
181
|
+
/** The generated filename. */
|
|
182
|
+
fileName?: string;
|
|
183
183
|
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { AiQueryOptions } from '../public-types/ai-query.public-types';
|
|
1
2
|
import { IntegrationId } from '../public-types/communication.public-types';
|
|
2
3
|
import { CollectionName, DocumentData } from '../public-types/document.public-types';
|
|
3
4
|
import { FieldSort, Operator, Query, SimpleCondition } from '../public-types/query.public-types';
|
|
4
5
|
import { DeepRecord, FieldOf, PartialBy, Paths } from '../public-types/typescript.public-types';
|
|
6
|
+
/**
|
|
7
|
+
* The information provided to the secureAiQuery function about the AI query being executed.
|
|
8
|
+
* @category AI
|
|
9
|
+
*/
|
|
10
|
+
export interface AiQueryContext {
|
|
11
|
+
/** The prompt provided for the AI query. */
|
|
12
|
+
prompt: string;
|
|
13
|
+
/** The options used for executing the AI query. */
|
|
14
|
+
options: AiQueryOptions;
|
|
15
|
+
}
|
|
5
16
|
/**
|
|
6
17
|
* Represents the Squid query context.
|
|
7
18
|
* Passed to methods that require query details, such as those annotated with the `@secureCollection` annotation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseSearchResultChunk, AiKnowledgeBaseWithOptionalChatModel } from '../public-types/ai-knowledge-base.public-types';
|
|
2
|
-
import { AiKnowledgeBaseId, AppId } from '../public-types/communication.public-types';
|
|
2
|
+
import { AiContextId, AiKnowledgeBaseId, AppId } from '../public-types/communication.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* Request structure for getting an AiKnowledgeBase
|
|
5
5
|
* @category AI
|
|
@@ -63,9 +63,17 @@ export interface ListAiKnowledgeBaseContextsRequest {
|
|
|
63
63
|
* @category AI
|
|
64
64
|
*/
|
|
65
65
|
export interface ListAiKnowledgeBaseContextsResponse {
|
|
66
|
-
/** The list AiKnowledgeBaseContexts */
|
|
66
|
+
/** The list of AiKnowledgeBaseContexts */
|
|
67
67
|
contexts: Array<AiKnowledgeBaseContext>;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Response structure to list contextids for an AiKnowledgeBase
|
|
71
|
+
* @category AI
|
|
72
|
+
*/
|
|
73
|
+
export interface ListAiKnowledgeBaseContextIdsResponse {
|
|
74
|
+
/** The list of AiContextIds */
|
|
75
|
+
contextIds: Array<AiContextId>;
|
|
76
|
+
}
|
|
69
77
|
/**
|
|
70
78
|
* Request structure for deleting AiKnowledgeBaseContexts
|
|
71
79
|
* @category AI
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AiQueryOptions, AiQueryResponse, ExecuteAiApiResponse } from '../../internal-common/src/public-types/ai-query.public-types';
|
|
2
2
|
import { AiAgentReference } from './agent/ai-agent-client-reference';
|
|
3
3
|
import { AiAssistantClient } from './ai-assistant-client';
|
|
4
4
|
import { AiAudioClient } from './ai-audio-client';
|
|
@@ -71,14 +71,16 @@ export declare class AiClient {
|
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* ```
|
|
74
|
-
* const response = await ai().executeAiQuery(myDbIntegrationId, "How many transactions ran yesterday?");
|
|
74
|
+
* const response = await squid.ai().executeAiQuery(myDbIntegrationId, "How many transactions ran yesterday?");
|
|
75
75
|
* console.log(response);
|
|
76
76
|
* ```
|
|
77
77
|
*
|
|
78
|
+
* Can be used with an API key or using a security rule with @secureAiQuery() decorator.
|
|
79
|
+
*
|
|
78
80
|
* For more details on the usage and capabilities of the AI Assistant, refer to the documentation provided at
|
|
79
81
|
* {@link https://docs.squid.cloud/docs/ai}.
|
|
80
82
|
*/
|
|
81
|
-
executeAiQuery(integrationId: IntegrationId, prompt: string, options?:
|
|
83
|
+
executeAiQuery(integrationId: IntegrationId, prompt: string, options?: AiQueryOptions): Promise<AiQueryResponse>;
|
|
82
84
|
/**
|
|
83
85
|
* Request to execute an AI-powered API call.
|
|
84
86
|
* Allows specifying allowed endpoints and whether to provide an explanation.
|
package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseDownloadContextResponse, AiKnowledgeBaseSearchResultChunk, AiKnowledgeBaseWithOptionalChatModel, UpsertKnowledgeBaseContextResponse, UpsertKnowledgeBaseContextsResponse } from '../../../internal-common/src/public-types/ai-knowledge-base.public-types';
|
|
2
|
+
import { AiContextId } from '../../../internal-common/src/public-types/communication.public-types';
|
|
2
3
|
/**
|
|
3
4
|
* Parameters for creating or updating an AI agent.
|
|
4
5
|
* Excludes the `id` field, as it is derived from the agent instance.
|
|
@@ -36,6 +37,10 @@ export declare class AiKnowledgeBaseReference {
|
|
|
36
37
|
* Lists all contexts associated with the knowledge base.
|
|
37
38
|
*/
|
|
38
39
|
listContexts(): Promise<Array<AiKnowledgeBaseContext>>;
|
|
40
|
+
/**
|
|
41
|
+
* Lists the ids for all contexts associated with the knowledge base.
|
|
42
|
+
*/
|
|
43
|
+
listContextIds(): Promise<Array<AiContextId>>;
|
|
39
44
|
/**
|
|
40
45
|
* Retrieves a specific context by its ID.
|
|
41
46
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.404",
|
|
4
4
|
"description": "A typescript implementation of the Squid client",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"publish:public": "npm run build && npm publish --access public",
|
|
28
28
|
"full-bundle-size-report": "cross-env BUILD_FULL_BUNDLE_SIZE_REPORT=1 webpack --mode=production",
|
|
29
29
|
"generate-docs-html": "typedoc",
|
|
30
|
-
"generate-docs-markdown": "typedoc --plugin typedoc-plugin-markdown --readme none --out ./
|
|
30
|
+
"generate-docs-markdown": "typedoc --plugin typedoc-plugin-markdown --readme none --out ./reference-docs/markdown"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"typescript",
|