@squidcloud/client 1.0.298 → 1.0.300
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 +10 -5
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.public-types.d.ts +7 -0
- package/dist/typescript-client/src/ai-agent-client.d.ts +10 -14
- package/dist/typescript-client/src/index.d.ts +1 -0
- 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,11 +1,12 @@
|
|
|
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
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-
|
|
5
|
-
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-
|
|
6
|
-
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-
|
|
5
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1-preview", "o1-mini"];
|
|
6
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-1.5-flash"];
|
|
7
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-5-haiku-latest", "claude-3-5-sonnet-latest"];
|
|
7
8
|
/** The supported AI model names. */
|
|
8
|
-
export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-
|
|
9
|
+
export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1-preview", "o1-mini", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "gemini-1.5-pro", "gemini-1.5-flash"];
|
|
9
10
|
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
10
11
|
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
11
12
|
/** The supported AI image generation model names. */
|
|
@@ -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;
|
|
@@ -180,7 +185,7 @@ export interface AiSearchRequest {
|
|
|
180
185
|
profileId: string;
|
|
181
186
|
integrationId: IntegrationId;
|
|
182
187
|
}
|
|
183
|
-
export type AiChatbotMutationType = 'insert' | 'update' | 'delete' | 'append';
|
|
188
|
+
export type AiChatbotMutationType = 'insert' | 'update' | 'delete' | 'append' | 'feedback';
|
|
184
189
|
export type AiChatbotResourceType = 'instruction' | 'context' | 'profile';
|
|
185
190
|
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
186
191
|
export interface AiChatbotContextBase {
|
|
@@ -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
|
};
|
|
@@ -8,12 +9,15 @@ export type AiChatbotProfileMetadata = {
|
|
|
8
9
|
isPublic: boolean;
|
|
9
10
|
strictContext?: boolean;
|
|
10
11
|
instructions: Record<string, string>;
|
|
12
|
+
feedbackInstructions?: string;
|
|
11
13
|
/** 'text-embedding-ada-002' if undefined. */
|
|
12
14
|
embeddingModelName?: AiEmbeddingsModelName;
|
|
13
15
|
/** 'pinecone' if undefined. */
|
|
14
16
|
vectorDbType?: VectorDbType;
|
|
15
17
|
/** List of AI functions attached to the profile by default. */
|
|
16
18
|
functions?: Array<FunctionName>;
|
|
19
|
+
/** List of child AI profiles (agents) that can be used by the current agent. */
|
|
20
|
+
connectedProfiles?: Array<AiConnectedAgentMetadata>;
|
|
17
21
|
auditLog?: boolean;
|
|
18
22
|
};
|
|
19
23
|
export type AiChatbotContextMetadata = {
|
|
@@ -22,3 +26,6 @@ export type AiChatbotContextMetadata = {
|
|
|
22
26
|
preview: boolean;
|
|
23
27
|
sizeBytes?: number;
|
|
24
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>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
}
|
|
@@ -120,25 +116,23 @@ export declare class AiAgentReference {
|
|
|
120
116
|
* Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
|
|
121
117
|
*
|
|
122
118
|
* @param data An object containing options for creating the profile.
|
|
123
|
-
* @param data.modelName - The name of the AI model (`gpt-3.5, `gpt-4`, `claude-3-
|
|
124
|
-
* `claude-3-
|
|
125
|
-
* `gemini-1.5-pro` `gemini-1.5-flash`).
|
|
119
|
+
* @param data.modelName - The name of the AI model (`gpt-3.5, `gpt-4`, `claude-3-5-sonnet-latest` or
|
|
120
|
+
* `claude-3-5-haiku-latest`, `gemini-1.5-pro` `gemini-1.5-flash`).
|
|
126
121
|
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
127
122
|
* @returns A promise that resolves when the profile is successfully created.
|
|
128
123
|
*/
|
|
129
|
-
insert(data:
|
|
124
|
+
insert(data: AiProfileData): Promise<void>;
|
|
130
125
|
/**
|
|
131
126
|
* Updates an existing chatbot profile. This will result in an error if a profile has not yet been created for the
|
|
132
127
|
* current profile id.
|
|
133
128
|
*
|
|
134
129
|
* @param data An object containing options for updating the profile.
|
|
135
|
-
* @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4`, `claude-3-
|
|
136
|
-
* `claude-3-
|
|
137
|
-
* `gemini-1.5-pro` `gemini-1.5-flash`).
|
|
130
|
+
* @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4`, `claude-3-5-sonnet-latest` or
|
|
131
|
+
* `claude-3-5-haiku-latest`, `gemini-1.5-pro` `gemini-1.5-flash`).
|
|
138
132
|
* @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
|
|
139
133
|
* @returns A promise that resolves when the profile is successfully updated.
|
|
140
134
|
*/
|
|
141
|
-
update(data: Partial<
|
|
135
|
+
update(data: Partial<AiProfileData>): Promise<void>;
|
|
142
136
|
/**
|
|
143
137
|
* Deletes an existing chatbot profile. This will result in an error if a profile has not yet been created for the
|
|
144
138
|
* current profile id.
|
|
@@ -146,6 +140,8 @@ export declare class AiAgentReference {
|
|
|
146
140
|
* @returns A promise that resolves when the profile is successfully deleted.
|
|
147
141
|
*/
|
|
148
142
|
delete(): Promise<void>;
|
|
143
|
+
feedback(feedback: string): Promise<void>;
|
|
144
|
+
resetFeedback(): Promise<void>;
|
|
149
145
|
}
|
|
150
146
|
export declare class AiAgentContextReference {
|
|
151
147
|
private readonly client;
|
|
@@ -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';
|
|
@@ -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.300";
|