@squidcloud/client 1.0.362 → 1.0.364
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 +16 -10
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +2 -2
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +77 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +2 -2
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +8 -8
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +14 -3
- package/dist/typescript-client/src/extraction-client.d.ts +6 -1
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -128,6 +128,10 @@ export type OpenAiReasoningChatModelName = (typeof OPENAI_REASONING_CHAT_MODEL_N
|
|
|
128
128
|
* @category AI
|
|
129
129
|
*/
|
|
130
130
|
export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
|
|
131
|
+
/**
|
|
132
|
+
* @category AI
|
|
133
|
+
*/
|
|
134
|
+
export type SquidAiModelName = (typeof SQUID_AI_MODEL_NAMES)[number];
|
|
131
135
|
/**
|
|
132
136
|
* @category AI
|
|
133
137
|
*/
|
|
@@ -392,7 +396,7 @@ export interface AiChatPromptQuotas {
|
|
|
392
396
|
* The base AI agent chat options, should not be used directly.
|
|
393
397
|
* @category AI
|
|
394
398
|
*/
|
|
395
|
-
export interface
|
|
399
|
+
export interface BaseAiChatOptions {
|
|
396
400
|
/** The maximum number of tokens to use when making the request to the AI model. Defaults to the max tokens the model can accept. */
|
|
397
401
|
maxTokens?: number;
|
|
398
402
|
/** A unique chat ID, if the same chat ID is used again and history is not disabled, it will continue the conversation. */
|
|
@@ -447,7 +451,7 @@ export interface BaseAiAgentChatOptions {
|
|
|
447
451
|
* Chat options specific to Gemini models, extending base options.
|
|
448
452
|
* @category AI
|
|
449
453
|
*/
|
|
450
|
-
export interface GeminiChatOptions extends
|
|
454
|
+
export interface GeminiChatOptions extends BaseAiChatOptions {
|
|
451
455
|
/** The Gemini model to use for the chat. */
|
|
452
456
|
model?: GeminiChatModelName;
|
|
453
457
|
/** Enables grounding with web search for more informed responses; defaults to false. */
|
|
@@ -457,7 +461,7 @@ export interface GeminiChatOptions extends BaseAiAgentChatOptions {
|
|
|
457
461
|
* Chat options specific to OpenAI models, extending base options.
|
|
458
462
|
* @category AI
|
|
459
463
|
*/
|
|
460
|
-
export interface OpenAiChatOptions extends
|
|
464
|
+
export interface OpenAiChatOptions extends BaseAiChatOptions {
|
|
461
465
|
/** The OpenAI model to use for the chat. */
|
|
462
466
|
model?: OpenAiChatModelName;
|
|
463
467
|
/** An array of file URLs to include in the chat context. */
|
|
@@ -466,7 +470,7 @@ export interface OpenAiChatOptions extends BaseAiAgentChatOptions {
|
|
|
466
470
|
/**
|
|
467
471
|
* @category AI
|
|
468
472
|
*/
|
|
469
|
-
export type
|
|
473
|
+
export type AiReasoningEffort = 'low' | 'medium' | 'high';
|
|
470
474
|
/**
|
|
471
475
|
* Chat options for OpenAI reasoning models, extending OpenAI options.
|
|
472
476
|
* @category AI
|
|
@@ -475,15 +479,17 @@ export interface OpenAiReasoningChatOptions extends OpenAiChatOptions {
|
|
|
475
479
|
/** The OpenAI reasoning model to use for the chat. */
|
|
476
480
|
model?: OpenAiReasoningChatModelName;
|
|
477
481
|
/** The level of reasoning effort to apply; defaults to model-specific value. */
|
|
478
|
-
reasoningEffort?:
|
|
482
|
+
reasoningEffort?: AiReasoningEffort;
|
|
479
483
|
}
|
|
480
484
|
/**
|
|
481
485
|
* Chat options specific to Anthropic models, extending base options.
|
|
482
486
|
* @category AI
|
|
483
487
|
*/
|
|
484
|
-
export interface AnthropicChatOptions extends
|
|
488
|
+
export interface AnthropicChatOptions extends BaseAiChatOptions {
|
|
485
489
|
/** The Anthropic model to use for the chat. */
|
|
486
490
|
model?: AnthropicChatModelName;
|
|
491
|
+
/** The level of reasoning effort to apply. Defaults to no reasoning. */
|
|
492
|
+
reasoningEffort?: AiReasoningEffort;
|
|
487
493
|
}
|
|
488
494
|
/**
|
|
489
495
|
* Optional settings for an AI session, allowing partial specification of identifiers.
|
|
@@ -504,12 +510,12 @@ export type AiSessionOptions = Partial<{
|
|
|
504
510
|
* the type is inferred from the provided overrideModel (or falls back to BaseAiAgentChatOptions).
|
|
505
511
|
* @category AI
|
|
506
512
|
*/
|
|
507
|
-
export type
|
|
513
|
+
export type AiChatOptions<T extends AiChatModelName | undefined = undefined> = T extends undefined ? BaseAiChatOptions | GeminiChatOptions | OpenAiReasoningChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiReasoningChatModelName ? OpenAiReasoningChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : T extends SquidAiModelName ? BaseAiChatOptions : never;
|
|
508
514
|
/**
|
|
509
515
|
* @category AI
|
|
510
516
|
*/
|
|
511
517
|
export type AllAiAgentChatOptions = {
|
|
512
|
-
[K in keyof
|
|
518
|
+
[K in keyof BaseAiChatOptions | keyof GeminiChatOptions | keyof OpenAiReasoningChatOptions | keyof OpenAiChatOptions | keyof AnthropicChatOptions]?: (K extends keyof BaseAiChatOptions ? BaseAiChatOptions[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);
|
|
513
519
|
};
|
|
514
520
|
/**
|
|
515
521
|
* A definition of an AI agent with its properties and default chat options.
|
|
@@ -529,7 +535,7 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
|
529
535
|
/** Enables audit logging for the agent's activities if true; defaults to false. */
|
|
530
536
|
auditLog?: boolean;
|
|
531
537
|
/** The default chat options for the agent, overridable by the user during use. */
|
|
532
|
-
options:
|
|
538
|
+
options: AiChatOptions<T>;
|
|
533
539
|
/** The embedding model name used by the agent. */
|
|
534
540
|
embeddingModelName: AiEmbeddingsModelName;
|
|
535
541
|
}
|
|
@@ -537,7 +543,7 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
|
537
543
|
* @category AI
|
|
538
544
|
*/
|
|
539
545
|
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options' | 'embeddingModelName'> & {
|
|
540
|
-
options?:
|
|
546
|
+
options?: AiChatOptions;
|
|
541
547
|
embeddingModelName?: AiEmbeddingsModelName;
|
|
542
548
|
};
|
|
543
549
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiAgentResponseFormat, OpenAiChatModelName,
|
|
1
|
+
import { AiAgentResponseFormat, OpenAiChatModelName, AiReasoningEffort } from './ai-agent.public-types';
|
|
2
2
|
import { AiFunctionId } from './backend.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* The type of assistant tool.
|
|
@@ -19,7 +19,7 @@ export interface QueryAssistantOptions {
|
|
|
19
19
|
/** The OpenAI chat model to use for the assistant, if specified. */
|
|
20
20
|
model?: OpenAiChatModelName;
|
|
21
21
|
/** The level of reasoning effort to apply, as defined by OpenAI. */
|
|
22
|
-
reasoningEffort?:
|
|
22
|
+
reasoningEffort?: AiReasoningEffort;
|
|
23
23
|
/** Custom instructions to guide the assistant's behavior, if provided. */
|
|
24
24
|
instructions?: string;
|
|
25
25
|
}
|
|
@@ -92,3 +92,80 @@ export interface ExtractDataFromDocumentResponse {
|
|
|
92
92
|
*/
|
|
93
93
|
pages: Array<ExtractDataFromDocumentPage>;
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Create PDF request type.
|
|
97
|
+
*/
|
|
98
|
+
export type CreatePdfType = 'html' | 'url';
|
|
99
|
+
/** The type of output options to apply when creating a PDF document. */
|
|
100
|
+
export type CreatePdfOutputOptionsType = 'format' | 'dimensions';
|
|
101
|
+
/** Base interface for PDF output options. This is used to define the type of output options. */
|
|
102
|
+
export interface BaseCreatePdfOutputOptions {
|
|
103
|
+
/** The type of output options, either 'format' or 'dimensions'. */
|
|
104
|
+
type: CreatePdfOutputOptionsType;
|
|
105
|
+
}
|
|
106
|
+
/** Output options by format */
|
|
107
|
+
export interface CreatePdfOutputFormatOptions extends BaseCreatePdfOutputOptions {
|
|
108
|
+
/** The type of output options, always 'format' for this interface. */
|
|
109
|
+
type: 'format';
|
|
110
|
+
/** The type of formatting, always 'format' for this interface. */
|
|
111
|
+
format: 'letter' | 'legal' | 'tabloid' | 'ledger' | 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6';
|
|
112
|
+
}
|
|
113
|
+
/** Output options by custom dimensions */
|
|
114
|
+
export interface CreatePdfOutputDimensionsOptions extends BaseCreatePdfOutputOptions {
|
|
115
|
+
/** The type of formatting, always 'dimensions' for this interface. */
|
|
116
|
+
type: 'dimensions';
|
|
117
|
+
/** The width of the PDF document in pixels. */
|
|
118
|
+
width: number;
|
|
119
|
+
/** The height of the PDF document in pixels. */
|
|
120
|
+
height: number;
|
|
121
|
+
}
|
|
122
|
+
/** Combined formatting options for creating a PDF document. */
|
|
123
|
+
export type CreatePdfOutputOptions = CreatePdfOutputFormatOptions | CreatePdfOutputDimensionsOptions;
|
|
124
|
+
/**
|
|
125
|
+
* Base request for creating a PDF document.
|
|
126
|
+
*/
|
|
127
|
+
export interface BaseCreatePdfRequest {
|
|
128
|
+
/**
|
|
129
|
+
* The type of PDF creation to perform, either from HTML or a URL.
|
|
130
|
+
*/
|
|
131
|
+
type: CreatePdfType;
|
|
132
|
+
/** The formatting options for the PDF document. Can be either a predefined format (like 'letter') or custom dimensions. */
|
|
133
|
+
outputOptions?: CreatePdfOutputOptions;
|
|
134
|
+
/** Optional title for the PDF document. */
|
|
135
|
+
title?: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Request payload for creating a PDF from a URL.
|
|
139
|
+
*/
|
|
140
|
+
export interface CreatePdfFromUrlRequest extends BaseCreatePdfRequest {
|
|
141
|
+
/** The type of PDF creation, always 'url' for this request. */
|
|
142
|
+
type: 'url';
|
|
143
|
+
/**
|
|
144
|
+
* The URL of the webpage to convert into a PDF.
|
|
145
|
+
*/
|
|
146
|
+
url: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Request payload for creating a PDF from HTML content.
|
|
150
|
+
*/
|
|
151
|
+
export interface CreatePdfFromHtmlRequest extends BaseCreatePdfRequest {
|
|
152
|
+
/** The type of PDF creation, always 'html' for this request. */
|
|
153
|
+
type: 'html';
|
|
154
|
+
/** The HTML content to convert into a PDF. Should not contain <html>, <body>, <head>, should just include the inner HTML */
|
|
155
|
+
innerHtml: string;
|
|
156
|
+
/** Optional URL for CSS styles to apply to the HTML content. */
|
|
157
|
+
cssUrl?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Combined request type for creating a PDF, which can be either from a URL or HTML content.
|
|
161
|
+
*/
|
|
162
|
+
export type CreatePdfRequest = CreatePdfFromUrlRequest | CreatePdfFromHtmlRequest;
|
|
163
|
+
/**
|
|
164
|
+
* Response type for the PDF creation operation, containing the URL of the generated PDF.
|
|
165
|
+
*/
|
|
166
|
+
export interface CreatePdfResponse {
|
|
167
|
+
/**
|
|
168
|
+
* The publicly accessible URL where the generated PDF can be downloaded.
|
|
169
|
+
*/
|
|
170
|
+
url: string;
|
|
171
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentContextRequest, AiAgent,
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiChatOptions, AiAgentContext, AiAudioCreateSpeechOptions, AiChatModelName, AiContextMetadata, AiContextMetadataFilter, AiEmbeddingsModelName, AiGenerateImageOptions, AiSearchOptions, AiSearchResultChunk, AllAiAgentChatOptions } from '../public-types/ai-agent.public-types';
|
|
2
2
|
import { AiAgentId, AppId, ClientRequestId } from '../public-types/communication.public-types';
|
|
3
3
|
import { AiFunctionId } from '../public-types/backend.public-types';
|
|
4
4
|
type ModelDataType = {
|
|
@@ -24,7 +24,7 @@ export interface AiGenerateImageRequest {
|
|
|
24
24
|
export interface AiAskQuestionInternalRequest {
|
|
25
25
|
appId: AppId;
|
|
26
26
|
prompt: string;
|
|
27
|
-
options:
|
|
27
|
+
options: AiChatOptions;
|
|
28
28
|
}
|
|
29
29
|
export interface AiAskQuestionInternalResponse {
|
|
30
30
|
answer: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AgentContextRequest, AiAgent,
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiAgentContext, AiChatModelName, AiConnectedAgentMetadata, AiObserveStatusOptions, AiSearchOptions, AiSearchResultChunk, AiStatusMessage, AiTranscribeAndAskResponse, GuardrailsOptions, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import {
|
|
3
|
+
import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for creating or updating an AI agent.
|
|
6
6
|
* Excludes the `id` field, as it is derived from the agent instance.
|
|
@@ -90,11 +90,11 @@ export declare class AiAgentReference {
|
|
|
90
90
|
/**
|
|
91
91
|
* Sends a prompt to the agent and receives streamed text responses.
|
|
92
92
|
*/
|
|
93
|
-
chat(prompt: string, options?:
|
|
93
|
+
chat<T extends AiChatModelName | undefined>(prompt: string, options?: AiChatOptionsWithoutVoice<T>): Observable<string>;
|
|
94
94
|
/**
|
|
95
95
|
* Transcribes the given file and performs a chat interaction.
|
|
96
96
|
*/
|
|
97
|
-
transcribeAndChat(fileToTranscribe: File, options?:
|
|
97
|
+
transcribeAndChat(fileToTranscribe: File, options?: AiChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
|
|
98
98
|
/**
|
|
99
99
|
* Performs a semantic search using the agent's knowledge base.
|
|
100
100
|
*/
|
|
@@ -102,7 +102,7 @@ export declare class AiAgentReference {
|
|
|
102
102
|
/**
|
|
103
103
|
* Sends a prompt and receives a full string response.
|
|
104
104
|
*/
|
|
105
|
-
ask(prompt: string, options?:
|
|
105
|
+
ask<T extends AiChatModelName | undefined = undefined>(prompt: string, options?: AiAskOptions<T>): Promise<string>;
|
|
106
106
|
/**
|
|
107
107
|
* Observes live status messages from the agent.
|
|
108
108
|
*/
|
|
@@ -110,15 +110,15 @@ export declare class AiAgentReference {
|
|
|
110
110
|
/**
|
|
111
111
|
* Transcribes audio and sends it to the agent for response.
|
|
112
112
|
*/
|
|
113
|
-
transcribeAndAsk(fileToTranscribe: File, options?:
|
|
113
|
+
transcribeAndAsk<T extends AiChatModelName | undefined>(fileToTranscribe: File, options?: AiAskOptions<T>): Promise<AiTranscribeAndAskResponse>;
|
|
114
114
|
/**
|
|
115
115
|
* Transcribes audio and gets both text and voice response from the agent.
|
|
116
116
|
*/
|
|
117
|
-
transcribeAndAskWithVoiceResponse(fileToTranscribe: File, options?:
|
|
117
|
+
transcribeAndAskWithVoiceResponse<T extends AiChatModelName | undefined>(fileToTranscribe: File, options?: AiAskOptionsWithVoice<T>): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
118
118
|
/**
|
|
119
119
|
* Sends a prompt and gets both text and voice response from the agent.
|
|
120
120
|
*/
|
|
121
|
-
askWithVoiceResponse(prompt: string, options?:
|
|
121
|
+
askWithVoiceResponse<T extends AiChatModelName | undefined>(prompt: string, options?: AiAskOptionsWithVoice<T>): Promise<AskWithVoiceResponse>;
|
|
122
122
|
private askInternal;
|
|
123
123
|
private createStatusSubject;
|
|
124
124
|
private chatInternal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AiChatModelName, AiChatOptions } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
/**
|
|
4
4
|
* Response format for transcribing audio and generating a chat response.
|
|
@@ -39,9 +39,20 @@ export interface AskWithVoiceResponse {
|
|
|
39
39
|
* Chat options that exclude voice-specific configurations.
|
|
40
40
|
* @category AI
|
|
41
41
|
*/
|
|
42
|
-
export type
|
|
42
|
+
export type AiChatOptionsWithoutVoice<T extends AiChatModelName | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions'> & {
|
|
43
|
+
model?: T;
|
|
44
|
+
};
|
|
43
45
|
/**
|
|
44
46
|
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
|
|
45
47
|
* @category AI
|
|
46
48
|
*/
|
|
47
|
-
export type
|
|
49
|
+
export type AiAskOptions<T extends AiChatModelName | undefined = undefined> = Omit<AiChatOptions<T>, 'voiceOptions' | 'smoothTyping'> & {
|
|
50
|
+
model?: T;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Options for AI-generated responses that include voice-specific settings but excludes smooth typing.
|
|
54
|
+
* @category AI
|
|
55
|
+
*/
|
|
56
|
+
export type AiAskOptionsWithVoice<T extends AiChatModelName | undefined = undefined> = Omit<AiChatOptions<T>, 'smoothTyping'> & {
|
|
57
|
+
model?: T;
|
|
58
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtractDataFromDocumentOptions, ExtractDataFromDocumentResponse } from '../../internal-common/src/public-types/extraction.public-types';
|
|
1
|
+
import { CreatePdfRequest, CreatePdfResponse, ExtractDataFromDocumentOptions, ExtractDataFromDocumentResponse } from '../../internal-common/src/public-types/extraction.public-types';
|
|
2
2
|
/**
|
|
3
3
|
* ExtractionClient provides methods for extracting structured data
|
|
4
4
|
* from document files using AI-driven processing.
|
|
@@ -22,4 +22,9 @@ export declare class ExtractionClient {
|
|
|
22
22
|
* @returns A promise that resolves with the extracted document data.
|
|
23
23
|
*/
|
|
24
24
|
extractDataFromDocumentUrl(url: string, options?: ExtractDataFromDocumentOptions): Promise<ExtractDataFromDocumentResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a PDF document from the provided request parameters.
|
|
27
|
+
* @param request - The request containing details for PDF creation, such as content or url.
|
|
28
|
+
*/
|
|
29
|
+
createPdf(request: CreatePdfRequest): Promise<CreatePdfResponse>;
|
|
25
30
|
}
|