@squidcloud/client 1.0.423 → 1.0.425
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/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +14 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +81 -13
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +12 -15
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +14 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +2 -2
- package/dist/internal-common/src/public-types/web.public-types.d.ts +26 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +195 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +17 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/internal-common/src/types/observability.types.d.ts +101 -0
- package/dist/internal-common/src/types/query.types.d.ts +13 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/internal-common/src/types/time-units.d.ts +1 -0
- package/dist/internal-common/src/types/url-shortener.types.d.ts +45 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/file-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
- package/dist/internal-common/src/utils/http.d.ts +5 -0
- package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +86 -0
- package/dist/internal-common/src/utils/serialization.d.ts +18 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/internal-common/src/websocket.impl.d.ts +26 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +17 -1
- package/dist/typescript-client/src/ai-client.d.ts +0 -7
- package/dist/typescript-client/src/index.d.ts +0 -2
- package/dist/typescript-client/src/public-types.d.ts +0 -1
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/dist/typescript-client/src/web-client.d.ts +9 -14
- package/package.json +1 -1
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +0 -31
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -72
- /package/dist/{typescript-client/src/file-utils.d.ts → internal-common/src/types/backend-function.types.d.ts} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { AiQueryOptions } from '../public-types/ai-query.public-types';
|
|
2
|
+
import { IntegrationId } from '../public-types/communication.public-types';
|
|
3
|
+
import { CollectionName, DocumentData } from '../public-types/document.public-types';
|
|
4
|
+
import { FieldSort, Operator, Query, SimpleCondition } from '../public-types/query.public-types';
|
|
5
|
+
import { DeepRecord, FieldOf, PartialBy, Paths } from '../public-types/typescript.public-types';
|
|
6
|
+
/**
|
|
7
|
+
* The information provided to the secureAiQuery function about the AI query being executed.
|
|
8
|
+
* @category AI
|
|
9
|
+
*/
|
|
10
|
+
export interface AiQueryContext {
|
|
11
|
+
/** The prompt provided for the AI query. */
|
|
12
|
+
prompt: string;
|
|
13
|
+
/** The options used for executing the AI query. */
|
|
14
|
+
options: AiQueryOptions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents the Squid query context.
|
|
18
|
+
* Passed to methods that require query details, such as those annotated with the `@secureCollection` annotation.
|
|
19
|
+
* @category Database
|
|
20
|
+
*/
|
|
21
|
+
export declare class QueryContext<T extends DocumentData = any> {
|
|
22
|
+
readonly query: Query<T>;
|
|
23
|
+
/**
|
|
24
|
+
* The ID of the integration being queried.
|
|
25
|
+
*/
|
|
26
|
+
get integrationId(): IntegrationId;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the collection being queried.
|
|
29
|
+
*/
|
|
30
|
+
get collectionName(): CollectionName;
|
|
31
|
+
/**
|
|
32
|
+
* The query limit if one exists, -1 otherwise.
|
|
33
|
+
*/
|
|
34
|
+
get limit(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Verifies that the query's sort order aligns with the provided field sorts. The fields specified in the `sorts`
|
|
37
|
+
* parameter must appear in the exact order at the beginning of the query's sort sequence. The query can include
|
|
38
|
+
* additional fields in its sort order, but only after the specified sorts.
|
|
39
|
+
*
|
|
40
|
+
* @param sorts An array of field sorts.
|
|
41
|
+
* @returns Whether the query's sorts matches the provided field sorts.
|
|
42
|
+
*/
|
|
43
|
+
sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Verifies that the query's sort order exactly matches the provided field sorts. The fields specified in the
|
|
46
|
+
* `sorts` parameter must appear in the exact order in the query's sort sequence. No additional sorts may be present
|
|
47
|
+
* in the query.
|
|
48
|
+
*
|
|
49
|
+
* @param sorts An array of field sorts.
|
|
50
|
+
* @returns Whether the query's sorts exactly match the provided field sorts.
|
|
51
|
+
*/
|
|
52
|
+
sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
|
|
55
|
+
* to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
|
|
56
|
+
* additional conditions, as these only narrow the result set.
|
|
57
|
+
*
|
|
58
|
+
* @param fieldName The name of the field for the condition.
|
|
59
|
+
* @param operator The operator of the condition.
|
|
60
|
+
* @param value The value of the condition.
|
|
61
|
+
* @returns Whether the query is a subquery of the parent condition.
|
|
62
|
+
*/
|
|
63
|
+
isSubqueryOf<F extends Paths<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
|
|
66
|
+
* to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
|
|
67
|
+
* additional conditions, as these only narrow the result set.
|
|
68
|
+
*
|
|
69
|
+
* @param condition The condition to validate.
|
|
70
|
+
* @returns Whether the query is a subquery of the parent condition.
|
|
71
|
+
*/
|
|
72
|
+
isSubqueryOfCondition(condition: GeneralCondition<T>): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Verifies that the query is a subquery of the specified conditions. A subquery is defined as a query that evaluates
|
|
75
|
+
* to a subset of the results that would be obtained by applying the parent conditions. The subquery may also include
|
|
76
|
+
* additional conditions, as these only narrow the result set.
|
|
77
|
+
*
|
|
78
|
+
* @param conditions The conditions to validate.
|
|
79
|
+
* @returns Whether the query includes subquery of the parent conditions.
|
|
80
|
+
*/
|
|
81
|
+
isSubqueryOfConditions(conditions: GeneralConditions<T>): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Verifies that the query is a subquery of the specified query. A subquery is defined as a query that evaluates
|
|
84
|
+
* to a subset of the results that obtained for the parent query, including sorts and limits.
|
|
85
|
+
*
|
|
86
|
+
* @param query The query to validate.
|
|
87
|
+
* @returns Whether the query is a subquery of the parent query.
|
|
88
|
+
*/
|
|
89
|
+
isSubqueryOfQuery(query: Query<T>): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Returns all conditions that apply to any of the specified field names. This method
|
|
92
|
+
* provides a convenient way to retrieve all conditions that involve a specific set of fields.
|
|
93
|
+
*
|
|
94
|
+
* @param fieldNames The field names for which to retrieve conditions.
|
|
95
|
+
* @returns An array of conditions that involve any of the specified field names.
|
|
96
|
+
*/
|
|
97
|
+
getConditionsFor<K extends Paths<T>>(...fieldNames: Array<K>): ContextConditions<T, K>;
|
|
98
|
+
/**
|
|
99
|
+
* Returns all conditions that apply to the specified field name. This method provides
|
|
100
|
+
* a convenient way to retrieve all conditions that involve a specific field.
|
|
101
|
+
*
|
|
102
|
+
* @param fieldName The field name for which to retrieve conditions.
|
|
103
|
+
* @returns An array of conditions that involve the specified field name.
|
|
104
|
+
*/
|
|
105
|
+
getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns true if the given document can be a result of the query.
|
|
108
|
+
* The method does not account for limit and sort order.
|
|
109
|
+
*/
|
|
110
|
+
documentMatchesQuery(doc: DocumentData): boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A list of context conditions.
|
|
114
|
+
* @category Database
|
|
115
|
+
*/
|
|
116
|
+
export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
|
|
117
|
+
/**
|
|
118
|
+
* A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'.
|
|
119
|
+
* @category Database
|
|
120
|
+
*/
|
|
121
|
+
export type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
|
|
122
|
+
/**
|
|
123
|
+
* A condition using the 'in' operator to match values within a set.
|
|
124
|
+
* @category Database
|
|
125
|
+
*/
|
|
126
|
+
export interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
|
|
127
|
+
/** Specifies the 'in' operator to check if a value exists within an array. */
|
|
128
|
+
operator: 'in';
|
|
129
|
+
/** An array of values to match against the field. */
|
|
130
|
+
value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A condition using the 'not in' operator to exclude values within a set.
|
|
134
|
+
* @category Database
|
|
135
|
+
*/
|
|
136
|
+
export interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
|
|
137
|
+
/** Specifies the 'not in' operator to check if a value does not exist within an array. */
|
|
138
|
+
operator: 'not in';
|
|
139
|
+
/** An array of values to exclude from the field. */
|
|
140
|
+
value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A condition using operators other than 'in' or 'not in' for field comparisons.
|
|
144
|
+
* @category Database
|
|
145
|
+
*/
|
|
146
|
+
export interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
|
|
147
|
+
/** The operator to use for the comparison, excluding 'in' and 'not in'. */
|
|
148
|
+
operator: Exclude<ContextOperator, 'in' | 'not in'>;
|
|
149
|
+
/** The value to compare against the field. */
|
|
150
|
+
value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A condition that includes all operators, including 'in' and 'not in', for general use.
|
|
154
|
+
* @category Database
|
|
155
|
+
*/
|
|
156
|
+
export interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
|
|
157
|
+
/** The operator to apply to the condition, including all possible operators. */
|
|
158
|
+
operator: AllOperators;
|
|
159
|
+
/** The value to use in the condition comparison. */
|
|
160
|
+
value: any;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A list of general conditions.
|
|
164
|
+
* @category Database
|
|
165
|
+
*/
|
|
166
|
+
export type GeneralConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<GeneralCondition<Doc, F>>;
|
|
167
|
+
/**
|
|
168
|
+
* @category Database
|
|
169
|
+
*/
|
|
170
|
+
export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
|
|
171
|
+
type AllOperators = Operator | 'in' | 'not in';
|
|
172
|
+
/**
|
|
173
|
+
* A generic value that can exist in a query.
|
|
174
|
+
* @category Database
|
|
175
|
+
*/
|
|
176
|
+
export type GenericValue<Doc = any, F extends Paths<Doc> = Paths<Doc>, O extends AllOperators = any> = O extends 'in' ? Array<DeepRecord<Doc>[F]> | null : O extends 'not in' ? Array<DeepRecord<Doc>[F]> | null : DeepRecord<Doc>[F] | null;
|
|
177
|
+
export {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiAgentContext, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings } from '../public-types/ai-agent.public-types';
|
|
2
|
+
import { AiProviderType } from '../public-types/ai-common.public-types';
|
|
3
|
+
import { AiContextMetadata, AiContextMetadataFilter } from '../public-types/ai-knowledge-base.public-types';
|
|
4
|
+
import { AiAgentId, AiKnowledgeBaseId, AppId, ClientRequestId } from '../public-types/communication.public-types';
|
|
5
|
+
import { JobId } from '../public-types/job.public-types';
|
|
6
|
+
import { SecretKey } from '../public-types/secret.public-types';
|
|
7
|
+
/** Specification for an AI model, defining its operational parameters. */
|
|
8
|
+
export type AiModelSpec = {
|
|
9
|
+
/** Maximum tokens the model can generate in a single response. */
|
|
10
|
+
maxOutputTokens: number;
|
|
11
|
+
/** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
|
|
12
|
+
contextWindowTokens: number;
|
|
13
|
+
};
|
|
14
|
+
export interface AiChatRequest {
|
|
15
|
+
agentId: AiAgentId;
|
|
16
|
+
clientRequestId: ClientRequestId;
|
|
17
|
+
prompt?: string;
|
|
18
|
+
options?: AllAiAgentChatOptions;
|
|
19
|
+
jobId: JobId;
|
|
20
|
+
}
|
|
21
|
+
export interface AiAskRequest {
|
|
22
|
+
agentId: AiAgentId;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
options?: AllAiAgentChatOptions;
|
|
25
|
+
jobId: JobId;
|
|
26
|
+
}
|
|
27
|
+
export interface AiGenerateImageRequest {
|
|
28
|
+
prompt: string;
|
|
29
|
+
options: AiGenerateImageOptions;
|
|
30
|
+
}
|
|
31
|
+
export interface AiAskQuestionInternalRequest {
|
|
32
|
+
appId: AppId;
|
|
33
|
+
prompt: string;
|
|
34
|
+
options: AiChatOptions;
|
|
35
|
+
}
|
|
36
|
+
export interface AiAskQuestionInternalResponse {
|
|
37
|
+
answer: string;
|
|
38
|
+
}
|
|
39
|
+
export interface GetSharedAgentsInternalRequest {
|
|
40
|
+
organizationId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface GetSharedAgentsInternalResponse {
|
|
43
|
+
sharedAgents: Array<{
|
|
44
|
+
agentId: AiAgentId;
|
|
45
|
+
appId: AppId;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
export interface ClearSharedAgentsForOrgInternalRequest {
|
|
49
|
+
organizationId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface AiContextSizeRequest {
|
|
52
|
+
appId: AppId;
|
|
53
|
+
agentId: AiAgentId;
|
|
54
|
+
}
|
|
55
|
+
export interface AiContextSizeResponse {
|
|
56
|
+
sizeBytes: number;
|
|
57
|
+
}
|
|
58
|
+
export interface AiAskResponse {
|
|
59
|
+
responseString: string;
|
|
60
|
+
annotations?: Record<string, AiAnnotation>;
|
|
61
|
+
}
|
|
62
|
+
export interface AiAskWithVoiceResponse {
|
|
63
|
+
responseString: string;
|
|
64
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
65
|
+
annotations?: Record<string, AiAnnotation>;
|
|
66
|
+
}
|
|
67
|
+
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
68
|
+
transcribedPrompt: string;
|
|
69
|
+
responseString: string;
|
|
70
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
71
|
+
annotations?: Record<string, AiAnnotation>;
|
|
72
|
+
}
|
|
73
|
+
export interface AiTranscribeAndChatResponse {
|
|
74
|
+
transcribedPrompt: string;
|
|
75
|
+
}
|
|
76
|
+
export interface AiAudioCreateSpeechResponse {
|
|
77
|
+
mimeType: string;
|
|
78
|
+
extension: string;
|
|
79
|
+
base64File: string;
|
|
80
|
+
}
|
|
81
|
+
export interface AiAudioCreateSpeechRequest {
|
|
82
|
+
input: string;
|
|
83
|
+
options: AiAudioCreateSpeechOptions;
|
|
84
|
+
}
|
|
85
|
+
export interface GetAgentRequest {
|
|
86
|
+
agentId: AiAgentId;
|
|
87
|
+
}
|
|
88
|
+
export interface GetAgentResponse {
|
|
89
|
+
agent: AiAgent | undefined;
|
|
90
|
+
}
|
|
91
|
+
export interface GetAgentContextRequest {
|
|
92
|
+
agentId: AiAgentId;
|
|
93
|
+
contextId: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ConnectAgentKnowledgeBaseRequest {
|
|
96
|
+
agentId: AiAgentId;
|
|
97
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
98
|
+
description: string;
|
|
99
|
+
}
|
|
100
|
+
export interface DisconnectAgentKnowledgeBaseRequest {
|
|
101
|
+
agentId: AiAgentId;
|
|
102
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
103
|
+
}
|
|
104
|
+
export interface DeleteAgentRequest {
|
|
105
|
+
agentId: AiAgentId;
|
|
106
|
+
}
|
|
107
|
+
export interface UnshareAgentRequest {
|
|
108
|
+
agentId: AiAgentId;
|
|
109
|
+
}
|
|
110
|
+
export interface SetAgentOptionInPathRequest {
|
|
111
|
+
agentId: AiAgentId;
|
|
112
|
+
path: string;
|
|
113
|
+
value: unknown;
|
|
114
|
+
}
|
|
115
|
+
export interface ListAgentContextsRequest {
|
|
116
|
+
agentId: AiAgentId;
|
|
117
|
+
}
|
|
118
|
+
export interface ListAgentContextsResponse {
|
|
119
|
+
contexts: Array<AiAgentContext>;
|
|
120
|
+
}
|
|
121
|
+
export interface DeleteAgentContextsRequest {
|
|
122
|
+
agentId: AiAgentId;
|
|
123
|
+
contextIds: Array<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface UpsertAgentContextsRequest {
|
|
126
|
+
agentId: AiAgentId;
|
|
127
|
+
contextRequests: Array<AgentContextRequest>;
|
|
128
|
+
}
|
|
129
|
+
export interface UpsertAgentCustomGuardrailsRequest {
|
|
130
|
+
agentId: AiAgentId;
|
|
131
|
+
customGuardrail: string;
|
|
132
|
+
}
|
|
133
|
+
export interface DeleteAgentCustomGuardrailsRequest {
|
|
134
|
+
agentId: AiAgentId;
|
|
135
|
+
}
|
|
136
|
+
export interface ListAgentsResponse {
|
|
137
|
+
agents: Array<AiAgent>;
|
|
138
|
+
}
|
|
139
|
+
export interface GetApplicationAiSettingsResponse {
|
|
140
|
+
settings: ApplicationAiSettings;
|
|
141
|
+
}
|
|
142
|
+
export interface GetApplicationAiSettingsResponse {
|
|
143
|
+
settings: ApplicationAiSettings;
|
|
144
|
+
}
|
|
145
|
+
export interface SetApplicationAiSettingsRequest {
|
|
146
|
+
settings: ApplicationAiSettings;
|
|
147
|
+
}
|
|
148
|
+
export interface SetAiProviderApiKeySecretRequest {
|
|
149
|
+
providerType: AiProviderType;
|
|
150
|
+
secretKey: SecretKey | undefined;
|
|
151
|
+
}
|
|
152
|
+
export interface SetAiProviderApiKeySecretResponse {
|
|
153
|
+
settings: ApplicationAiSettings;
|
|
154
|
+
}
|
|
155
|
+
export interface RegenerateAgentApiKeyRequest {
|
|
156
|
+
agentId: AiAgentId;
|
|
157
|
+
}
|
|
158
|
+
export interface GetAgentApiKeyRequest {
|
|
159
|
+
agentId: AiAgentId;
|
|
160
|
+
}
|
|
161
|
+
export declare function validateAiContextMetadata(metadata: AiContextMetadata): void;
|
|
162
|
+
export declare function validateAiContextMetadataFilter(filter: AiContextMetadataFilter): void;
|
|
163
|
+
export declare const METADATA_SERVICE_FUNCTION_NAME = "default:metadata";
|
|
164
|
+
export interface UpdateApplicationAiSettingsWebhookPayload {
|
|
165
|
+
appId: AppId;
|
|
166
|
+
aiSettings: ApplicationAiSettings;
|
|
167
|
+
}
|
|
168
|
+
export interface GetChatHistoryRequest {
|
|
169
|
+
agentId: AiAgentId;
|
|
170
|
+
memoryId: string;
|
|
171
|
+
}
|
|
172
|
+
export interface GetChatHistoryResponse {
|
|
173
|
+
messages: Array<AiChatMessage>;
|
|
174
|
+
}
|
|
175
|
+
export interface ProvideAgentFeedbackRequest {
|
|
176
|
+
agentId: string;
|
|
177
|
+
feedback: string;
|
|
178
|
+
}
|
|
179
|
+
export interface UploadAiFileRequest {
|
|
180
|
+
/** AI provider to upload file to. */
|
|
181
|
+
provider: AiProviderType;
|
|
182
|
+
/** Optional expiration time in seconds. If provided, file will be registered for automatic cleanup. */
|
|
183
|
+
expirationInSeconds?: number;
|
|
184
|
+
}
|
|
185
|
+
export interface UploadAiFileResponse {
|
|
186
|
+
fileId: string;
|
|
187
|
+
}
|
|
188
|
+
export interface DeleteAiFileRequest {
|
|
189
|
+
fileId: string;
|
|
190
|
+
/** AI provider that owns the file. */
|
|
191
|
+
provider: AiProviderType;
|
|
192
|
+
}
|
|
193
|
+
export interface DeleteAiFileResponse {
|
|
194
|
+
deleted: boolean;
|
|
195
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseSearchResultChunk, AiKnowledgeBaseWithOptionalChatModel } from '../public-types/ai-knowledge-base.public-types';
|
|
2
|
+
import { AiContextId, AiKnowledgeBaseId, AppId } from '../public-types/communication.public-types';
|
|
3
|
+
/**
|
|
4
|
+
* Request structure for getting an AiKnowledgeBase
|
|
5
|
+
* @category AI
|
|
6
|
+
*/
|
|
7
|
+
export interface GetAiKnowledgeBaseRequest {
|
|
8
|
+
/** The id of the app */
|
|
9
|
+
appId: AppId;
|
|
10
|
+
/** The id of the AiKnowledgeBase */
|
|
11
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Request structure for getting all AiKnowledgeBases
|
|
15
|
+
* @category AI
|
|
16
|
+
*/
|
|
17
|
+
export interface GetAiKnowledgeBasesRequest {
|
|
18
|
+
/** The id of the app */
|
|
19
|
+
appId: AppId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Response structure for getting an AiKnowledgeBase
|
|
23
|
+
* @category AI
|
|
24
|
+
*/
|
|
25
|
+
export interface GetAiKnowledgeBaseResponse {
|
|
26
|
+
/** The resulting AiKnowledgeBase, if it is found */
|
|
27
|
+
knowledgeBase: AiKnowledgeBase | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Request structure for deleting an AiKnowledgeBase
|
|
31
|
+
* @category AI
|
|
32
|
+
*/
|
|
33
|
+
export interface DeleteAiKnowledgeBaseRequest {
|
|
34
|
+
/** The id of the AiKnowledgeBase */
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Request structure for upserting an AiKnowledgeBase
|
|
39
|
+
* @category AI
|
|
40
|
+
*/
|
|
41
|
+
export interface UpsertAiKnowledgeBaseRequest {
|
|
42
|
+
/** The AiKnowledgeBase to upsert */
|
|
43
|
+
knowledgeBase: Omit<AiKnowledgeBaseWithOptionalChatModel, 'appId' | 'updatedAt'>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Response structure for listing AiKnowledgeBases
|
|
47
|
+
* @category AI
|
|
48
|
+
*/
|
|
49
|
+
export interface ListAiKnowledgeBasesResponse {
|
|
50
|
+
/** The list of AiKnowledgeBases */
|
|
51
|
+
knowledgeBases: Array<AiKnowledgeBase>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Request structure for listing AiKnowledgeBaseContexts
|
|
55
|
+
* @category AI
|
|
56
|
+
*/
|
|
57
|
+
export interface ListAiKnowledgeBaseContextsRequest {
|
|
58
|
+
/** The id of the AiKnowledgeBase */
|
|
59
|
+
id: string;
|
|
60
|
+
/** The number of characters after which text is truncated. Optional */
|
|
61
|
+
truncateTextAfter?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Response structure to list AiKnowledgeBaseContexts
|
|
65
|
+
* @category AI
|
|
66
|
+
*/
|
|
67
|
+
export interface ListAiKnowledgeBaseContextsResponse {
|
|
68
|
+
/** The list of AiKnowledgeBaseContexts */
|
|
69
|
+
contexts: Array<AiKnowledgeBaseContext>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Response structure to list contextids for an AiKnowledgeBase
|
|
73
|
+
* @category AI
|
|
74
|
+
*/
|
|
75
|
+
export interface ListAiKnowledgeBaseContextIdsResponse {
|
|
76
|
+
/** The list of AiContextIds */
|
|
77
|
+
contextIds: Array<AiContextId>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Request structure for deleting AiKnowledgeBaseContexts
|
|
81
|
+
* @category AI
|
|
82
|
+
*/
|
|
83
|
+
export interface DeleteAiKnowledgeBaseContextsRequest {
|
|
84
|
+
/** The id of the AiKnowledgeBase */
|
|
85
|
+
knowledgeBaseId: string;
|
|
86
|
+
/** An array of AiKnowledgeBaseContext ids */
|
|
87
|
+
contextIds: Array<string>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Request structure for getting an AiKnowledgeBaseContext
|
|
91
|
+
* @category AI
|
|
92
|
+
*/
|
|
93
|
+
export interface GetAiKnowledgeBaseContextRequest {
|
|
94
|
+
/** The id of the AiKnowledgeBase */
|
|
95
|
+
knowledgeBaseId: string;
|
|
96
|
+
/** The id of the AiKnowledgeBaseContext */
|
|
97
|
+
contextId: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Request structure for getting all AiKnowledgeBaseContexts
|
|
101
|
+
* for a given knowledge base
|
|
102
|
+
* @category AI
|
|
103
|
+
*/
|
|
104
|
+
export interface GetAiKnowledgeBaseContextsRequest {
|
|
105
|
+
/** The id of the app */
|
|
106
|
+
appId: AppId;
|
|
107
|
+
/** The id of the AiKnowledgeBase */
|
|
108
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
109
|
+
/** The number of characters after which text is truncated. Optional */
|
|
110
|
+
truncateTextAfter?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Response structure for getting an AiKnowledgeBaseContext
|
|
114
|
+
* @category AI
|
|
115
|
+
*/
|
|
116
|
+
export interface GetAiKnowledgeBaseContextResponse {
|
|
117
|
+
/** The resulting AiKnowledgeBaseContext, if it is found */
|
|
118
|
+
context: AiKnowledgeBaseContext | undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Request structure for upserting context for an AiKnowledgeBase
|
|
122
|
+
* @category AI
|
|
123
|
+
*/
|
|
124
|
+
export interface UpsertAiKnowledgeBaseContextsRequest {
|
|
125
|
+
/** The id of the AiKnowledgeBase */
|
|
126
|
+
knowledgeBaseId: string;
|
|
127
|
+
/** The AiKnowledgeBaseContext data, which could be a file or text */
|
|
128
|
+
contextRequests: Array<AiKnowledgeBaseContextRequest>;
|
|
129
|
+
/** The job ID to use for the async upsert job */
|
|
130
|
+
jobId: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Response structure for searching an AiKnowledgeBase
|
|
134
|
+
* @category AI
|
|
135
|
+
*/
|
|
136
|
+
export interface AiKnowledgeBaseSearchResponse {
|
|
137
|
+
/** Array of result chunks from the search */
|
|
138
|
+
chunks: Array<AiKnowledgeBaseSearchResultChunk>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Request structure for getting the size of context
|
|
142
|
+
* for an AiKnowledgeBase
|
|
143
|
+
* @category AI
|
|
144
|
+
*/
|
|
145
|
+
export interface AiKnowledgeBaseContextSizeRequest {
|
|
146
|
+
/** The ID of the App */
|
|
147
|
+
appId: AppId;
|
|
148
|
+
/** The ID of the AIKnowledgeBase */
|
|
149
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
153
|
+
*/
|
|
154
|
+
export interface AiKnowledgeBaseReimportAllFilesRequest {
|
|
155
|
+
/** The ID of the AIKnowledgeBase */
|
|
156
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
160
|
+
*/
|
|
161
|
+
export interface AiKnowledgeBaseReimportFilesRequest {
|
|
162
|
+
/** The ID of the AIKnowledgeBase */
|
|
163
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
164
|
+
/** The ids of the AiKnowledgeBaseContexts to reimport */
|
|
165
|
+
contextIds: Array<string>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Response structure for getting size of context
|
|
169
|
+
* @category AI
|
|
170
|
+
*/
|
|
171
|
+
export interface AiKnowledgeBaseContextSizeResponse {
|
|
172
|
+
/** Size of context bytes, as a number */
|
|
173
|
+
sizeBytes: number;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Request structure for getting the values vector of
|
|
177
|
+
* a specific context
|
|
178
|
+
*
|
|
179
|
+
* @category AI
|
|
180
|
+
*/
|
|
181
|
+
export interface AiKnowledgeBaseValueVectorRequest {
|
|
182
|
+
/** The ID of the App */
|
|
183
|
+
appId: AppId;
|
|
184
|
+
/** The ID of the AIKnowledgeBase */
|
|
185
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
186
|
+
/** The ID of the context */
|
|
187
|
+
contextId: AiContextId;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Response structure for getting values vector of a
|
|
191
|
+
* specific context
|
|
192
|
+
* @category AI
|
|
193
|
+
*/
|
|
194
|
+
export interface AiKnowledgeBaseValueVectorResponse {
|
|
195
|
+
/** The vector */
|
|
196
|
+
vector: number[];
|
|
197
|
+
}
|
|
198
|
+
export interface AiKnowledgeBaseChatRequest {
|
|
199
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
200
|
+
prompt?: string;
|
|
201
|
+
options?: AiKnowledgeBaseChatOptions;
|
|
202
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MmEntity, MmEntityMatch, MmFindMatchesOptions, MmListEntitiesOptions, MmMatchMaker } from '../public-types/ai-matchmaking.public-types';
|
|
2
|
+
export interface MmCreateMatchMakerRequest {
|
|
3
|
+
matchMaker: MmMatchMaker;
|
|
4
|
+
}
|
|
5
|
+
export interface MmDeleteMatchMakerRequest {
|
|
6
|
+
matchMakerId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MmGetMatchMakerRequest {
|
|
9
|
+
matchMakerId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface MmGetMatchMakerResponse {
|
|
12
|
+
matchMaker: MmMatchMaker | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface MmDeleteEntityRequest {
|
|
15
|
+
matchMakerId: string;
|
|
16
|
+
entityId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface MmInsertEntityRequest {
|
|
19
|
+
matchMakerId: string;
|
|
20
|
+
entity: MmEntity;
|
|
21
|
+
}
|
|
22
|
+
export interface MmInsertEntitiesRequest {
|
|
23
|
+
matchMakerId: string;
|
|
24
|
+
entities: Array<MmEntity>;
|
|
25
|
+
}
|
|
26
|
+
export interface MmFindMatchesRequest {
|
|
27
|
+
matchMakerId: string;
|
|
28
|
+
entityId: string;
|
|
29
|
+
options: MmFindMatchesOptions;
|
|
30
|
+
}
|
|
31
|
+
export interface MmFindMatchesResponse {
|
|
32
|
+
matches: Array<MmEntityMatch>;
|
|
33
|
+
}
|
|
34
|
+
export interface MmFindMatchesForEntityRequest {
|
|
35
|
+
matchMakerId: string;
|
|
36
|
+
entity: Omit<MmEntity, 'metadata' | 'id'>;
|
|
37
|
+
options: MmFindMatchesOptions;
|
|
38
|
+
}
|
|
39
|
+
export interface MmFindMatchesForEntityResponse {
|
|
40
|
+
matches: Array<MmEntityMatch>;
|
|
41
|
+
}
|
|
42
|
+
export interface MmListMatchMakersResponse {
|
|
43
|
+
matchMakers: Array<MmMatchMaker>;
|
|
44
|
+
}
|
|
45
|
+
export interface MmListEntitiesRequest {
|
|
46
|
+
matchMakerId: string;
|
|
47
|
+
categoryId: string;
|
|
48
|
+
options: MmListEntitiesOptions;
|
|
49
|
+
}
|
|
50
|
+
export interface MmListEntitiesResponse {
|
|
51
|
+
entities: Array<MmEntity>;
|
|
52
|
+
}
|
|
53
|
+
export interface MmGetEntityRequest {
|
|
54
|
+
matchMakerId: string;
|
|
55
|
+
entityId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface MmGetEntityResponse {
|
|
58
|
+
entity: MmEntity | undefined;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ChatId = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** HTTP header names used by Squid for request metadata. */
|
|
2
|
+
export declare const SquidHeaders: {
|
|
3
|
+
/** Correlates logs and spans across distributed calls. */
|
|
4
|
+
readonly TRACE_ID: "x-squid-traceid";
|
|
5
|
+
/** Shared secret header for internal authentication. */
|
|
6
|
+
readonly SECRET: "x-squid-secret";
|
|
7
|
+
/** API key provided by the calling application. */
|
|
8
|
+
readonly APP_API_KEY: "x-app-api-key";
|
|
9
|
+
/** Unique identifier of the client application. */
|
|
10
|
+
readonly APP_ID: "x-squid-appid";
|
|
11
|
+
/** Unique identifier of the end user or service client. */
|
|
12
|
+
readonly CLIENT_ID: "x-squid-clientid";
|
|
13
|
+
/** Version string of the Squid client library. */
|
|
14
|
+
readonly CLIENT_VERSION: "x-squid-client-version";
|
|
15
|
+
/** Originating IP address of the request. */
|
|
16
|
+
readonly SOURCE_IP: "x-squid-source-ip";
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|