@squidcloud/client 1.0.348 → 1.0.350
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 +48 -17
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +5 -3
- package/dist/internal-common/src/public-types/web.public-types.d.ts +32 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/dist/typescript-client/src/web-client.d.ts +24 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AiAgentId, AiContextId, IntegrationId } from './communication.public-types';
|
|
2
2
|
import { IntegrationType } from './integration.public-types';
|
|
3
|
-
import {
|
|
3
|
+
import { AiFunctionId, AiFunctionIdWithContext } from './backend.public-types';
|
|
4
4
|
/**
|
|
5
5
|
* The supported OpenAI models.
|
|
6
6
|
* @category AI
|
|
@@ -30,11 +30,15 @@ export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1
|
|
|
30
30
|
/**
|
|
31
31
|
* @category AI
|
|
32
32
|
*/
|
|
33
|
-
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"
|
|
33
|
+
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"];
|
|
34
34
|
/**
|
|
35
35
|
* @category AI
|
|
36
36
|
*/
|
|
37
|
-
export declare const
|
|
37
|
+
export declare const VOYAGE_EMBEDDING_MODEL_NAMES: readonly ["voyage-3-large"];
|
|
38
|
+
/**
|
|
39
|
+
* @category AI
|
|
40
|
+
*/
|
|
41
|
+
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "voyage-3-large"];
|
|
38
42
|
/**
|
|
39
43
|
* The supported AI image generation model names.
|
|
40
44
|
* @category AI
|
|
@@ -43,15 +47,15 @@ export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"];
|
|
|
43
47
|
/**
|
|
44
48
|
* @category AI
|
|
45
49
|
*/
|
|
46
|
-
export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
50
|
+
export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
|
|
47
51
|
/**
|
|
48
52
|
* @category AI
|
|
49
53
|
*/
|
|
50
|
-
export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
54
|
+
export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
51
55
|
/**
|
|
52
56
|
* @category AI
|
|
53
57
|
*/
|
|
54
|
-
export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "tts-1", "tts-1-hd"];
|
|
58
|
+
export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
55
59
|
/**
|
|
56
60
|
* @category AI
|
|
57
61
|
*/
|
|
@@ -67,11 +71,11 @@ export declare const AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusi
|
|
|
67
71
|
/**
|
|
68
72
|
* @category AI
|
|
69
73
|
*/
|
|
70
|
-
export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
74
|
+
export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
|
|
71
75
|
/**
|
|
72
76
|
* @category AI
|
|
73
77
|
*/
|
|
74
|
-
export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
78
|
+
export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
75
79
|
/**
|
|
76
80
|
* @category AI
|
|
77
81
|
*/
|
|
@@ -84,6 +88,10 @@ export type AiChatModelName = (typeof AI_CHAT_MODEL_NAMES)[number];
|
|
|
84
88
|
* @category AI
|
|
85
89
|
*/
|
|
86
90
|
export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
|
|
91
|
+
/**
|
|
92
|
+
* @category AI
|
|
93
|
+
*/
|
|
94
|
+
export type AiVoyageEmbeddingsModelName = (typeof VOYAGE_EMBEDDING_MODEL_NAMES)[number];
|
|
87
95
|
/**
|
|
88
96
|
* @category AI
|
|
89
97
|
*/
|
|
@@ -147,7 +155,11 @@ export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions |
|
|
|
147
155
|
/**
|
|
148
156
|
* @category AI
|
|
149
157
|
*/
|
|
150
|
-
export type
|
|
158
|
+
export type OpenAiAudioTranscribeOptions = WhisperTranscribeOptions | Gpt4oTranscribeOptions;
|
|
159
|
+
/**
|
|
160
|
+
* @category AI
|
|
161
|
+
*/
|
|
162
|
+
export type AiAudioTranscribeOptions = OpenAiAudioTranscribeOptions;
|
|
151
163
|
/**
|
|
152
164
|
* @category AI
|
|
153
165
|
*/
|
|
@@ -190,19 +202,33 @@ export interface DallEOptions extends BaseAiGenerateImageOptions {
|
|
|
190
202
|
/** The number of images to generate; defaults to 1 and limited to 1. */
|
|
191
203
|
numberOfImagesToGenerate?: 1;
|
|
192
204
|
}
|
|
205
|
+
interface BaseOpenAiAudioTranscribeOptions extends BaseAiAudioTranscribeOptions {
|
|
206
|
+
/** Specifies the model for audio transcription. */
|
|
207
|
+
modelName: OpenAiAudioTranscriptionModelName;
|
|
208
|
+
/** The temperature for sampling during transcription; defaults to model-specific value. */
|
|
209
|
+
temperature?: number;
|
|
210
|
+
/** An optional prompt to guide the transcription process. */
|
|
211
|
+
prompt?: string;
|
|
212
|
+
}
|
|
193
213
|
/**
|
|
194
214
|
* Options for transcribing audio using the Whisper model.
|
|
195
215
|
* @category AI
|
|
196
216
|
*/
|
|
197
|
-
export interface
|
|
217
|
+
export interface WhisperTranscribeOptions extends BaseOpenAiAudioTranscribeOptions {
|
|
198
218
|
/** Specifies the Whisper-1 model for audio transcription. */
|
|
199
219
|
modelName: 'whisper-1';
|
|
200
220
|
/** The format of the transcription response; defaults to 'json'. */
|
|
201
221
|
responseFormat?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Options for transcribing audio using the GPT-4o model.
|
|
225
|
+
* @category AI
|
|
226
|
+
*/
|
|
227
|
+
export interface Gpt4oTranscribeOptions extends BaseOpenAiAudioTranscribeOptions {
|
|
228
|
+
/** Specifies the Whisper-1 model for audio transcription. */
|
|
229
|
+
modelName: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe';
|
|
230
|
+
/** The format of the transcription response; defaults to 'json'. */
|
|
231
|
+
responseFormat?: 'json';
|
|
206
232
|
}
|
|
207
233
|
/**
|
|
208
234
|
* Options for creating speech using OpenAI's text-to-speech models.
|
|
@@ -212,9 +238,11 @@ export interface OpenAiCreateSpeechOptions extends BaseAiAudioCreateSpeechOption
|
|
|
212
238
|
/** The OpenAI model to use for speech creation (e.g., 'tts-1' or 'tts-1-hd'). */
|
|
213
239
|
modelName: OpenAiAudioCreateSpeechModelName;
|
|
214
240
|
/** The voice to use for speech synthesis; defaults to model-specific value. */
|
|
215
|
-
voice?: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
241
|
+
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer' | 'verse';
|
|
216
242
|
/** The format of the audio output; defaults to 'mp3'. */
|
|
217
243
|
responseFormat?: OpenAiCreateSpeechFormat;
|
|
244
|
+
/** An optional prompt to guide the speech synthesis process. */
|
|
245
|
+
instructions?: string;
|
|
218
246
|
/** The speed of the speech; defaults to 1.0. */
|
|
219
247
|
speed?: number;
|
|
220
248
|
}
|
|
@@ -346,7 +374,7 @@ export interface BaseAiAgentChatOptions {
|
|
|
346
374
|
* The parameter values must be valid serializable JSON values.
|
|
347
375
|
* Overrides the stored value.
|
|
348
376
|
*/
|
|
349
|
-
functions?: Array<
|
|
377
|
+
functions?: Array<AiFunctionId | AiFunctionIdWithContext>;
|
|
350
378
|
/** Instructions to include with the prompt. */
|
|
351
379
|
instructions?: string;
|
|
352
380
|
/** A set of filters that will limit the context the AI can access. */
|
|
@@ -455,12 +483,15 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
|
455
483
|
auditLog?: boolean;
|
|
456
484
|
/** The default chat options for the agent, overridable by the user during use. */
|
|
457
485
|
options: AiAgentChatOptions<T>;
|
|
486
|
+
/** The embedding model name used by the agent. */
|
|
487
|
+
embeddingModelName: AiEmbeddingsModelName;
|
|
458
488
|
}
|
|
459
489
|
/**
|
|
460
490
|
* @category AI
|
|
461
491
|
*/
|
|
462
|
-
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
|
|
492
|
+
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options' | 'embeddingModelName'> & {
|
|
463
493
|
options?: AiAgentChatOptions;
|
|
494
|
+
embeddingModelName?: AiEmbeddingsModelName;
|
|
464
495
|
};
|
|
465
496
|
/**
|
|
466
497
|
* Options for observing the status of an AI agent operation.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/** Backend related public types that should be available on the client SDK */
|
|
2
|
+
/** A type alias for a string that represents an AI function ID. */
|
|
3
|
+
export type AiFunctionId = string;
|
|
2
4
|
/**
|
|
3
5
|
* A type alias for a service identifier.
|
|
4
6
|
* @category Queue
|
|
@@ -11,9 +13,9 @@ export type FunctionName = string;
|
|
|
11
13
|
/**
|
|
12
14
|
* Function name with contextual data, where the data must be serializable as JSON.
|
|
13
15
|
*/
|
|
14
|
-
export interface
|
|
15
|
-
/** The
|
|
16
|
-
name:
|
|
16
|
+
export interface AiFunctionIdWithContext {
|
|
17
|
+
/** The ID of the AI function as described in @aiFunction decorator. */
|
|
18
|
+
name: AiFunctionId;
|
|
17
19
|
/** A record of contextual data associated with the function call. */
|
|
18
20
|
context: Record<string, unknown>;
|
|
19
21
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppId } from './communication.public-types';
|
|
1
2
|
/**
|
|
2
3
|
* Request to search the web.
|
|
3
4
|
*/
|
|
@@ -37,3 +38,34 @@ export interface WebGetUrlContentResponse {
|
|
|
37
38
|
/** The content fetched from the URL in Markdown format. */
|
|
38
39
|
markdownText: string;
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Request to create a shortened URL.
|
|
43
|
+
*/
|
|
44
|
+
export interface WebShortUrlRequest {
|
|
45
|
+
/** The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). */
|
|
46
|
+
url: string;
|
|
47
|
+
/** The application ID that will own this shortened URL. */
|
|
48
|
+
appId: AppId;
|
|
49
|
+
/** Seconds to live for the shortened URL. If set to 0, the URL will never expire. */
|
|
50
|
+
secondsToLive?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Response with the newly created shortened URL.
|
|
54
|
+
*/
|
|
55
|
+
export interface WebShortUrlResponse {
|
|
56
|
+
/** The ID of the shortened URL. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** The full valid shortened URL. */
|
|
59
|
+
shortUrl: string;
|
|
60
|
+
/** The time when the shortened URL will expire. */
|
|
61
|
+
expiry: Date | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Request to delete a shortened URL.
|
|
65
|
+
*/
|
|
66
|
+
export interface WebShortUrlDeleteRequest {
|
|
67
|
+
/** The ID of the shortened URL to delete. */
|
|
68
|
+
id: string;
|
|
69
|
+
/** The application ID that owns the shortened URL. */
|
|
70
|
+
appId: AppId;
|
|
71
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { WebAiSearchResponse } from '../../internal-common/src/public-types/web.public-types';
|
|
1
|
+
import { WebAiSearchResponse, WebShortUrlResponse } from '../../internal-common/src/public-types/web.public-types';
|
|
2
2
|
/**
|
|
3
3
|
* WebClient provides methods to interact with web-related functionalities.
|
|
4
4
|
* @category Platform
|
|
5
5
|
*/
|
|
6
6
|
export declare class WebClient {
|
|
7
7
|
private readonly rpcManager;
|
|
8
|
+
private readonly region;
|
|
9
|
+
private readonly appId;
|
|
10
|
+
private readonly apiKey;
|
|
8
11
|
/**
|
|
9
12
|
* Search the web using AI. Returns a response containing Markdown text and cited URLs.
|
|
10
13
|
* @param query The keywords or query string to search for.
|
|
@@ -15,4 +18,24 @@ export declare class WebClient {
|
|
|
15
18
|
* @param url The URL to fetch content from.
|
|
16
19
|
*/
|
|
17
20
|
getUrlContent(url: string): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a shortened URL for the given URL.
|
|
23
|
+
*
|
|
24
|
+
* Defaults to a 30 day expiration if no expiry is provided via the `secondsToLive` field.
|
|
25
|
+
* If `secondsToLive` is set to 0, the URL will never expire.
|
|
26
|
+
*
|
|
27
|
+
* @param url The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or
|
|
28
|
+
* https://).
|
|
29
|
+
* @param secondsToLive Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 30
|
|
30
|
+
* days.
|
|
31
|
+
*/
|
|
32
|
+
createShortUrl(url: string, secondsToLive?: number): Promise<WebShortUrlResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Deletes a shortened URL by its ID.
|
|
35
|
+
*
|
|
36
|
+
* The ID is the unique identifier at the end of the shortened URL.
|
|
37
|
+
*
|
|
38
|
+
* @param id The ID of the shortened URL to delete.
|
|
39
|
+
*/
|
|
40
|
+
deleteShortUrl(id: string): Promise<void>;
|
|
18
41
|
}
|