@squidcloud/client 1.0.277 → 1.0.279
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-chatbot.public-types.d.ts +54 -6
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +118 -4
- package/dist/internal-common/src/utils/metric-utils.d.ts +3 -3
- package/dist/typescript-client/src/{ai-chatbot-client.d.ts → ai-agent-client.d.ts} +48 -11
- package/dist/typescript-client/src/ai-audio-client.d.ts +2 -1
- package/dist/typescript-client/src/ai.types.d.ts +2 -1
- package/dist/typescript-client/src/file-utils.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +2 -1
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -10,28 +10,49 @@ export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-
|
|
|
10
10
|
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
11
11
|
/** The supported AI image generation model names. */
|
|
12
12
|
export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"];
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
14
|
+
export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
15
|
+
export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "tts-1", "tts-1-hd"];
|
|
14
16
|
export declare const STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"];
|
|
15
17
|
export declare const AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusion-core"];
|
|
16
|
-
export declare const
|
|
18
|
+
export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
|
|
19
|
+
export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
|
|
20
|
+
export declare const OPEN_AI_CREATE_SPEECH_FORMATS: readonly ["mp3", "opus", "aac", "flac", "wav", "pcm"];
|
|
17
21
|
export type AiChatModelName = (typeof AI_CHAT_MODEL_NAMES)[number];
|
|
18
22
|
export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
|
|
19
23
|
export type OpenAiChatModelName = (typeof OPENAI_CHAT_MODEL_NAMES)[number];
|
|
20
24
|
export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
|
|
21
25
|
export type AnthropicChatModelName = (typeof ANTHROPIC_CHAT_MODEL_NAMES)[number];
|
|
22
26
|
export type AiImageModelName = (typeof AI_IMAGE_MODEL_NAMES)[number];
|
|
23
|
-
export type
|
|
27
|
+
export type AiAudioTranscriptionModelName = (typeof AI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
28
|
+
export type AiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
29
|
+
export type AiAudioModelName = (typeof OPENAI_AUDIO_MODEL_NAMES)[number];
|
|
24
30
|
export type OpenAiImageModelName = (typeof OPENAI_IMAGE_MODEL_NAMES)[number];
|
|
25
|
-
export type
|
|
31
|
+
export type OpenAiAudioTranscriptionModelName = (typeof OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
32
|
+
export type OpenAiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
33
|
+
export type OpenAiCreateSpeechFormat = (typeof OPEN_AI_CREATE_SPEECH_FORMATS)[number];
|
|
26
34
|
export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[number];
|
|
27
35
|
export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions;
|
|
28
36
|
export type AiAudioTranscribeOptions = WhisperOptions;
|
|
37
|
+
export type AiAudioCreateSpeechOptions = OpenAiCreateSpeechOptions;
|
|
29
38
|
export type VectorDbType = 'pinecone' | 'postgres';
|
|
39
|
+
export interface AiAudioCreateSpeechResponse {
|
|
40
|
+
mimeType: string;
|
|
41
|
+
extension: string;
|
|
42
|
+
base64File: string;
|
|
43
|
+
}
|
|
44
|
+
export interface AiAudioCreateSpeechRequest {
|
|
45
|
+
input: string;
|
|
46
|
+
options: AiAudioCreateSpeechOptions;
|
|
47
|
+
}
|
|
30
48
|
export interface BaseAiGenerateImageOptions {
|
|
31
49
|
modelName: AiImageModelName;
|
|
32
50
|
}
|
|
33
51
|
export interface BaseAiAudioTranscribeOptions {
|
|
34
|
-
modelName:
|
|
52
|
+
modelName: AiAudioTranscriptionModelName;
|
|
53
|
+
}
|
|
54
|
+
export interface BaseAiAudioCreateSpeechOptions {
|
|
55
|
+
modelName: AiAudioCreateSpeechModelName;
|
|
35
56
|
}
|
|
36
57
|
export interface DallEOptions extends BaseAiGenerateImageOptions {
|
|
37
58
|
modelName: 'dall-e-3';
|
|
@@ -45,6 +66,12 @@ export interface WhisperOptions extends BaseAiAudioTranscribeOptions {
|
|
|
45
66
|
temperature?: number;
|
|
46
67
|
prompt?: string;
|
|
47
68
|
}
|
|
69
|
+
export interface OpenAiCreateSpeechOptions extends BaseAiAudioCreateSpeechOptions {
|
|
70
|
+
modelName: OpenAiAudioCreateSpeechModelName;
|
|
71
|
+
voice?: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
72
|
+
responseFormat?: OpenAiCreateSpeechFormat;
|
|
73
|
+
speed?: number;
|
|
74
|
+
}
|
|
48
75
|
export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
|
|
49
76
|
modelName: 'stable-diffusion-core';
|
|
50
77
|
aspectRatio?: '16:9' | '1:1' | '21:9' | '2:3' | '3:2' | '4:5' | '5:4' | '9:16' | '9:21';
|
|
@@ -89,6 +116,27 @@ export interface AiChatbotChatOptions {
|
|
|
89
116
|
instructions?: Array<string>;
|
|
90
117
|
/** A set of filters that will limit the context the AI can access */
|
|
91
118
|
contextMetadataFilter?: AiContextMetadataFilter;
|
|
119
|
+
/** The options to use for the response in voice */
|
|
120
|
+
voiceOptions?: AiAudioCreateSpeechOptions;
|
|
121
|
+
}
|
|
122
|
+
export interface AiAskResponse {
|
|
123
|
+
responseString: string;
|
|
124
|
+
}
|
|
125
|
+
export interface AiTranscribeAndAskResponse {
|
|
126
|
+
responseString: string;
|
|
127
|
+
transcribedPrompt: string;
|
|
128
|
+
}
|
|
129
|
+
export interface AiAskWithVoiceResponse {
|
|
130
|
+
responseString: string;
|
|
131
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
132
|
+
}
|
|
133
|
+
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
134
|
+
transcribedPrompt: string;
|
|
135
|
+
responseString: string;
|
|
136
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
137
|
+
}
|
|
138
|
+
export interface AiTranscribeAndChatResponse {
|
|
139
|
+
transcribedPrompt: string;
|
|
92
140
|
}
|
|
93
141
|
/** The options for the AI chatbot search method. */
|
|
94
142
|
export interface AiSearchOptions {
|
|
@@ -136,7 +184,7 @@ export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
|
136
184
|
minImageHeight?: number;
|
|
137
185
|
}
|
|
138
186
|
export declare class AiChatbotChatContext {
|
|
139
|
-
readonly prompt
|
|
187
|
+
readonly prompt?: string;
|
|
140
188
|
readonly profileId: string;
|
|
141
189
|
}
|
|
142
190
|
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
@@ -27,6 +27,7 @@ export declare enum IntegrationType {
|
|
|
27
27
|
'built_in_s3' = "built_in_s3",
|
|
28
28
|
'built_in_gcs' = "built_in_gcs",
|
|
29
29
|
'google_drive' = "google_drive",
|
|
30
|
+
'ai_agents' = "ai_agents",
|
|
30
31
|
'algolia' = "algolia",
|
|
31
32
|
'elastic_observability' = "elastic_observability",
|
|
32
33
|
'elastic_search' = "elastic_search",
|
|
@@ -1,10 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Name of metrics publicly provided by the system.
|
|
3
|
+
* - Metrics suffixed by '_time' are 'gauge' metrics.
|
|
4
|
+
* - Metrics suffixed by '_count' are 'count' metrics.
|
|
5
|
+
* All Squid metrics starts with `squid_` prefix.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time"];
|
|
8
|
+
export type SquidMetricName = (typeof SQUID_METRIC_NAMES)[number];
|
|
9
|
+
export declare const METRIC_FUNCTIONS: readonly ["sum", "max", "min", "average", "median", "p95", "p99", "count"];
|
|
10
|
+
export type MetricFunction = (typeof METRIC_FUNCTIONS)[number];
|
|
11
|
+
/** Defines source of the metric: reported by user or automatically collected by the system (Squid). */
|
|
12
|
+
export declare const METRIC_DOMAIN: readonly ["user", "squid"];
|
|
13
|
+
export type MetricDomain = (typeof METRIC_DOMAIN)[number];
|
|
14
|
+
export declare const METRIC_INTERVAL_ALIGNMENT: readonly ["align-by-start-time", "align-by-end-time"];
|
|
15
|
+
/** Indicates how to align per-point periods in metric queries. */
|
|
16
|
+
export type MetricIntervalAlignment = (typeof METRIC_INTERVAL_ALIGNMENT)[number];
|
|
17
|
+
export interface QueryMetricsRequestCommon {
|
|
18
|
+
/** Kind of the metrics (domain) to query. */
|
|
19
|
+
domain: MetricDomain;
|
|
20
|
+
/** Start of the queried interval. Must be an integer value. */
|
|
21
|
+
periodStartSeconds: number;
|
|
22
|
+
/** End of the queried interval. Must be an integer value. */
|
|
23
|
+
periodEndSeconds: number;
|
|
24
|
+
/**
|
|
25
|
+
* Time interval per point. Must be less than periodEndSeconds - periodStartSeconds.
|
|
26
|
+
* Set to 0 or keep undefined to have only 1 value in the result.
|
|
27
|
+
*/
|
|
28
|
+
pointIntervalSeconds?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies the alignment of the per-point interval.
|
|
31
|
+
* Default: 'align-by-start-time'
|
|
32
|
+
*/
|
|
33
|
+
pointIntervalAlignment?: MetricIntervalAlignment;
|
|
34
|
+
/** Aggregation functions that maps multiple points per point region to a single point value. */
|
|
35
|
+
fn: MetricFunction | Array<MetricFunction>;
|
|
36
|
+
/**
|
|
37
|
+
* If there is no data in the specified region this value will be used to fill the gap.
|
|
38
|
+
* Default: null.
|
|
39
|
+
*/
|
|
40
|
+
fillValue?: number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Tag filters.
|
|
43
|
+
* TODO: add operations to exclude tags: !=, !contains...
|
|
44
|
+
*/
|
|
45
|
+
tagFilter?: Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* A mapping of known tag values that must be present in the response groups.
|
|
48
|
+
*
|
|
49
|
+
* This ensures that the result will include groups for all specified tag values,
|
|
50
|
+
* even if there is no data for some values in the database.
|
|
51
|
+
*
|
|
52
|
+
* Example: Consider a tag 'isError' with two possible values: '0' and '1'.
|
|
53
|
+
* When 'tagDomains' contains {'isError': ['0', '1']}, the result will include
|
|
54
|
+
* groups for both 'isError: 0' and 'isError: 1'. If the database lacks data for
|
|
55
|
+
* 'isError: 1', the points in this group will be set to 'fillValue' (default is 'null').
|
|
56
|
+
*
|
|
57
|
+
* The tags in the new groups will be copied from the existing resultGroups,
|
|
58
|
+
* along with one of the tag domain values.
|
|
59
|
+
*
|
|
60
|
+
* @property {Record<string, string[]>} tagDomains - A record where each key is a tag name and
|
|
61
|
+
* each value is an array of possible values for that tag. Should only contain tags listed in 'groupByTags' field.
|
|
62
|
+
*/
|
|
63
|
+
tagDomains?: Record<string, string[]>;
|
|
64
|
+
/** List of ordered tag names for a 'GROUP BY'. */
|
|
65
|
+
groupByTags?: string[];
|
|
66
|
+
/** The results will be ordered by the specified tags (ORDER BY). */
|
|
67
|
+
orderByTags?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Specifies what result will be returned if there were no records found in the database.
|
|
70
|
+
* In this case the 'resultGroups' array will be empty (default), or can be filled with a default
|
|
71
|
+
* values if 'return-result-group-with-default-values' is specified.
|
|
72
|
+
* The generated result group will have 'tagValues' set to empty strings.
|
|
73
|
+
*
|
|
74
|
+
* May be useful to get a ready-to-render array with no additional post-processing required.
|
|
75
|
+
*
|
|
76
|
+
* Note: 'tagDomains' can provide similar functionality when set of tag values is defined: multiple result groups
|
|
77
|
+
* will be filled with default values. There is no need to use this option if 'tagDomains' is used.
|
|
78
|
+
*
|
|
79
|
+
* Default: 'return-no-result-groups'
|
|
80
|
+
*/
|
|
81
|
+
noDataBehavior?: 'return-no-result-groups' | 'return-result-group-with-default-values';
|
|
82
|
+
}
|
|
83
|
+
export interface QueryUserMetricsRequest<NameType extends string = string> extends QueryMetricsRequestCommon {
|
|
84
|
+
domain: 'user';
|
|
85
|
+
/** Squid metric name. */
|
|
86
|
+
name: NameType;
|
|
87
|
+
}
|
|
88
|
+
export interface QuerySquidMetricsRequest<NameType extends SquidMetricName = SquidMetricName> extends QueryMetricsRequestCommon {
|
|
89
|
+
domain: 'squid';
|
|
90
|
+
/** User metric name. */
|
|
91
|
+
name: NameType;
|
|
92
|
+
}
|
|
93
|
+
export type QueryMetricsRequest<NameType extends string = string> = QuerySquidMetricsRequest<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsRequest<NameType>;
|
|
94
|
+
/**
|
|
95
|
+
* Every result point is a list of [timestamp, values...],
|
|
96
|
+
* where list of values are defined by the list of functions in the request.
|
|
97
|
+
* If there is no data for the point 'null' is used as a 'value'.
|
|
3
98
|
* The timestamp is always equal to the point period start date and is measured in Unix epoch seconds.
|
|
4
99
|
*/
|
|
5
|
-
export type
|
|
6
|
-
export interface
|
|
100
|
+
export type QueryMetricsResultPoint = [number, ...(number | null)[]];
|
|
101
|
+
export interface QueryMetricsResultGroup {
|
|
7
102
|
/** Values of the tags in the group. The tags are ordered the same way as in request.groupByTags collection. */
|
|
8
103
|
tagValues: string[];
|
|
9
|
-
points: Array<
|
|
104
|
+
points: Array<QueryMetricsResultPoint>;
|
|
105
|
+
}
|
|
106
|
+
export interface QueryMetricsResponseCommon {
|
|
107
|
+
/**
|
|
108
|
+
* Result of the metrics query.
|
|
109
|
+
* Contains only 1 element if `groupByTags` are empty, otherwise contains multiple results grouped by tags.
|
|
110
|
+
*/
|
|
111
|
+
resultGroups: Array<QueryMetricsResultGroup>;
|
|
112
|
+
}
|
|
113
|
+
export interface QueryUserMetricsResponse<NameType extends string = string> extends QueryMetricsResponseCommon {
|
|
114
|
+
domain: 'user';
|
|
115
|
+
metricName: NameType;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A single metric response for 'SquidMetricsRequest'.
|
|
119
|
+
*/
|
|
120
|
+
export interface QuerySquidMetricsResponse<NameType extends SquidMetricName> extends QueryMetricsResponseCommon {
|
|
121
|
+
domain: 'squid';
|
|
122
|
+
metricName: NameType;
|
|
10
123
|
}
|
|
124
|
+
export type QueryMetricsResponse<NameType extends string = string> = Required<QuerySquidMetricsResponse<NameType extends SquidMetricName ? NameType : SquidMetricName> | QueryUserMetricsResponse<NameType>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
1
|
+
import { QueryMetricsRequestCommon, QueryMetricsResultGroup } from '../public-types/metric.public-types';
|
|
2
|
+
export type QueryMetricsRequestIntervals = Required<Pick<QueryMetricsRequestCommon, 'fillValue' | 'fn' | 'groupByTags' | 'periodEndSeconds' | 'periodStartSeconds' | 'pointIntervalAlignment' | 'pointIntervalSeconds' | 'tagDomains' | 'noDataBehavior'>>;
|
|
3
3
|
/** Adds missed known tag domain groups and fills all missed points with a request.fillValue. */
|
|
4
|
-
export declare function fillMissedPoints(request:
|
|
4
|
+
export declare function fillMissedPoints(request: QueryMetricsRequestIntervals, resultGroups: Array<QueryMetricsResultGroup>): void;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
import { AiChatbotChatOptions, AiChatbotContext, AiChatModelName, AiSearchOptions, AiSearchResponse } from './public-types';
|
|
1
|
+
import { AiChatbotChatOptions, AiChatbotContext, AiChatModelName, AiSearchOptions, AiSearchResponse, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse } from './public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
export
|
|
3
|
+
export interface TranscribeAndChatResponse {
|
|
4
|
+
transcribedPrompt: string;
|
|
5
|
+
responseStream: Observable<string>;
|
|
6
|
+
}
|
|
7
|
+
export interface TranscribeAndAskWithVoiceResponse {
|
|
8
|
+
transcribedPrompt: string;
|
|
9
|
+
responseString: string;
|
|
10
|
+
voiceResponseFile: File;
|
|
11
|
+
}
|
|
12
|
+
export interface AskWithVoiceResponse {
|
|
13
|
+
responseString: string;
|
|
14
|
+
voiceResponseFile: File;
|
|
15
|
+
}
|
|
16
|
+
export interface ChatInternalResponse {
|
|
17
|
+
responseStream: Observable<string>;
|
|
18
|
+
serverResponse?: Promise<AiTranscribeAndChatResponse>;
|
|
19
|
+
}
|
|
20
|
+
export type ChatOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions'>;
|
|
21
|
+
export type AskOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions' | 'smoothTyping'>;
|
|
22
|
+
export declare class AiAgentClient {
|
|
4
23
|
private readonly rpcManager;
|
|
5
24
|
private readonly socketManager;
|
|
6
25
|
private readonly integrationId;
|
|
@@ -13,7 +32,7 @@ export declare class AiChatbotClient {
|
|
|
13
32
|
* @param id - The id of the profile.
|
|
14
33
|
* @returns The profile reference.
|
|
15
34
|
*/
|
|
16
|
-
profile(id: string):
|
|
35
|
+
profile(id: string): AiAgentReference;
|
|
17
36
|
/**
|
|
18
37
|
* Sends a prompt to the specified profile id.
|
|
19
38
|
*
|
|
@@ -23,8 +42,10 @@ export declare class AiChatbotClient {
|
|
|
23
42
|
* @returns An observable that emits when a new response token is received. The emitted value is the entire response
|
|
24
43
|
* that has been received so far.
|
|
25
44
|
*/
|
|
26
|
-
chat(profileId: string, prompt: string, options?:
|
|
27
|
-
|
|
45
|
+
chat(profileId: string, prompt: string, options?: ChatOptionsWithoutVoice): Observable<string>;
|
|
46
|
+
transcribeAndChat(profileId: string, fileToTranscribe: File, options?: ChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
|
|
47
|
+
private chatInternal;
|
|
48
|
+
search(agentId: string, options: AiSearchOptions): Promise<AiSearchResponse>;
|
|
28
49
|
/**
|
|
29
50
|
* Sends a prompt to the specified profile id and returns the response as a Promise of string.
|
|
30
51
|
*
|
|
@@ -33,7 +54,11 @@ export declare class AiChatbotClient {
|
|
|
33
54
|
* @param options - The options to send to the chat model.
|
|
34
55
|
* @returns A promise that resolves when the chat is complete. The resolved value is the entire response.
|
|
35
56
|
*/
|
|
36
|
-
ask(profileId: string, prompt: string, options?:
|
|
57
|
+
ask(profileId: string, prompt: string, options?: AskOptionsWithoutVoice): Promise<string>;
|
|
58
|
+
transcribeAndAsk(profileId: string, fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
|
|
59
|
+
transcribeAndAskWithVoiceResponse(profileId: string, fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
60
|
+
askWithVoiceResponse(profileId: string, prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
|
|
61
|
+
askInternal<T>(profileId: string, prompt: string | File, isVoiceResponse: boolean, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<T>;
|
|
37
62
|
private handleChatResponse;
|
|
38
63
|
}
|
|
39
64
|
export interface AiChatBotContextData {
|
|
@@ -48,7 +73,7 @@ export interface ProfileData {
|
|
|
48
73
|
export interface InstructionData {
|
|
49
74
|
instruction: string;
|
|
50
75
|
}
|
|
51
|
-
export declare class
|
|
76
|
+
export declare class AiAgentReference {
|
|
52
77
|
private readonly client;
|
|
53
78
|
private readonly integrationId;
|
|
54
79
|
private readonly profileId;
|
|
@@ -61,12 +86,16 @@ export declare class AiChatbotProfileReference {
|
|
|
61
86
|
* that has been received so far.
|
|
62
87
|
*/
|
|
63
88
|
chat(prompt: string, options?: AiChatbotChatOptions): Observable<string>;
|
|
89
|
+
transcribeAndChat(fileToTranscribe: File, options?: AiChatbotChatOptions): Promise<TranscribeAndChatResponse>;
|
|
64
90
|
/**
|
|
65
91
|
* Sends a prompt to the current profile and returns the response as a Promise of string.
|
|
66
92
|
* @param prompt - The prompt.
|
|
67
93
|
* @param options - The chat options.
|
|
68
94
|
*/
|
|
69
95
|
ask(prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<string>;
|
|
96
|
+
transcribeAndAsk(fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
|
|
97
|
+
transcribeAndAskWithVoiceResponse(fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
98
|
+
askWithVoiceResponse(prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
|
|
70
99
|
search(options: AiSearchOptions): Promise<AiSearchResponse>;
|
|
71
100
|
/**
|
|
72
101
|
* Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
|
|
@@ -76,7 +105,7 @@ export declare class AiChatbotProfileReference {
|
|
|
76
105
|
* generated and the reference will point to a new context entry.
|
|
77
106
|
* @returns The context reference.
|
|
78
107
|
*/
|
|
79
|
-
context(id?: string):
|
|
108
|
+
context(id?: string): AiAgentContextReference;
|
|
80
109
|
/**
|
|
81
110
|
* Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
|
|
82
111
|
* instruction entry to the profile, or update/delete an existing instruction entry.
|
|
@@ -85,7 +114,7 @@ export declare class AiChatbotProfileReference {
|
|
|
85
114
|
* generated and the reference will point to a new instruction entry.
|
|
86
115
|
* @returns The instruction reference.
|
|
87
116
|
*/
|
|
88
|
-
instruction(id?: string):
|
|
117
|
+
instruction(id?: string): AiAgentInstructionReference;
|
|
89
118
|
/**
|
|
90
119
|
* Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
|
|
91
120
|
*
|
|
@@ -117,7 +146,7 @@ export declare class AiChatbotProfileReference {
|
|
|
117
146
|
*/
|
|
118
147
|
delete(): Promise<void>;
|
|
119
148
|
}
|
|
120
|
-
export declare class
|
|
149
|
+
export declare class AiAgentContextReference {
|
|
121
150
|
private readonly client;
|
|
122
151
|
private readonly integrationId;
|
|
123
152
|
private readonly profileId;
|
|
@@ -157,7 +186,7 @@ export declare class AiChatbotContextReference {
|
|
|
157
186
|
*/
|
|
158
187
|
delete(): Promise<void>;
|
|
159
188
|
}
|
|
160
|
-
export declare class
|
|
189
|
+
export declare class AiAgentInstructionReference {
|
|
161
190
|
private readonly client;
|
|
162
191
|
private readonly integrationId;
|
|
163
192
|
private readonly profileId;
|
|
@@ -188,3 +217,11 @@ export declare class AiChatbotInstructionReference {
|
|
|
188
217
|
*/
|
|
189
218
|
delete(): Promise<void>;
|
|
190
219
|
}
|
|
220
|
+
export declare class AiChatbotProfileReference extends AiAgentReference {
|
|
221
|
+
}
|
|
222
|
+
export declare class AiChatbotClient extends AiAgentClient {
|
|
223
|
+
}
|
|
224
|
+
export declare class AiChatbotContextReference extends AiAgentContextReference {
|
|
225
|
+
}
|
|
226
|
+
export declare class AiChatbotInstructionReference extends AiAgentInstructionReference {
|
|
227
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AiAudioTranscribeOptions } from './public-types';
|
|
1
|
+
import { AiAudioCreateSpeechOptions, AiAudioTranscribeOptions } from './public-types';
|
|
2
2
|
import { BlobAndFilename } from './types';
|
|
3
3
|
export declare class AiAudioClient {
|
|
4
4
|
private readonly rpcManager;
|
|
5
5
|
transcribe(file: File | BlobAndFilename, options?: AiAudioTranscribeOptions): Promise<string>;
|
|
6
|
+
createSpeech(input: string, options: AiAudioCreateSpeechOptions): Promise<File>;
|
|
6
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiChatbotClient } from './ai-
|
|
1
|
+
import { AiAgentReference, AiChatbotClient } from './ai-agent-client';
|
|
2
2
|
import { AiAssistantClient } from './ai-assistant-client';
|
|
3
3
|
import { IntegrationId } from './public-types';
|
|
4
4
|
import { AiImageClient } from './ai-image-client';
|
|
@@ -43,6 +43,7 @@ export declare class AiClient {
|
|
|
43
43
|
* @returns An instance of AiChatbotClient associated with the given AI integration ID.
|
|
44
44
|
*/
|
|
45
45
|
chatbot(aiIntegrationId: IntegrationId): AiChatbotClient;
|
|
46
|
+
agent(agentId: string): AiAgentReference;
|
|
46
47
|
/**
|
|
47
48
|
* Retrieves the AI assistant client.
|
|
48
49
|
* @returns An instance of AiAssistantClient.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function base64ToFile(base64: string, filename: string, mimeType?: string): File;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './ai-assistant-client';
|
|
2
2
|
export * from './ai-chatbot-client.factory';
|
|
3
|
-
export * from './ai-
|
|
3
|
+
export * from './ai-agent-client';
|
|
4
4
|
export * from './ai-image-client';
|
|
5
5
|
export * from './ai-audio-client';
|
|
6
6
|
export * from './ai.types';
|
|
@@ -43,3 +43,4 @@ export * from './types';
|
|
|
43
43
|
export * from './storage-client';
|
|
44
44
|
export * from './personal-storage-client';
|
|
45
45
|
export * from './extraction-client';
|
|
46
|
+
export * from './file-utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.279";
|