@squidcloud/client 1.0.441 → 1.0.443
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 +4 -4
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +7 -7
- package/dist/internal-common/src/types/management-api-key.types.d.ts +4 -4
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +7 -8
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +4 -5
- package/dist/typescript-client/src/management-client.d.ts +41 -9
- package/dist/typescript-client/src/squid.d.ts +2 -2
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -324,7 +324,7 @@ export interface AiAgentExecutionPlanOptions {
|
|
|
324
324
|
/** Whether to enable an execution plan for the agent. */
|
|
325
325
|
enabled: boolean;
|
|
326
326
|
/** The model to use for the execution plan - defaults to the model used by the agent. */
|
|
327
|
-
model?:
|
|
327
|
+
model?: AiChatModelSelection;
|
|
328
328
|
/** In case the model supports reasoning, this will control the level of effort - defaults to `high`. */
|
|
329
329
|
reasoningEffort?: AiReasoningEffort;
|
|
330
330
|
/**
|
|
@@ -557,7 +557,7 @@ export interface AnthropicChatOptions extends BaseAiChatOptions {
|
|
|
557
557
|
* the type is inferred from the provided overrideModel (or falls back to BaseAiAgentChatOptions).
|
|
558
558
|
* @category AI
|
|
559
559
|
*/
|
|
560
|
-
export type AiChatOptions<T extends
|
|
560
|
+
export type AiChatOptions<T extends AiChatModelSelection | undefined = undefined> = T extends undefined ? BaseAiChatOptions | GeminiChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : T extends GrokChatModelName ? GrokChatOptions : BaseAiChatOptions;
|
|
561
561
|
/**
|
|
562
562
|
* @category AI
|
|
563
563
|
*/
|
|
@@ -568,7 +568,7 @@ export type AllAiAgentChatOptions = {
|
|
|
568
568
|
* A definition of an AI agent with its properties and default chat options.
|
|
569
569
|
* @category AI
|
|
570
570
|
*/
|
|
571
|
-
export interface AiAgent<T extends
|
|
571
|
+
export interface AiAgent<T extends AiChatModelSelection | undefined = undefined> {
|
|
572
572
|
/** The unique identifier of the AI agent. */
|
|
573
573
|
id: AiAgentId;
|
|
574
574
|
/** The date and time the agent was created. */
|
|
@@ -773,7 +773,7 @@ export interface FileContextRequest extends BaseContextRequest {
|
|
|
773
773
|
/** The minimum size for extracted images, if applicable. */
|
|
774
774
|
imageMinSizePixels?: number;
|
|
775
775
|
/** The AI model to use for extraction, if specified. */
|
|
776
|
-
extractionModel?:
|
|
776
|
+
extractionModel?: AiChatModelSelection;
|
|
777
777
|
/** General options for how to process the file. */
|
|
778
778
|
options?: AiContextFileOptions;
|
|
779
779
|
/** The preferred method for extracting data from the document. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AgentContextRequest, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
|
-
import {
|
|
1
|
+
import { AgentContextRequest, AiChatModelSelection, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
|
+
import { AiEmbeddingsModelName, AiRerankProvider } from './ai-common.public-types';
|
|
3
3
|
import { AiContextId, AiKnowledgeBaseId, AppId } from './communication.public-types';
|
|
4
4
|
import { DocumentExtractionMethod } from './extraction.public-types';
|
|
5
5
|
/**
|
|
@@ -18,7 +18,7 @@ export interface AiKnowledgeBase {
|
|
|
18
18
|
/** The embedding model name that should be used for this knowledge base.*/
|
|
19
19
|
embeddingModel: AiEmbeddingsModelName;
|
|
20
20
|
/** The model name that should be used when asking questions of this knowledge base. */
|
|
21
|
-
chatModel:
|
|
21
|
+
chatModel: AiChatModelSelection;
|
|
22
22
|
/** The timestamp the knowledge base was last updated */
|
|
23
23
|
updatedAt: Date;
|
|
24
24
|
}
|
|
@@ -125,7 +125,7 @@ export interface AiKnowledgeBaseChatOptions {
|
|
|
125
125
|
/** How many chunks to look over. Defaults to 100 */
|
|
126
126
|
chunkLimit?: number;
|
|
127
127
|
/** Which chat model to use when asking the question */
|
|
128
|
-
chatModel?:
|
|
128
|
+
chatModel?: AiChatModelSelection;
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* @category AI
|
|
@@ -216,7 +216,7 @@ export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseCo
|
|
|
216
216
|
/** The minimum size for extracted images, if applicable. */
|
|
217
217
|
imageMinSizePixels?: number;
|
|
218
218
|
/** The AI model to use for extraction, if specified. */
|
|
219
|
-
imageExtractionModel?:
|
|
219
|
+
imageExtractionModel?: AiChatModelSelection;
|
|
220
220
|
/** General options for how to process the file. */
|
|
221
221
|
options?: AiKnowledgeBaseContextFileOptions;
|
|
222
222
|
/** The preferred method for extracting data from the document. */
|
|
@@ -262,7 +262,7 @@ export interface AiKnowledgeBaseSearchOptions {
|
|
|
262
262
|
/** How many chunks to look over. Defaults to 100 */
|
|
263
263
|
chunkLimit?: number;
|
|
264
264
|
/** Which chat model to use when asking the question */
|
|
265
|
-
chatModel?:
|
|
265
|
+
chatModel?: AiChatModelSelection;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* A single chunk of data returned from an AI search operation.
|
|
@@ -320,7 +320,7 @@ export interface BaseAiKnowledgeBaseSearchContextsRequest {
|
|
|
320
320
|
/** Whether to rerank the results with AI and provide reasoning - defaults to true */
|
|
321
321
|
rerank?: boolean;
|
|
322
322
|
/** Which chat model to use when doing reranking */
|
|
323
|
-
chatModel?:
|
|
323
|
+
chatModel?: AiChatModelSelection;
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
326
326
|
* Request structure for searching AI contexts in the AiKnowledgeBase with prompt.
|
|
@@ -46,10 +46,10 @@ export interface CreateManagementApiKeyRequest {
|
|
|
46
46
|
* @category ManagementApiKey
|
|
47
47
|
*/
|
|
48
48
|
export interface CreateManagementApiKeyResponse {
|
|
49
|
-
/** The created key
|
|
50
|
-
key: ManagementApiKey
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
/** The created key metadata */
|
|
50
|
+
key: ManagementApiKey;
|
|
51
|
+
/** The raw key value (only returned once during creation) */
|
|
52
|
+
keyValue: string;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Request to update a management API key's status.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { AiAgent, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
|
-
import { AiChatModelName } from '../../../internal-common/src/public-types/ai-common.public-types';
|
|
4
3
|
import { JobId } from '../../../internal-common/src/public-types/job.public-types';
|
|
5
4
|
import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
|
|
6
5
|
import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
@@ -96,7 +95,7 @@ export declare class AiAgentReference {
|
|
|
96
95
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
97
96
|
* knows it can look up the job’s status.
|
|
98
97
|
*/
|
|
99
|
-
chat<T extends
|
|
98
|
+
chat<T extends AiChatModelSelection | undefined>(prompt: string, options?: AiChatOptionsWithoutVoice<T>, jobId?: JobId): Observable<string>;
|
|
100
99
|
/**
|
|
101
100
|
* Transcribes the given file and performs a chat interaction.
|
|
102
101
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
@@ -114,7 +113,7 @@ export declare class AiAgentReference {
|
|
|
114
113
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
115
114
|
* knows it can look up the job’s status.
|
|
116
115
|
*/
|
|
117
|
-
ask<T extends
|
|
116
|
+
ask<T extends AiChatModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
|
|
118
117
|
/**
|
|
119
118
|
* Sends a prompt and returns the string response and file annotations.
|
|
120
119
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -123,7 +122,7 @@ export declare class AiAgentReference {
|
|
|
123
122
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
124
123
|
* knows it can look up the job’s status.
|
|
125
124
|
*/
|
|
126
|
-
askWithAnnotations<T extends
|
|
125
|
+
askWithAnnotations<T extends AiChatModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<AskResponse>;
|
|
127
126
|
/**
|
|
128
127
|
* Sends a prompt and not wait for the result - the result can be tracked using the job ID
|
|
129
128
|
* (`squid.jobs().awaitJob(jobId)` or `squid.jobs().getJob(jobId)).
|
|
@@ -134,7 +133,7 @@ export declare class AiAgentReference {
|
|
|
134
133
|
to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.
|
|
135
134
|
* @param options Optional parameters for the AI ask request.
|
|
136
135
|
*/
|
|
137
|
-
askAsync<T extends
|
|
136
|
+
askAsync<T extends AiChatModelSelection | undefined = undefined>(prompt: string, jobId: JobId, options?: AiAskOptions<T>): Promise<void>;
|
|
138
137
|
/**
|
|
139
138
|
* Observes live status messages from the agent.
|
|
140
139
|
* @param jobId The job ID to filter status updates for a specific job. If not provided, all status updates for the agent are observed.
|
|
@@ -153,7 +152,7 @@ export declare class AiAgentReference {
|
|
|
153
152
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
154
153
|
* knows it can look up the job’s status.
|
|
155
154
|
*/
|
|
156
|
-
transcribeAndAsk<T extends
|
|
155
|
+
transcribeAndAsk<T extends AiChatModelSelection | undefined>(fileToTranscribe: File, options?: AiAskOptions<T>, jobId?: JobId): Promise<AiTranscribeAndAskResponse>;
|
|
157
156
|
/**
|
|
158
157
|
* Transcribes audio and gets both text and voice response from the agent.
|
|
159
158
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
@@ -162,7 +161,7 @@ export declare class AiAgentReference {
|
|
|
162
161
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
163
162
|
* knows it can look up the job’s status.
|
|
164
163
|
*/
|
|
165
|
-
transcribeAndAskWithVoiceResponse<T extends
|
|
164
|
+
transcribeAndAskWithVoiceResponse<T extends AiChatModelSelection | undefined>(fileToTranscribe: File, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
166
165
|
/**
|
|
167
166
|
* Sends a prompt and gets both text and voice response from the agent.
|
|
168
167
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -171,7 +170,7 @@ export declare class AiAgentReference {
|
|
|
171
170
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
172
171
|
* knows it can look up the job’s status.
|
|
173
172
|
*/
|
|
174
|
-
askWithVoiceResponse<T extends
|
|
173
|
+
askWithVoiceResponse<T extends AiChatModelSelection | undefined>(prompt: string, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<AskWithVoiceResponse>;
|
|
175
174
|
/**
|
|
176
175
|
* Sets a value at a specific path within the agent's options.
|
|
177
176
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAnnotation, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
|
-
import { AiChatModelName } from '../../../internal-common/src/public-types/ai-common.public-types';
|
|
2
|
+
import { AiAnnotation, AiChatModelSelection, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
4
3
|
/**
|
|
5
4
|
* Response format for transcribing audio and generating a chat response.
|
|
6
5
|
* Contains the transcribed text and a stream of AI-generated responses.
|
|
@@ -50,20 +49,20 @@ export interface AskWithVoiceResponse {
|
|
|
50
49
|
* Chat options that exclude voice-specific configurations.
|
|
51
50
|
* @category AI
|
|
52
51
|
*/
|
|
53
|
-
export type AiChatOptionsWithoutVoice<T extends
|
|
52
|
+
export type AiChatOptionsWithoutVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions'> & {
|
|
54
53
|
model?: T;
|
|
55
54
|
};
|
|
56
55
|
/**
|
|
57
56
|
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
|
|
58
57
|
* @category AI
|
|
59
58
|
*/
|
|
60
|
-
export type AiAskOptions<T extends
|
|
59
|
+
export type AiAskOptions<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions' | 'smoothTyping'> & {
|
|
61
60
|
model?: T;
|
|
62
61
|
};
|
|
63
62
|
/**
|
|
64
63
|
* Options for AI-generated responses that include voice-specific settings but excludes smooth typing.
|
|
65
64
|
* @category AI
|
|
66
65
|
*/
|
|
67
|
-
export type AiAskOptionsWithVoice<T extends
|
|
66
|
+
export type AiAskOptionsWithVoice<T extends AiChatModelSelection | undefined = undefined> = Omit<AiChatOptions<T>, 'smoothTyping'> & {
|
|
68
67
|
model?: T;
|
|
69
68
|
};
|
|
@@ -7,7 +7,7 @@ export interface ManagementClientOptions {
|
|
|
7
7
|
/** The management API key (starts with 'squid_mgmt_') */
|
|
8
8
|
apiKey: string;
|
|
9
9
|
/** The Squid region to connect to */
|
|
10
|
-
|
|
10
|
+
consoleRegion: SquidRegion;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Request to create a new organization.
|
|
@@ -44,14 +44,30 @@ export interface ManagementCreateApplicationRequest {
|
|
|
44
44
|
export interface ManagementCreateApplicationResponse {
|
|
45
45
|
/** The ID of the created application */
|
|
46
46
|
appId: string;
|
|
47
|
+
/** The API key for the dev environment */
|
|
48
|
+
devApiKey: string;
|
|
49
|
+
/** The API key for the prod environment */
|
|
50
|
+
prodApiKey: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Request to rename an organization.
|
|
54
|
+
* @category ManagementClient
|
|
55
|
+
*/
|
|
56
|
+
export interface ManagementRenameOrganizationRequest {
|
|
57
|
+
/** The ID of the organization to rename */
|
|
58
|
+
organizationId: string;
|
|
59
|
+
/** New name for the organization (2-50 characters) */
|
|
60
|
+
name: string;
|
|
47
61
|
}
|
|
48
62
|
/**
|
|
49
|
-
* Request to
|
|
63
|
+
* Request to rename an application.
|
|
50
64
|
* @category ManagementClient
|
|
51
65
|
*/
|
|
52
|
-
export interface
|
|
53
|
-
/** The ID of the application to
|
|
66
|
+
export interface ManagementRenameApplicationRequest {
|
|
67
|
+
/** The ID of the application to rename */
|
|
54
68
|
appId: string;
|
|
69
|
+
/** New name for the application */
|
|
70
|
+
name: string;
|
|
55
71
|
}
|
|
56
72
|
/**
|
|
57
73
|
* Client for programmatic management of Squid organizations and applications.
|
|
@@ -77,14 +93,14 @@ export interface ManagementDeleteApplicationRequest {
|
|
|
77
93
|
* });
|
|
78
94
|
*
|
|
79
95
|
* // Delete an application
|
|
80
|
-
* await client.deleteApplication(
|
|
96
|
+
* await client.deleteApplication('my-app-id');
|
|
81
97
|
* ```
|
|
82
98
|
*
|
|
83
99
|
* @category ManagementClient
|
|
84
100
|
*/
|
|
85
101
|
export declare class ManagementClient {
|
|
86
102
|
private readonly apiKey;
|
|
87
|
-
private readonly
|
|
103
|
+
private readonly consoleRegion;
|
|
88
104
|
/**
|
|
89
105
|
* Creates a new ManagementClient.
|
|
90
106
|
*
|
|
@@ -106,7 +122,7 @@ export declare class ManagementClient {
|
|
|
106
122
|
* Requires the user to be an admin in the target organization.
|
|
107
123
|
*
|
|
108
124
|
* @param request - The application creation request
|
|
109
|
-
* @returns The created application's ID
|
|
125
|
+
* @returns The created application's ID and API keys
|
|
110
126
|
* @throws Error if user is not admin or organization quota reached
|
|
111
127
|
*/
|
|
112
128
|
createApplication(request: ManagementCreateApplicationRequest): Promise<ManagementCreateApplicationResponse>;
|
|
@@ -114,8 +130,24 @@ export declare class ManagementClient {
|
|
|
114
130
|
* Deletes an application.
|
|
115
131
|
* Requires the user to be an admin in the application's organization.
|
|
116
132
|
*
|
|
117
|
-
* @param
|
|
133
|
+
* @param appId - The ID of the application to delete
|
|
134
|
+
* @throws Error if user is not admin or application not found
|
|
135
|
+
*/
|
|
136
|
+
deleteApplication(appId: string): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Renames an organization.
|
|
139
|
+
* Requires the user to be an admin in the organization.
|
|
140
|
+
*
|
|
141
|
+
* @param request - The rename request containing organizationId and new name
|
|
142
|
+
* @throws Error if user is not admin or organization not found
|
|
143
|
+
*/
|
|
144
|
+
renameOrganization(request: ManagementRenameOrganizationRequest): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Renames an application.
|
|
147
|
+
* Requires the user to be an admin in the application's organization.
|
|
148
|
+
*
|
|
149
|
+
* @param request - The rename request containing appId and new name
|
|
118
150
|
* @throws Error if user is not admin or application not found
|
|
119
151
|
*/
|
|
120
|
-
|
|
152
|
+
renameApplication(request: ManagementRenameApplicationRequest): Promise<void>;
|
|
121
153
|
}
|
|
@@ -149,6 +149,8 @@ export declare class Squid {
|
|
|
149
149
|
* Returns the application ID of the current Squid instance.
|
|
150
150
|
*/
|
|
151
151
|
get appId(): AppId;
|
|
152
|
+
/** Set to true if the client was destructured. */
|
|
153
|
+
get isDestructed(): boolean;
|
|
152
154
|
/**
|
|
153
155
|
* Returns the global Squid instance with the given options, creating a new instance if one with the same options
|
|
154
156
|
* does not exist.
|
|
@@ -379,8 +381,6 @@ export declare class Squid {
|
|
|
379
381
|
* @returns A promise that resolves when the destruct process is complete.
|
|
380
382
|
*/
|
|
381
383
|
destruct(): Promise<void>;
|
|
382
|
-
/** Set to true if the client was destructured. */
|
|
383
|
-
get isDestructed(): boolean;
|
|
384
384
|
/** Provides information about the connection to the Squid Server. */
|
|
385
385
|
connectionDetails(): ConnectionDetails;
|
|
386
386
|
/** Returns the notification client for handling (publishing and receiving) custom messages. */
|