@squidcloud/client 1.0.338 → 1.0.340
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/public-types/ai-agent.public-types.d.ts +287 -62
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +9 -2
- package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +6 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +13 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +7 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +12 -1
- package/dist/internal-common/src/public-types/document.public-types.d.ts +42 -12
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +21 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +16 -2
- package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +0 -11
- package/dist/internal-common/src/public-types/query.public-types.d.ts +35 -7
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +13 -4
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +24 -7
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +12 -0
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +0 -3
- package/dist/typescript-client/src/admin-client.d.ts +1 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +73 -2
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +1 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +8 -1
- package/dist/typescript-client/src/ai-assistant-client.d.ts +3 -2
- package/dist/typescript-client/src/ai-audio-client.d.ts +15 -0
- package/dist/typescript-client/src/ai-client.d.ts +5 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +16 -1
- package/dist/typescript-client/src/ai-matchmaking-client.d.ts +57 -11
- package/dist/typescript-client/src/ai.types.d.ts +24 -30
- package/dist/typescript-client/src/api-client.d.ts +1 -0
- package/dist/typescript-client/src/auth.manager.d.ts +4 -1
- package/dist/typescript-client/src/collection-reference.d.ts +2 -0
- package/dist/typescript-client/src/connection-details.d.ts +1 -0
- package/dist/typescript-client/src/destruct.manager.d.ts +1 -21
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +4 -1
- package/dist/typescript-client/src/document-reference.d.ts +1 -0
- package/dist/typescript-client/src/document-store.d.ts +1 -17
- package/dist/typescript-client/src/extraction-client.d.ts +1 -0
- package/dist/typescript-client/src/integration-client.d.ts +1 -0
- package/dist/typescript-client/src/observability-client.d.ts +5 -1
- package/dist/typescript-client/src/personal-storage-client.d.ts +23 -4
- package/dist/typescript-client/src/public-types.d.ts +1 -4
- package/dist/typescript-client/src/query/deserializer.d.ts +1 -0
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +34 -8
- package/dist/typescript-client/src/query/pagination.d.ts +10 -10
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +12 -4
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -12
- package/dist/typescript-client/src/query/query.types.d.ts +2 -93
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +1 -0
- package/dist/typescript-client/src/query-utils.d.ts +5 -1
- package/dist/typescript-client/src/queue.manager.d.ts +1 -0
- package/dist/typescript-client/src/scheduler-client.d.ts +1 -0
- package/dist/typescript-client/src/secret.client.d.ts +2 -0
- package/dist/typescript-client/src/squid.d.ts +16 -4
- package/dist/typescript-client/src/storage-client.d.ts +9 -9
- package/dist/typescript-client/src/types.d.ts +4 -1
- package/dist/typescript-client/src/version.d.ts +2 -2
- package/package.json +6 -2
- package/dist/internal-common/src/metric-name.d.ts +0 -9
- package/dist/internal-common/src/public-types/application.public-types.d.ts +0 -94
- package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +0 -33
- package/dist/internal-common/src/public-types/mutation.public-types.d.ts +0 -54
- package/dist/internal-common/src/public-types/storage.types.d.ts +0 -9
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -21
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -18
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -127
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -53
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/observability.types.d.ts +0 -71
- package/dist/internal-common/src/types/query.types.d.ts +0 -10
- package/dist/internal-common/src/types/secret.types.d.ts +0 -2
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/utils/array.d.ts +0 -1
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http.d.ts +0 -1
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -49
- package/dist/internal-common/src/utils/serialization.d.ts +0 -5
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -19
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -1,84 +1,205 @@
|
|
|
1
1
|
import { AiAgentId, AiContextId, IntegrationId } from './communication.public-types';
|
|
2
2
|
import { IntegrationType } from './integration.public-types';
|
|
3
|
-
import { FunctionName, FunctionNameWithContext } from './
|
|
4
|
-
/**
|
|
3
|
+
import { FunctionName, FunctionNameWithContext } from './backend.public-types';
|
|
4
|
+
/**
|
|
5
|
+
* The supported OpenAI models.
|
|
6
|
+
* @category AI
|
|
7
|
+
*/
|
|
5
8
|
export declare const OPENAI_O1_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini"];
|
|
9
|
+
/**
|
|
10
|
+
* @category AI
|
|
11
|
+
*/
|
|
6
12
|
export declare const OPENAI_REASONING_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini", "o3-mini"];
|
|
13
|
+
/**
|
|
14
|
+
* @category AI
|
|
15
|
+
*/
|
|
7
16
|
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"];
|
|
17
|
+
/**
|
|
18
|
+
* @category AI
|
|
19
|
+
*/
|
|
8
20
|
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-2.0-flash"];
|
|
21
|
+
/**
|
|
22
|
+
* @category AI
|
|
23
|
+
*/
|
|
9
24
|
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-5-haiku-latest", "claude-3-5-sonnet-latest"];
|
|
10
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The supported AI model names.
|
|
27
|
+
* @category AI
|
|
28
|
+
*/
|
|
11
29
|
export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "gemini-1.5-pro", "gemini-2.0-flash"];
|
|
30
|
+
/**
|
|
31
|
+
* @category AI
|
|
32
|
+
*/
|
|
12
33
|
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
34
|
+
/**
|
|
35
|
+
* @category AI
|
|
36
|
+
*/
|
|
13
37
|
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
14
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* The supported AI image generation model names.
|
|
40
|
+
* @category AI
|
|
41
|
+
*/
|
|
15
42
|
export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"];
|
|
43
|
+
/**
|
|
44
|
+
* @category AI
|
|
45
|
+
*/
|
|
16
46
|
export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
47
|
+
/**
|
|
48
|
+
* @category AI
|
|
49
|
+
*/
|
|
17
50
|
export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
51
|
+
/**
|
|
52
|
+
* @category AI
|
|
53
|
+
*/
|
|
18
54
|
export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "tts-1", "tts-1-hd"];
|
|
55
|
+
/**
|
|
56
|
+
* @category AI
|
|
57
|
+
*/
|
|
19
58
|
export declare const STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"];
|
|
59
|
+
/**
|
|
60
|
+
* @category AI
|
|
61
|
+
*/
|
|
20
62
|
export declare const FLUX_MODEL_NAMES: readonly ["flux-pro-1.1"];
|
|
63
|
+
/**
|
|
64
|
+
* @category AI
|
|
65
|
+
*/
|
|
21
66
|
export declare const AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusion-core", "flux-pro-1.1"];
|
|
67
|
+
/**
|
|
68
|
+
* @category AI
|
|
69
|
+
*/
|
|
22
70
|
export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
71
|
+
/**
|
|
72
|
+
* @category AI
|
|
73
|
+
*/
|
|
23
74
|
export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
75
|
+
/**
|
|
76
|
+
* @category AI
|
|
77
|
+
*/
|
|
24
78
|
export declare const OPEN_AI_CREATE_SPEECH_FORMATS: readonly ["mp3", "opus", "aac", "flac", "wav", "pcm"];
|
|
79
|
+
/**
|
|
80
|
+
* @category AI
|
|
81
|
+
*/
|
|
25
82
|
export type AiChatModelName = (typeof AI_CHAT_MODEL_NAMES)[number];
|
|
83
|
+
/**
|
|
84
|
+
* @category AI
|
|
85
|
+
*/
|
|
26
86
|
export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
|
|
87
|
+
/**
|
|
88
|
+
* @category AI
|
|
89
|
+
*/
|
|
27
90
|
export type OpenAiChatModelName = (typeof OPENAI_CHAT_MODEL_NAMES)[number];
|
|
91
|
+
/**
|
|
92
|
+
* @category AI
|
|
93
|
+
*/
|
|
28
94
|
export type OpenAiReasoningChatModelName = (typeof OPENAI_REASONING_CHAT_MODEL_NAMES)[number];
|
|
95
|
+
/**
|
|
96
|
+
* @category AI
|
|
97
|
+
*/
|
|
29
98
|
export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
|
|
99
|
+
/**
|
|
100
|
+
* @category AI
|
|
101
|
+
*/
|
|
30
102
|
export type AnthropicChatModelName = (typeof ANTHROPIC_CHAT_MODEL_NAMES)[number];
|
|
103
|
+
/**
|
|
104
|
+
* @category AI
|
|
105
|
+
*/
|
|
31
106
|
export type AiImageModelName = (typeof AI_IMAGE_MODEL_NAMES)[number];
|
|
107
|
+
/**
|
|
108
|
+
* @category AI
|
|
109
|
+
*/
|
|
32
110
|
export type AiAudioTranscriptionModelName = (typeof AI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
111
|
+
/**
|
|
112
|
+
* @category AI
|
|
113
|
+
*/
|
|
33
114
|
export type AiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
115
|
+
/**
|
|
116
|
+
* @category AI
|
|
117
|
+
*/
|
|
34
118
|
export type AiAudioModelName = (typeof OPENAI_AUDIO_MODEL_NAMES)[number];
|
|
119
|
+
/**
|
|
120
|
+
* @category AI
|
|
121
|
+
*/
|
|
35
122
|
export type OpenAiImageModelName = (typeof OPENAI_IMAGE_MODEL_NAMES)[number];
|
|
123
|
+
/**
|
|
124
|
+
* @category AI
|
|
125
|
+
*/
|
|
36
126
|
export type OpenAiAudioTranscriptionModelName = (typeof OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
127
|
+
/**
|
|
128
|
+
* @category AI
|
|
129
|
+
*/
|
|
37
130
|
export type OpenAiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
131
|
+
/**
|
|
132
|
+
* @category AI
|
|
133
|
+
*/
|
|
38
134
|
export type OpenAiCreateSpeechFormat = (typeof OPEN_AI_CREATE_SPEECH_FORMATS)[number];
|
|
135
|
+
/**
|
|
136
|
+
* @category AI
|
|
137
|
+
*/
|
|
39
138
|
export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[number];
|
|
139
|
+
/**
|
|
140
|
+
* @category AI
|
|
141
|
+
*/
|
|
40
142
|
export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
|
|
143
|
+
/**
|
|
144
|
+
* @category AI
|
|
145
|
+
*/
|
|
41
146
|
export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions | FluxOptions;
|
|
147
|
+
/**
|
|
148
|
+
* @category AI
|
|
149
|
+
*/
|
|
42
150
|
export type AiAudioTranscribeOptions = WhisperOptions;
|
|
151
|
+
/**
|
|
152
|
+
* @category AI
|
|
153
|
+
*/
|
|
43
154
|
export type AiAudioCreateSpeechOptions = OpenAiCreateSpeechOptions;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
mimeType: string;
|
|
48
|
-
extension: string;
|
|
49
|
-
base64File: string;
|
|
50
|
-
}
|
|
51
|
-
export interface AiAudioCreateSpeechRequest {
|
|
52
|
-
input: string;
|
|
53
|
-
options: AiAudioCreateSpeechOptions;
|
|
54
|
-
}
|
|
155
|
+
/**
|
|
156
|
+
* @category AI
|
|
157
|
+
*/
|
|
55
158
|
export interface BaseAiGenerateImageOptions {
|
|
56
159
|
modelName: AiImageModelName;
|
|
57
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* @category AI
|
|
163
|
+
*/
|
|
58
164
|
export interface BaseAiAudioTranscribeOptions {
|
|
59
165
|
modelName: AiAudioTranscriptionModelName;
|
|
60
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* @category AI
|
|
169
|
+
*/
|
|
61
170
|
export interface BaseAiAudioCreateSpeechOptions {
|
|
62
171
|
modelName: AiAudioCreateSpeechModelName;
|
|
63
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* @category AI
|
|
175
|
+
*/
|
|
64
176
|
export interface DallEOptions extends BaseAiGenerateImageOptions {
|
|
65
177
|
modelName: 'dall-e-3';
|
|
66
178
|
quality?: 'hd' | 'standard';
|
|
67
179
|
size?: '1024x1024' | '1792x1024' | '1024x1792';
|
|
68
180
|
numberOfImagesToGenerate?: 1;
|
|
69
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* @category AI
|
|
184
|
+
*/
|
|
70
185
|
export interface WhisperOptions extends BaseAiAudioTranscribeOptions {
|
|
71
186
|
modelName: 'whisper-1';
|
|
72
187
|
responseFormat?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
|
|
73
188
|
temperature?: number;
|
|
74
189
|
prompt?: string;
|
|
75
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* @category AI
|
|
193
|
+
*/
|
|
76
194
|
export interface OpenAiCreateSpeechOptions extends BaseAiAudioCreateSpeechOptions {
|
|
77
195
|
modelName: OpenAiAudioCreateSpeechModelName;
|
|
78
196
|
voice?: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
79
197
|
responseFormat?: OpenAiCreateSpeechFormat;
|
|
80
198
|
speed?: number;
|
|
81
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* @category AI
|
|
202
|
+
*/
|
|
82
203
|
export interface FluxOptions extends BaseAiGenerateImageOptions {
|
|
83
204
|
modelName: 'flux-pro-1.1';
|
|
84
205
|
/** Must be a multiple of 32. Min 256, max 1440 - default to 1024 */
|
|
@@ -92,6 +213,9 @@ export interface FluxOptions extends BaseAiGenerateImageOptions {
|
|
|
92
213
|
/** 1 is most strict and 5 is most permissive */
|
|
93
214
|
safety_tolerance?: number;
|
|
94
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* @category AI
|
|
218
|
+
*/
|
|
95
219
|
export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
|
|
96
220
|
modelName: 'stable-diffusion-core';
|
|
97
221
|
aspectRatio?: '16:9' | '1:1' | '21:9' | '2:3' | '3:2' | '4:5' | '5:4' | '9:16' | '9:21';
|
|
@@ -100,14 +224,29 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
|
|
|
100
224
|
stylePreset?: 'analog-film' | 'anime' | 'cinematic' | 'comic-book' | 'digital-art' | 'enhance' | 'fantasy-art' | 'isometric' | 'line-art' | 'low-poly' | 'modeling-compound' | 'neon-punk' | 'origami' | 'photographic' | 'pixel-art' | 'tile-texture';
|
|
101
225
|
outputFormat?: 'jpeg' | 'png' | 'webp';
|
|
102
226
|
}
|
|
103
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* The possible sources for the LLM provider API key.
|
|
229
|
+
* @category AI
|
|
230
|
+
*/
|
|
104
231
|
export type ApiKeySource = 'user' | 'system';
|
|
232
|
+
/**
|
|
233
|
+
* @category AI
|
|
234
|
+
*/
|
|
105
235
|
export type AiAgentResponseFormat = 'text' | 'json_object';
|
|
236
|
+
/**
|
|
237
|
+
* @category AI
|
|
238
|
+
*/
|
|
106
239
|
export type AiFileUrlType = 'image';
|
|
240
|
+
/**
|
|
241
|
+
* @category AI
|
|
242
|
+
*/
|
|
107
243
|
export interface AiFileUrl {
|
|
108
244
|
type: AiFileUrlType;
|
|
109
245
|
url: string;
|
|
110
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* @category AI
|
|
249
|
+
*/
|
|
111
250
|
export interface AiConnectedIntegrationMetadata {
|
|
112
251
|
integrationId: IntegrationId;
|
|
113
252
|
/** Type of the connected integration. */
|
|
@@ -118,7 +257,15 @@ export interface AiConnectedIntegrationMetadata {
|
|
|
118
257
|
* If not provided the default one is used.
|
|
119
258
|
*/
|
|
120
259
|
description?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Instructions for the connected integration agent.
|
|
262
|
+
* If not provided the default one is used.
|
|
263
|
+
*/
|
|
264
|
+
instructions?: string;
|
|
121
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* @category AI
|
|
268
|
+
*/
|
|
122
269
|
export interface AiConnectedAgentMetadata {
|
|
123
270
|
agentId: AiAgentId;
|
|
124
271
|
/**
|
|
@@ -127,7 +274,10 @@ export interface AiConnectedAgentMetadata {
|
|
|
127
274
|
*/
|
|
128
275
|
description: string;
|
|
129
276
|
}
|
|
130
|
-
/**
|
|
277
|
+
/**
|
|
278
|
+
* Quotas for a single AI chat prompt (`ask()` method call).
|
|
279
|
+
* @category AI
|
|
280
|
+
*/
|
|
131
281
|
export interface AiChatPromptQuotas {
|
|
132
282
|
/**
|
|
133
283
|
* Maximum depth of AI call recursion allowed.
|
|
@@ -138,7 +288,11 @@ export interface AiChatPromptQuotas {
|
|
|
138
288
|
*/
|
|
139
289
|
maxAiCallStackSize: number;
|
|
140
290
|
}
|
|
141
|
-
|
|
291
|
+
/**
|
|
292
|
+
* The base AI agent chat options, should not be used directly.
|
|
293
|
+
* @category AI
|
|
294
|
+
*/
|
|
295
|
+
export interface BaseAiAgentChatOptions {
|
|
142
296
|
/** The maximum number of tokens to use when making the request to the AI model. Default to the max tokens the model can accept. */
|
|
143
297
|
maxTokens?: number;
|
|
144
298
|
/** A unique chat ID, if the same chat ID is used again and history is not disabled, it will continue the conversation. */
|
|
@@ -182,34 +336,66 @@ interface BaseAiAgentChatOptions {
|
|
|
182
336
|
includeMetadata?: boolean;
|
|
183
337
|
/** The temperature to use when sampling from the model. Default to 0.5. */
|
|
184
338
|
temperature?: number;
|
|
339
|
+
/** Preset instruction options that can be toggled on */
|
|
340
|
+
guardrails?: GuardrailsOptions;
|
|
185
341
|
model?: AiChatModelName;
|
|
186
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Each model-specific options interface now “anchors” the overrideModel property.
|
|
345
|
+
* @category AI
|
|
346
|
+
*/
|
|
187
347
|
export interface GeminiChatOptions extends BaseAiAgentChatOptions {
|
|
188
348
|
model?: GeminiChatModelName;
|
|
189
349
|
groundingWithWebSearch?: boolean;
|
|
190
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* @category AI
|
|
353
|
+
*/
|
|
191
354
|
export interface OpenAiChatOptions extends BaseAiAgentChatOptions {
|
|
192
355
|
model?: OpenAiChatModelName;
|
|
193
356
|
fileUrls?: Array<AiFileUrl>;
|
|
194
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* @category AI
|
|
360
|
+
*/
|
|
195
361
|
export type OpenAiReasoningEffort = 'low' | 'medium' | 'high';
|
|
362
|
+
/**
|
|
363
|
+
* @category AI
|
|
364
|
+
*/
|
|
196
365
|
export interface OpenAiReasoningChatOptions extends OpenAiChatOptions {
|
|
197
366
|
model?: OpenAiReasoningChatModelName;
|
|
198
367
|
reasoningEffort?: OpenAiReasoningEffort;
|
|
199
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* @category AI
|
|
371
|
+
*/
|
|
200
372
|
export interface AnthropicChatOptions extends BaseAiAgentChatOptions {
|
|
201
373
|
model?: AnthropicChatModelName;
|
|
202
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* @category AI
|
|
377
|
+
*/
|
|
203
378
|
export type AiSessionOptions = Partial<{
|
|
204
379
|
traceId: string;
|
|
205
380
|
clientId: string;
|
|
206
381
|
agentId: string;
|
|
207
382
|
}>;
|
|
383
|
+
/**
|
|
384
|
+
* The generic options type. When no generic is provided,
|
|
385
|
+
* the type is inferred from the provided overrideModel (or falls back to BaseAiAgentChatOptions).
|
|
386
|
+
* @category AI
|
|
387
|
+
*/
|
|
208
388
|
export type AiAgentChatOptions<T extends AiChatModelName | undefined = undefined> = T extends undefined ? BaseAiAgentChatOptions | GeminiChatOptions | OpenAiReasoningChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiReasoningChatModelName ? OpenAiReasoningChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : never;
|
|
389
|
+
/**
|
|
390
|
+
* @category AI
|
|
391
|
+
*/
|
|
209
392
|
export type AllAiAgentChatOptions = {
|
|
210
393
|
[K in keyof BaseAiAgentChatOptions | keyof GeminiChatOptions | keyof OpenAiReasoningChatOptions | keyof OpenAiChatOptions | keyof AnthropicChatOptions]?: (K extends keyof BaseAiAgentChatOptions ? BaseAiAgentChatOptions[K] : never) | (K extends keyof GeminiChatOptions ? GeminiChatOptions[K] : never) | (K extends keyof OpenAiReasoningChatOptions ? OpenAiReasoningChatOptions[K] : never) | (K extends keyof OpenAiChatOptions ? OpenAiChatOptions[K] : never) | (K extends keyof AnthropicChatOptions ? AnthropicChatOptions[K] : never);
|
|
211
394
|
};
|
|
212
|
-
/**
|
|
395
|
+
/**
|
|
396
|
+
* A definition of an AI agent.
|
|
397
|
+
* @category AI
|
|
398
|
+
*/
|
|
213
399
|
export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
214
400
|
id: AiAgentId;
|
|
215
401
|
createdAt: Date;
|
|
@@ -220,39 +406,32 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
|
220
406
|
/** The default options of the agent - can be overridden by the user when using the agent. */
|
|
221
407
|
options: AiAgentChatOptions<T>;
|
|
222
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* @category AI
|
|
411
|
+
*/
|
|
223
412
|
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
|
|
224
413
|
options?: AiAgentChatOptions;
|
|
225
414
|
};
|
|
415
|
+
/**
|
|
416
|
+
* @category AI
|
|
417
|
+
*/
|
|
226
418
|
export interface AiObserveStatusOptions {
|
|
227
419
|
/** A unique chat ID for the conversation. */
|
|
228
420
|
chatId?: string;
|
|
229
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* @category AI
|
|
424
|
+
*/
|
|
230
425
|
export interface AiStatusMessage {
|
|
231
426
|
agentId: string;
|
|
232
427
|
chatId?: string;
|
|
233
428
|
title: string;
|
|
234
429
|
tags?: Record<string, any>;
|
|
235
430
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
responseString: string;
|
|
241
|
-
transcribedPrompt: string;
|
|
242
|
-
}
|
|
243
|
-
export interface AiAskWithVoiceResponse {
|
|
244
|
-
responseString: string;
|
|
245
|
-
voiceResponse: AiAudioCreateSpeechResponse;
|
|
246
|
-
}
|
|
247
|
-
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
248
|
-
transcribedPrompt: string;
|
|
249
|
-
responseString: string;
|
|
250
|
-
voiceResponse: AiAudioCreateSpeechResponse;
|
|
251
|
-
}
|
|
252
|
-
export interface AiTranscribeAndChatResponse {
|
|
253
|
-
transcribedPrompt: string;
|
|
254
|
-
}
|
|
255
|
-
/** The options for the AI agent search method. */
|
|
431
|
+
/**
|
|
432
|
+
* The options for the AI agent search method.
|
|
433
|
+
* @category AI
|
|
434
|
+
*/
|
|
256
435
|
export interface AiSearchOptions {
|
|
257
436
|
/** The prompt to search for */
|
|
258
437
|
prompt: string;
|
|
@@ -261,26 +440,17 @@ export interface AiSearchOptions {
|
|
|
261
440
|
/** The maximum number of results to return */
|
|
262
441
|
limit?: number;
|
|
263
442
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
export interface AiSearchResponse {
|
|
269
|
-
chunks: Array<AiSearchResultChunk>;
|
|
270
|
-
}
|
|
443
|
+
/**
|
|
444
|
+
* @category AI
|
|
445
|
+
*/
|
|
271
446
|
export interface AiSearchResultChunk {
|
|
272
447
|
data: string;
|
|
273
448
|
metadata?: AiContextMetadata;
|
|
274
449
|
score: number;
|
|
275
450
|
}
|
|
276
451
|
/**
|
|
277
|
-
*
|
|
278
|
-
* Refer to the `@secureAiAgent` annotation for more details.
|
|
452
|
+
* @category AI
|
|
279
453
|
*/
|
|
280
|
-
export declare class SecureAiAgentContext {
|
|
281
|
-
readonly prompt?: string;
|
|
282
|
-
readonly agentId: AiAgentId;
|
|
283
|
-
}
|
|
284
454
|
export interface AiAgentContext {
|
|
285
455
|
id: AiContextId;
|
|
286
456
|
createdAt: Date;
|
|
@@ -293,18 +463,30 @@ export interface AiAgentContext {
|
|
|
293
463
|
sizeBytes: number;
|
|
294
464
|
metadata: AiContextMetadata;
|
|
295
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* @category AI
|
|
468
|
+
*/
|
|
296
469
|
export type AgentContextRequest = TextContextRequest | FileContextRequest;
|
|
297
|
-
|
|
470
|
+
interface BaseContextRequest {
|
|
298
471
|
contextId: string;
|
|
299
472
|
type: AiContextType;
|
|
300
473
|
metadata?: AiContextMetadata;
|
|
301
474
|
}
|
|
475
|
+
/**
|
|
476
|
+
* @category AI
|
|
477
|
+
*/
|
|
302
478
|
export type AiContextType = 'text' | 'file';
|
|
479
|
+
/**
|
|
480
|
+
* @category AI
|
|
481
|
+
*/
|
|
303
482
|
export interface TextContextRequest extends BaseContextRequest {
|
|
304
483
|
type: 'text';
|
|
305
484
|
title: string;
|
|
306
485
|
text: string;
|
|
307
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* @category AI
|
|
489
|
+
*/
|
|
308
490
|
export interface FileContextRequest extends BaseContextRequest {
|
|
309
491
|
type: 'file';
|
|
310
492
|
extractImages?: boolean;
|
|
@@ -314,45 +496,88 @@ export interface FileContextRequest extends BaseContextRequest {
|
|
|
314
496
|
extractionModel?: AiChatModelName;
|
|
315
497
|
password?: string;
|
|
316
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* @category AI
|
|
501
|
+
*/
|
|
317
502
|
export type AiContextMetadataValue = number | string | boolean | undefined;
|
|
503
|
+
/**
|
|
504
|
+
* @category AI
|
|
505
|
+
*/
|
|
318
506
|
export type AiContextMetadataValueArray = AiContextMetadataValue[];
|
|
319
|
-
|
|
507
|
+
interface AiContextMetadataEqFilter {
|
|
320
508
|
$eq: AiContextMetadataValue;
|
|
321
509
|
}
|
|
322
|
-
|
|
510
|
+
interface AiContextMetadataNeFilter {
|
|
323
511
|
$ne: AiContextMetadataValue;
|
|
324
512
|
}
|
|
325
|
-
|
|
513
|
+
interface AiContextMetadataGtFilter {
|
|
326
514
|
$gt: number;
|
|
327
515
|
}
|
|
328
|
-
|
|
516
|
+
interface AiContextMetadataGteFilter {
|
|
329
517
|
$gte: number;
|
|
330
518
|
}
|
|
331
|
-
|
|
519
|
+
interface AiContextMetadataLtFilter {
|
|
332
520
|
$lt: number;
|
|
333
521
|
}
|
|
334
|
-
|
|
522
|
+
interface AiContextMetadataLteFilter {
|
|
335
523
|
$lte: number;
|
|
336
524
|
}
|
|
337
|
-
|
|
525
|
+
interface AiContextMetadataInFilter {
|
|
338
526
|
$in: AiContextMetadataValueArray;
|
|
339
527
|
}
|
|
340
|
-
|
|
528
|
+
interface AiContextMetadataNinFilter {
|
|
341
529
|
$nin: AiContextMetadataValueArray;
|
|
342
530
|
}
|
|
343
|
-
|
|
531
|
+
interface AiContextMetadataExistsFilter {
|
|
344
532
|
$exists: boolean;
|
|
345
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
* @category AI
|
|
536
|
+
*/
|
|
346
537
|
export type AiContextMetadataSimpleFilter = AiContextMetadataEqFilter | AiContextMetadataNeFilter | AiContextMetadataGtFilter | AiContextMetadataGteFilter | AiContextMetadataLtFilter | AiContextMetadataLteFilter | AiContextMetadataInFilter | AiContextMetadataNinFilter | AiContextMetadataExistsFilter;
|
|
538
|
+
/**
|
|
539
|
+
* @category AI
|
|
540
|
+
*/
|
|
347
541
|
export interface AiContextMetadataFieldFilter {
|
|
348
542
|
[field: string]: AiContextMetadataSimpleFilter | AiContextMetadataValue;
|
|
349
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* @category AI
|
|
546
|
+
*/
|
|
350
547
|
export interface AiContextMetadataAndFilter {
|
|
351
548
|
$and: AiContextMetadataFilter[];
|
|
352
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* @category AI
|
|
552
|
+
*/
|
|
353
553
|
export interface AiContextMetadataOrFilter {
|
|
354
554
|
$or: AiContextMetadataFilter[];
|
|
355
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* @category AI
|
|
558
|
+
*/
|
|
356
559
|
export type AiContextMetadataFilter = AiContextMetadataFieldFilter | AiContextMetadataAndFilter | AiContextMetadataOrFilter;
|
|
560
|
+
/**
|
|
561
|
+
* @category AI
|
|
562
|
+
*/
|
|
357
563
|
export type AiContextMetadata = Record<string, AiContextMetadataValue>;
|
|
564
|
+
/**
|
|
565
|
+
* @category AI
|
|
566
|
+
*/
|
|
567
|
+
export type GuardrailKeysType = 'disableProfanity' | 'offTopicAnswers' | 'professionalTone' | 'disablePii';
|
|
568
|
+
/**
|
|
569
|
+
* @category AI
|
|
570
|
+
*/
|
|
571
|
+
export type GuardrailsOptions = {
|
|
572
|
+
[k in GuardrailKeysType]?: boolean;
|
|
573
|
+
} & {
|
|
574
|
+
custom?: string;
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* @category AI
|
|
578
|
+
*/
|
|
579
|
+
export interface AiTranscribeAndAskResponse {
|
|
580
|
+
responseString: string;
|
|
581
|
+
transcribedPrompt: string;
|
|
582
|
+
}
|
|
358
583
|
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { OpenAiChatModelName, OpenAiReasoningEffort, AiAgentResponseFormat } from './ai-agent.public-types';
|
|
2
|
-
import { FunctionName } from './
|
|
2
|
+
import { FunctionName } from './backend.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* The type of assistant tool.
|
|
5
|
+
* @category AI
|
|
6
|
+
*/
|
|
3
7
|
export type AssistantToolType = 'code_interpreter' | 'file_search';
|
|
4
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The options for the AI assistant.
|
|
10
|
+
* @category AI
|
|
11
|
+
*/
|
|
5
12
|
export interface QueryAssistantOptions {
|
|
6
13
|
/** Extra context passed to all AI functions. */
|
|
7
14
|
agentContext?: Record<string, unknown>;
|
|
@@ -2,6 +2,7 @@ import { AiContextMetadata, AiContextMetadataFilter } from './ai-agent.public-ty
|
|
|
2
2
|
/**
|
|
3
3
|
* Represents a category in the matchmaker.
|
|
4
4
|
* The description is used by the AI to extract features from the content.
|
|
5
|
+
* @category AI
|
|
5
6
|
*/
|
|
6
7
|
export interface MmCategory {
|
|
7
8
|
id: string;
|
|
@@ -10,6 +11,7 @@ export interface MmCategory {
|
|
|
10
11
|
/**
|
|
11
12
|
* Represents a matchmaker entity for a given category.
|
|
12
13
|
* The metadata is used to filter the entities when finding matches.
|
|
14
|
+
* @category AI
|
|
13
15
|
*/
|
|
14
16
|
export interface MmEntity {
|
|
15
17
|
id: string;
|
|
@@ -22,6 +24,7 @@ export interface MmEntity {
|
|
|
22
24
|
* The description is used to describe the matchmaker and by the AI to better understand the domain.
|
|
23
25
|
* The categories represent the types of entities that can be matched (it is possible to match items in the same
|
|
24
26
|
* category).
|
|
27
|
+
* @category AI
|
|
25
28
|
*/
|
|
26
29
|
export interface MmMatchMaker {
|
|
27
30
|
id: string;
|
|
@@ -34,6 +37,7 @@ export interface MmMatchMaker {
|
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
36
39
|
* Represents a matchmaker entity match. A high score indicates a good match.
|
|
40
|
+
* @category AI
|
|
37
41
|
*/
|
|
38
42
|
export interface MmEntityMatch extends MmEntity {
|
|
39
43
|
/** The score of the match between 0 and 100 - 100 represents best match. */
|
|
@@ -42,6 +46,7 @@ export interface MmEntityMatch extends MmEntity {
|
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* Represents options for finding matches.
|
|
49
|
+
* @category AI
|
|
45
50
|
*/
|
|
46
51
|
export interface MmFindMatchesOptions {
|
|
47
52
|
/** Metadata filter conditions - defaults to none */
|
|
@@ -56,6 +61,7 @@ export interface MmFindMatchesOptions {
|
|
|
56
61
|
}
|
|
57
62
|
/**
|
|
58
63
|
* Represents options for listing entities.
|
|
64
|
+
* @category AI
|
|
59
65
|
*/
|
|
60
66
|
export interface MmListEntitiesOptions {
|
|
61
67
|
/** Metadata filter conditions - defaults to none */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Backend related public types that should be available on the client SDK */
|
|
2
|
+
/**
|
|
3
|
+
* @category Queue
|
|
4
|
+
*/
|
|
5
|
+
export type TopicName = string;
|
|
6
|
+
export type ServiceName = string;
|
|
7
|
+
export type FunctionName = string;
|
|
8
|
+
/** Function name with the contextual data. The data must be a serializable JSON. */
|
|
9
|
+
export interface FunctionNameWithContext {
|
|
10
|
+
name: FunctionName;
|
|
11
|
+
context: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
|
|
@@ -10,5 +10,12 @@ export type SquidDocId = string;
|
|
|
10
10
|
export type ClientRequestId = string;
|
|
11
11
|
/** ID of AI agent. Also known as AI profile id. */
|
|
12
12
|
export type AiAgentId = string;
|
|
13
|
+
/**
|
|
14
|
+
* The built-in agent id. Cannot be customized.
|
|
15
|
+
* @category AI
|
|
16
|
+
*/
|
|
13
17
|
export declare const BUILT_IN_AGENT_ID = "built_in_agent";
|
|
18
|
+
/**
|
|
19
|
+
* @category AI
|
|
20
|
+
*/
|
|
14
21
|
export type AiContextId = string;
|