@squidcloud/client 1.0.299 → 1.0.301
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 +5 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.public-types.d.ts +6 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +3 -2
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +23 -0
- package/dist/internal-common/src/utils/assert.d.ts +1 -0
- package/dist/typescript-client/src/ai-agent-client.d.ts +4 -8
- package/dist/typescript-client/src/index.d.ts +1 -0
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +7 -3
- package/dist/typescript-client/src/query-utils.d.ts +14 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
|
|
2
2
|
import { IntegrationId } from './communication.public-types';
|
|
3
|
+
import { AiChatPromptQuotas, AiConnectedAgentMetadata } from '../types/ai-chatbot.types';
|
|
3
4
|
/** The supported OpenAI models */
|
|
4
5
|
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1-preview", "o1-mini"];
|
|
5
6
|
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-1.5-flash"];
|
|
@@ -146,6 +147,10 @@ export interface AiChatbotChatOptions {
|
|
|
146
147
|
contextMetadataFilter?: AiContextMetadataFilter;
|
|
147
148
|
/** The options to use for the response in voice. */
|
|
148
149
|
voiceOptions?: AiAudioCreateSpeechOptions;
|
|
150
|
+
/** List of connected AI agents can be called by the current agent. */
|
|
151
|
+
connectedAgents?: Array<AiConnectedAgentMetadata>;
|
|
152
|
+
/** Current budget for nested or recursive AI chat calls per single prompt. */
|
|
153
|
+
quotas?: AiChatPromptQuotas;
|
|
149
154
|
}
|
|
150
155
|
export interface AiAskResponse {
|
|
151
156
|
responseString: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AiChatModelName, AiEmbeddingsModelName, VectorDbType } from '../ai-chatbot.public-types';
|
|
2
2
|
import { FunctionName } from '../bundle-data.public-types';
|
|
3
|
+
import { AiConnectedAgentMetadata } from '../../types/ai-chatbot.types';
|
|
3
4
|
export type AiChatbotConfiguration = {
|
|
4
5
|
apiKey?: string;
|
|
5
6
|
};
|
|
@@ -15,6 +16,8 @@ export type AiChatbotProfileMetadata = {
|
|
|
15
16
|
vectorDbType?: VectorDbType;
|
|
16
17
|
/** List of AI functions attached to the profile by default. */
|
|
17
18
|
functions?: Array<FunctionName>;
|
|
19
|
+
/** List of child AI profiles (agents) that can be used by the current agent. */
|
|
20
|
+
connectedProfiles?: Array<AiConnectedAgentMetadata>;
|
|
18
21
|
auditLog?: boolean;
|
|
19
22
|
};
|
|
20
23
|
export type AiChatbotContextMetadata = {
|
|
@@ -23,3 +26,6 @@ export type AiChatbotContextMetadata = {
|
|
|
23
26
|
preview: boolean;
|
|
24
27
|
sizeBytes?: number;
|
|
25
28
|
};
|
|
29
|
+
export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | 'connectedProfiles'>;
|
|
30
|
+
/** List of fields that can be updated in runtime via API. */
|
|
31
|
+
export declare const MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS: Array<MutableAiChatbotProfileMetadataFieldsType>;
|
|
@@ -35,9 +35,10 @@ export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
|
35
35
|
}
|
|
36
36
|
export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
|
|
37
37
|
type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
38
|
+
export declare const ARRAY_OPERATORS: Array<string>;
|
|
39
|
+
export declare const ALL_OPERATORS: Array<string>;
|
|
38
40
|
/** An operator in a query condition. */
|
|
39
|
-
export type Operator =
|
|
40
|
-
export declare const ALL_OPERATORS: Array<Operator>;
|
|
41
|
+
export type Operator = (typeof ALL_OPERATORS)[number];
|
|
41
42
|
/** A definition of a sort by a filed. */
|
|
42
43
|
export interface FieldSort<Doc> {
|
|
43
44
|
fieldName: FieldName<Doc>;
|
|
@@ -16,4 +16,27 @@ export interface AiChatOptions {
|
|
|
16
16
|
agentContext?: Record<string, unknown>;
|
|
17
17
|
/** List of AI functions available for the chatbot. */
|
|
18
18
|
functions?: Array<FunctionName | FunctionNameWithContext>;
|
|
19
|
+
/** List of connected AI agents can be called by the current agent. */
|
|
20
|
+
connectedAgents?: Array<AiConnectedAgentMetadata>;
|
|
21
|
+
/** Current budget for nested or recursive AI chat calls per single prompt. */
|
|
22
|
+
quotas?: AiChatPromptQuotas;
|
|
23
|
+
}
|
|
24
|
+
export interface AiConnectedAgentMetadata {
|
|
25
|
+
agentId: AiAgentId;
|
|
26
|
+
/**
|
|
27
|
+
* Description of the connected agent for the parent agent context.
|
|
28
|
+
* Works as AI function description.
|
|
29
|
+
*/
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
32
|
+
/** Quotas for a single AI chat prompt (`ask()` method call). */
|
|
33
|
+
export interface AiChatPromptQuotas {
|
|
34
|
+
/**
|
|
35
|
+
* Maximum depth of AI call recursion allowed.
|
|
36
|
+
* Recursion occurs when one AI agent calls another.
|
|
37
|
+
* Note that, for simplicity of implementation, this option guarantees only the maximum recursion depth,
|
|
38
|
+
* not the total number of nested AI calls.
|
|
39
|
+
* Default: 5.
|
|
40
|
+
*/
|
|
41
|
+
maxAiCallStackSize: number;
|
|
19
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiChatbotChatOptions, AiChatbotContext,
|
|
1
|
+
import { AiChatbotChatOptions, AiChatbotContext, AiChatbotProfileMetadata, AiProfileId, AiSearchOptions, AiSearchResponse, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse, MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS } from './public-types';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { BlobAndFilename } from './types';
|
|
4
4
|
export interface TranscribeAndChatResponse {
|
|
@@ -66,11 +66,7 @@ export interface AiChatBotContextData {
|
|
|
66
66
|
title: string;
|
|
67
67
|
context: AiChatbotContext;
|
|
68
68
|
}
|
|
69
|
-
export
|
|
70
|
-
modelName: AiChatModelName;
|
|
71
|
-
/** If the profile is public, there is no need to write a security rule to access the chat functionality. This can be dangerous, use with caution. */
|
|
72
|
-
isPublic: boolean;
|
|
73
|
-
}
|
|
69
|
+
export type AiProfileData = Pick<AiChatbotProfileMetadata, (typeof MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS)[number]>;
|
|
74
70
|
export interface InstructionData {
|
|
75
71
|
instruction: string;
|
|
76
72
|
}
|
|
@@ -125,7 +121,7 @@ export declare class AiAgentReference {
|
|
|
125
121
|
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
126
122
|
* @returns A promise that resolves when the profile is successfully created.
|
|
127
123
|
*/
|
|
128
|
-
insert(data:
|
|
124
|
+
insert(data: AiProfileData): Promise<void>;
|
|
129
125
|
/**
|
|
130
126
|
* Updates an existing chatbot profile. This will result in an error if a profile has not yet been created for the
|
|
131
127
|
* current profile id.
|
|
@@ -136,7 +132,7 @@ export declare class AiAgentReference {
|
|
|
136
132
|
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
137
133
|
* @returns A promise that resolves when the profile is successfully updated.
|
|
138
134
|
*/
|
|
139
|
-
update(data: Partial<
|
|
135
|
+
update(data: Partial<AiProfileData>): Promise<void>;
|
|
140
136
|
/**
|
|
141
137
|
* Deletes an existing chatbot profile. This will result in an error if a profile has not yet been created for the
|
|
142
138
|
* current profile id.
|
|
@@ -22,6 +22,7 @@ export * from './mutation/mutation-sender';
|
|
|
22
22
|
export * from './native-query-manager';
|
|
23
23
|
export * from './public-types';
|
|
24
24
|
export * from './public-utils';
|
|
25
|
+
export * from './query-utils';
|
|
25
26
|
export * from './query/deserializer';
|
|
26
27
|
export * from './query/join-query-builder.factory';
|
|
27
28
|
export * from './query/local-query-manager';
|
|
@@ -87,7 +87,9 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
|
87
87
|
* A shortcut for where(fieldName, 'like', pattern).
|
|
88
88
|
*
|
|
89
89
|
* @param fieldName The name of the field to query.
|
|
90
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one
|
|
90
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one
|
|
91
|
+
* character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%',
|
|
92
|
+
* '_', or '\' is invalid.
|
|
91
93
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
92
94
|
* @returns The query builder.
|
|
93
95
|
*/
|
|
@@ -96,7 +98,9 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
|
96
98
|
* A shortcut for where(fieldName, 'not like', pattern).
|
|
97
99
|
*
|
|
98
100
|
* @param fieldName The name of the field to query.
|
|
99
|
-
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one
|
|
101
|
+
* @param pattern The pattern to compare against. '%' matches 0 or more characters. '_' matches exactly one
|
|
102
|
+
* character. '\' can be used to escape '%', '_'. or another '\'. Note that any '\' that is not followed by '%',
|
|
103
|
+
* '_', or '\' is invalid.
|
|
100
104
|
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
101
105
|
* @returns The query builder.
|
|
102
106
|
*/
|
|
@@ -153,7 +157,7 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
|
|
|
153
157
|
private readonly documentIdentityService;
|
|
154
158
|
private forceFetchFromServer;
|
|
155
159
|
/** @inheritDoc */
|
|
156
|
-
where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator
|
|
160
|
+
where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator, value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
157
161
|
/** @inheritDoc */
|
|
158
162
|
limit(limit: number): this;
|
|
159
163
|
getLimit(): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocumentData } from '../../internal-common/src/public-types/document.public-types';
|
|
2
|
+
import { QueryBuilder } from './query/query-builder.factory';
|
|
3
|
+
/** Result of the `visitQueryResults` function. */
|
|
4
|
+
export interface VisitQueryResultsStats {
|
|
5
|
+
/** Count of documents visited. */
|
|
6
|
+
count: number;
|
|
7
|
+
/** Time in millis spent in the function. */
|
|
8
|
+
time: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Reads all objects from the query in a safe way (with pagination) and calls callback() on every object.
|
|
12
|
+
* The iteration is interrupted if error is thrown.
|
|
13
|
+
*/
|
|
14
|
+
export declare function visitQueryResults<T extends DocumentData>(query: QueryBuilder<T>, callback: (t: T) => Promise<unknown>, pageSize?: number): Promise<VisitQueryResultsStats>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.301";
|