@algolia/agent-studio 0.1.0-beta.0
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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/browser.d.ts +1999 -0
- package/dist/builds/browser.js +1354 -0
- package/dist/builds/browser.js.map +1 -0
- package/dist/builds/browser.min.js +6 -0
- package/dist/builds/browser.min.js.map +1 -0
- package/dist/builds/browser.umd.js +16 -0
- package/dist/builds/fetch.js +1364 -0
- package/dist/builds/fetch.js.map +1 -0
- package/dist/builds/node.cjs +1390 -0
- package/dist/builds/node.cjs.map +1 -0
- package/dist/builds/node.js +1364 -0
- package/dist/builds/node.js.map +1 -0
- package/dist/builds/worker.js +1348 -0
- package/dist/builds/worker.js.map +1 -0
- package/dist/fetch.d.ts +2000 -0
- package/dist/node.d.cts +2000 -0
- package/dist/node.d.ts +2000 -0
- package/dist/src/agentStudioClient.cjs +1341 -0
- package/dist/src/agentStudioClient.cjs.map +1 -0
- package/dist/src/agentStudioClient.js +1315 -0
- package/dist/src/agentStudioClient.js.map +1 -0
- package/dist/worker.d.ts +2000 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,1999 @@
|
|
|
1
|
+
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ServerSentEvent, StreamEvent, ClientOptions } from '@algolia/client-common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the algolia_display_results tool.
|
|
6
|
+
*/
|
|
7
|
+
type AlgoliaDisplayResultsToolConfig = {
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
type: string;
|
|
10
|
+
minGroups?: number | undefined;
|
|
11
|
+
maxGroups?: number | undefined;
|
|
12
|
+
minResultsPerGroup?: number | undefined;
|
|
13
|
+
maxResultsPerGroup?: number | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type AlgoliaRecommendToolIndexConfig = {
|
|
17
|
+
index: string;
|
|
18
|
+
modelName: string;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for the Algolia Recommend tool. Allows specifying recommend models and related parameters.
|
|
24
|
+
*/
|
|
25
|
+
type AlgoliaRecommendToolConfigInput = {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
allowedConfigs?: Array<AlgoliaRecommendToolIndexConfig> | undefined;
|
|
29
|
+
predefinedRecommendParameters?: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A facets parameter that is always hidden from the LLM.
|
|
36
|
+
*/
|
|
37
|
+
type FacetsParam = {
|
|
38
|
+
exposed?: boolean | undefined;
|
|
39
|
+
_default?: Array<string> | null | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Constraints for a number parameter.
|
|
44
|
+
*/
|
|
45
|
+
type NumberParamConstraint = {
|
|
46
|
+
min?: number | null | undefined;
|
|
47
|
+
max?: number | null | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A number search parameter with exposure control and optional constraints.
|
|
52
|
+
*/
|
|
53
|
+
type NumberParam = {
|
|
54
|
+
exposed: boolean;
|
|
55
|
+
_default?: number | null | undefined;
|
|
56
|
+
constraint?: NumberParamConstraint | null | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constraints for a string array parameter.
|
|
61
|
+
*/
|
|
62
|
+
type StringArrayParamConstraint = {
|
|
63
|
+
values?: Array<string> | null | undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A string array search parameter with exposure control, constraints, and merge behavior.
|
|
68
|
+
*/
|
|
69
|
+
type StringArrayParam = {
|
|
70
|
+
exposed: boolean;
|
|
71
|
+
_default?: Array<string> | null | undefined;
|
|
72
|
+
constraint?: StringArrayParamConstraint | null | undefined;
|
|
73
|
+
merge?: boolean | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A text search parameter with exposure control.
|
|
78
|
+
*/
|
|
79
|
+
type TextParam = {
|
|
80
|
+
exposed: boolean;
|
|
81
|
+
_default?: string | null | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Structured search parameters configuration for an Algolia index. Each parameter controls whether it is exposed to the LLM, its default value, optional constraints, and merge behavior.
|
|
86
|
+
*/
|
|
87
|
+
type IndexSearchParameters = {
|
|
88
|
+
query?: TextParam | null | undefined;
|
|
89
|
+
hitsPerPage?: NumberParam | undefined;
|
|
90
|
+
page?: NumberParam | undefined;
|
|
91
|
+
attributesToRetrieve?: StringArrayParam | undefined;
|
|
92
|
+
responseFields?: StringArrayParam | undefined;
|
|
93
|
+
facets?: FacetsParam | null | undefined;
|
|
94
|
+
custom?: {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
} | null | undefined;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* AdvancedSyntaxFeatures.
|
|
101
|
+
*/
|
|
102
|
+
type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* AlternativesAsExact.
|
|
106
|
+
*/
|
|
107
|
+
type AlternativesAsExact = 'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym' | 'ignoreConjugations';
|
|
108
|
+
|
|
109
|
+
type AroundPrecisionUnion = number | Array<{
|
|
110
|
+
[key: string]: number;
|
|
111
|
+
}>;
|
|
112
|
+
|
|
113
|
+
type AroundRadiusUnion = number | string;
|
|
114
|
+
|
|
115
|
+
type DistinctUnion = boolean | number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word. - `attribute`. The Exact ranking criterion is 1 if the query word and attribute value are the same. For example, a search for \"road\" will match the value \"road\", but not \"road trip\". - `none`. The Exact ranking criterion is ignored on single-word searches. - `word`. The Exact ranking criterion is 1 if the query word is found in the attribute value. The query word must have at least 3 characters and must not be a stop word. Only exact matches will be highlighted, partial and prefix matches won\'t.
|
|
119
|
+
*/
|
|
120
|
+
type ExactOnSingleWordQuery = 'attribute' | 'none' | 'word';
|
|
121
|
+
|
|
122
|
+
type FacetFiltersUnion = Array<FacetFiltersUnion> | string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Order of facet names.
|
|
126
|
+
*/
|
|
127
|
+
type Facets = Record<string, any> & {
|
|
128
|
+
order?: Array<string> | null | undefined;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
type FacetsUnion = Array<string> | Facets;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* ISO code for a supported language.
|
|
135
|
+
*/
|
|
136
|
+
type SupportedLanguage = 'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh';
|
|
137
|
+
|
|
138
|
+
type IgnorePluralsUnion = boolean | Array<SupportedLanguage>;
|
|
139
|
+
|
|
140
|
+
type InsideBoundingBoxUnion = string | Array<Array<number>>;
|
|
141
|
+
|
|
142
|
+
type InsidePolygonUnion = string | Array<Array<number>>;
|
|
143
|
+
|
|
144
|
+
type NumericFiltersUnion = string | Array<NumericFiltersUnion>;
|
|
145
|
+
|
|
146
|
+
type OptionalFiltersUnion = string | Array<OptionalFiltersUnion>;
|
|
147
|
+
|
|
148
|
+
type OptionalWordsUnion = string | Array<string>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as a prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching).
|
|
152
|
+
*/
|
|
153
|
+
type QueryType = 'prefixLast' | 'prefixAll' | 'prefixNone';
|
|
154
|
+
|
|
155
|
+
type ReRankingApplyFilterUnion = string | Array<{
|
|
156
|
+
[key: string]: any;
|
|
157
|
+
}>;
|
|
158
|
+
|
|
159
|
+
type RemoveStopWordsUnion = boolean | Array<SupportedLanguage>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Strategy for removing words from the query when it doesn\'t return any results. This helps to avoid returning empty search results. - `none`. No words are removed when a query doesn\'t return results. - `lastWords`. Treat the last (then second to last, then third to last) word as optional, until there are results or at most 5 words have been removed. - `firstWords`. Treat the first (then second, then third) word as optional, until there are results or at most 5 words have been removed. - `allOptional`. Treat all words as optional. For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results).
|
|
163
|
+
*/
|
|
164
|
+
type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
|
|
165
|
+
|
|
166
|
+
type TagFiltersUnion = string | Array<TagFiltersUnion>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
|
|
170
|
+
*/
|
|
171
|
+
type TypoToleranceEnum = 'min' | 'strict' | 'true' | 'false';
|
|
172
|
+
|
|
173
|
+
type TypoToleranceUnion = boolean | TypoToleranceEnum;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Algolia Search API parameters that can be predefined for the search tool. Reference: https://www.algolia.com/doc/api-reference/search-api-parameters/ The parameters that seemed irrelevant for the search tool have been commented out. Uses types from algoliasearch.search.models for better type safety.
|
|
177
|
+
*/
|
|
178
|
+
type SearchParameters = {
|
|
179
|
+
queryType?: QueryType | null | undefined;
|
|
180
|
+
similarQuery?: string | null | undefined;
|
|
181
|
+
queryLanguages?: Array<SupportedLanguage> | null | undefined;
|
|
182
|
+
advancedSyntax?: boolean | null | undefined;
|
|
183
|
+
advancedSyntaxFeatures?: Array<AdvancedSyntaxFeatures> | null | undefined;
|
|
184
|
+
alternativesAsExact?: Array<AlternativesAsExact> | null | undefined;
|
|
185
|
+
decompoundQuery?: boolean | null | undefined;
|
|
186
|
+
typoTolerance?: TypoToleranceUnion | null | undefined;
|
|
187
|
+
allowTyposOnNumericTokens?: boolean | null | undefined;
|
|
188
|
+
minWordSizeFor1Typo?: number | null | undefined;
|
|
189
|
+
minWordSizeFor2Typos?: number | null | undefined;
|
|
190
|
+
disableTypoToleranceOnAttributes?: Array<string> | null | undefined;
|
|
191
|
+
filters?: string | null | undefined;
|
|
192
|
+
facetFilters?: FacetFiltersUnion | null | undefined;
|
|
193
|
+
facets?: FacetsUnion | null | undefined;
|
|
194
|
+
maxValuesPerFacet?: number | null | undefined;
|
|
195
|
+
maxFacetHits?: number | null | undefined;
|
|
196
|
+
facetingAfterDistinct?: boolean | null | undefined;
|
|
197
|
+
sortFacetValuesBy?: string | null | undefined;
|
|
198
|
+
numericFilters?: NumericFiltersUnion | null | undefined;
|
|
199
|
+
tagFilters?: TagFiltersUnion | null | undefined;
|
|
200
|
+
sumOrFiltersScores?: boolean | null | undefined;
|
|
201
|
+
aroundLatLng?: string | null | undefined;
|
|
202
|
+
aroundLatLngViaIp?: boolean | null | undefined;
|
|
203
|
+
aroundRadius?: AroundRadiusUnion | null | undefined;
|
|
204
|
+
aroundPrecision?: AroundPrecisionUnion | null | undefined;
|
|
205
|
+
minimumAroundRadius?: number | null | undefined;
|
|
206
|
+
insideBoundingBox?: InsideBoundingBoxUnion | null | undefined;
|
|
207
|
+
insidePolygon?: InsidePolygonUnion | null | undefined;
|
|
208
|
+
attributesToRetrieve?: Array<string> | null | undefined;
|
|
209
|
+
attributesToSnippet?: Array<string> | null | undefined;
|
|
210
|
+
snippetEllipsisText?: string | null | undefined;
|
|
211
|
+
restrictHighlightAndSnippetArrays?: boolean | null | undefined;
|
|
212
|
+
page?: number | null | undefined;
|
|
213
|
+
offset?: number | null | undefined;
|
|
214
|
+
hitsPerPage?: number | null | undefined;
|
|
215
|
+
length?: number | null | undefined;
|
|
216
|
+
getRankingInfo?: boolean | null | undefined;
|
|
217
|
+
relevancyStrictness?: number | null | undefined;
|
|
218
|
+
minProximity?: number | null | undefined;
|
|
219
|
+
attributeCriteriaComputedByMinProximity?: boolean | null | undefined;
|
|
220
|
+
distinct?: DistinctUnion | null | undefined;
|
|
221
|
+
enableRules?: boolean | null | undefined;
|
|
222
|
+
enablePersonalization?: boolean | null | undefined;
|
|
223
|
+
personalizationImpact?: number | null | undefined;
|
|
224
|
+
enableAbTest?: boolean | null | undefined;
|
|
225
|
+
enableReRanking?: boolean | null | undefined;
|
|
226
|
+
reRankingApplyFilter?: ReRankingApplyFilterUnion | null | undefined;
|
|
227
|
+
ruleContexts?: Array<string> | null | undefined;
|
|
228
|
+
removeStopWords?: RemoveStopWordsUnion | null | undefined;
|
|
229
|
+
ignorePlurals?: IgnorePluralsUnion | null | undefined;
|
|
230
|
+
removeWordsIfNoResults?: RemoveWordsIfNoResults | null | undefined;
|
|
231
|
+
optionalWords?: OptionalWordsUnion | null | undefined;
|
|
232
|
+
optionalFilters?: OptionalFiltersUnion | null | undefined;
|
|
233
|
+
synonyms?: boolean | null | undefined;
|
|
234
|
+
replaceSynonymsInHighlight?: boolean | null | undefined;
|
|
235
|
+
analytics?: boolean | null | undefined;
|
|
236
|
+
analyticsTags?: Array<string> | null | undefined;
|
|
237
|
+
clickAnalytics?: boolean | null | undefined;
|
|
238
|
+
userToken?: string | null | undefined;
|
|
239
|
+
restrictSearchableAttributes?: Array<string> | null | undefined;
|
|
240
|
+
disableExactOnAttributes?: Array<string> | null | undefined;
|
|
241
|
+
exactOnSingleWordQuery?: ExactOnSingleWordQuery | null | undefined;
|
|
242
|
+
naturalLanguages?: Array<SupportedLanguage> | null | undefined;
|
|
243
|
+
percentileComputation?: boolean | null | undefined;
|
|
244
|
+
explain?: Array<string> | null | undefined;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
type AlgoliaSearchToolIndexConfig = {
|
|
248
|
+
index: string;
|
|
249
|
+
description: string;
|
|
250
|
+
enhancedDescription?: string | undefined;
|
|
251
|
+
searchParameters?: SearchParameters | null | undefined;
|
|
252
|
+
searchControls?: IndexSearchParameters | null | undefined;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
type AlgoliaSearchToolConfig = {
|
|
256
|
+
name: string;
|
|
257
|
+
type: string;
|
|
258
|
+
indices: Array<AlgoliaSearchToolIndexConfig>;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
type ClientToolsArgsSchema = {
|
|
262
|
+
type?: string | undefined;
|
|
263
|
+
properties?: {
|
|
264
|
+
[key: string]: any;
|
|
265
|
+
} | undefined;
|
|
266
|
+
required?: Array<string> | undefined;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
type ClientSideToolConfig = {
|
|
270
|
+
name: string;
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
inputSchema: ClientToolsArgsSchema;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
type McpToolConfig = {
|
|
277
|
+
requiresApproval?: boolean | null | undefined;
|
|
278
|
+
alias?: string | null | undefined;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
type ToolConfig = McpToolConfig | boolean;
|
|
282
|
+
|
|
283
|
+
type McpServerToolConfig = {
|
|
284
|
+
url: string;
|
|
285
|
+
transport?: string | undefined;
|
|
286
|
+
headers: {
|
|
287
|
+
[key: string]: string;
|
|
288
|
+
};
|
|
289
|
+
name: string;
|
|
290
|
+
type: string;
|
|
291
|
+
/**
|
|
292
|
+
* Stable unique identifier for this MCP tool.
|
|
293
|
+
*/
|
|
294
|
+
id?: string | null | undefined;
|
|
295
|
+
allowedTools?: {
|
|
296
|
+
[key: string]: ToolConfig;
|
|
297
|
+
} | null | undefined;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Exists only to ensure that when you change branch from toolX to feat/toolY, your config stays valid.
|
|
302
|
+
*/
|
|
303
|
+
type UnknownToolConfig = Record<string, any> & {
|
|
304
|
+
name: string;
|
|
305
|
+
type: string;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
type ToolConfigInput = ClientSideToolConfig | AlgoliaSearchToolConfig | AlgoliaRecommendToolConfigInput | AlgoliaDisplayResultsToolConfig | McpServerToolConfig | UnknownToolConfig;
|
|
309
|
+
|
|
310
|
+
type AgentConfigCreate = {
|
|
311
|
+
name: string;
|
|
312
|
+
description?: string | undefined;
|
|
313
|
+
providerId?: string | undefined;
|
|
314
|
+
model?: string | undefined;
|
|
315
|
+
/**
|
|
316
|
+
* The agent prompt: defines the agent\'s role, tone, and goals. Guides how it answers using the provided context. Corresponds to the \'Agent prompt\' field in the dashboard.
|
|
317
|
+
*/
|
|
318
|
+
instructions: string;
|
|
319
|
+
/**
|
|
320
|
+
* The system prompt: defines system-level rules and constraints. Guides how the agent uses tools, features, and generates context. Prepended before `instructions` in the final prompt sent to the LLM. Typically injected by an agent template — modify with caution, as changes may affect behavior, tool usage, or response accuracy. Corresponds to the \'System prompt\' field in the dashboard.
|
|
321
|
+
*/
|
|
322
|
+
systemPrompt?: string | undefined;
|
|
323
|
+
templateType?: string | undefined;
|
|
324
|
+
config?: {
|
|
325
|
+
[key: string]: any;
|
|
326
|
+
} | undefined;
|
|
327
|
+
tools?: Array<ToolConfigInput> | undefined;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
type AgentStatus = 'draft' | 'published';
|
|
331
|
+
|
|
332
|
+
type AgentWithVersionResponse = {
|
|
333
|
+
id: string;
|
|
334
|
+
name: string;
|
|
335
|
+
description: string | null;
|
|
336
|
+
status: AgentStatus;
|
|
337
|
+
providerId: string | null;
|
|
338
|
+
model?: string | null | undefined;
|
|
339
|
+
instructions: string;
|
|
340
|
+
systemPrompt?: string | null | undefined;
|
|
341
|
+
config: {
|
|
342
|
+
[key: string]: any;
|
|
343
|
+
};
|
|
344
|
+
tools?: Array<ToolConfigInput> | undefined;
|
|
345
|
+
templateType?: string | null | undefined;
|
|
346
|
+
createdAt: string;
|
|
347
|
+
updatedAt: string | null;
|
|
348
|
+
lastUsedAt: string | null;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Single allowed domain in API responses.
|
|
353
|
+
*/
|
|
354
|
+
type AllowedDomainResponse = {
|
|
355
|
+
id: string;
|
|
356
|
+
appId: string;
|
|
357
|
+
agentId: string;
|
|
358
|
+
domain: string;
|
|
359
|
+
createdAt: string;
|
|
360
|
+
updatedAt: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* List of allowed domains for an application.
|
|
365
|
+
*/
|
|
366
|
+
type AllowedDomainListResponse = {
|
|
367
|
+
domains: Array<AllowedDomainResponse>;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
type ApplicationConfigPatch = {
|
|
371
|
+
/**
|
|
372
|
+
* Maximum number of days to retain data. Valid values: [0, 30, 60, 90].
|
|
373
|
+
*/
|
|
374
|
+
maxRetentionDays?: number | null | undefined;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
type ApplicationConfigResponse = {
|
|
378
|
+
maxRetentionDays: number;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Public metadata exposed on conversation responses.
|
|
383
|
+
*/
|
|
384
|
+
type ConversationMetadata = {
|
|
385
|
+
cachedAt?: string | null | undefined;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
type FeedbackResponse = {
|
|
389
|
+
id: string;
|
|
390
|
+
agentId: string;
|
|
391
|
+
messageId: string;
|
|
392
|
+
vote: number;
|
|
393
|
+
tags: Array<string>;
|
|
394
|
+
notes?: string | null | undefined;
|
|
395
|
+
model?: string | null | undefined;
|
|
396
|
+
createdAt: string;
|
|
397
|
+
updatedAt: string;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
type ReasoningPart = {
|
|
401
|
+
type: string;
|
|
402
|
+
text: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
type StartPart = {
|
|
406
|
+
type: string;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
type StartStepPart = {
|
|
410
|
+
type: string;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
type TextPart = {
|
|
414
|
+
type: string;
|
|
415
|
+
text: string;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
type ToolApprovalRequestPart = {
|
|
419
|
+
type: string;
|
|
420
|
+
toolCallId: string;
|
|
421
|
+
toolName: string;
|
|
422
|
+
args: any | null;
|
|
423
|
+
description?: string | null | undefined;
|
|
424
|
+
providerOptions?: {
|
|
425
|
+
[key: string]: any;
|
|
426
|
+
} | null | undefined;
|
|
427
|
+
argsHash?: string | null | undefined;
|
|
428
|
+
appId?: string | null | undefined;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
type ToolCallPart = {
|
|
432
|
+
type: string;
|
|
433
|
+
toolCallId: string;
|
|
434
|
+
toolName: string;
|
|
435
|
+
args: any | null;
|
|
436
|
+
requiresApproval?: boolean | null | undefined;
|
|
437
|
+
providerOptions?: {
|
|
438
|
+
[key: string]: any;
|
|
439
|
+
} | null | undefined;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The valid \'type\' of tool results.
|
|
444
|
+
*/
|
|
445
|
+
type ToolResultOutputType = 'text' | 'json' | 'error-text' | 'error-json' | 'content';
|
|
446
|
+
|
|
447
|
+
type ToolResultOutput = {
|
|
448
|
+
type: ToolResultOutputType;
|
|
449
|
+
value: any | null;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
type ToolResultPart = {
|
|
453
|
+
type: string;
|
|
454
|
+
toolCallId: string;
|
|
455
|
+
toolName: string;
|
|
456
|
+
output: ToolResultOutput;
|
|
457
|
+
providerOptions?: {
|
|
458
|
+
[key: string]: any;
|
|
459
|
+
} | null | undefined;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
type MessagePart = TextPart | ToolCallPart | ToolResultPart | StartPart | StartStepPart | ReasoningPart | ToolApprovalRequestPart;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Role of a message in the conversation.
|
|
466
|
+
*/
|
|
467
|
+
type MessageRole = 'user' | 'assistant';
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Response model for a message.
|
|
471
|
+
*/
|
|
472
|
+
type MessageResponse = {
|
|
473
|
+
id: string;
|
|
474
|
+
conversationId: string;
|
|
475
|
+
role: MessageRole;
|
|
476
|
+
parts: Array<MessagePart>;
|
|
477
|
+
createdAt: string;
|
|
478
|
+
updatedAt: string;
|
|
479
|
+
model?: string | null | undefined;
|
|
480
|
+
inputTokens?: number | null | undefined;
|
|
481
|
+
outputTokens?: number | null | undefined;
|
|
482
|
+
turnContext?: {
|
|
483
|
+
[key: string]: string;
|
|
484
|
+
} | null | undefined;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Response model for a conversation with all its messages.
|
|
489
|
+
*/
|
|
490
|
+
type ConversationFullResponse = {
|
|
491
|
+
id: string;
|
|
492
|
+
agentId: string;
|
|
493
|
+
title?: string | null | undefined;
|
|
494
|
+
createdAt: string;
|
|
495
|
+
updatedAt: string;
|
|
496
|
+
lastActivityAt?: string | null | undefined;
|
|
497
|
+
userToken?: string | null | undefined;
|
|
498
|
+
isFromDashboard?: boolean | undefined;
|
|
499
|
+
messageCount?: number | undefined;
|
|
500
|
+
totalInputTokens?: number | undefined;
|
|
501
|
+
totalOutputTokens?: number | undefined;
|
|
502
|
+
totalTokens?: number | undefined;
|
|
503
|
+
conversationMetadata?: ConversationMetadata | null | undefined;
|
|
504
|
+
feedback?: Array<FeedbackResponse> | null | undefined;
|
|
505
|
+
messages: Array<MessageResponse>;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
type VoteEnum = 0 | 1;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Request model for creating a feedback entry.
|
|
512
|
+
*/
|
|
513
|
+
type FeedbackCreationRequest = {
|
|
514
|
+
messageId: string;
|
|
515
|
+
agentId: string;
|
|
516
|
+
vote: VoteEnum;
|
|
517
|
+
tags?: Array<string> | undefined;
|
|
518
|
+
notes?: string | undefined;
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
type PaginationMetadata = {
|
|
522
|
+
page: number;
|
|
523
|
+
limit: number;
|
|
524
|
+
totalCount: number;
|
|
525
|
+
totalPages: number;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
type PaginatedAgentsResponse = {
|
|
529
|
+
data: Array<AgentWithVersionResponse>;
|
|
530
|
+
pagination: PaginationMetadata;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Lightweight response model without its messages.
|
|
535
|
+
*/
|
|
536
|
+
type ConversationBaseResponse = {
|
|
537
|
+
id: string;
|
|
538
|
+
agentId: string;
|
|
539
|
+
title?: string | null | undefined;
|
|
540
|
+
createdAt: string;
|
|
541
|
+
updatedAt: string;
|
|
542
|
+
lastActivityAt?: string | null | undefined;
|
|
543
|
+
userToken?: string | null | undefined;
|
|
544
|
+
isFromDashboard?: boolean | undefined;
|
|
545
|
+
messageCount?: number | undefined;
|
|
546
|
+
totalInputTokens?: number | undefined;
|
|
547
|
+
totalOutputTokens?: number | undefined;
|
|
548
|
+
totalTokens?: number | undefined;
|
|
549
|
+
conversationMetadata?: ConversationMetadata | null | undefined;
|
|
550
|
+
feedback?: Array<FeedbackResponse> | null | undefined;
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
type PaginatedConversationsResponse = {
|
|
554
|
+
data: Array<ConversationBaseResponse>;
|
|
555
|
+
pagination: PaginationMetadata;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Anthropic-specific provider input.
|
|
560
|
+
*/
|
|
561
|
+
type AnthropicProviderInput = {
|
|
562
|
+
apiKey: string;
|
|
563
|
+
baseUrl?: string | null | undefined;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Azure OpenAI-specific provider input.
|
|
568
|
+
*/
|
|
569
|
+
type AzureOpenAIProviderInput = {
|
|
570
|
+
apiKey: string;
|
|
571
|
+
azureEndpoint: string;
|
|
572
|
+
/**
|
|
573
|
+
* Azure model deployment name is required.
|
|
574
|
+
*/
|
|
575
|
+
azureDeployment: string;
|
|
576
|
+
apiVersion?: string | null | undefined;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Base input that all providers must have.
|
|
581
|
+
*/
|
|
582
|
+
type BaseProviderInput = {
|
|
583
|
+
apiKey: string;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* OpenAI-compatible provider input. Contrary to the OpenAIProviderInput, the base_url is required. A model is required to verify connectivity and get saved as the default model. This can later be changed at the Agent level.
|
|
588
|
+
*/
|
|
589
|
+
type OpenAICompatibleProviderInput = {
|
|
590
|
+
apiKey: string;
|
|
591
|
+
baseUrl: string;
|
|
592
|
+
/**
|
|
593
|
+
* Default model for this provider. Used for validation and as fallback when no model is specified at agent level.
|
|
594
|
+
*/
|
|
595
|
+
defaultModel: string;
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* OpenAI-specific provider input.
|
|
600
|
+
*/
|
|
601
|
+
type OpenAIProviderInput = {
|
|
602
|
+
apiKey: string;
|
|
603
|
+
baseUrl?: string | null | undefined;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
type ProviderInput = OpenAIProviderInput | AzureOpenAIProviderInput | OpenAICompatibleProviderInput | BaseProviderInput | AnthropicProviderInput;
|
|
607
|
+
|
|
608
|
+
type ProviderAuthenticationResponse = {
|
|
609
|
+
id: string;
|
|
610
|
+
name: string;
|
|
611
|
+
providerName: string;
|
|
612
|
+
input: ProviderInput;
|
|
613
|
+
createdAt: string;
|
|
614
|
+
updatedAt: string;
|
|
615
|
+
lastUsedAt?: string | null | undefined;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
type PaginatedProviderAuthenticationsResponse = {
|
|
619
|
+
data: Array<ProviderAuthenticationResponse>;
|
|
620
|
+
pagination: PaginationMetadata;
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
type SecretKeyResponse = {
|
|
624
|
+
id: string;
|
|
625
|
+
name: string;
|
|
626
|
+
value: string;
|
|
627
|
+
createdAt: string;
|
|
628
|
+
updatedAt: string;
|
|
629
|
+
lastUsedAt: string | null;
|
|
630
|
+
isDefault?: boolean | undefined;
|
|
631
|
+
agentIds: Array<string>;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
type PaginatedSecretKeysResponse = {
|
|
635
|
+
data: Array<SecretKeyResponse>;
|
|
636
|
+
pagination: PaginationMetadata;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
type ProviderName = 'openai' | 'azure_openai' | 'google_genai' | 'deepseek' | 'openai_compatible' | 'anthropic';
|
|
640
|
+
|
|
641
|
+
type ProviderAuthenticationCreate = {
|
|
642
|
+
name: string;
|
|
643
|
+
providerName: ProviderName;
|
|
644
|
+
input: ProviderInput;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Secret key creation payload.
|
|
649
|
+
*/
|
|
650
|
+
type SecretKeyCreate = {
|
|
651
|
+
/**
|
|
652
|
+
* The name of the secret key.
|
|
653
|
+
*/
|
|
654
|
+
name: string;
|
|
655
|
+
/**
|
|
656
|
+
* List of agent IDs this secret key is associated with.
|
|
657
|
+
*/
|
|
658
|
+
agentIds?: Array<string> | undefined;
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Episodic memory schema following LangMem\'s OTAR pattern: Observation → Thoughts → Action → Result Captures complete interaction experiences for agent learning. See https://langchain-ai.github.io/langmem/concepts/conceptual_guide/#episodic-memory-past-experiences.
|
|
663
|
+
*/
|
|
664
|
+
type Episode = {
|
|
665
|
+
/**
|
|
666
|
+
* What user wanted + key context (1-2 sentences). Include prior failed attempts if they informed the approach.
|
|
667
|
+
*/
|
|
668
|
+
observation: string;
|
|
669
|
+
/**
|
|
670
|
+
* WHY this approach was chosen, which constraints/preferences drove decisions (1-3 sentences). Capture reasoning that applies to similar future scenarios.
|
|
671
|
+
*/
|
|
672
|
+
thoughts: string;
|
|
673
|
+
/**
|
|
674
|
+
* What was done with PRECISE details (1-3 sentences). WITH tool calls: use arrow notation `tool(param:value) → feedback → tool(refined_param:new_value)`. WITHOUT tool calls: capture communication/workflow pattern.
|
|
675
|
+
*/
|
|
676
|
+
action: string;
|
|
677
|
+
/**
|
|
678
|
+
* Learned pattern + effectiveness (1-3 sentences). What worked and WHY it\'s replicable. Note efficiency: multi-turn refinements, which results were relevant, what made final attempt succeed. Use strict `param:value` syntax for learnings. Format: \'For [context], use [param:value] because [reason]\'.
|
|
679
|
+
*/
|
|
680
|
+
result: string;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Memory types implemented so far. Follows LangMem\'s ontology: https://langchain-ai.github.io/langmem/concepts/conceptual_guide/#memory-types.
|
|
685
|
+
*/
|
|
686
|
+
type MemoryType = 'semantic' | 'episodic';
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Universal storage model for all memory types (semantic, episodic). This is the ONLY model that touches storage (Algolia). Domain models (SemanticMemory, EpisodicMemory) are used for LLM extraction and converted to MemoryRecord before saving. See https://langchain-ai.github.io/langmem/concepts/conceptual_guide/#memory-types for memory type definitions.
|
|
690
|
+
*/
|
|
691
|
+
type MemoryRecord = {
|
|
692
|
+
memoryType?: MemoryType | undefined;
|
|
693
|
+
episode?: Episode | null | undefined;
|
|
694
|
+
/**
|
|
695
|
+
* Self-contained, first-person memory for long-term recall.
|
|
696
|
+
*/
|
|
697
|
+
text: string;
|
|
698
|
+
/**
|
|
699
|
+
* Verbatim conversation extract, not paraphrased.
|
|
700
|
+
*/
|
|
701
|
+
rawExtract: string;
|
|
702
|
+
/**
|
|
703
|
+
* 5-20 free-form keywords: entities, context, search terms (any words).
|
|
704
|
+
*/
|
|
705
|
+
keywords?: Array<string> | undefined;
|
|
706
|
+
/**
|
|
707
|
+
* 2-4 topics ONLY from this list: [complaints, entertainment, family, feedback, finance, food, goals, health, history, hobbies, learning, praise, preferences, schedule, shopping, technical, travel, work].
|
|
708
|
+
*/
|
|
709
|
+
topics?: Array<string> | undefined;
|
|
710
|
+
/**
|
|
711
|
+
* Arbitrary labels/themes for flexible categorization (e.g., \'Q1-goals\', \'paris-trip\', \'vip-customer\').
|
|
712
|
+
*/
|
|
713
|
+
_tags?: Array<string> | undefined;
|
|
714
|
+
/**
|
|
715
|
+
* 3-5 natural phrases that should trigger this memory.
|
|
716
|
+
*/
|
|
717
|
+
recallTriggers?: Array<string> | undefined;
|
|
718
|
+
/**
|
|
719
|
+
* ObjectID of existing memory to update. Leave empty for new memory.
|
|
720
|
+
*/
|
|
721
|
+
objectID?: string | null | undefined;
|
|
722
|
+
/**
|
|
723
|
+
* Application ID.
|
|
724
|
+
*/
|
|
725
|
+
appId?: string | undefined;
|
|
726
|
+
/**
|
|
727
|
+
* Agent IDs with access: [\'agent1\'], [\'*\'] for all, [\'*\', \'-agent1\'] to exclude.
|
|
728
|
+
*/
|
|
729
|
+
agentIDs?: Array<string> | undefined;
|
|
730
|
+
/**
|
|
731
|
+
* User ID.
|
|
732
|
+
*/
|
|
733
|
+
userID?: string | undefined;
|
|
734
|
+
/**
|
|
735
|
+
* Epoch seconds.
|
|
736
|
+
*/
|
|
737
|
+
createdAt?: number | undefined;
|
|
738
|
+
/**
|
|
739
|
+
* Epoch seconds.
|
|
740
|
+
*/
|
|
741
|
+
updatedAt?: number | undefined;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
type UserDataResponse = {
|
|
745
|
+
conversations: Array<ConversationFullResponse>;
|
|
746
|
+
memories: Array<MemoryRecord>;
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Algolia Search API parameters that can be predefined for the search tool. Reference: https://www.algolia.com/doc/api-reference/search-api-parameters/ A subset of SearchParameters of specific params we allow for runtime override.
|
|
751
|
+
*/
|
|
752
|
+
type SearchParametersOverrides = {
|
|
753
|
+
filters?: string | undefined;
|
|
754
|
+
attributesToRetrieve?: Array<string> | undefined;
|
|
755
|
+
restrictSearchableAttributes?: Array<string> | undefined;
|
|
756
|
+
distinct?: DistinctUnion | null | undefined;
|
|
757
|
+
userToken?: string | undefined;
|
|
758
|
+
enablePersonalization?: boolean | undefined;
|
|
759
|
+
personalizationImpact?: number | undefined;
|
|
760
|
+
optionalFilters?: OptionalFiltersUnion | null | undefined;
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
type AgentCompletionAlgoliaParams = {
|
|
764
|
+
mcpServers?: {
|
|
765
|
+
[key: string]: {
|
|
766
|
+
[key: string]: {
|
|
767
|
+
[key: string]: string;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
} | undefined;
|
|
771
|
+
searchParameters?: {
|
|
772
|
+
[key: string]: SearchParametersOverrides;
|
|
773
|
+
} | null | undefined;
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Dynamic configuration for testing agents.
|
|
778
|
+
*/
|
|
779
|
+
type AgentTestConfiguration = {
|
|
780
|
+
id?: string | undefined;
|
|
781
|
+
providerId?: string | undefined;
|
|
782
|
+
model?: string | undefined;
|
|
783
|
+
instructions: string;
|
|
784
|
+
systemPrompt?: string | undefined;
|
|
785
|
+
config: {
|
|
786
|
+
[key: string]: any;
|
|
787
|
+
};
|
|
788
|
+
tools: Array<ToolConfigInput>;
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
type ReasoningPartV4 = {
|
|
792
|
+
type?: string | undefined;
|
|
793
|
+
reasoning: string;
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
type StepStartPartV4 = {
|
|
797
|
+
type?: string | undefined;
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
type TextPartV4 = {
|
|
801
|
+
type?: string | undefined;
|
|
802
|
+
text: string;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Model for tool invocation in a Message.
|
|
807
|
+
*/
|
|
808
|
+
type ToolInvocationV4 = {
|
|
809
|
+
toolCallId: string;
|
|
810
|
+
toolName: string;
|
|
811
|
+
args?: {
|
|
812
|
+
[key: string]: any;
|
|
813
|
+
} | undefined;
|
|
814
|
+
result?: {
|
|
815
|
+
[key: string]: any;
|
|
816
|
+
} | undefined;
|
|
817
|
+
step?: number | undefined;
|
|
818
|
+
state?: string | undefined;
|
|
819
|
+
providerOptions?: {
|
|
820
|
+
[key: string]: any;
|
|
821
|
+
} | undefined;
|
|
822
|
+
requiresApproval?: boolean | undefined;
|
|
823
|
+
description?: string | undefined;
|
|
824
|
+
argsHash?: string | undefined;
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
type ToolInvocationPartV4 = {
|
|
828
|
+
type?: string | undefined;
|
|
829
|
+
toolInvocation: ToolInvocationV4;
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
type AssistantPartV4 = StepStartPartV4 | ReasoningPartV4 | TextPartV4 | ToolInvocationPartV4;
|
|
833
|
+
|
|
834
|
+
type AssistantMessageV4 = {
|
|
835
|
+
id?: string | undefined;
|
|
836
|
+
role: string;
|
|
837
|
+
content: string;
|
|
838
|
+
parts?: Array<AssistantPartV4> | undefined;
|
|
839
|
+
toolInvocations?: Array<ToolInvocationV4> | null | undefined;
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
type UserMessageV4 = {
|
|
843
|
+
id?: string | undefined;
|
|
844
|
+
role: string;
|
|
845
|
+
content: string;
|
|
846
|
+
parts?: Array<TextPartV4> | undefined;
|
|
847
|
+
annotations?: Array<{
|
|
848
|
+
[key: string]: any;
|
|
849
|
+
}> | undefined;
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
type MessageV4 = UserMessageV4 | AssistantMessageV4;
|
|
853
|
+
|
|
854
|
+
type ReasoningPartV5 = {
|
|
855
|
+
type?: string | undefined;
|
|
856
|
+
text: string;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
type StepStartPartV5 = {
|
|
860
|
+
type?: string | undefined;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
type TextPartV5 = {
|
|
864
|
+
type?: string | undefined;
|
|
865
|
+
text: string;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
type ToolState = 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Model for tool invocation in a Message.
|
|
872
|
+
*/
|
|
873
|
+
type ToolPartV5 = {
|
|
874
|
+
type: string;
|
|
875
|
+
toolCallId: string;
|
|
876
|
+
state?: ToolState | undefined;
|
|
877
|
+
input?: {
|
|
878
|
+
[key: string]: any;
|
|
879
|
+
} | undefined;
|
|
880
|
+
output?: {
|
|
881
|
+
[key: string]: any;
|
|
882
|
+
} | undefined;
|
|
883
|
+
errorText?: string | undefined;
|
|
884
|
+
providerOptions?: {
|
|
885
|
+
[key: string]: any;
|
|
886
|
+
} | undefined;
|
|
887
|
+
requiresApproval?: boolean | undefined;
|
|
888
|
+
description?: string | undefined;
|
|
889
|
+
argsHash?: string | undefined;
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
type AssistantPartV5 = StepStartPartV5 | TextPartV5 | ReasoningPartV5 | ToolPartV5;
|
|
893
|
+
|
|
894
|
+
type AssistantMessageV5 = {
|
|
895
|
+
id?: string | undefined;
|
|
896
|
+
role: string;
|
|
897
|
+
parts?: Array<AssistantPartV5> | undefined;
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Client-supplied metadata on a v5 user message. `turn_context` is namespaced so other callers can use `metadata` for unrelated purposes without collision. Unknown keys are preserved and ignored by this pipeline. Note: `turn_context` is deliberately typed `dict[str, Any]` (not `TurnContext`). The metadata is parsed eagerly with the request body, but cap/charset validation must be deferred to `extract_turn_context_v5` so the kill-switch (`TURN_CONTEXT_ENABLED=false`) can silently drop payloads instead of 422-ing. See `test_invalid_metadata_does_not_raise_at_model_construction`.
|
|
902
|
+
*/
|
|
903
|
+
type UserMessageMetadataV5 = Record<string, any> & {
|
|
904
|
+
turnContext?: {
|
|
905
|
+
[key: string]: any;
|
|
906
|
+
} | undefined;
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
type UserMessageV5 = {
|
|
910
|
+
id?: string | undefined;
|
|
911
|
+
role: string;
|
|
912
|
+
parts?: Array<TextPartV5> | undefined;
|
|
913
|
+
metadata?: UserMessageMetadataV5 | undefined;
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
type MessageV5 = UserMessageV5 | AssistantMessageV5;
|
|
917
|
+
|
|
918
|
+
type MessagesUnion = Array<MessageV4> | Array<MessageV5>;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Request model for creating a completion for an assistant.
|
|
922
|
+
*/
|
|
923
|
+
type AgentCompletionRequest = {
|
|
924
|
+
configuration?: AgentTestConfiguration | undefined;
|
|
925
|
+
messages?: MessagesUnion | null | undefined;
|
|
926
|
+
/**
|
|
927
|
+
* Optional conversation id.
|
|
928
|
+
*/
|
|
929
|
+
id?: string | undefined;
|
|
930
|
+
algolia?: AgentCompletionAlgoliaParams | undefined;
|
|
931
|
+
/**
|
|
932
|
+
* Approval decisions for pending tool calls keyed by toolCallId.
|
|
933
|
+
*/
|
|
934
|
+
toolApprovals?: Record<string, unknown> | undefined;
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
type AgentConfigUpdate = {
|
|
938
|
+
name?: string | null | undefined;
|
|
939
|
+
description?: string | null | undefined;
|
|
940
|
+
providerId?: string | null | undefined;
|
|
941
|
+
model?: string | null | undefined;
|
|
942
|
+
/**
|
|
943
|
+
* The agent prompt: defines the agent\'s role, tone, and goals. Guides how it answers using the provided context. Corresponds to the \'Agent prompt\' field in the dashboard.
|
|
944
|
+
*/
|
|
945
|
+
instructions?: string | null | undefined;
|
|
946
|
+
/**
|
|
947
|
+
* The system prompt: defines system-level rules and constraints. Guides how the agent uses tools, features, and generates context. Prepended before `instructions` in the final prompt sent to the LLM. Typically injected by an agent template — modify with caution, as changes may affect behavior, tool usage, or response accuracy. Corresponds to the \'System prompt\' field in the dashboard.
|
|
948
|
+
*/
|
|
949
|
+
systemPrompt?: string | null | undefined;
|
|
950
|
+
config?: {
|
|
951
|
+
[key: string]: any;
|
|
952
|
+
} | null | undefined;
|
|
953
|
+
tools?: Array<ToolConfigInput> | null | undefined;
|
|
954
|
+
templateType?: string | null | undefined;
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Request body for bulk delete by IDs.
|
|
959
|
+
*/
|
|
960
|
+
type AllowedDomainBulkDelete = {
|
|
961
|
+
/**
|
|
962
|
+
* IDs of allowed domain records to delete.
|
|
963
|
+
*/
|
|
964
|
+
domainIds: Array<string>;
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Request body for bulk insert.
|
|
969
|
+
*/
|
|
970
|
+
type AllowedDomainBulkInsert = {
|
|
971
|
+
/**
|
|
972
|
+
* List of domain patterns to add.
|
|
973
|
+
*/
|
|
974
|
+
domains: Array<string>;
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Request body to add a single allowed domain.
|
|
979
|
+
*/
|
|
980
|
+
type AllowedDomainCreate = {
|
|
981
|
+
/**
|
|
982
|
+
* Domain or pattern, e.g. https://app.example.com or *.example.com.
|
|
983
|
+
*/
|
|
984
|
+
domain: string;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Support Compatibility modes for the completion API.
|
|
989
|
+
*/
|
|
990
|
+
type CompatibilityMode = 'ai-sdk-4' | 'ai-sdk-5';
|
|
991
|
+
|
|
992
|
+
type ProviderInputNullable = OpenAIProviderInput | AzureOpenAIProviderInput | OpenAICompatibleProviderInput | BaseProviderInput | AnthropicProviderInput;
|
|
993
|
+
|
|
994
|
+
type ProviderAuthenticationPatch = {
|
|
995
|
+
name?: string | null | undefined;
|
|
996
|
+
input?: ProviderInputNullable | null | undefined;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* Secret key patch payload.
|
|
1001
|
+
*/
|
|
1002
|
+
type SecretKeyPatch = {
|
|
1003
|
+
/**
|
|
1004
|
+
* The new name of the secret key.
|
|
1005
|
+
*/
|
|
1006
|
+
name?: string | null | undefined;
|
|
1007
|
+
/**
|
|
1008
|
+
* Updated list of agent IDs this secret key is associated with.
|
|
1009
|
+
*/
|
|
1010
|
+
agentIds?: Array<string> | null | undefined;
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Properties for the `bulkCreateAllowedDomains` method.
|
|
1015
|
+
*/
|
|
1016
|
+
type BulkCreateAllowedDomainsProps = {
|
|
1017
|
+
/**
|
|
1018
|
+
* The agentId.
|
|
1019
|
+
*/
|
|
1020
|
+
agentId: string;
|
|
1021
|
+
allowedDomainBulkInsert: AllowedDomainBulkInsert;
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
1024
|
+
* Properties for the `bulkDeleteAllowedDomains` method.
|
|
1025
|
+
*/
|
|
1026
|
+
type BulkDeleteAllowedDomainsProps = {
|
|
1027
|
+
/**
|
|
1028
|
+
* The agentId.
|
|
1029
|
+
*/
|
|
1030
|
+
agentId: string;
|
|
1031
|
+
allowedDomainBulkDelete: AllowedDomainBulkDelete;
|
|
1032
|
+
};
|
|
1033
|
+
/**
|
|
1034
|
+
* Properties for the `createAgentAllowedDomain` method.
|
|
1035
|
+
*/
|
|
1036
|
+
type CreateAgentAllowedDomainProps = {
|
|
1037
|
+
/**
|
|
1038
|
+
* The agentId.
|
|
1039
|
+
*/
|
|
1040
|
+
agentId: string;
|
|
1041
|
+
allowedDomainCreate: AllowedDomainCreate;
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* Properties for the `createAgentCompletion` method.
|
|
1045
|
+
*/
|
|
1046
|
+
type CreateAgentCompletionProps = {
|
|
1047
|
+
/**
|
|
1048
|
+
* The agentId.
|
|
1049
|
+
*/
|
|
1050
|
+
agentId: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Compatibility mode for the completion API.
|
|
1053
|
+
*/
|
|
1054
|
+
compatibilityMode: CompatibilityMode;
|
|
1055
|
+
agentCompletionRequest: AgentCompletionRequest;
|
|
1056
|
+
/**
|
|
1057
|
+
* Whether to stream the response or not.
|
|
1058
|
+
*/
|
|
1059
|
+
stream?: boolean | undefined;
|
|
1060
|
+
/**
|
|
1061
|
+
* Use cached responses if available.
|
|
1062
|
+
*/
|
|
1063
|
+
cache?: boolean | undefined;
|
|
1064
|
+
/**
|
|
1065
|
+
* Set to false to disable memory (enabled by default).
|
|
1066
|
+
*/
|
|
1067
|
+
memory?: boolean | undefined;
|
|
1068
|
+
/**
|
|
1069
|
+
* Set to false to skip analytics for this completion (default: true). Disables Agent Studio BigQuery analytics, Algolia search analytics, click analytics, and query-suggestions training. Useful for offline-eval workflows.
|
|
1070
|
+
*/
|
|
1071
|
+
analytics?: boolean | undefined;
|
|
1072
|
+
/**
|
|
1073
|
+
* The X-Algolia-Secure-User-Token.
|
|
1074
|
+
*/
|
|
1075
|
+
xAlgoliaSecureUserToken?: string | undefined;
|
|
1076
|
+
};
|
|
1077
|
+
/**
|
|
1078
|
+
* Properties for the `customDelete` method.
|
|
1079
|
+
*/
|
|
1080
|
+
type CustomDeleteProps = {
|
|
1081
|
+
/**
|
|
1082
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1083
|
+
*/
|
|
1084
|
+
path: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Query parameters to apply to the current query.
|
|
1087
|
+
*/
|
|
1088
|
+
parameters?: {
|
|
1089
|
+
[key: string]: any;
|
|
1090
|
+
} | undefined;
|
|
1091
|
+
};
|
|
1092
|
+
/**
|
|
1093
|
+
* Properties for the `customGet` method.
|
|
1094
|
+
*/
|
|
1095
|
+
type CustomGetProps = {
|
|
1096
|
+
/**
|
|
1097
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1098
|
+
*/
|
|
1099
|
+
path: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Query parameters to apply to the current query.
|
|
1102
|
+
*/
|
|
1103
|
+
parameters?: {
|
|
1104
|
+
[key: string]: any;
|
|
1105
|
+
} | undefined;
|
|
1106
|
+
};
|
|
1107
|
+
/**
|
|
1108
|
+
* Properties for the `customPost` method.
|
|
1109
|
+
*/
|
|
1110
|
+
type CustomPostProps = {
|
|
1111
|
+
/**
|
|
1112
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1113
|
+
*/
|
|
1114
|
+
path: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Query parameters to apply to the current query.
|
|
1117
|
+
*/
|
|
1118
|
+
parameters?: {
|
|
1119
|
+
[key: string]: any;
|
|
1120
|
+
} | undefined;
|
|
1121
|
+
/**
|
|
1122
|
+
* Parameters to send with the custom request.
|
|
1123
|
+
*/
|
|
1124
|
+
body?: Record<string, unknown> | undefined;
|
|
1125
|
+
};
|
|
1126
|
+
/**
|
|
1127
|
+
* Properties for the `customPut` method.
|
|
1128
|
+
*/
|
|
1129
|
+
type CustomPutProps = {
|
|
1130
|
+
/**
|
|
1131
|
+
* Path of the endpoint, for example `1/newFeature`.
|
|
1132
|
+
*/
|
|
1133
|
+
path: string;
|
|
1134
|
+
/**
|
|
1135
|
+
* Query parameters to apply to the current query.
|
|
1136
|
+
*/
|
|
1137
|
+
parameters?: {
|
|
1138
|
+
[key: string]: any;
|
|
1139
|
+
} | undefined;
|
|
1140
|
+
/**
|
|
1141
|
+
* Parameters to send with the custom request.
|
|
1142
|
+
*/
|
|
1143
|
+
body?: Record<string, unknown> | undefined;
|
|
1144
|
+
};
|
|
1145
|
+
/**
|
|
1146
|
+
* Properties for the `deleteAgent` method.
|
|
1147
|
+
*/
|
|
1148
|
+
type DeleteAgentProps = {
|
|
1149
|
+
/**
|
|
1150
|
+
* The agentId.
|
|
1151
|
+
*/
|
|
1152
|
+
agentId: string;
|
|
1153
|
+
};
|
|
1154
|
+
/**
|
|
1155
|
+
* Properties for the `deleteAgentConversations` method.
|
|
1156
|
+
*/
|
|
1157
|
+
type DeleteAgentConversationsProps = {
|
|
1158
|
+
/**
|
|
1159
|
+
* The agentId.
|
|
1160
|
+
*/
|
|
1161
|
+
agentId: string;
|
|
1162
|
+
/**
|
|
1163
|
+
* Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1164
|
+
*/
|
|
1165
|
+
startDate?: string | undefined;
|
|
1166
|
+
/**
|
|
1167
|
+
* Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1168
|
+
*/
|
|
1169
|
+
endDate?: string | undefined;
|
|
1170
|
+
};
|
|
1171
|
+
/**
|
|
1172
|
+
* Properties for the `deleteAllowedDomain` method.
|
|
1173
|
+
*/
|
|
1174
|
+
type DeleteAllowedDomainProps = {
|
|
1175
|
+
/**
|
|
1176
|
+
* The domainId.
|
|
1177
|
+
*/
|
|
1178
|
+
domainId: string;
|
|
1179
|
+
/**
|
|
1180
|
+
* The agentId.
|
|
1181
|
+
*/
|
|
1182
|
+
agentId: string;
|
|
1183
|
+
};
|
|
1184
|
+
/**
|
|
1185
|
+
* Properties for the `deleteConversation` method.
|
|
1186
|
+
*/
|
|
1187
|
+
type DeleteConversationProps = {
|
|
1188
|
+
/**
|
|
1189
|
+
* The conversationId.
|
|
1190
|
+
*/
|
|
1191
|
+
conversationId: string;
|
|
1192
|
+
/**
|
|
1193
|
+
* The agentId.
|
|
1194
|
+
*/
|
|
1195
|
+
agentId: string;
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
1198
|
+
* Properties for the `deleteProvider` method.
|
|
1199
|
+
*/
|
|
1200
|
+
type DeleteProviderProps = {
|
|
1201
|
+
/**
|
|
1202
|
+
* The providerId.
|
|
1203
|
+
*/
|
|
1204
|
+
providerId: string;
|
|
1205
|
+
};
|
|
1206
|
+
/**
|
|
1207
|
+
* Properties for the `deleteSecretKey` method.
|
|
1208
|
+
*/
|
|
1209
|
+
type DeleteSecretKeyProps = {
|
|
1210
|
+
/**
|
|
1211
|
+
* The secretKeyId.
|
|
1212
|
+
*/
|
|
1213
|
+
secretKeyId: string;
|
|
1214
|
+
};
|
|
1215
|
+
/**
|
|
1216
|
+
* Properties for the `deleteUserData` method.
|
|
1217
|
+
*/
|
|
1218
|
+
type DeleteUserDataProps = {
|
|
1219
|
+
/**
|
|
1220
|
+
* The userToken.
|
|
1221
|
+
*/
|
|
1222
|
+
userToken: string;
|
|
1223
|
+
};
|
|
1224
|
+
/**
|
|
1225
|
+
* Properties for the `exportConversations` method.
|
|
1226
|
+
*/
|
|
1227
|
+
type ExportConversationsProps = {
|
|
1228
|
+
/**
|
|
1229
|
+
* The agentId.
|
|
1230
|
+
*/
|
|
1231
|
+
agentId: string;
|
|
1232
|
+
/**
|
|
1233
|
+
* Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1234
|
+
*/
|
|
1235
|
+
startDate?: string | undefined;
|
|
1236
|
+
/**
|
|
1237
|
+
* Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1238
|
+
*/
|
|
1239
|
+
endDate?: string | undefined;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* Properties for the `getAgent` method.
|
|
1243
|
+
*/
|
|
1244
|
+
type GetAgentProps = {
|
|
1245
|
+
/**
|
|
1246
|
+
* The agentId.
|
|
1247
|
+
*/
|
|
1248
|
+
agentId: string;
|
|
1249
|
+
};
|
|
1250
|
+
/**
|
|
1251
|
+
* Properties for the `getAllowedDomain` method.
|
|
1252
|
+
*/
|
|
1253
|
+
type GetAllowedDomainProps = {
|
|
1254
|
+
/**
|
|
1255
|
+
* The domainId.
|
|
1256
|
+
*/
|
|
1257
|
+
domainId: string;
|
|
1258
|
+
/**
|
|
1259
|
+
* The agentId.
|
|
1260
|
+
*/
|
|
1261
|
+
agentId: string;
|
|
1262
|
+
};
|
|
1263
|
+
/**
|
|
1264
|
+
* Properties for the `getConversation` method.
|
|
1265
|
+
*/
|
|
1266
|
+
type GetConversationProps = {
|
|
1267
|
+
/**
|
|
1268
|
+
* The conversationId.
|
|
1269
|
+
*/
|
|
1270
|
+
conversationId: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* The agentId.
|
|
1273
|
+
*/
|
|
1274
|
+
agentId: string;
|
|
1275
|
+
/**
|
|
1276
|
+
* Include feedback for the conversation.
|
|
1277
|
+
*/
|
|
1278
|
+
includeFeedback?: boolean | undefined;
|
|
1279
|
+
/**
|
|
1280
|
+
* The X-Algolia-Secure-User-Token.
|
|
1281
|
+
*/
|
|
1282
|
+
xAlgoliaSecureUserToken?: string | undefined;
|
|
1283
|
+
};
|
|
1284
|
+
/**
|
|
1285
|
+
* Properties for the `getProvider` method.
|
|
1286
|
+
*/
|
|
1287
|
+
type GetProviderProps = {
|
|
1288
|
+
/**
|
|
1289
|
+
* The providerId.
|
|
1290
|
+
*/
|
|
1291
|
+
providerId: string;
|
|
1292
|
+
};
|
|
1293
|
+
/**
|
|
1294
|
+
* Properties for the `getSecretKey` method.
|
|
1295
|
+
*/
|
|
1296
|
+
type GetSecretKeyProps = {
|
|
1297
|
+
/**
|
|
1298
|
+
* The secretKeyId.
|
|
1299
|
+
*/
|
|
1300
|
+
secretKeyId: string;
|
|
1301
|
+
};
|
|
1302
|
+
/**
|
|
1303
|
+
* Properties for the `getUserData` method.
|
|
1304
|
+
*/
|
|
1305
|
+
type GetUserDataProps = {
|
|
1306
|
+
/**
|
|
1307
|
+
* The userToken.
|
|
1308
|
+
*/
|
|
1309
|
+
userToken: string;
|
|
1310
|
+
};
|
|
1311
|
+
/**
|
|
1312
|
+
* Properties for the `invalidateAgentCache` method.
|
|
1313
|
+
*/
|
|
1314
|
+
type InvalidateAgentCacheProps = {
|
|
1315
|
+
/**
|
|
1316
|
+
* The agentId.
|
|
1317
|
+
*/
|
|
1318
|
+
agentId: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* Delete entries strictly before this date (exclusive, YYYY-MM-DD).
|
|
1321
|
+
*/
|
|
1322
|
+
before?: string | undefined;
|
|
1323
|
+
};
|
|
1324
|
+
/**
|
|
1325
|
+
* Properties for the `listAgentAllowedDomains` method.
|
|
1326
|
+
*/
|
|
1327
|
+
type ListAgentAllowedDomainsProps = {
|
|
1328
|
+
/**
|
|
1329
|
+
* The agentId.
|
|
1330
|
+
*/
|
|
1331
|
+
agentId: string;
|
|
1332
|
+
};
|
|
1333
|
+
/**
|
|
1334
|
+
* Properties for the `listAgentConversations` method.
|
|
1335
|
+
*/
|
|
1336
|
+
type ListAgentConversationsProps = {
|
|
1337
|
+
/**
|
|
1338
|
+
* The agentId.
|
|
1339
|
+
*/
|
|
1340
|
+
agentId: string;
|
|
1341
|
+
/**
|
|
1342
|
+
* Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1343
|
+
*/
|
|
1344
|
+
startDate?: string | undefined;
|
|
1345
|
+
/**
|
|
1346
|
+
* Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1347
|
+
*/
|
|
1348
|
+
endDate?: string | undefined;
|
|
1349
|
+
/**
|
|
1350
|
+
* Include feedback per conversation.
|
|
1351
|
+
*/
|
|
1352
|
+
includeFeedback?: boolean | undefined;
|
|
1353
|
+
/**
|
|
1354
|
+
* Filter by feedback value (requires includeFeedback=true).
|
|
1355
|
+
*/
|
|
1356
|
+
feedbackVote?: number | undefined;
|
|
1357
|
+
/**
|
|
1358
|
+
* Page number.
|
|
1359
|
+
*/
|
|
1360
|
+
page?: number | undefined;
|
|
1361
|
+
/**
|
|
1362
|
+
* Items per page.
|
|
1363
|
+
*/
|
|
1364
|
+
limit?: number | undefined;
|
|
1365
|
+
/**
|
|
1366
|
+
* The X-Algolia-Secure-User-Token.
|
|
1367
|
+
*/
|
|
1368
|
+
xAlgoliaSecureUserToken?: string | undefined;
|
|
1369
|
+
};
|
|
1370
|
+
/**
|
|
1371
|
+
* Properties for the `listAgents` method.
|
|
1372
|
+
*/
|
|
1373
|
+
type ListAgentsProps = {
|
|
1374
|
+
/**
|
|
1375
|
+
* Page number.
|
|
1376
|
+
*/
|
|
1377
|
+
page?: number | undefined;
|
|
1378
|
+
/**
|
|
1379
|
+
* Items per page.
|
|
1380
|
+
*/
|
|
1381
|
+
limit?: number | undefined;
|
|
1382
|
+
/**
|
|
1383
|
+
* Filter by provider id.
|
|
1384
|
+
*/
|
|
1385
|
+
providerId?: string | undefined;
|
|
1386
|
+
};
|
|
1387
|
+
/**
|
|
1388
|
+
* Properties for the `listProviderModels` method.
|
|
1389
|
+
*/
|
|
1390
|
+
type ListProviderModelsProps = {
|
|
1391
|
+
/**
|
|
1392
|
+
* The providerId.
|
|
1393
|
+
*/
|
|
1394
|
+
providerId: string;
|
|
1395
|
+
};
|
|
1396
|
+
/**
|
|
1397
|
+
* Properties for the `listProviders` method.
|
|
1398
|
+
*/
|
|
1399
|
+
type ListProvidersProps = {
|
|
1400
|
+
/**
|
|
1401
|
+
* Page number.
|
|
1402
|
+
*/
|
|
1403
|
+
page?: number | undefined;
|
|
1404
|
+
/**
|
|
1405
|
+
* Items per page.
|
|
1406
|
+
*/
|
|
1407
|
+
limit?: number | undefined;
|
|
1408
|
+
};
|
|
1409
|
+
/**
|
|
1410
|
+
* Properties for the `listSecretKeys` method.
|
|
1411
|
+
*/
|
|
1412
|
+
type ListSecretKeysProps = {
|
|
1413
|
+
/**
|
|
1414
|
+
* Page number.
|
|
1415
|
+
*/
|
|
1416
|
+
page?: number | undefined;
|
|
1417
|
+
/**
|
|
1418
|
+
* Items per page.
|
|
1419
|
+
*/
|
|
1420
|
+
limit?: number | undefined;
|
|
1421
|
+
};
|
|
1422
|
+
/**
|
|
1423
|
+
* Properties for the `publishAgent` method.
|
|
1424
|
+
*/
|
|
1425
|
+
type PublishAgentProps = {
|
|
1426
|
+
/**
|
|
1427
|
+
* The agentId.
|
|
1428
|
+
*/
|
|
1429
|
+
agentId: string;
|
|
1430
|
+
};
|
|
1431
|
+
/**
|
|
1432
|
+
* Properties for the `unpublishAgent` method.
|
|
1433
|
+
*/
|
|
1434
|
+
type UnpublishAgentProps = {
|
|
1435
|
+
/**
|
|
1436
|
+
* The agentId.
|
|
1437
|
+
*/
|
|
1438
|
+
agentId: string;
|
|
1439
|
+
};
|
|
1440
|
+
/**
|
|
1441
|
+
* Properties for the `updateAgent` method.
|
|
1442
|
+
*/
|
|
1443
|
+
type UpdateAgentProps = {
|
|
1444
|
+
/**
|
|
1445
|
+
* The agentId.
|
|
1446
|
+
*/
|
|
1447
|
+
agentId: string;
|
|
1448
|
+
agentConfigUpdate: AgentConfigUpdate;
|
|
1449
|
+
};
|
|
1450
|
+
/**
|
|
1451
|
+
* Properties for the `updateProvider` method.
|
|
1452
|
+
*/
|
|
1453
|
+
type UpdateProviderProps = {
|
|
1454
|
+
/**
|
|
1455
|
+
* The providerId.
|
|
1456
|
+
*/
|
|
1457
|
+
providerId: string;
|
|
1458
|
+
providerAuthenticationPatch: ProviderAuthenticationPatch;
|
|
1459
|
+
};
|
|
1460
|
+
/**
|
|
1461
|
+
* Properties for the `updateSecretKey` method.
|
|
1462
|
+
*/
|
|
1463
|
+
type UpdateSecretKeyProps = {
|
|
1464
|
+
/**
|
|
1465
|
+
* The secretKeyId.
|
|
1466
|
+
*/
|
|
1467
|
+
secretKeyId: string;
|
|
1468
|
+
secretKeyPatch: SecretKeyPatch;
|
|
1469
|
+
};
|
|
1470
|
+
type AgentStudioNodeHelpers = {
|
|
1471
|
+
forgeSecuredUserToken: (opts: {
|
|
1472
|
+
secretKey: string;
|
|
1473
|
+
secretKeyId: string;
|
|
1474
|
+
userId: string;
|
|
1475
|
+
expiresIn?: number;
|
|
1476
|
+
}) => string;
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
declare const apiClientVersion = "0.1.0-beta.0";
|
|
1480
|
+
/**
|
|
1481
|
+
* @beta
|
|
1482
|
+
* The Agent Studio API is not yet stable and may change without notice.
|
|
1483
|
+
* See {@link https://www.algolia.com/doc/rest-api/agent-studio | Agent Studio API docs}.
|
|
1484
|
+
*/
|
|
1485
|
+
declare function createAgentStudioClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
1486
|
+
transporter: _algolia_client_common.Transporter;
|
|
1487
|
+
/**
|
|
1488
|
+
* The `appId` currently in use.
|
|
1489
|
+
*/
|
|
1490
|
+
appId: string;
|
|
1491
|
+
/**
|
|
1492
|
+
* The `apiKey` currently in use.
|
|
1493
|
+
*/
|
|
1494
|
+
apiKey: string;
|
|
1495
|
+
/**
|
|
1496
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1497
|
+
*/
|
|
1498
|
+
clearCache(): Promise<void>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
1501
|
+
*/
|
|
1502
|
+
readonly _ua: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
1505
|
+
*
|
|
1506
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
1507
|
+
* @param version - The version of the agent.
|
|
1508
|
+
*/
|
|
1509
|
+
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
|
1510
|
+
/**
|
|
1511
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
1512
|
+
*
|
|
1513
|
+
* @param params - Method params.
|
|
1514
|
+
* @param params.apiKey - The new API Key to use.
|
|
1515
|
+
*/
|
|
1516
|
+
setClientApiKey({ apiKey }: {
|
|
1517
|
+
apiKey: string;
|
|
1518
|
+
}): void;
|
|
1519
|
+
/**
|
|
1520
|
+
* Add multiple allowed domain patterns. Duplicates are skipped.
|
|
1521
|
+
*
|
|
1522
|
+
* Required API Key ACLs:
|
|
1523
|
+
* - editSettings
|
|
1524
|
+
* @param bulkCreateAllowedDomains - The bulkCreateAllowedDomains object.
|
|
1525
|
+
* @param bulkCreateAllowedDomains.agentId - The agentId.
|
|
1526
|
+
* @param bulkCreateAllowedDomains.allowedDomainBulkInsert - The allowedDomainBulkInsert object.
|
|
1527
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1528
|
+
*/
|
|
1529
|
+
bulkCreateAllowedDomains({ agentId, allowedDomainBulkInsert }: BulkCreateAllowedDomainsProps, requestOptions?: RequestOptions): Promise<AllowedDomainListResponse>;
|
|
1530
|
+
/**
|
|
1531
|
+
* Delete allowed domains by id list.
|
|
1532
|
+
*
|
|
1533
|
+
* Required API Key ACLs:
|
|
1534
|
+
* - editSettings
|
|
1535
|
+
* @param bulkDeleteAllowedDomains - The bulkDeleteAllowedDomains object.
|
|
1536
|
+
* @param bulkDeleteAllowedDomains.agentId - The agentId.
|
|
1537
|
+
* @param bulkDeleteAllowedDomains.allowedDomainBulkDelete - The allowedDomainBulkDelete object.
|
|
1538
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1539
|
+
*/
|
|
1540
|
+
bulkDeleteAllowedDomains({ agentId, allowedDomainBulkDelete }: BulkDeleteAllowedDomainsProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1541
|
+
/**
|
|
1542
|
+
* Create a new agent.
|
|
1543
|
+
*
|
|
1544
|
+
* Required API Key ACLs:
|
|
1545
|
+
* - editSettings
|
|
1546
|
+
* @param agentConfigCreate - The agentConfigCreate object.
|
|
1547
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1548
|
+
*/
|
|
1549
|
+
createAgent(agentConfigCreate: AgentConfigCreate, requestOptions?: RequestOptions): Promise<AgentWithVersionResponse>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Add a single allowed domain pattern (e.g. https://app.example.com or *.example.com).
|
|
1552
|
+
*
|
|
1553
|
+
* Required API Key ACLs:
|
|
1554
|
+
* - editSettings
|
|
1555
|
+
* @param createAgentAllowedDomain - The createAgentAllowedDomain object.
|
|
1556
|
+
* @param createAgentAllowedDomain.agentId - The agentId.
|
|
1557
|
+
* @param createAgentAllowedDomain.allowedDomainCreate - The allowedDomainCreate object.
|
|
1558
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1559
|
+
*/
|
|
1560
|
+
createAgentAllowedDomain({ agentId, allowedDomainCreate }: CreateAgentAllowedDomainProps, requestOptions?: RequestOptions): Promise<AllowedDomainResponse>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.
|
|
1563
|
+
*
|
|
1564
|
+
* Required API Key ACLs:
|
|
1565
|
+
* - search
|
|
1566
|
+
* @param createAgentCompletion - The createAgentCompletion object.
|
|
1567
|
+
* @param createAgentCompletion.agentId - The agentId.
|
|
1568
|
+
* @param createAgentCompletion.compatibilityMode - Compatibility mode for the completion API.
|
|
1569
|
+
* @param createAgentCompletion.agentCompletionRequest - The agentCompletionRequest object.
|
|
1570
|
+
* @param createAgentCompletion.stream - Whether to stream the response or not.
|
|
1571
|
+
* @param createAgentCompletion.cache - Use cached responses if available.
|
|
1572
|
+
* @param createAgentCompletion.memory - Set to false to disable memory (enabled by default).
|
|
1573
|
+
* @param createAgentCompletion.analytics - Set to false to skip analytics for this completion (default: true). Disables Agent Studio BigQuery analytics, Algolia search analytics, click analytics, and query-suggestions training. Useful for offline-eval workflows.
|
|
1574
|
+
* @param createAgentCompletion.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
|
|
1575
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1576
|
+
*/
|
|
1577
|
+
createAgentCompletion({ agentId, compatibilityMode, agentCompletionRequest, stream, cache, memory, analytics, xAlgoliaSecureUserToken, }: CreateAgentCompletionProps, requestOptions?: RequestOptions): Promise<{
|
|
1578
|
+
[key: string]: any;
|
|
1579
|
+
}>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result. (raw streaming version).
|
|
1582
|
+
*
|
|
1583
|
+
* Yields raw {@link ServerSentEvent} objects. Each event's `data` field contains a JSON-encoded `{ [key: string]: any; }` string.
|
|
1584
|
+
*
|
|
1585
|
+
* @see createAgentCompletionStream for the parsed variant.
|
|
1586
|
+
* @see createAgentCompletion for the non-streaming version.
|
|
1587
|
+
*/
|
|
1588
|
+
createAgentCompletionStreamRaw({ agentId, compatibilityMode, agentCompletionRequest, stream, cache, memory, analytics, xAlgoliaSecureUserToken, }: CreateAgentCompletionProps, requestOptions?: RequestOptions): AsyncGenerator<ServerSentEvent>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result. (streaming version).
|
|
1591
|
+
*
|
|
1592
|
+
* Yields {@link StreamEvent} objects wrapping parsed `{ [key: string]: any; }` payloads.
|
|
1593
|
+
*
|
|
1594
|
+
* @see createAgentCompletionStreamRaw for the raw variant.
|
|
1595
|
+
* @see createAgentCompletion for the non-streaming version.
|
|
1596
|
+
*/
|
|
1597
|
+
createAgentCompletionStream({ agentId, compatibilityMode, agentCompletionRequest, stream, cache, memory, analytics, xAlgoliaSecureUserToken, }: CreateAgentCompletionProps, requestOptions?: RequestOptions): AsyncGenerator<StreamEvent<{
|
|
1598
|
+
[key: string]: any;
|
|
1599
|
+
}>>;
|
|
1600
|
+
/**
|
|
1601
|
+
* Create new feedback entry.
|
|
1602
|
+
*
|
|
1603
|
+
* Required API Key ACLs:
|
|
1604
|
+
* - search
|
|
1605
|
+
* @param feedbackCreationRequest - The feedbackCreationRequest object.
|
|
1606
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1607
|
+
*/
|
|
1608
|
+
createFeedback(feedbackCreationRequest: FeedbackCreationRequest, requestOptions?: RequestOptions): Promise<FeedbackResponse>;
|
|
1609
|
+
/**
|
|
1610
|
+
* Create Provider.
|
|
1611
|
+
*
|
|
1612
|
+
* Required API Key ACLs:
|
|
1613
|
+
* - editSettings
|
|
1614
|
+
* @param providerAuthenticationCreate - The providerAuthenticationCreate object.
|
|
1615
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1616
|
+
*/
|
|
1617
|
+
createProvider(providerAuthenticationCreate: ProviderAuthenticationCreate, requestOptions?: RequestOptions): Promise<ProviderAuthenticationResponse>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Create Secret Key.
|
|
1620
|
+
*
|
|
1621
|
+
* Required API Key ACLs:
|
|
1622
|
+
* - admin
|
|
1623
|
+
* @param secretKeyCreate - The secretKeyCreate object.
|
|
1624
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1625
|
+
*/
|
|
1626
|
+
createSecretKey(secretKeyCreate: SecretKeyCreate, requestOptions?: RequestOptions): Promise<SecretKeyResponse>;
|
|
1627
|
+
/**
|
|
1628
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1629
|
+
* @param customDelete - The customDelete object.
|
|
1630
|
+
* @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
|
|
1631
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
1632
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1633
|
+
*/
|
|
1634
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1635
|
+
/**
|
|
1636
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1637
|
+
* @param customGet - The customGet object.
|
|
1638
|
+
* @param customGet.path - Path of the endpoint, for example `1/newFeature`.
|
|
1639
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
1640
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1641
|
+
*/
|
|
1642
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1643
|
+
/**
|
|
1644
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1645
|
+
* @param customPost - The customPost object.
|
|
1646
|
+
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
|
1647
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
1648
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
1649
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1650
|
+
*/
|
|
1651
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1652
|
+
/**
|
|
1653
|
+
* This method lets you send requests to the Algolia REST API.
|
|
1654
|
+
* @param customPut - The customPut object.
|
|
1655
|
+
* @param customPut.path - Path of the endpoint, for example `1/newFeature`.
|
|
1656
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
1657
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
1658
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1659
|
+
*/
|
|
1660
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
1661
|
+
/**
|
|
1662
|
+
* Delete the specified agent.
|
|
1663
|
+
*
|
|
1664
|
+
* Required API Key ACLs:
|
|
1665
|
+
* - editSettings
|
|
1666
|
+
* @param deleteAgent - The deleteAgent object.
|
|
1667
|
+
* @param deleteAgent.agentId - The agentId.
|
|
1668
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1669
|
+
*/
|
|
1670
|
+
deleteAgent({ agentId }: DeleteAgentProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1671
|
+
/**
|
|
1672
|
+
* Deletes the conversations matching the given filers.
|
|
1673
|
+
*
|
|
1674
|
+
* Required API Key ACLs:
|
|
1675
|
+
* - logs
|
|
1676
|
+
* @param deleteAgentConversations - The deleteAgentConversations object.
|
|
1677
|
+
* @param deleteAgentConversations.agentId - The agentId.
|
|
1678
|
+
* @param deleteAgentConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1679
|
+
* @param deleteAgentConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1680
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1681
|
+
*/
|
|
1682
|
+
deleteAgentConversations({ agentId, startDate, endDate }: DeleteAgentConversationsProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Remove an allowed domain by id.
|
|
1685
|
+
*
|
|
1686
|
+
* Required API Key ACLs:
|
|
1687
|
+
* - editSettings
|
|
1688
|
+
* @param deleteAllowedDomain - The deleteAllowedDomain object.
|
|
1689
|
+
* @param deleteAllowedDomain.domainId - The domainId.
|
|
1690
|
+
* @param deleteAllowedDomain.agentId - The agentId.
|
|
1691
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1692
|
+
*/
|
|
1693
|
+
deleteAllowedDomain({ domainId, agentId }: DeleteAllowedDomainProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1694
|
+
/**
|
|
1695
|
+
* Deletes the conversation with the given ID.
|
|
1696
|
+
*
|
|
1697
|
+
* Required API Key ACLs:
|
|
1698
|
+
* - logs
|
|
1699
|
+
* @param deleteConversation - The deleteConversation object.
|
|
1700
|
+
* @param deleteConversation.conversationId - The conversationId.
|
|
1701
|
+
* @param deleteConversation.agentId - The agentId.
|
|
1702
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1703
|
+
*/
|
|
1704
|
+
deleteConversation({ conversationId, agentId }: DeleteConversationProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1705
|
+
/**
|
|
1706
|
+
* Delete Provider.
|
|
1707
|
+
*
|
|
1708
|
+
* Required API Key ACLs:
|
|
1709
|
+
* - editSettings
|
|
1710
|
+
* @param deleteProvider - The deleteProvider object.
|
|
1711
|
+
* @param deleteProvider.providerId - The providerId.
|
|
1712
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1713
|
+
*/
|
|
1714
|
+
deleteProvider({ providerId }: DeleteProviderProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Delete Secret Key.
|
|
1717
|
+
*
|
|
1718
|
+
* Required API Key ACLs:
|
|
1719
|
+
* - admin
|
|
1720
|
+
* @param deleteSecretKey - The deleteSecretKey object.
|
|
1721
|
+
* @param deleteSecretKey.secretKeyId - The secretKeyId.
|
|
1722
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1723
|
+
*/
|
|
1724
|
+
deleteSecretKey({ secretKeyId }: DeleteSecretKeyProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Permanently deletes all messages for the given user token. Does not delete conversations.
|
|
1727
|
+
*
|
|
1728
|
+
* Required API Key ACLs:
|
|
1729
|
+
* - logs
|
|
1730
|
+
* @param deleteUserData - The deleteUserData object.
|
|
1731
|
+
* @param deleteUserData.userToken - The userToken.
|
|
1732
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1733
|
+
*/
|
|
1734
|
+
deleteUserData({ userToken }: DeleteUserDataProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1735
|
+
/**
|
|
1736
|
+
* Exports all conversations based on the passed filters.
|
|
1737
|
+
*
|
|
1738
|
+
* Required API Key ACLs:
|
|
1739
|
+
* - logs
|
|
1740
|
+
* @param exportConversations - The exportConversations object.
|
|
1741
|
+
* @param exportConversations.agentId - The agentId.
|
|
1742
|
+
* @param exportConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1743
|
+
* @param exportConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1744
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1745
|
+
*/
|
|
1746
|
+
exportConversations({ agentId, startDate, endDate }: ExportConversationsProps, requestOptions?: RequestOptions): Promise<Array<ConversationFullResponse>>;
|
|
1747
|
+
/**
|
|
1748
|
+
* Retrieve details of the specified agent.
|
|
1749
|
+
*
|
|
1750
|
+
* Required API Key ACLs:
|
|
1751
|
+
* - settings
|
|
1752
|
+
* @param getAgent - The getAgent object.
|
|
1753
|
+
* @param getAgent.agentId - The agentId.
|
|
1754
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1755
|
+
*/
|
|
1756
|
+
getAgent({ agentId }: GetAgentProps, requestOptions?: RequestOptions): Promise<AgentWithVersionResponse>;
|
|
1757
|
+
/**
|
|
1758
|
+
* Get a single allowed domain by id.
|
|
1759
|
+
*
|
|
1760
|
+
* Required API Key ACLs:
|
|
1761
|
+
* - settings
|
|
1762
|
+
* @param getAllowedDomain - The getAllowedDomain object.
|
|
1763
|
+
* @param getAllowedDomain.domainId - The domainId.
|
|
1764
|
+
* @param getAllowedDomain.agentId - The agentId.
|
|
1765
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1766
|
+
*/
|
|
1767
|
+
getAllowedDomain({ domainId, agentId }: GetAllowedDomainProps, requestOptions?: RequestOptions): Promise<AllowedDomainResponse>;
|
|
1768
|
+
/**
|
|
1769
|
+
* Get Configuration.
|
|
1770
|
+
*
|
|
1771
|
+
* Required API Key ACLs:
|
|
1772
|
+
* - logs
|
|
1773
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1774
|
+
*/
|
|
1775
|
+
getConfiguration(requestOptions?: RequestOptions | undefined): Promise<ApplicationConfigResponse>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Retrieves the conversation and its messages for the given ID.
|
|
1778
|
+
*
|
|
1779
|
+
* Required API Key ACLs:
|
|
1780
|
+
* - logs
|
|
1781
|
+
* @param getConversation - The getConversation object.
|
|
1782
|
+
* @param getConversation.conversationId - The conversationId.
|
|
1783
|
+
* @param getConversation.agentId - The agentId.
|
|
1784
|
+
* @param getConversation.includeFeedback - Include feedback for the conversation.
|
|
1785
|
+
* @param getConversation.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
|
|
1786
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1787
|
+
*/
|
|
1788
|
+
getConversation({ conversationId, agentId, includeFeedback, xAlgoliaSecureUserToken }: GetConversationProps, requestOptions?: RequestOptions): Promise<ConversationFullResponse>;
|
|
1789
|
+
/**
|
|
1790
|
+
* Get Provider.
|
|
1791
|
+
*
|
|
1792
|
+
* Required API Key ACLs:
|
|
1793
|
+
* - settings
|
|
1794
|
+
* @param getProvider - The getProvider object.
|
|
1795
|
+
* @param getProvider.providerId - The providerId.
|
|
1796
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1797
|
+
*/
|
|
1798
|
+
getProvider({ providerId }: GetProviderProps, requestOptions?: RequestOptions): Promise<ProviderAuthenticationResponse>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Get Secret Key.
|
|
1801
|
+
*
|
|
1802
|
+
* Required API Key ACLs:
|
|
1803
|
+
* - settings
|
|
1804
|
+
* @param getSecretKey - The getSecretKey object.
|
|
1805
|
+
* @param getSecretKey.secretKeyId - The secretKeyId.
|
|
1806
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1807
|
+
*/
|
|
1808
|
+
getSecretKey({ secretKeyId }: GetSecretKeyProps, requestOptions?: RequestOptions): Promise<SecretKeyResponse>;
|
|
1809
|
+
/**
|
|
1810
|
+
* Retrieves all memories, conversations and their messages for the given user token.
|
|
1811
|
+
*
|
|
1812
|
+
* Required API Key ACLs:
|
|
1813
|
+
* - logs
|
|
1814
|
+
* @param getUserData - The getUserData object.
|
|
1815
|
+
* @param getUserData.userToken - The userToken.
|
|
1816
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1817
|
+
*/
|
|
1818
|
+
getUserData({ userToken }: GetUserDataProps, requestOptions?: RequestOptions): Promise<UserDataResponse>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Invalidate cached completions for this agent. Filter with `before` (exclusive).
|
|
1821
|
+
*
|
|
1822
|
+
* Required API Key ACLs:
|
|
1823
|
+
* - editSettings
|
|
1824
|
+
* @param invalidateAgentCache - The invalidateAgentCache object.
|
|
1825
|
+
* @param invalidateAgentCache.agentId - The agentId.
|
|
1826
|
+
* @param invalidateAgentCache.before - Delete entries strictly before this date (exclusive, YYYY-MM-DD).
|
|
1827
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1828
|
+
*/
|
|
1829
|
+
invalidateAgentCache({ agentId, before }: InvalidateAgentCacheProps, requestOptions?: RequestOptions): Promise<void>;
|
|
1830
|
+
/**
|
|
1831
|
+
* List all allowed domain patterns for this agent.
|
|
1832
|
+
*
|
|
1833
|
+
* Required API Key ACLs:
|
|
1834
|
+
* - settings
|
|
1835
|
+
* @param listAgentAllowedDomains - The listAgentAllowedDomains object.
|
|
1836
|
+
* @param listAgentAllowedDomains.agentId - The agentId.
|
|
1837
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1838
|
+
*/
|
|
1839
|
+
listAgentAllowedDomains({ agentId }: ListAgentAllowedDomainsProps, requestOptions?: RequestOptions): Promise<AllowedDomainListResponse>;
|
|
1840
|
+
/**
|
|
1841
|
+
* Retrieves the conversations for the given agent ID.
|
|
1842
|
+
*
|
|
1843
|
+
* Required API Key ACLs:
|
|
1844
|
+
* - logs
|
|
1845
|
+
* @param listAgentConversations - The listAgentConversations object.
|
|
1846
|
+
* @param listAgentConversations.agentId - The agentId.
|
|
1847
|
+
* @param listAgentConversations.startDate - Filter conversations created after this date (format: YYYY-MM-DD).
|
|
1848
|
+
* @param listAgentConversations.endDate - Filter conversations created before this date (format: YYYY-MM-DD).
|
|
1849
|
+
* @param listAgentConversations.includeFeedback - Include feedback per conversation.
|
|
1850
|
+
* @param listAgentConversations.feedbackVote - Filter by feedback value (requires includeFeedback=true).
|
|
1851
|
+
* @param listAgentConversations.page - Page number.
|
|
1852
|
+
* @param listAgentConversations.limit - Items per page.
|
|
1853
|
+
* @param listAgentConversations.xAlgoliaSecureUserToken - The X-Algolia-Secure-User-Token.
|
|
1854
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1855
|
+
*/
|
|
1856
|
+
listAgentConversations({ agentId, startDate, endDate, includeFeedback, feedbackVote, page, limit, xAlgoliaSecureUserToken, }: ListAgentConversationsProps, requestOptions?: RequestOptions): Promise<PaginatedConversationsResponse>;
|
|
1857
|
+
/**
|
|
1858
|
+
* List all agents with pagination and filtering.
|
|
1859
|
+
*
|
|
1860
|
+
* Required API Key ACLs:
|
|
1861
|
+
* - settings
|
|
1862
|
+
* @param listAgents - The listAgents object.
|
|
1863
|
+
* @param listAgents.page - Page number.
|
|
1864
|
+
* @param listAgents.limit - Items per page.
|
|
1865
|
+
* @param listAgents.providerId - Filter by provider id.
|
|
1866
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1867
|
+
*/
|
|
1868
|
+
listAgents({ page, limit, providerId }?: ListAgentsProps, requestOptions?: RequestOptions | undefined): Promise<PaginatedAgentsResponse>;
|
|
1869
|
+
/**
|
|
1870
|
+
* Get Provider Models.
|
|
1871
|
+
*
|
|
1872
|
+
* Required API Key ACLs:
|
|
1873
|
+
* - settings
|
|
1874
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1875
|
+
*/
|
|
1876
|
+
listModels(requestOptions?: RequestOptions | undefined): Promise<{
|
|
1877
|
+
[key: string]: Array<string>;
|
|
1878
|
+
}>;
|
|
1879
|
+
/**
|
|
1880
|
+
* Get available models for a specific provider.
|
|
1881
|
+
*
|
|
1882
|
+
* Required API Key ACLs:
|
|
1883
|
+
* - settings
|
|
1884
|
+
* @param listProviderModels - The listProviderModels object.
|
|
1885
|
+
* @param listProviderModels.providerId - The providerId.
|
|
1886
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1887
|
+
*/
|
|
1888
|
+
listProviderModels({ providerId }: ListProviderModelsProps, requestOptions?: RequestOptions): Promise<Array<string>>;
|
|
1889
|
+
/**
|
|
1890
|
+
* List Providers.
|
|
1891
|
+
*
|
|
1892
|
+
* Required API Key ACLs:
|
|
1893
|
+
* - settings
|
|
1894
|
+
* @param listProviders - The listProviders object.
|
|
1895
|
+
* @param listProviders.page - Page number.
|
|
1896
|
+
* @param listProviders.limit - Items per page.
|
|
1897
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1898
|
+
*/
|
|
1899
|
+
listProviders({ page, limit }?: ListProvidersProps, requestOptions?: RequestOptions | undefined): Promise<PaginatedProviderAuthenticationsResponse>;
|
|
1900
|
+
/**
|
|
1901
|
+
* List Secret Keys.
|
|
1902
|
+
*
|
|
1903
|
+
* Required API Key ACLs:
|
|
1904
|
+
* - settings
|
|
1905
|
+
* @param listSecretKeys - The listSecretKeys object.
|
|
1906
|
+
* @param listSecretKeys.page - Page number.
|
|
1907
|
+
* @param listSecretKeys.limit - Items per page.
|
|
1908
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1909
|
+
*/
|
|
1910
|
+
listSecretKeys({ page, limit }?: ListSecretKeysProps, requestOptions?: RequestOptions | undefined): Promise<PaginatedSecretKeysResponse>;
|
|
1911
|
+
/**
|
|
1912
|
+
* Publish the specified agent.
|
|
1913
|
+
*
|
|
1914
|
+
* Required API Key ACLs:
|
|
1915
|
+
* - editSettings
|
|
1916
|
+
* @param publishAgent - The publishAgent object.
|
|
1917
|
+
* @param publishAgent.agentId - The agentId.
|
|
1918
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1919
|
+
*/
|
|
1920
|
+
publishAgent({ agentId }: PublishAgentProps, requestOptions?: RequestOptions): Promise<AgentWithVersionResponse>;
|
|
1921
|
+
/**
|
|
1922
|
+
* Unpublish the specified agent.
|
|
1923
|
+
*
|
|
1924
|
+
* Required API Key ACLs:
|
|
1925
|
+
* - editSettings
|
|
1926
|
+
* @param unpublishAgent - The unpublishAgent object.
|
|
1927
|
+
* @param unpublishAgent.agentId - The agentId.
|
|
1928
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1929
|
+
*/
|
|
1930
|
+
unpublishAgent({ agentId }: UnpublishAgentProps, requestOptions?: RequestOptions): Promise<AgentWithVersionResponse>;
|
|
1931
|
+
/**
|
|
1932
|
+
* Update the specified agent.
|
|
1933
|
+
*
|
|
1934
|
+
* Required API Key ACLs:
|
|
1935
|
+
* - editSettings
|
|
1936
|
+
* @param updateAgent - The updateAgent object.
|
|
1937
|
+
* @param updateAgent.agentId - The agentId.
|
|
1938
|
+
* @param updateAgent.agentConfigUpdate - The agentConfigUpdate object.
|
|
1939
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1940
|
+
*/
|
|
1941
|
+
updateAgent({ agentId, agentConfigUpdate }: UpdateAgentProps, requestOptions?: RequestOptions): Promise<AgentWithVersionResponse>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Patch Configuration.
|
|
1944
|
+
*
|
|
1945
|
+
* Required API Key ACLs:
|
|
1946
|
+
* - logs
|
|
1947
|
+
* @param applicationConfigPatch - The applicationConfigPatch object.
|
|
1948
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1949
|
+
*/
|
|
1950
|
+
updateConfiguration(applicationConfigPatch: ApplicationConfigPatch, requestOptions?: RequestOptions): Promise<ApplicationConfigResponse>;
|
|
1951
|
+
/**
|
|
1952
|
+
* Update Provider.
|
|
1953
|
+
*
|
|
1954
|
+
* Required API Key ACLs:
|
|
1955
|
+
* - editSettings
|
|
1956
|
+
* @param updateProvider - The updateProvider object.
|
|
1957
|
+
* @param updateProvider.providerId - The providerId.
|
|
1958
|
+
* @param updateProvider.providerAuthenticationPatch - The providerAuthenticationPatch object.
|
|
1959
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1960
|
+
*/
|
|
1961
|
+
updateProvider({ providerId, providerAuthenticationPatch }: UpdateProviderProps, requestOptions?: RequestOptions): Promise<ProviderAuthenticationResponse>;
|
|
1962
|
+
/**
|
|
1963
|
+
* Patch Secret Key.
|
|
1964
|
+
*
|
|
1965
|
+
* Required API Key ACLs:
|
|
1966
|
+
* - admin
|
|
1967
|
+
* @param updateSecretKey - The updateSecretKey object.
|
|
1968
|
+
* @param updateSecretKey.secretKeyId - The secretKeyId.
|
|
1969
|
+
* @param updateSecretKey.secretKeyPatch - The secretKeyPatch object.
|
|
1970
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1971
|
+
*/
|
|
1972
|
+
updateSecretKey({ secretKeyId, secretKeyPatch }: UpdateSecretKeyProps, requestOptions?: RequestOptions): Promise<SecretKeyResponse>;
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Error.
|
|
1977
|
+
*/
|
|
1978
|
+
type ErrorBase = Record<string, any> & {
|
|
1979
|
+
message?: string | undefined;
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
type LocationItemUnion = string | number;
|
|
1983
|
+
|
|
1984
|
+
type ValidationError = {
|
|
1985
|
+
loc: Array<LocationItemUnion>;
|
|
1986
|
+
msg: string;
|
|
1987
|
+
type: string;
|
|
1988
|
+
input?: any | null | undefined;
|
|
1989
|
+
ctx?: Record<string, unknown> | undefined;
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
type HTTPValidationError = {
|
|
1993
|
+
detail?: Array<ValidationError> | undefined;
|
|
1994
|
+
};
|
|
1995
|
+
|
|
1996
|
+
declare function agentStudioClient(appId: string, apiKey: string, options?: ClientOptions | undefined): AgentStudioClient;
|
|
1997
|
+
type AgentStudioClient = ReturnType<typeof createAgentStudioClient>;
|
|
1998
|
+
|
|
1999
|
+
export { type AdvancedSyntaxFeatures, type AgentCompletionAlgoliaParams, type AgentCompletionRequest, type AgentConfigCreate, type AgentConfigUpdate, type AgentStatus, type AgentStudioClient, type AgentStudioNodeHelpers, type AgentTestConfiguration, type AgentWithVersionResponse, type AlgoliaDisplayResultsToolConfig, type AlgoliaRecommendToolConfigInput, type AlgoliaRecommendToolIndexConfig, type AlgoliaSearchToolConfig, type AlgoliaSearchToolIndexConfig, type AllowedDomainBulkDelete, type AllowedDomainBulkInsert, type AllowedDomainCreate, type AllowedDomainListResponse, type AllowedDomainResponse, type AlternativesAsExact, type AnthropicProviderInput, type ApplicationConfigPatch, type ApplicationConfigResponse, type AroundPrecisionUnion, type AroundRadiusUnion, type AssistantMessageV4, type AssistantMessageV5, type AssistantPartV4, type AssistantPartV5, type AzureOpenAIProviderInput, type BaseProviderInput, type BulkCreateAllowedDomainsProps, type BulkDeleteAllowedDomainsProps, type ClientSideToolConfig, type ClientToolsArgsSchema, type CompatibilityMode, type ConversationBaseResponse, type ConversationFullResponse, type ConversationMetadata, type CreateAgentAllowedDomainProps, type CreateAgentCompletionProps, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAgentConversationsProps, type DeleteAgentProps, type DeleteAllowedDomainProps, type DeleteConversationProps, type DeleteProviderProps, type DeleteSecretKeyProps, type DeleteUserDataProps, type DistinctUnion, type Episode, type ErrorBase, type ExactOnSingleWordQuery, type ExportConversationsProps, type FacetFiltersUnion, type Facets, type FacetsParam, type FacetsUnion, type FeedbackCreationRequest, type FeedbackResponse, type GetAgentProps, type GetAllowedDomainProps, type GetConversationProps, type GetProviderProps, type GetSecretKeyProps, type GetUserDataProps, type HTTPValidationError, type IgnorePluralsUnion, type IndexSearchParameters, type InsideBoundingBoxUnion, type InsidePolygonUnion, type InvalidateAgentCacheProps, type ListAgentAllowedDomainsProps, type ListAgentConversationsProps, type ListAgentsProps, type ListProviderModelsProps, type ListProvidersProps, type ListSecretKeysProps, type LocationItemUnion, type McpServerToolConfig, type McpToolConfig, type MemoryRecord, type MemoryType, type MessagePart, type MessageResponse, type MessageRole, type MessageV4, type MessageV5, type MessagesUnion, type NumberParam, type NumberParamConstraint, type NumericFiltersUnion, type OpenAICompatibleProviderInput, type OpenAIProviderInput, type OptionalFiltersUnion, type OptionalWordsUnion, type PaginatedAgentsResponse, type PaginatedConversationsResponse, type PaginatedProviderAuthenticationsResponse, type PaginatedSecretKeysResponse, type PaginationMetadata, type ProviderAuthenticationCreate, type ProviderAuthenticationPatch, type ProviderAuthenticationResponse, type ProviderInput, type ProviderInputNullable, type ProviderName, type PublishAgentProps, type QueryType, type ReRankingApplyFilterUnion, type ReasoningPart, type ReasoningPartV4, type ReasoningPartV5, type RemoveStopWordsUnion, type RemoveWordsIfNoResults, type SearchParameters, type SearchParametersOverrides, type SecretKeyCreate, type SecretKeyPatch, type SecretKeyResponse, type StartPart, type StartStepPart, type StepStartPartV4, type StepStartPartV5, type StringArrayParam, type StringArrayParamConstraint, type SupportedLanguage, type TagFiltersUnion, type TextParam, type TextPart, type TextPartV4, type TextPartV5, type ToolApprovalRequestPart, type ToolCallPart, type ToolConfig, type ToolConfigInput, type ToolInvocationPartV4, type ToolInvocationV4, type ToolPartV5, type ToolResultOutput, type ToolResultOutputType, type ToolResultPart, type ToolState, type TypoToleranceEnum, type TypoToleranceUnion, type UnknownToolConfig, type UnpublishAgentProps, type UpdateAgentProps, type UpdateProviderProps, type UpdateSecretKeyProps, type UserDataResponse, type UserMessageMetadataV5, type UserMessageV4, type UserMessageV5, type ValidationError, type VoteEnum, agentStudioClient, apiClientVersion };
|