tako-sdk 0.1.4 → 1.0.1
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 +92 -77
- package/dist/index.cjs +3349 -92
- package/dist/index.d.cts +3391 -71
- package/dist/index.d.ts +3391 -71
- package/dist/index.js +3025 -84
- package/package.json +40 -24
package/dist/index.js
CHANGED
|
@@ -1,108 +1,3049 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(SourceIndex || {});
|
|
7
|
-
var TakoException = class extends Error {
|
|
8
|
-
constructor(status, message, details) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.status = status;
|
|
11
|
-
this.details = details;
|
|
12
|
-
this.name = "TakoException";
|
|
1
|
+
// src/generated/runtime.ts
|
|
2
|
+
var BASE_PATH = "https://tako.com/api".replace(/\/+$/, "");
|
|
3
|
+
var Configuration = class {
|
|
4
|
+
constructor(configuration = {}) {
|
|
5
|
+
this.configuration = configuration;
|
|
13
6
|
}
|
|
7
|
+
set config(configuration) {
|
|
8
|
+
this.configuration = configuration;
|
|
9
|
+
}
|
|
10
|
+
get basePath() {
|
|
11
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
12
|
+
}
|
|
13
|
+
get fetchApi() {
|
|
14
|
+
return this.configuration.fetchApi;
|
|
15
|
+
}
|
|
16
|
+
get middleware() {
|
|
17
|
+
return this.configuration.middleware || [];
|
|
18
|
+
}
|
|
19
|
+
get queryParamsStringify() {
|
|
20
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
21
|
+
}
|
|
22
|
+
get username() {
|
|
23
|
+
return this.configuration.username;
|
|
24
|
+
}
|
|
25
|
+
get password() {
|
|
26
|
+
return this.configuration.password;
|
|
27
|
+
}
|
|
28
|
+
get apiKey() {
|
|
29
|
+
const apiKey = this.configuration.apiKey;
|
|
30
|
+
if (apiKey) {
|
|
31
|
+
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
32
|
+
}
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
get accessToken() {
|
|
36
|
+
const accessToken = this.configuration.accessToken;
|
|
37
|
+
if (accessToken) {
|
|
38
|
+
return typeof accessToken === "function" ? accessToken : async () => accessToken;
|
|
39
|
+
}
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
get headers() {
|
|
43
|
+
return this.configuration.headers;
|
|
44
|
+
}
|
|
45
|
+
get credentials() {
|
|
46
|
+
return this.configuration.credentials;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var DefaultConfig = new Configuration();
|
|
50
|
+
var _BaseAPI = class _BaseAPI {
|
|
51
|
+
constructor(configuration = DefaultConfig) {
|
|
52
|
+
this.configuration = configuration;
|
|
53
|
+
this.fetchApi = async (url, init) => {
|
|
54
|
+
let fetchParams = { url, init };
|
|
55
|
+
for (const middleware of this.middleware) {
|
|
56
|
+
if (middleware.pre) {
|
|
57
|
+
fetchParams = await middleware.pre({
|
|
58
|
+
fetch: this.fetchApi,
|
|
59
|
+
...fetchParams
|
|
60
|
+
}) || fetchParams;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
let response = void 0;
|
|
64
|
+
try {
|
|
65
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
for (const middleware of this.middleware) {
|
|
68
|
+
if (middleware.onError) {
|
|
69
|
+
response = await middleware.onError({
|
|
70
|
+
fetch: this.fetchApi,
|
|
71
|
+
url: fetchParams.url,
|
|
72
|
+
init: fetchParams.init,
|
|
73
|
+
error: e,
|
|
74
|
+
response: response ? response.clone() : void 0
|
|
75
|
+
}) || response;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (response === void 0) {
|
|
79
|
+
if (e instanceof Error) {
|
|
80
|
+
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
81
|
+
} else {
|
|
82
|
+
throw e;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const middleware of this.middleware) {
|
|
87
|
+
if (middleware.post) {
|
|
88
|
+
response = await middleware.post({
|
|
89
|
+
fetch: this.fetchApi,
|
|
90
|
+
url: fetchParams.url,
|
|
91
|
+
init: fetchParams.init,
|
|
92
|
+
response: response.clone()
|
|
93
|
+
}) || response;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return response;
|
|
97
|
+
};
|
|
98
|
+
this.middleware = configuration.middleware;
|
|
99
|
+
}
|
|
100
|
+
withMiddleware(...middlewares) {
|
|
101
|
+
const next = this.clone();
|
|
102
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
103
|
+
return next;
|
|
104
|
+
}
|
|
105
|
+
withPreMiddleware(...preMiddlewares) {
|
|
106
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
107
|
+
return this.withMiddleware(...middlewares);
|
|
108
|
+
}
|
|
109
|
+
withPostMiddleware(...postMiddlewares) {
|
|
110
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
111
|
+
return this.withMiddleware(...middlewares);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Check if the given MIME is a JSON MIME.
|
|
115
|
+
* JSON MIME examples:
|
|
116
|
+
* application/json
|
|
117
|
+
* application/json; charset=UTF8
|
|
118
|
+
* APPLICATION/JSON
|
|
119
|
+
* application/vnd.company+json
|
|
120
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
121
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
122
|
+
*/
|
|
123
|
+
isJsonMime(mime) {
|
|
124
|
+
if (!mime) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
return _BaseAPI.jsonRegex.test(mime);
|
|
128
|
+
}
|
|
129
|
+
async request(context, initOverrides) {
|
|
130
|
+
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
131
|
+
const response = await this.fetchApi(url, init);
|
|
132
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
133
|
+
return response;
|
|
134
|
+
}
|
|
135
|
+
throw new ResponseError(response, "Response returned an error code");
|
|
136
|
+
}
|
|
137
|
+
async createFetchParams(context, initOverrides) {
|
|
138
|
+
let url = this.configuration.basePath + context.path;
|
|
139
|
+
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
|
|
140
|
+
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
141
|
+
}
|
|
142
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
143
|
+
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
|
|
144
|
+
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
|
|
145
|
+
const initParams = {
|
|
146
|
+
method: context.method,
|
|
147
|
+
headers,
|
|
148
|
+
body: context.body,
|
|
149
|
+
credentials: this.configuration.credentials
|
|
150
|
+
};
|
|
151
|
+
const overriddenInit = {
|
|
152
|
+
...initParams,
|
|
153
|
+
...await initOverrideFn({
|
|
154
|
+
init: initParams,
|
|
155
|
+
context
|
|
156
|
+
})
|
|
157
|
+
};
|
|
158
|
+
let body;
|
|
159
|
+
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
|
|
160
|
+
body = overriddenInit.body;
|
|
161
|
+
} else if (this.isJsonMime(headers["Content-Type"])) {
|
|
162
|
+
body = JSON.stringify(overriddenInit.body);
|
|
163
|
+
} else {
|
|
164
|
+
body = overriddenInit.body;
|
|
165
|
+
}
|
|
166
|
+
const init = {
|
|
167
|
+
...overriddenInit,
|
|
168
|
+
body
|
|
169
|
+
};
|
|
170
|
+
return { url, init };
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
174
|
+
* and then shallow cloning data members.
|
|
175
|
+
*/
|
|
176
|
+
clone() {
|
|
177
|
+
const constructor = this.constructor;
|
|
178
|
+
const next = new constructor(this.configuration);
|
|
179
|
+
next.middleware = this.middleware.slice();
|
|
180
|
+
return next;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
_BaseAPI.jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
|
|
184
|
+
var BaseAPI = _BaseAPI;
|
|
185
|
+
function isBlob(value) {
|
|
186
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
187
|
+
}
|
|
188
|
+
function isFormData(value) {
|
|
189
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
190
|
+
}
|
|
191
|
+
var ResponseError = class extends Error {
|
|
192
|
+
constructor(response, msg) {
|
|
193
|
+
super(msg);
|
|
194
|
+
this.response = response;
|
|
195
|
+
this.name = "ResponseError";
|
|
196
|
+
const actualProto = new.target.prototype;
|
|
197
|
+
if (Object.setPrototypeOf) {
|
|
198
|
+
Object.setPrototypeOf(this, actualProto);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
var FetchError = class extends Error {
|
|
203
|
+
constructor(cause, msg) {
|
|
204
|
+
super(msg);
|
|
205
|
+
this.cause = cause;
|
|
206
|
+
this.name = "FetchError";
|
|
207
|
+
const actualProto = new.target.prototype;
|
|
208
|
+
if (Object.setPrototypeOf) {
|
|
209
|
+
Object.setPrototypeOf(this, actualProto);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
var RequiredError = class extends Error {
|
|
214
|
+
constructor(field, msg) {
|
|
215
|
+
super(msg);
|
|
216
|
+
this.field = field;
|
|
217
|
+
this.name = "RequiredError";
|
|
218
|
+
const actualProto = new.target.prototype;
|
|
219
|
+
if (Object.setPrototypeOf) {
|
|
220
|
+
Object.setPrototypeOf(this, actualProto);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
var COLLECTION_FORMATS = {
|
|
225
|
+
csv: ",",
|
|
226
|
+
ssv: " ",
|
|
227
|
+
tsv: " ",
|
|
228
|
+
pipes: "|"
|
|
229
|
+
};
|
|
230
|
+
function querystring(params, prefix = "") {
|
|
231
|
+
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
232
|
+
}
|
|
233
|
+
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
234
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
235
|
+
if (value instanceof Array) {
|
|
236
|
+
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
237
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
238
|
+
}
|
|
239
|
+
if (value instanceof Set) {
|
|
240
|
+
const valueAsArray = Array.from(value);
|
|
241
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
242
|
+
}
|
|
243
|
+
if (value instanceof Date) {
|
|
244
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
245
|
+
}
|
|
246
|
+
if (value instanceof Object) {
|
|
247
|
+
return querystring(value, fullKey);
|
|
248
|
+
}
|
|
249
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
250
|
+
}
|
|
251
|
+
function exists(json, key) {
|
|
252
|
+
const value = json[key];
|
|
253
|
+
return value !== null && value !== void 0;
|
|
254
|
+
}
|
|
255
|
+
function mapValues(data, fn) {
|
|
256
|
+
const result = {};
|
|
257
|
+
for (const key of Object.keys(data)) {
|
|
258
|
+
result[key] = fn(data[key]);
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
function canConsumeForm(consumes) {
|
|
263
|
+
for (const consume of consumes) {
|
|
264
|
+
if ("multipart/form-data" === consume.contentType) {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
var JSONApiResponse = class {
|
|
271
|
+
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
272
|
+
this.raw = raw;
|
|
273
|
+
this.transformer = transformer;
|
|
274
|
+
}
|
|
275
|
+
async value() {
|
|
276
|
+
return this.transformer(await this.raw.json());
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var VoidApiResponse = class {
|
|
280
|
+
constructor(raw) {
|
|
281
|
+
this.raw = raw;
|
|
282
|
+
}
|
|
283
|
+
async value() {
|
|
284
|
+
return void 0;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
var BlobApiResponse = class {
|
|
288
|
+
constructor(raw) {
|
|
289
|
+
this.raw = raw;
|
|
290
|
+
}
|
|
291
|
+
async value() {
|
|
292
|
+
return await this.raw.blob();
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var TextApiResponse = class {
|
|
296
|
+
constructor(raw) {
|
|
297
|
+
this.raw = raw;
|
|
298
|
+
}
|
|
299
|
+
async value() {
|
|
300
|
+
return await this.raw.text();
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/generated/models/KnowledgeCardMethodology.ts
|
|
305
|
+
function instanceOfKnowledgeCardMethodology(value) {
|
|
306
|
+
if (!("methodology_name" in value) || value["methodology_name"] === void 0) return false;
|
|
307
|
+
if (!("methodology_description" in value) || value["methodology_description"] === void 0) return false;
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
function KnowledgeCardMethodologyFromJSON(json) {
|
|
311
|
+
return KnowledgeCardMethodologyFromJSONTyped(json, false);
|
|
312
|
+
}
|
|
313
|
+
function KnowledgeCardMethodologyFromJSONTyped(json, ignoreDiscriminator) {
|
|
314
|
+
if (json == null) {
|
|
315
|
+
return json;
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
"methodology_name": json["methodology_name"],
|
|
319
|
+
"methodology_description": json["methodology_description"]
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function KnowledgeCardMethodologyToJSON(json) {
|
|
323
|
+
return KnowledgeCardMethodologyToJSONTyped(json, false);
|
|
324
|
+
}
|
|
325
|
+
function KnowledgeCardMethodologyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
326
|
+
if (value == null) {
|
|
327
|
+
return value;
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
"methodology_name": value["methodology_name"],
|
|
331
|
+
"methodology_description": value["methodology_description"]
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/generated/models/CardSourceIndex.ts
|
|
336
|
+
var CardSourceIndex = {
|
|
337
|
+
Tako: "tako",
|
|
338
|
+
Web: "web",
|
|
339
|
+
ConnectedData: "connected_data",
|
|
340
|
+
TakoDeepV2: "tako_deep_v2"
|
|
341
|
+
};
|
|
342
|
+
function instanceOfCardSourceIndex(value) {
|
|
343
|
+
for (const key in CardSourceIndex) {
|
|
344
|
+
if (Object.prototype.hasOwnProperty.call(CardSourceIndex, key)) {
|
|
345
|
+
if (CardSourceIndex[key] === value) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
function CardSourceIndexFromJSON(json) {
|
|
353
|
+
return CardSourceIndexFromJSONTyped(json, false);
|
|
354
|
+
}
|
|
355
|
+
function CardSourceIndexFromJSONTyped(json, ignoreDiscriminator) {
|
|
356
|
+
return json;
|
|
357
|
+
}
|
|
358
|
+
function CardSourceIndexToJSON(value) {
|
|
359
|
+
return value;
|
|
360
|
+
}
|
|
361
|
+
function CardSourceIndexToJSONTyped(value, ignoreDiscriminator) {
|
|
362
|
+
return value;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/generated/models/KnowledgeCardSourceIndexesInner.ts
|
|
366
|
+
function instanceOfKnowledgeCardSourceIndexesInner(value) {
|
|
367
|
+
if (!("index_type" in value) || value["index_type"] === void 0) return false;
|
|
368
|
+
if (!("segment_id" in value) || value["segment_id"] === void 0) return false;
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
function KnowledgeCardSourceIndexesInnerFromJSON(json) {
|
|
372
|
+
return KnowledgeCardSourceIndexesInnerFromJSONTyped(json, false);
|
|
373
|
+
}
|
|
374
|
+
function KnowledgeCardSourceIndexesInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
375
|
+
if (json == null) {
|
|
376
|
+
return json;
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
"index_type": CardSourceIndexFromJSON(json["index_type"]),
|
|
380
|
+
"segment_id": json["segment_id"]
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function KnowledgeCardSourceIndexesInnerToJSON(json) {
|
|
384
|
+
return KnowledgeCardSourceIndexesInnerToJSONTyped(json, false);
|
|
385
|
+
}
|
|
386
|
+
function KnowledgeCardSourceIndexesInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
387
|
+
if (value == null) {
|
|
388
|
+
return value;
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
"index_type": CardSourceIndexToJSON(value["index_type"]),
|
|
392
|
+
"segment_id": value["segment_id"]
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// src/generated/models/SourceIndex.ts
|
|
397
|
+
function instanceOfSourceIndex(value) {
|
|
398
|
+
if (!("index_type" in value) || value["index_type"] === void 0) return false;
|
|
399
|
+
if (!("segment_id" in value) || value["segment_id"] === void 0) return false;
|
|
400
|
+
if (!("private_index_id" in value) || value["private_index_id"] === void 0) return false;
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
function SourceIndexFromJSON(json) {
|
|
404
|
+
return SourceIndexFromJSONTyped(json, false);
|
|
405
|
+
}
|
|
406
|
+
function SourceIndexFromJSONTyped(json, ignoreDiscriminator) {
|
|
407
|
+
if (json == null) {
|
|
408
|
+
return json;
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
"index_type": CardSourceIndexFromJSON(json["index_type"]),
|
|
412
|
+
"segment_id": json["segment_id"],
|
|
413
|
+
"private_index_id": json["private_index_id"]
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
function SourceIndexToJSON(json) {
|
|
417
|
+
return SourceIndexToJSONTyped(json, false);
|
|
418
|
+
}
|
|
419
|
+
function SourceIndexToJSONTyped(value, ignoreDiscriminator = false) {
|
|
420
|
+
if (value == null) {
|
|
421
|
+
return value;
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
"index_type": CardSourceIndexToJSON(value["index_type"]),
|
|
425
|
+
"segment_id": value["segment_id"],
|
|
426
|
+
"private_index_id": value["private_index_id"]
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/generated/models/KnowledgeCardSource.ts
|
|
431
|
+
function instanceOfKnowledgeCardSource(value) {
|
|
432
|
+
if (!("source_name" in value) || value["source_name"] === void 0) return false;
|
|
433
|
+
if (!("source_description" in value) || value["source_description"] === void 0) return false;
|
|
434
|
+
if (!("source_index" in value) || value["source_index"] === void 0) return false;
|
|
435
|
+
if (!("url" in value) || value["url"] === void 0) return false;
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
function KnowledgeCardSourceFromJSON(json) {
|
|
439
|
+
return KnowledgeCardSourceFromJSONTyped(json, false);
|
|
440
|
+
}
|
|
441
|
+
function KnowledgeCardSourceFromJSONTyped(json, ignoreDiscriminator) {
|
|
442
|
+
if (json == null) {
|
|
443
|
+
return json;
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
"source_name": json["source_name"],
|
|
447
|
+
"source_description": json["source_description"],
|
|
448
|
+
"source_index": SourceIndexFromJSON(json["source_index"]),
|
|
449
|
+
"url": json["url"],
|
|
450
|
+
"source_text": json["source_text"] == null ? void 0 : json["source_text"]
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function KnowledgeCardSourceToJSON(json) {
|
|
454
|
+
return KnowledgeCardSourceToJSONTyped(json, false);
|
|
455
|
+
}
|
|
456
|
+
function KnowledgeCardSourceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
457
|
+
if (value == null) {
|
|
458
|
+
return value;
|
|
459
|
+
}
|
|
460
|
+
return {
|
|
461
|
+
"source_name": value["source_name"],
|
|
462
|
+
"source_description": value["source_description"],
|
|
463
|
+
"source_index": SourceIndexToJSON(value["source_index"]),
|
|
464
|
+
"url": value["url"],
|
|
465
|
+
"source_text": value["source_text"]
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// src/generated/models/ContentFormat.ts
|
|
470
|
+
var ContentFormat = {
|
|
471
|
+
Csv: "csv",
|
|
472
|
+
Text: "text"
|
|
473
|
+
};
|
|
474
|
+
function instanceOfContentFormat(value) {
|
|
475
|
+
for (const key in ContentFormat) {
|
|
476
|
+
if (Object.prototype.hasOwnProperty.call(ContentFormat, key)) {
|
|
477
|
+
if (ContentFormat[key] === value) {
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
function ContentFormatFromJSON(json) {
|
|
485
|
+
return ContentFormatFromJSONTyped(json, false);
|
|
486
|
+
}
|
|
487
|
+
function ContentFormatFromJSONTyped(json, ignoreDiscriminator) {
|
|
488
|
+
return json;
|
|
489
|
+
}
|
|
490
|
+
function ContentFormatToJSON(value) {
|
|
491
|
+
return value;
|
|
492
|
+
}
|
|
493
|
+
function ContentFormatToJSONTyped(value, ignoreDiscriminator) {
|
|
494
|
+
return value;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// src/generated/models/ResultContent.ts
|
|
498
|
+
function instanceOfResultContent(value) {
|
|
499
|
+
if (!("format" in value) || value["format"] === void 0) return false;
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
function ResultContentFromJSON(json) {
|
|
503
|
+
return ResultContentFromJSONTyped(json, false);
|
|
504
|
+
}
|
|
505
|
+
function ResultContentFromJSONTyped(json, ignoreDiscriminator) {
|
|
506
|
+
if (json == null) {
|
|
507
|
+
return json;
|
|
508
|
+
}
|
|
509
|
+
return {
|
|
510
|
+
"format": ContentFormatFromJSON(json["format"]),
|
|
511
|
+
"cost": json["cost"] == null ? void 0 : json["cost"],
|
|
512
|
+
"data": json["data"] == null ? void 0 : json["data"],
|
|
513
|
+
"total_rows": json["total_rows"] == null ? void 0 : json["total_rows"],
|
|
514
|
+
"truncated": json["truncated"] == null ? void 0 : json["truncated"]
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function ResultContentToJSON(json) {
|
|
518
|
+
return ResultContentToJSONTyped(json, false);
|
|
519
|
+
}
|
|
520
|
+
function ResultContentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
521
|
+
if (value == null) {
|
|
522
|
+
return value;
|
|
523
|
+
}
|
|
524
|
+
return {
|
|
525
|
+
"format": ContentFormatToJSON(value["format"]),
|
|
526
|
+
"cost": value["cost"],
|
|
527
|
+
"data": value["data"],
|
|
528
|
+
"total_rows": value["total_rows"],
|
|
529
|
+
"truncated": value["truncated"]
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// src/generated/models/KnowledgeCardRelevance.ts
|
|
534
|
+
var KnowledgeCardRelevance = {
|
|
535
|
+
High: "High",
|
|
536
|
+
Medium: "Medium",
|
|
537
|
+
Low: "Low"
|
|
538
|
+
};
|
|
539
|
+
function instanceOfKnowledgeCardRelevance(value) {
|
|
540
|
+
for (const key in KnowledgeCardRelevance) {
|
|
541
|
+
if (Object.prototype.hasOwnProperty.call(KnowledgeCardRelevance, key)) {
|
|
542
|
+
if (KnowledgeCardRelevance[key] === value) {
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return false;
|
|
548
|
+
}
|
|
549
|
+
function KnowledgeCardRelevanceFromJSON(json) {
|
|
550
|
+
return KnowledgeCardRelevanceFromJSONTyped(json, false);
|
|
551
|
+
}
|
|
552
|
+
function KnowledgeCardRelevanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
553
|
+
return json;
|
|
554
|
+
}
|
|
555
|
+
function KnowledgeCardRelevanceToJSON(value) {
|
|
556
|
+
return value;
|
|
557
|
+
}
|
|
558
|
+
function KnowledgeCardRelevanceToJSONTyped(value, ignoreDiscriminator) {
|
|
559
|
+
return value;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// src/generated/models/TakoCard.ts
|
|
563
|
+
function instanceOfTakoCard(value) {
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
function TakoCardFromJSON(json) {
|
|
567
|
+
return TakoCardFromJSONTyped(json, false);
|
|
568
|
+
}
|
|
569
|
+
function TakoCardFromJSONTyped(json, ignoreDiscriminator) {
|
|
570
|
+
if (json == null) {
|
|
571
|
+
return json;
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
"card_id": json["card_id"] == null ? void 0 : json["card_id"],
|
|
575
|
+
"title": json["title"] == null ? void 0 : json["title"],
|
|
576
|
+
"description": json["description"] == null ? void 0 : json["description"],
|
|
577
|
+
"semantic_description": json["semantic_description"] == null ? void 0 : json["semantic_description"],
|
|
578
|
+
"webpage_url": json["webpage_url"] == null ? void 0 : json["webpage_url"],
|
|
579
|
+
"image_url": json["image_url"] == null ? void 0 : json["image_url"],
|
|
580
|
+
"embed_url": json["embed_url"] == null ? void 0 : json["embed_url"],
|
|
581
|
+
"sources": json["sources"] == null ? void 0 : json["sources"].map(KnowledgeCardSourceFromJSON),
|
|
582
|
+
"methodologies": json["methodologies"] == null ? void 0 : json["methodologies"].map(KnowledgeCardMethodologyFromJSON),
|
|
583
|
+
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"].map(KnowledgeCardSourceIndexesInnerFromJSON),
|
|
584
|
+
"card_type": json["card_type"] == null ? void 0 : json["card_type"],
|
|
585
|
+
"relevance": json["relevance"] == null ? void 0 : KnowledgeCardRelevanceFromJSON(json["relevance"]),
|
|
586
|
+
"content": json["content"] == null ? void 0 : ResultContentFromJSON(json["content"])
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
function TakoCardToJSON(json) {
|
|
590
|
+
return TakoCardToJSONTyped(json, false);
|
|
591
|
+
}
|
|
592
|
+
function TakoCardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
593
|
+
if (value == null) {
|
|
594
|
+
return value;
|
|
595
|
+
}
|
|
596
|
+
return {
|
|
597
|
+
"card_id": value["card_id"],
|
|
598
|
+
"title": value["title"],
|
|
599
|
+
"description": value["description"],
|
|
600
|
+
"semantic_description": value["semantic_description"],
|
|
601
|
+
"webpage_url": value["webpage_url"],
|
|
602
|
+
"image_url": value["image_url"],
|
|
603
|
+
"embed_url": value["embed_url"],
|
|
604
|
+
"sources": value["sources"] == null ? void 0 : value["sources"].map(KnowledgeCardSourceToJSON),
|
|
605
|
+
"methodologies": value["methodologies"] == null ? void 0 : value["methodologies"].map(KnowledgeCardMethodologyToJSON),
|
|
606
|
+
"source_indexes": value["source_indexes"] == null ? void 0 : value["source_indexes"].map(KnowledgeCardSourceIndexesInnerToJSON),
|
|
607
|
+
"card_type": value["card_type"],
|
|
608
|
+
"relevance": KnowledgeCardRelevanceToJSON(value["relevance"]),
|
|
609
|
+
"content": ResultContentToJSON(value["content"])
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// src/generated/models/WebResult.ts
|
|
614
|
+
function instanceOfWebResult(value) {
|
|
615
|
+
if (!("title" in value) || value["title"] === void 0) return false;
|
|
616
|
+
if (!("url" in value) || value["url"] === void 0) return false;
|
|
617
|
+
return true;
|
|
618
|
+
}
|
|
619
|
+
function WebResultFromJSON(json) {
|
|
620
|
+
return WebResultFromJSONTyped(json, false);
|
|
621
|
+
}
|
|
622
|
+
function WebResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
623
|
+
if (json == null) {
|
|
624
|
+
return json;
|
|
625
|
+
}
|
|
626
|
+
return {
|
|
627
|
+
"title": json["title"],
|
|
628
|
+
"url": json["url"],
|
|
629
|
+
"snippet": json["snippet"] == null ? void 0 : json["snippet"],
|
|
630
|
+
"source_name": json["source_name"] == null ? void 0 : json["source_name"],
|
|
631
|
+
"publish_date": json["publish_date"] == null ? void 0 : json["publish_date"],
|
|
632
|
+
"content": json["content"] == null ? void 0 : ResultContentFromJSON(json["content"]),
|
|
633
|
+
"citation_number": json["citation_number"] == null ? void 0 : json["citation_number"]
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function WebResultToJSON(json) {
|
|
637
|
+
return WebResultToJSONTyped(json, false);
|
|
638
|
+
}
|
|
639
|
+
function WebResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
640
|
+
if (value == null) {
|
|
641
|
+
return value;
|
|
642
|
+
}
|
|
643
|
+
return {
|
|
644
|
+
"title": value["title"],
|
|
645
|
+
"url": value["url"],
|
|
646
|
+
"snippet": value["snippet"],
|
|
647
|
+
"source_name": value["source_name"],
|
|
648
|
+
"publish_date": value["publish_date"],
|
|
649
|
+
"content": ResultContentToJSON(value["content"]),
|
|
650
|
+
"citation_number": value["citation_number"]
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/generated/models/AgentResult.ts
|
|
655
|
+
function instanceOfAgentResult(value) {
|
|
656
|
+
return true;
|
|
657
|
+
}
|
|
658
|
+
function AgentResultFromJSON(json) {
|
|
659
|
+
return AgentResultFromJSONTyped(json, false);
|
|
660
|
+
}
|
|
661
|
+
function AgentResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
662
|
+
if (json == null) {
|
|
663
|
+
return json;
|
|
664
|
+
}
|
|
665
|
+
return {
|
|
666
|
+
"answer": json["answer"] == null ? void 0 : json["answer"],
|
|
667
|
+
"cards": json["cards"] == null ? void 0 : json["cards"].map(TakoCardFromJSON),
|
|
668
|
+
"web_results": json["web_results"] == null ? void 0 : json["web_results"].map(WebResultFromJSON),
|
|
669
|
+
"request_id": json["request_id"] == null ? void 0 : json["request_id"]
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function AgentResultToJSON(json) {
|
|
673
|
+
return AgentResultToJSONTyped(json, false);
|
|
674
|
+
}
|
|
675
|
+
function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
676
|
+
if (value == null) {
|
|
677
|
+
return value;
|
|
678
|
+
}
|
|
679
|
+
return {
|
|
680
|
+
"answer": value["answer"],
|
|
681
|
+
"cards": value["cards"] == null ? void 0 : value["cards"].map(TakoCardToJSON),
|
|
682
|
+
"web_results": value["web_results"] == null ? void 0 : value["web_results"].map(WebResultToJSON),
|
|
683
|
+
"request_id": value["request_id"]
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// src/generated/models/AgentRunStatus.ts
|
|
688
|
+
var AgentRunStatus = {
|
|
689
|
+
Queued: "queued",
|
|
690
|
+
Running: "running",
|
|
691
|
+
Completed: "completed",
|
|
692
|
+
Failed: "failed"
|
|
693
|
+
};
|
|
694
|
+
function instanceOfAgentRunStatus(value) {
|
|
695
|
+
for (const key in AgentRunStatus) {
|
|
696
|
+
if (Object.prototype.hasOwnProperty.call(AgentRunStatus, key)) {
|
|
697
|
+
if (AgentRunStatus[key] === value) {
|
|
698
|
+
return true;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
704
|
+
function AgentRunStatusFromJSON(json) {
|
|
705
|
+
return AgentRunStatusFromJSONTyped(json, false);
|
|
706
|
+
}
|
|
707
|
+
function AgentRunStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
708
|
+
return json;
|
|
709
|
+
}
|
|
710
|
+
function AgentRunStatusToJSON(value) {
|
|
711
|
+
return value;
|
|
712
|
+
}
|
|
713
|
+
function AgentRunStatusToJSONTyped(value, ignoreDiscriminator) {
|
|
714
|
+
return value;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// src/generated/models/ErrorObject.ts
|
|
718
|
+
function instanceOfErrorObject(value) {
|
|
719
|
+
if (!("code" in value) || value["code"] === void 0) return false;
|
|
720
|
+
if (!("message" in value) || value["message"] === void 0) return false;
|
|
721
|
+
return true;
|
|
722
|
+
}
|
|
723
|
+
function ErrorObjectFromJSON(json) {
|
|
724
|
+
return ErrorObjectFromJSONTyped(json, false);
|
|
725
|
+
}
|
|
726
|
+
function ErrorObjectFromJSONTyped(json, ignoreDiscriminator) {
|
|
727
|
+
if (json == null) {
|
|
728
|
+
return json;
|
|
729
|
+
}
|
|
730
|
+
return {
|
|
731
|
+
"code": json["code"],
|
|
732
|
+
"message": json["message"]
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
function ErrorObjectToJSON(json) {
|
|
736
|
+
return ErrorObjectToJSONTyped(json, false);
|
|
737
|
+
}
|
|
738
|
+
function ErrorObjectToJSONTyped(value, ignoreDiscriminator = false) {
|
|
739
|
+
if (value == null) {
|
|
740
|
+
return value;
|
|
741
|
+
}
|
|
742
|
+
return {
|
|
743
|
+
"code": value["code"],
|
|
744
|
+
"message": value["message"]
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// src/generated/models/AgentRun.ts
|
|
749
|
+
var AgentRunObjectEnum = {
|
|
750
|
+
AgentRun: "agent.run"
|
|
14
751
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
752
|
+
function instanceOfAgentRun(value) {
|
|
753
|
+
if (!("run_id" in value) || value["run_id"] === void 0) return false;
|
|
754
|
+
if (!("status" in value) || value["status"] === void 0) return false;
|
|
755
|
+
if (!("created_at" in value) || value["created_at"] === void 0) return false;
|
|
756
|
+
return true;
|
|
757
|
+
}
|
|
758
|
+
function AgentRunFromJSON(json) {
|
|
759
|
+
return AgentRunFromJSONTyped(json, false);
|
|
760
|
+
}
|
|
761
|
+
function AgentRunFromJSONTyped(json, ignoreDiscriminator) {
|
|
762
|
+
if (json == null) {
|
|
763
|
+
return json;
|
|
764
|
+
}
|
|
765
|
+
return {
|
|
766
|
+
"run_id": json["run_id"],
|
|
767
|
+
"object": json["object"] == null ? void 0 : json["object"],
|
|
768
|
+
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
769
|
+
"status": AgentRunStatusFromJSON(json["status"]),
|
|
770
|
+
"created_at": json["created_at"],
|
|
771
|
+
"completed_at": json["completed_at"] == null ? void 0 : json["completed_at"],
|
|
772
|
+
"result": json["result"] == null ? void 0 : AgentResultFromJSON(json["result"]),
|
|
773
|
+
"error": json["error"] == null ? void 0 : ErrorObjectFromJSON(json["error"])
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
function AgentRunToJSON(json) {
|
|
777
|
+
return AgentRunToJSONTyped(json, false);
|
|
778
|
+
}
|
|
779
|
+
function AgentRunToJSONTyped(value, ignoreDiscriminator = false) {
|
|
780
|
+
if (value == null) {
|
|
781
|
+
return value;
|
|
19
782
|
}
|
|
783
|
+
return {
|
|
784
|
+
"run_id": value["run_id"],
|
|
785
|
+
"object": value["object"],
|
|
786
|
+
"thread_id": value["thread_id"],
|
|
787
|
+
"status": AgentRunStatusToJSON(value["status"]),
|
|
788
|
+
"created_at": value["created_at"],
|
|
789
|
+
"completed_at": value["completed_at"],
|
|
790
|
+
"result": AgentResultToJSON(value["result"]),
|
|
791
|
+
"error": ErrorObjectToJSON(value["error"])
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// src/generated/models/AgentEffortLevel.ts
|
|
796
|
+
var AgentEffortLevel = {
|
|
797
|
+
Medium: "medium"
|
|
20
798
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
799
|
+
function instanceOfAgentEffortLevel(value) {
|
|
800
|
+
for (const key in AgentEffortLevel) {
|
|
801
|
+
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
802
|
+
if (AgentEffortLevel[key] === value) {
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
return false;
|
|
808
|
+
}
|
|
809
|
+
function AgentEffortLevelFromJSON(json) {
|
|
810
|
+
return AgentEffortLevelFromJSONTyped(json, false);
|
|
811
|
+
}
|
|
812
|
+
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
813
|
+
return json;
|
|
814
|
+
}
|
|
815
|
+
function AgentEffortLevelToJSON(value) {
|
|
816
|
+
return value;
|
|
817
|
+
}
|
|
818
|
+
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
819
|
+
return value;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// src/generated/models/AgentOutputSettings.ts
|
|
823
|
+
function instanceOfAgentOutputSettings(value) {
|
|
824
|
+
return true;
|
|
825
|
+
}
|
|
826
|
+
function AgentOutputSettingsFromJSON(json) {
|
|
827
|
+
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
828
|
+
}
|
|
829
|
+
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
830
|
+
if (json == null) {
|
|
831
|
+
return json;
|
|
832
|
+
}
|
|
833
|
+
return {
|
|
834
|
+
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
function AgentOutputSettingsToJSON(json) {
|
|
838
|
+
return AgentOutputSettingsToJSONTyped(json, false);
|
|
839
|
+
}
|
|
840
|
+
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
841
|
+
if (value == null) {
|
|
842
|
+
return value;
|
|
25
843
|
}
|
|
844
|
+
return {
|
|
845
|
+
"image_dark_mode": value["image_dark_mode"]
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// src/generated/models/AgentRunRequest.ts
|
|
850
|
+
var AgentRunRequestSourceIndexesEnum = {
|
|
851
|
+
Tako: "tako",
|
|
852
|
+
Web: "web"
|
|
26
853
|
};
|
|
854
|
+
function instanceOfAgentRunRequest(value) {
|
|
855
|
+
if (!("query" in value) || value["query"] === void 0) return false;
|
|
856
|
+
return true;
|
|
857
|
+
}
|
|
858
|
+
function AgentRunRequestFromJSON(json) {
|
|
859
|
+
return AgentRunRequestFromJSONTyped(json, false);
|
|
860
|
+
}
|
|
861
|
+
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
862
|
+
if (json == null) {
|
|
863
|
+
return json;
|
|
864
|
+
}
|
|
865
|
+
return {
|
|
866
|
+
"query": json["query"],
|
|
867
|
+
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
868
|
+
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
869
|
+
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
870
|
+
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
871
|
+
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
872
|
+
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
function AgentRunRequestToJSON(json) {
|
|
876
|
+
return AgentRunRequestToJSONTyped(json, false);
|
|
877
|
+
}
|
|
878
|
+
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
879
|
+
if (value == null) {
|
|
880
|
+
return value;
|
|
881
|
+
}
|
|
882
|
+
return {
|
|
883
|
+
"query": value["query"],
|
|
884
|
+
"thread_id": value["thread_id"],
|
|
885
|
+
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
886
|
+
"source_indexes": value["source_indexes"],
|
|
887
|
+
"locale": value["locale"],
|
|
888
|
+
"timezone": value["timezone"],
|
|
889
|
+
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
890
|
+
};
|
|
891
|
+
}
|
|
27
892
|
|
|
28
|
-
// src/
|
|
29
|
-
var
|
|
893
|
+
// src/generated/apis/AgentApi.ts
|
|
894
|
+
var AgentApi = class extends BaseAPI {
|
|
30
895
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param config Configuration for the Tako API client
|
|
896
|
+
* Creates request options for createAgentRun without sending the request
|
|
33
897
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
898
|
+
async createAgentRunRequestOpts(requestParameters) {
|
|
899
|
+
const queryParameters = {};
|
|
900
|
+
const headerParameters = {};
|
|
901
|
+
headerParameters["Content-Type"] = "application/json";
|
|
902
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
903
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
37
904
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
905
|
+
let urlPath = `/v1/agent/runs`;
|
|
906
|
+
return {
|
|
907
|
+
path: urlPath,
|
|
908
|
+
method: "POST",
|
|
909
|
+
headers: headerParameters,
|
|
910
|
+
query: queryParameters,
|
|
911
|
+
body: AgentRunRequestToJSON(requestParameters["agentRunRequest"])
|
|
912
|
+
};
|
|
41
913
|
}
|
|
42
914
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @param method HTTP method
|
|
46
|
-
* @param body Request body
|
|
47
|
-
* @returns Response data
|
|
915
|
+
* Dispatch a deep-research agent run. Returns 202 with an AgentRun object; poll GET /v1/agent/runs/{run_id} until status is \'completed\' or \'failed\'.
|
|
916
|
+
* Dispatch an agent run
|
|
48
917
|
*/
|
|
49
|
-
async
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (!response.ok) {
|
|
62
|
-
const errorData = await response.json();
|
|
63
|
-
const message = errorData.message || response.statusText;
|
|
64
|
-
switch (response.status) {
|
|
65
|
-
case 401:
|
|
66
|
-
throw new TakoUnauthorizedException(message, errorData);
|
|
67
|
-
case 429:
|
|
68
|
-
throw new TakoRateLimitException(message, errorData);
|
|
69
|
-
case 404:
|
|
70
|
-
return null;
|
|
71
|
-
default:
|
|
72
|
-
throw new TakoException(response.status, message, errorData);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return await response.json();
|
|
918
|
+
async createAgentRunRaw(requestParameters, initOverrides) {
|
|
919
|
+
const requestOptions = await this.createAgentRunRequestOpts(requestParameters);
|
|
920
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
921
|
+
return new JSONApiResponse(response, (jsonValue) => AgentRunFromJSON(jsonValue));
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Dispatch a deep-research agent run. Returns 202 with an AgentRun object; poll GET /v1/agent/runs/{run_id} until status is \'completed\' or \'failed\'.
|
|
925
|
+
* Dispatch an agent run
|
|
926
|
+
*/
|
|
927
|
+
async createAgentRun(requestParameters = {}, initOverrides) {
|
|
928
|
+
const response = await this.createAgentRunRaw(requestParameters, initOverrides);
|
|
929
|
+
return await response.value();
|
|
76
930
|
}
|
|
77
931
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param text The natural language query text
|
|
80
|
-
* @param sourceIndexes Optional array of source indexes to search within
|
|
81
|
-
* @returns Knowledge search results
|
|
932
|
+
* Creates request options for getAgentRun without sending the request
|
|
82
933
|
*/
|
|
83
|
-
async
|
|
84
|
-
if (
|
|
85
|
-
throw new
|
|
934
|
+
async getAgentRunRequestOpts(requestParameters) {
|
|
935
|
+
if (requestParameters["runId"] == null) {
|
|
936
|
+
throw new RequiredError(
|
|
937
|
+
"runId",
|
|
938
|
+
'Required parameter "runId" was null or undefined when calling getAgentRun().'
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
const queryParameters = {};
|
|
942
|
+
if (requestParameters["startingAfter"] != null) {
|
|
943
|
+
queryParameters["starting_after"] = requestParameters["startingAfter"];
|
|
944
|
+
}
|
|
945
|
+
const headerParameters = {};
|
|
946
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
947
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
86
948
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
949
|
+
let urlPath = `/v1/agent/runs/{run_id}`;
|
|
950
|
+
urlPath = urlPath.replace("{run_id}", encodeURIComponent(String(requestParameters["runId"])));
|
|
951
|
+
return {
|
|
952
|
+
path: urlPath,
|
|
953
|
+
method: "GET",
|
|
954
|
+
headers: headerParameters,
|
|
955
|
+
query: queryParameters
|
|
92
956
|
};
|
|
93
|
-
const response = await this.request("/knowledge_search", "POST", requestBody);
|
|
94
|
-
return response || { outputs: { knowledge_cards: [] } };
|
|
95
957
|
}
|
|
958
|
+
/**
|
|
959
|
+
* Retrieve the current state of an agent run. Poll until status is \'completed\' or \'failed\'. result is populated when status is \'completed\'.
|
|
960
|
+
* Poll an agent run
|
|
961
|
+
*/
|
|
962
|
+
async getAgentRunRaw(requestParameters, initOverrides) {
|
|
963
|
+
const requestOptions = await this.getAgentRunRequestOpts(requestParameters);
|
|
964
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
965
|
+
return new JSONApiResponse(response, (jsonValue) => AgentRunFromJSON(jsonValue));
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Retrieve the current state of an agent run. Poll until status is \'completed\' or \'failed\'. result is populated when status is \'completed\'.
|
|
969
|
+
* Poll an agent run
|
|
970
|
+
*/
|
|
971
|
+
async getAgentRun(requestParameters, initOverrides) {
|
|
972
|
+
const response = await this.getAgentRunRaw(requestParameters, initOverrides);
|
|
973
|
+
return await response.value();
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
// src/generated/models/AnswerResponse.ts
|
|
978
|
+
function instanceOfAnswerResponse(value) {
|
|
979
|
+
if (!("answer" in value) || value["answer"] === void 0) return false;
|
|
980
|
+
if (!("request_id" in value) || value["request_id"] === void 0) return false;
|
|
981
|
+
return true;
|
|
982
|
+
}
|
|
983
|
+
function AnswerResponseFromJSON(json) {
|
|
984
|
+
return AnswerResponseFromJSONTyped(json, false);
|
|
985
|
+
}
|
|
986
|
+
function AnswerResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
987
|
+
if (json == null) {
|
|
988
|
+
return json;
|
|
989
|
+
}
|
|
990
|
+
return {
|
|
991
|
+
"answer": json["answer"],
|
|
992
|
+
"cards": json["cards"] == null ? void 0 : json["cards"].map(TakoCardFromJSON),
|
|
993
|
+
"web_results": json["web_results"] == null ? void 0 : json["web_results"].map(WebResultFromJSON),
|
|
994
|
+
"contents_total_cost": json["contents_total_cost"] == null ? void 0 : json["contents_total_cost"],
|
|
995
|
+
"request_id": json["request_id"]
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
function AnswerResponseToJSON(json) {
|
|
999
|
+
return AnswerResponseToJSONTyped(json, false);
|
|
1000
|
+
}
|
|
1001
|
+
function AnswerResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1002
|
+
if (value == null) {
|
|
1003
|
+
return value;
|
|
1004
|
+
}
|
|
1005
|
+
return {
|
|
1006
|
+
"answer": value["answer"],
|
|
1007
|
+
"cards": value["cards"] == null ? void 0 : value["cards"].map(TakoCardToJSON),
|
|
1008
|
+
"web_results": value["web_results"] == null ? void 0 : value["web_results"].map(WebResultToJSON),
|
|
1009
|
+
"contents_total_cost": value["contents_total_cost"],
|
|
1010
|
+
"request_id": value["request_id"]
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// src/generated/models/ContentsDeliveryMode.ts
|
|
1015
|
+
var ContentsDeliveryMode = {
|
|
1016
|
+
Url: "url",
|
|
1017
|
+
Inline: "inline"
|
|
96
1018
|
};
|
|
1019
|
+
function instanceOfContentsDeliveryMode(value) {
|
|
1020
|
+
for (const key in ContentsDeliveryMode) {
|
|
1021
|
+
if (Object.prototype.hasOwnProperty.call(ContentsDeliveryMode, key)) {
|
|
1022
|
+
if (ContentsDeliveryMode[key] === value) {
|
|
1023
|
+
return true;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
function ContentsDeliveryModeFromJSON(json) {
|
|
1030
|
+
return ContentsDeliveryModeFromJSONTyped(json, false);
|
|
1031
|
+
}
|
|
1032
|
+
function ContentsDeliveryModeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1033
|
+
return json;
|
|
1034
|
+
}
|
|
1035
|
+
function ContentsDeliveryModeToJSON(value) {
|
|
1036
|
+
return value;
|
|
1037
|
+
}
|
|
1038
|
+
function ContentsDeliveryModeToJSONTyped(value, ignoreDiscriminator) {
|
|
1039
|
+
return value;
|
|
1040
|
+
}
|
|
97
1041
|
|
|
98
|
-
// src/
|
|
99
|
-
function
|
|
100
|
-
|
|
1042
|
+
// src/generated/models/ContentsRequest.ts
|
|
1043
|
+
function instanceOfContentsRequest(value) {
|
|
1044
|
+
if (!("url" in value) || value["url"] === void 0) return false;
|
|
1045
|
+
return true;
|
|
101
1046
|
}
|
|
1047
|
+
function ContentsRequestFromJSON(json) {
|
|
1048
|
+
return ContentsRequestFromJSONTyped(json, false);
|
|
1049
|
+
}
|
|
1050
|
+
function ContentsRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1051
|
+
if (json == null) {
|
|
1052
|
+
return json;
|
|
1053
|
+
}
|
|
1054
|
+
return {
|
|
1055
|
+
"url": json["url"],
|
|
1056
|
+
"mode": json["mode"] == null ? void 0 : ContentsDeliveryModeFromJSON(json["mode"])
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
function ContentsRequestToJSON(json) {
|
|
1060
|
+
return ContentsRequestToJSONTyped(json, false);
|
|
1061
|
+
}
|
|
1062
|
+
function ContentsRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1063
|
+
if (value == null) {
|
|
1064
|
+
return value;
|
|
1065
|
+
}
|
|
1066
|
+
return {
|
|
1067
|
+
"url": value["url"],
|
|
1068
|
+
"mode": ContentsDeliveryModeToJSON(value["mode"])
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
// src/generated/models/ContentItem.ts
|
|
1073
|
+
function instanceOfContentItem(value) {
|
|
1074
|
+
if (!("format" in value) || value["format"] === void 0) return false;
|
|
1075
|
+
if (!("source_url" in value) || value["source_url"] === void 0) return false;
|
|
1076
|
+
return true;
|
|
1077
|
+
}
|
|
1078
|
+
function ContentItemFromJSON(json) {
|
|
1079
|
+
return ContentItemFromJSONTyped(json, false);
|
|
1080
|
+
}
|
|
1081
|
+
function ContentItemFromJSONTyped(json, ignoreDiscriminator) {
|
|
1082
|
+
if (json == null) {
|
|
1083
|
+
return json;
|
|
1084
|
+
}
|
|
1085
|
+
return {
|
|
1086
|
+
"format": ContentFormatFromJSON(json["format"]),
|
|
1087
|
+
"cost": json["cost"] == null ? void 0 : json["cost"],
|
|
1088
|
+
"data": json["data"] == null ? void 0 : json["data"],
|
|
1089
|
+
"total_rows": json["total_rows"] == null ? void 0 : json["total_rows"],
|
|
1090
|
+
"truncated": json["truncated"] == null ? void 0 : json["truncated"],
|
|
1091
|
+
"source_url": json["source_url"],
|
|
1092
|
+
"url": json["url"] == null ? void 0 : json["url"],
|
|
1093
|
+
"expires_at": json["expires_at"] == null ? void 0 : json["expires_at"]
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
function ContentItemToJSON(json) {
|
|
1097
|
+
return ContentItemToJSONTyped(json, false);
|
|
1098
|
+
}
|
|
1099
|
+
function ContentItemToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1100
|
+
if (value == null) {
|
|
1101
|
+
return value;
|
|
1102
|
+
}
|
|
1103
|
+
return {
|
|
1104
|
+
"format": ContentFormatToJSON(value["format"]),
|
|
1105
|
+
"cost": value["cost"],
|
|
1106
|
+
"data": value["data"],
|
|
1107
|
+
"total_rows": value["total_rows"],
|
|
1108
|
+
"truncated": value["truncated"],
|
|
1109
|
+
"source_url": value["source_url"],
|
|
1110
|
+
"url": value["url"],
|
|
1111
|
+
"expires_at": value["expires_at"]
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// src/generated/models/ContentsResponse.ts
|
|
1116
|
+
function instanceOfContentsResponse(value) {
|
|
1117
|
+
if (!("request_id" in value) || value["request_id"] === void 0) return false;
|
|
1118
|
+
return true;
|
|
1119
|
+
}
|
|
1120
|
+
function ContentsResponseFromJSON(json) {
|
|
1121
|
+
return ContentsResponseFromJSONTyped(json, false);
|
|
1122
|
+
}
|
|
1123
|
+
function ContentsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1124
|
+
if (json == null) {
|
|
1125
|
+
return json;
|
|
1126
|
+
}
|
|
1127
|
+
return {
|
|
1128
|
+
"contents": json["contents"] == null ? void 0 : json["contents"].map(ContentItemFromJSON),
|
|
1129
|
+
"request_id": json["request_id"]
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
function ContentsResponseToJSON(json) {
|
|
1133
|
+
return ContentsResponseToJSONTyped(json, false);
|
|
1134
|
+
}
|
|
1135
|
+
function ContentsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1136
|
+
if (value == null) {
|
|
1137
|
+
return value;
|
|
1138
|
+
}
|
|
1139
|
+
return {
|
|
1140
|
+
"contents": value["contents"] == null ? void 0 : value["contents"].map(ContentItemToJSON),
|
|
1141
|
+
"request_id": value["request_id"]
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// src/generated/models/ComponentTypeEnum.ts
|
|
1146
|
+
var ComponentTypeEnum = {
|
|
1147
|
+
CategoricalBar: "categorical_bar",
|
|
1148
|
+
Choropleth: "choropleth",
|
|
1149
|
+
DataTableChart: "data_table_chart",
|
|
1150
|
+
FinancialBoxes: "financial_boxes",
|
|
1151
|
+
GenericTimeseries: "generic_timeseries",
|
|
1152
|
+
Header: "header",
|
|
1153
|
+
Heatmap: "heatmap",
|
|
1154
|
+
Histogram: "histogram",
|
|
1155
|
+
Marimekko: "marimekko",
|
|
1156
|
+
Pie: "pie",
|
|
1157
|
+
Scatter: "scatter",
|
|
1158
|
+
Table: "table",
|
|
1159
|
+
Boxplot: "boxplot",
|
|
1160
|
+
Treemap: "treemap",
|
|
1161
|
+
Waterfall: "waterfall",
|
|
1162
|
+
Sankey: "sankey",
|
|
1163
|
+
Bubble: "bubble",
|
|
1164
|
+
PersonCard: "person_card",
|
|
1165
|
+
Timeline: "timeline",
|
|
1166
|
+
TopLevelMetric: "top_level_metric"
|
|
1167
|
+
};
|
|
1168
|
+
function instanceOfComponentTypeEnum(value) {
|
|
1169
|
+
for (const key in ComponentTypeEnum) {
|
|
1170
|
+
if (Object.prototype.hasOwnProperty.call(ComponentTypeEnum, key)) {
|
|
1171
|
+
if (ComponentTypeEnum[key] === value) {
|
|
1172
|
+
return true;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return false;
|
|
1177
|
+
}
|
|
1178
|
+
function ComponentTypeEnumFromJSON(json) {
|
|
1179
|
+
return ComponentTypeEnumFromJSONTyped(json, false);
|
|
1180
|
+
}
|
|
1181
|
+
function ComponentTypeEnumFromJSONTyped(json, ignoreDiscriminator) {
|
|
1182
|
+
return json;
|
|
1183
|
+
}
|
|
1184
|
+
function ComponentTypeEnumToJSON(value) {
|
|
1185
|
+
return value;
|
|
1186
|
+
}
|
|
1187
|
+
function ComponentTypeEnumToJSONTyped(value, ignoreDiscriminator) {
|
|
1188
|
+
return value;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
// src/generated/models/ComponentConfig.ts
|
|
1192
|
+
function instanceOfComponentConfig(value) {
|
|
1193
|
+
if (!("component_type" in value) || value["component_type"] === void 0) return false;
|
|
1194
|
+
if (!("config" in value) || value["config"] === void 0) return false;
|
|
1195
|
+
return true;
|
|
1196
|
+
}
|
|
1197
|
+
function ComponentConfigFromJSON(json) {
|
|
1198
|
+
return ComponentConfigFromJSONTyped(json, false);
|
|
1199
|
+
}
|
|
1200
|
+
function ComponentConfigFromJSONTyped(json, ignoreDiscriminator) {
|
|
1201
|
+
if (json == null) {
|
|
1202
|
+
return json;
|
|
1203
|
+
}
|
|
1204
|
+
return {
|
|
1205
|
+
"component_type": ComponentTypeEnumFromJSON(json["component_type"]),
|
|
1206
|
+
"component_variant": json["component_variant"] == null ? void 0 : json["component_variant"],
|
|
1207
|
+
"config": json["config"]
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
function ComponentConfigToJSON(json) {
|
|
1211
|
+
return ComponentConfigToJSONTyped(json, false);
|
|
1212
|
+
}
|
|
1213
|
+
function ComponentConfigToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1214
|
+
if (value == null) {
|
|
1215
|
+
return value;
|
|
1216
|
+
}
|
|
1217
|
+
return {
|
|
1218
|
+
"component_type": ComponentTypeEnumToJSON(value["component_type"]),
|
|
1219
|
+
"component_variant": value["component_variant"],
|
|
1220
|
+
"config": value["config"]
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// src/generated/models/CreateCardRequest.ts
|
|
1225
|
+
function instanceOfCreateCardRequest(value) {
|
|
1226
|
+
if (!("components" in value) || value["components"] === void 0) return false;
|
|
1227
|
+
return true;
|
|
1228
|
+
}
|
|
1229
|
+
function CreateCardRequestFromJSON(json) {
|
|
1230
|
+
return CreateCardRequestFromJSONTyped(json, false);
|
|
1231
|
+
}
|
|
1232
|
+
function CreateCardRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1233
|
+
if (json == null) {
|
|
1234
|
+
return json;
|
|
1235
|
+
}
|
|
1236
|
+
return {
|
|
1237
|
+
"components": json["components"].map(ComponentConfigFromJSON),
|
|
1238
|
+
"title": json["title"] == null ? void 0 : json["title"],
|
|
1239
|
+
"description": json["description"] == null ? void 0 : json["description"],
|
|
1240
|
+
"source": json["source"] == null ? void 0 : json["source"],
|
|
1241
|
+
"height": json["height"] == null ? void 0 : json["height"],
|
|
1242
|
+
"postmessage_embed": json["postmessage_embed"] == null ? void 0 : json["postmessage_embed"],
|
|
1243
|
+
"normalize_currencies": json["normalize_currencies"] == null ? void 0 : json["normalize_currencies"],
|
|
1244
|
+
"image_ttl_minutes": json["image_ttl_minutes"] == null ? void 0 : json["image_ttl_minutes"]
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
function CreateCardRequestToJSON(json) {
|
|
1248
|
+
return CreateCardRequestToJSONTyped(json, false);
|
|
1249
|
+
}
|
|
1250
|
+
function CreateCardRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1251
|
+
if (value == null) {
|
|
1252
|
+
return value;
|
|
1253
|
+
}
|
|
1254
|
+
return {
|
|
1255
|
+
"components": value["components"].map(ComponentConfigToJSON),
|
|
1256
|
+
"title": value["title"],
|
|
1257
|
+
"description": value["description"],
|
|
1258
|
+
"source": value["source"],
|
|
1259
|
+
"height": value["height"],
|
|
1260
|
+
"postmessage_embed": value["postmessage_embed"],
|
|
1261
|
+
"normalize_currencies": value["normalize_currencies"],
|
|
1262
|
+
"image_ttl_minutes": value["image_ttl_minutes"]
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// src/generated/models/IdealVizDecision.ts
|
|
1267
|
+
function instanceOfIdealVizDecision(value) {
|
|
1268
|
+
if (!("property_path" in value) || value["property_path"] === void 0) return false;
|
|
1269
|
+
if (!("reason" in value) || value["reason"] === void 0) return false;
|
|
1270
|
+
return true;
|
|
1271
|
+
}
|
|
1272
|
+
function IdealVizDecisionFromJSON(json) {
|
|
1273
|
+
return IdealVizDecisionFromJSONTyped(json, false);
|
|
1274
|
+
}
|
|
1275
|
+
function IdealVizDecisionFromJSONTyped(json, ignoreDiscriminator) {
|
|
1276
|
+
if (json == null) {
|
|
1277
|
+
return json;
|
|
1278
|
+
}
|
|
1279
|
+
return {
|
|
1280
|
+
"property_path": json["property_path"],
|
|
1281
|
+
"property_path_display_name": json["property_path_display_name"] == null ? void 0 : json["property_path_display_name"],
|
|
1282
|
+
"reason": json["reason"]
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
function IdealVizDecisionToJSON(json) {
|
|
1286
|
+
return IdealVizDecisionToJSONTyped(json, false);
|
|
1287
|
+
}
|
|
1288
|
+
function IdealVizDecisionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1289
|
+
if (value == null) {
|
|
1290
|
+
return value;
|
|
1291
|
+
}
|
|
1292
|
+
return {
|
|
1293
|
+
"property_path": value["property_path"],
|
|
1294
|
+
"property_path_display_name": value["property_path_display_name"],
|
|
1295
|
+
"reason": value["reason"]
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
// src/generated/models/KnowledgeCard.ts
|
|
1300
|
+
function instanceOfKnowledgeCard(value) {
|
|
1301
|
+
if (!("card_id" in value) || value["card_id"] === void 0) return false;
|
|
1302
|
+
if (!("title" in value) || value["title"] === void 0) return false;
|
|
1303
|
+
if (!("description" in value) || value["description"] === void 0) return false;
|
|
1304
|
+
if (!("webpage_url" in value) || value["webpage_url"] === void 0) return false;
|
|
1305
|
+
if (!("image_url" in value) || value["image_url"] === void 0) return false;
|
|
1306
|
+
if (!("embed_url" in value) || value["embed_url"] === void 0) return false;
|
|
1307
|
+
if (!("sources" in value) || value["sources"] === void 0) return false;
|
|
1308
|
+
if (!("methodologies" in value) || value["methodologies"] === void 0) return false;
|
|
1309
|
+
if (!("source_indexes" in value) || value["source_indexes"] === void 0) return false;
|
|
1310
|
+
if (!("card_type" in value) || value["card_type"] === void 0) return false;
|
|
1311
|
+
if (!("data_url" in value) || value["data_url"] === void 0) return false;
|
|
1312
|
+
if (!("relevance" in value) || value["relevance"] === void 0) return false;
|
|
1313
|
+
if (!("visualization_data" in value) || value["visualization_data"] === void 0) return false;
|
|
1314
|
+
return true;
|
|
1315
|
+
}
|
|
1316
|
+
function KnowledgeCardFromJSON(json) {
|
|
1317
|
+
return KnowledgeCardFromJSONTyped(json, false);
|
|
1318
|
+
}
|
|
1319
|
+
function KnowledgeCardFromJSONTyped(json, ignoreDiscriminator) {
|
|
1320
|
+
if (json == null) {
|
|
1321
|
+
return json;
|
|
1322
|
+
}
|
|
1323
|
+
return {
|
|
1324
|
+
"card_id": json["card_id"],
|
|
1325
|
+
"title": json["title"],
|
|
1326
|
+
"description": json["description"],
|
|
1327
|
+
"semantic_description": json["semantic_description"] == null ? void 0 : json["semantic_description"],
|
|
1328
|
+
"webpage_url": json["webpage_url"],
|
|
1329
|
+
"image_url": json["image_url"],
|
|
1330
|
+
"embed_url": json["embed_url"],
|
|
1331
|
+
"sources": json["sources"] == null ? null : json["sources"].map(KnowledgeCardSourceFromJSON),
|
|
1332
|
+
"methodologies": json["methodologies"] == null ? null : json["methodologies"].map(KnowledgeCardMethodologyFromJSON),
|
|
1333
|
+
"source_indexes": json["source_indexes"] == null ? null : json["source_indexes"].map(KnowledgeCardSourceIndexesInnerFromJSON),
|
|
1334
|
+
"card_type": json["card_type"],
|
|
1335
|
+
"data_url": json["data_url"],
|
|
1336
|
+
"relevance": KnowledgeCardRelevanceFromJSON(json["relevance"]),
|
|
1337
|
+
"visualization_data": json["visualization_data"],
|
|
1338
|
+
"ideal_viz_decisions": json["ideal_viz_decisions"] == null ? void 0 : json["ideal_viz_decisions"].map(IdealVizDecisionFromJSON)
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
function KnowledgeCardToJSON(json) {
|
|
1342
|
+
return KnowledgeCardToJSONTyped(json, false);
|
|
1343
|
+
}
|
|
1344
|
+
function KnowledgeCardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1345
|
+
if (value == null) {
|
|
1346
|
+
return value;
|
|
1347
|
+
}
|
|
1348
|
+
return {
|
|
1349
|
+
"card_id": value["card_id"],
|
|
1350
|
+
"title": value["title"],
|
|
1351
|
+
"description": value["description"],
|
|
1352
|
+
"semantic_description": value["semantic_description"],
|
|
1353
|
+
"webpage_url": value["webpage_url"],
|
|
1354
|
+
"image_url": value["image_url"],
|
|
1355
|
+
"embed_url": value["embed_url"],
|
|
1356
|
+
"sources": value["sources"] == null ? null : value["sources"].map(KnowledgeCardSourceToJSON),
|
|
1357
|
+
"methodologies": value["methodologies"] == null ? null : value["methodologies"].map(KnowledgeCardMethodologyToJSON),
|
|
1358
|
+
"source_indexes": value["source_indexes"] == null ? null : value["source_indexes"].map(KnowledgeCardSourceIndexesInnerToJSON),
|
|
1359
|
+
"card_type": value["card_type"],
|
|
1360
|
+
"data_url": value["data_url"],
|
|
1361
|
+
"relevance": KnowledgeCardRelevanceToJSON(value["relevance"]),
|
|
1362
|
+
"visualization_data": value["visualization_data"],
|
|
1363
|
+
"ideal_viz_decisions": value["ideal_viz_decisions"] == null ? void 0 : value["ideal_viz_decisions"].map(IdealVizDecisionToJSON)
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
// src/generated/models/SearchEffortLevel.ts
|
|
1368
|
+
var SearchEffortLevel = {
|
|
1369
|
+
Fast: "fast",
|
|
1370
|
+
Instant: "instant"
|
|
1371
|
+
};
|
|
1372
|
+
function instanceOfSearchEffortLevel(value) {
|
|
1373
|
+
for (const key in SearchEffortLevel) {
|
|
1374
|
+
if (Object.prototype.hasOwnProperty.call(SearchEffortLevel, key)) {
|
|
1375
|
+
if (SearchEffortLevel[key] === value) {
|
|
1376
|
+
return true;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
return false;
|
|
1381
|
+
}
|
|
1382
|
+
function SearchEffortLevelFromJSON(json) {
|
|
1383
|
+
return SearchEffortLevelFromJSONTyped(json, false);
|
|
1384
|
+
}
|
|
1385
|
+
function SearchEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
1386
|
+
return json;
|
|
1387
|
+
}
|
|
1388
|
+
function SearchEffortLevelToJSON(value) {
|
|
1389
|
+
return value;
|
|
1390
|
+
}
|
|
1391
|
+
function SearchEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
1392
|
+
return value;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
// src/generated/models/OutputSettings.ts
|
|
1396
|
+
function instanceOfOutputSettings(value) {
|
|
1397
|
+
return true;
|
|
1398
|
+
}
|
|
1399
|
+
function OutputSettingsFromJSON(json) {
|
|
1400
|
+
return OutputSettingsFromJSONTyped(json, false);
|
|
1401
|
+
}
|
|
1402
|
+
function OutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1403
|
+
if (json == null) {
|
|
1404
|
+
return json;
|
|
1405
|
+
}
|
|
1406
|
+
return {
|
|
1407
|
+
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"],
|
|
1408
|
+
"force_refresh": json["force_refresh"] == null ? void 0 : json["force_refresh"]
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
function OutputSettingsToJSON(json) {
|
|
1412
|
+
return OutputSettingsToJSONTyped(json, false);
|
|
1413
|
+
}
|
|
1414
|
+
function OutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1415
|
+
if (value == null) {
|
|
1416
|
+
return value;
|
|
1417
|
+
}
|
|
1418
|
+
return {
|
|
1419
|
+
"image_dark_mode": value["image_dark_mode"],
|
|
1420
|
+
"force_refresh": value["force_refresh"]
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
// src/generated/models/TakoSourceSettings.ts
|
|
1425
|
+
function instanceOfTakoSourceSettings(value) {
|
|
1426
|
+
return true;
|
|
1427
|
+
}
|
|
1428
|
+
function TakoSourceSettingsFromJSON(json) {
|
|
1429
|
+
return TakoSourceSettingsFromJSONTyped(json, false);
|
|
1430
|
+
}
|
|
1431
|
+
function TakoSourceSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1432
|
+
if (json == null) {
|
|
1433
|
+
return json;
|
|
1434
|
+
}
|
|
1435
|
+
return {
|
|
1436
|
+
"count": json["count"] == null ? void 0 : json["count"],
|
|
1437
|
+
"include_contents": json["include_contents"] == null ? void 0 : json["include_contents"],
|
|
1438
|
+
"defer_data_retrieval": json["defer_data_retrieval"] == null ? void 0 : json["defer_data_retrieval"]
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
function TakoSourceSettingsToJSON(json) {
|
|
1442
|
+
return TakoSourceSettingsToJSONTyped(json, false);
|
|
1443
|
+
}
|
|
1444
|
+
function TakoSourceSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1445
|
+
if (value == null) {
|
|
1446
|
+
return value;
|
|
1447
|
+
}
|
|
1448
|
+
return {
|
|
1449
|
+
"count": value["count"],
|
|
1450
|
+
"include_contents": value["include_contents"],
|
|
1451
|
+
"defer_data_retrieval": value["defer_data_retrieval"]
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
// src/generated/models/SourceSettings.ts
|
|
1456
|
+
function instanceOfSourceSettings(value) {
|
|
1457
|
+
return true;
|
|
1458
|
+
}
|
|
1459
|
+
function SourceSettingsFromJSON(json) {
|
|
1460
|
+
return SourceSettingsFromJSONTyped(json, false);
|
|
1461
|
+
}
|
|
1462
|
+
function SourceSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1463
|
+
if (json == null) {
|
|
1464
|
+
return json;
|
|
1465
|
+
}
|
|
1466
|
+
return {
|
|
1467
|
+
"count": json["count"] == null ? void 0 : json["count"],
|
|
1468
|
+
"include_contents": json["include_contents"] == null ? void 0 : json["include_contents"]
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
function SourceSettingsToJSON(json) {
|
|
1472
|
+
return SourceSettingsToJSONTyped(json, false);
|
|
1473
|
+
}
|
|
1474
|
+
function SourceSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1475
|
+
if (value == null) {
|
|
1476
|
+
return value;
|
|
1477
|
+
}
|
|
1478
|
+
return {
|
|
1479
|
+
"count": value["count"],
|
|
1480
|
+
"include_contents": value["include_contents"]
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
// src/generated/models/Sources.ts
|
|
1485
|
+
function instanceOfSources(value) {
|
|
1486
|
+
return true;
|
|
1487
|
+
}
|
|
1488
|
+
function SourcesFromJSON(json) {
|
|
1489
|
+
return SourcesFromJSONTyped(json, false);
|
|
1490
|
+
}
|
|
1491
|
+
function SourcesFromJSONTyped(json, ignoreDiscriminator) {
|
|
1492
|
+
if (json == null) {
|
|
1493
|
+
return json;
|
|
1494
|
+
}
|
|
1495
|
+
return {
|
|
1496
|
+
"tako": json["tako"] == null ? void 0 : TakoSourceSettingsFromJSON(json["tako"]),
|
|
1497
|
+
"web": json["web"] == null ? void 0 : SourceSettingsFromJSON(json["web"])
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
function SourcesToJSON(json) {
|
|
1501
|
+
return SourcesToJSONTyped(json, false);
|
|
1502
|
+
}
|
|
1503
|
+
function SourcesToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1504
|
+
if (value == null) {
|
|
1505
|
+
return value;
|
|
1506
|
+
}
|
|
1507
|
+
return {
|
|
1508
|
+
"tako": TakoSourceSettingsToJSON(value["tako"]),
|
|
1509
|
+
"web": SourceSettingsToJSON(value["web"])
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
// src/generated/models/SearchRequest.ts
|
|
1514
|
+
function instanceOfSearchRequest(value) {
|
|
1515
|
+
if (!("query" in value) || value["query"] === void 0) return false;
|
|
1516
|
+
return true;
|
|
1517
|
+
}
|
|
1518
|
+
function SearchRequestFromJSON(json) {
|
|
1519
|
+
return SearchRequestFromJSONTyped(json, false);
|
|
1520
|
+
}
|
|
1521
|
+
function SearchRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1522
|
+
if (json == null) {
|
|
1523
|
+
return json;
|
|
1524
|
+
}
|
|
1525
|
+
return {
|
|
1526
|
+
"query": json["query"],
|
|
1527
|
+
"effort": json["effort"] == null ? void 0 : SearchEffortLevelFromJSON(json["effort"]),
|
|
1528
|
+
"sources": json["sources"] == null ? void 0 : SourcesFromJSON(json["sources"]),
|
|
1529
|
+
"country_code": json["country_code"] == null ? void 0 : json["country_code"],
|
|
1530
|
+
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
1531
|
+
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
1532
|
+
"output_settings": json["output_settings"] == null ? void 0 : OutputSettingsFromJSON(json["output_settings"])
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
function SearchRequestToJSON(json) {
|
|
1536
|
+
return SearchRequestToJSONTyped(json, false);
|
|
1537
|
+
}
|
|
1538
|
+
function SearchRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1539
|
+
if (value == null) {
|
|
1540
|
+
return value;
|
|
1541
|
+
}
|
|
1542
|
+
return {
|
|
1543
|
+
"query": value["query"],
|
|
1544
|
+
"effort": SearchEffortLevelToJSON(value["effort"]),
|
|
1545
|
+
"sources": SourcesToJSON(value["sources"]),
|
|
1546
|
+
"country_code": value["country_code"],
|
|
1547
|
+
"locale": value["locale"],
|
|
1548
|
+
"timezone": value["timezone"],
|
|
1549
|
+
"output_settings": OutputSettingsToJSON(value["output_settings"])
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
// src/generated/models/SearchResponse.ts
|
|
1554
|
+
function instanceOfSearchResponse(value) {
|
|
1555
|
+
if (!("request_id" in value) || value["request_id"] === void 0) return false;
|
|
1556
|
+
return true;
|
|
1557
|
+
}
|
|
1558
|
+
function SearchResponseFromJSON(json) {
|
|
1559
|
+
return SearchResponseFromJSONTyped(json, false);
|
|
1560
|
+
}
|
|
1561
|
+
function SearchResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1562
|
+
if (json == null) {
|
|
1563
|
+
return json;
|
|
1564
|
+
}
|
|
1565
|
+
return {
|
|
1566
|
+
"cards": json["cards"] == null ? void 0 : json["cards"].map(TakoCardFromJSON),
|
|
1567
|
+
"web_results": json["web_results"] == null ? void 0 : json["web_results"].map(WebResultFromJSON),
|
|
1568
|
+
"contents_total_cost": json["contents_total_cost"] == null ? void 0 : json["contents_total_cost"],
|
|
1569
|
+
"request_id": json["request_id"]
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
function SearchResponseToJSON(json) {
|
|
1573
|
+
return SearchResponseToJSONTyped(json, false);
|
|
1574
|
+
}
|
|
1575
|
+
function SearchResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1576
|
+
if (value == null) {
|
|
1577
|
+
return value;
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
"cards": value["cards"] == null ? void 0 : value["cards"].map(TakoCardToJSON),
|
|
1581
|
+
"web_results": value["web_results"] == null ? void 0 : value["web_results"].map(WebResultToJSON),
|
|
1582
|
+
"contents_total_cost": value["contents_total_cost"],
|
|
1583
|
+
"request_id": value["request_id"]
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
// src/generated/apis/TakoApi.ts
|
|
1588
|
+
var TakoApi = class extends BaseAPI {
|
|
1589
|
+
/**
|
|
1590
|
+
* Creates request options for answer without sending the request
|
|
1591
|
+
*/
|
|
1592
|
+
async answerRequestOpts(requestParameters) {
|
|
1593
|
+
const queryParameters = {};
|
|
1594
|
+
const headerParameters = {};
|
|
1595
|
+
headerParameters["Content-Type"] = "application/json";
|
|
1596
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1597
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
1598
|
+
}
|
|
1599
|
+
let urlPath = `/v1/answer`;
|
|
1600
|
+
return {
|
|
1601
|
+
path: urlPath,
|
|
1602
|
+
method: "POST",
|
|
1603
|
+
headers: headerParameters,
|
|
1604
|
+
query: queryParameters,
|
|
1605
|
+
body: SearchRequestToJSON(requestParameters["searchRequest"])
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Fast-pipeline retrieval plus an LLM-synthesized answer with confidence. Replaces the grounding endpoint.
|
|
1610
|
+
* Answer
|
|
1611
|
+
*/
|
|
1612
|
+
async answerRaw(requestParameters, initOverrides) {
|
|
1613
|
+
const requestOptions = await this.answerRequestOpts(requestParameters);
|
|
1614
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1615
|
+
return new JSONApiResponse(response, (jsonValue) => AnswerResponseFromJSON(jsonValue));
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Fast-pipeline retrieval plus an LLM-synthesized answer with confidence. Replaces the grounding endpoint.
|
|
1619
|
+
* Answer
|
|
1620
|
+
*/
|
|
1621
|
+
async answer(requestParameters = {}, initOverrides) {
|
|
1622
|
+
const response = await this.answerRaw(requestParameters, initOverrides);
|
|
1623
|
+
return await response.value();
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* Creates request options for contents without sending the request
|
|
1627
|
+
*/
|
|
1628
|
+
async contentsRequestOpts(requestParameters) {
|
|
1629
|
+
const queryParameters = {};
|
|
1630
|
+
const headerParameters = {};
|
|
1631
|
+
headerParameters["Content-Type"] = "application/json";
|
|
1632
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1633
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
1634
|
+
}
|
|
1635
|
+
let urlPath = `/v1/contents`;
|
|
1636
|
+
return {
|
|
1637
|
+
path: urlPath,
|
|
1638
|
+
method: "POST",
|
|
1639
|
+
headers: headerParameters,
|
|
1640
|
+
query: queryParameters,
|
|
1641
|
+
body: ContentsRequestToJSON(requestParameters["contentsRequest"])
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Download the content behind a search result: a CSV of a Tako card\'s underlying data, or the full text of a web page. Returns a short-lived presigned download URL. Protected-source cards (data export not available) return 403.
|
|
1646
|
+
* Download content
|
|
1647
|
+
*/
|
|
1648
|
+
async contentsRaw(requestParameters, initOverrides) {
|
|
1649
|
+
const requestOptions = await this.contentsRequestOpts(requestParameters);
|
|
1650
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1651
|
+
return new JSONApiResponse(response, (jsonValue) => ContentsResponseFromJSON(jsonValue));
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Download the content behind a search result: a CSV of a Tako card\'s underlying data, or the full text of a web page. Returns a short-lived presigned download URL. Protected-source cards (data export not available) return 403.
|
|
1655
|
+
* Download content
|
|
1656
|
+
*/
|
|
1657
|
+
async contents(requestParameters = {}, initOverrides) {
|
|
1658
|
+
const response = await this.contentsRaw(requestParameters, initOverrides);
|
|
1659
|
+
return await response.value();
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Creates request options for createCard without sending the request
|
|
1663
|
+
*/
|
|
1664
|
+
async createCardRequestOpts(requestParameters) {
|
|
1665
|
+
const queryParameters = {};
|
|
1666
|
+
const headerParameters = {};
|
|
1667
|
+
headerParameters["Content-Type"] = "application/json";
|
|
1668
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1669
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
1670
|
+
}
|
|
1671
|
+
let urlPath = `/v1/thin_viz/create/`;
|
|
1672
|
+
return {
|
|
1673
|
+
path: urlPath,
|
|
1674
|
+
method: "POST",
|
|
1675
|
+
headers: headerParameters,
|
|
1676
|
+
query: queryParameters,
|
|
1677
|
+
body: CreateCardRequestToJSON(requestParameters["createCardRequest"])
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Create a visualization card directly from component configurations. Supported component types: header, generic_timeseries, categorical_bar, stock_boxes, financial_boxes, table.
|
|
1682
|
+
*/
|
|
1683
|
+
async createCardRaw(requestParameters, initOverrides) {
|
|
1684
|
+
const requestOptions = await this.createCardRequestOpts(requestParameters);
|
|
1685
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1686
|
+
return new JSONApiResponse(response, (jsonValue) => KnowledgeCardFromJSON(jsonValue));
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Create a visualization card directly from component configurations. Supported component types: header, generic_timeseries, categorical_bar, stock_boxes, financial_boxes, table.
|
|
1690
|
+
*/
|
|
1691
|
+
async createCard(requestParameters = {}, initOverrides) {
|
|
1692
|
+
const response = await this.createCardRaw(requestParameters, initOverrides);
|
|
1693
|
+
return await response.value();
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Creates request options for search without sending the request
|
|
1697
|
+
*/
|
|
1698
|
+
async searchRequestOpts(requestParameters) {
|
|
1699
|
+
const queryParameters = {};
|
|
1700
|
+
const headerParameters = {};
|
|
1701
|
+
headerParameters["Content-Type"] = "application/json";
|
|
1702
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
1703
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
1704
|
+
}
|
|
1705
|
+
let urlPath = `/v3/search`;
|
|
1706
|
+
return {
|
|
1707
|
+
path: urlPath,
|
|
1708
|
+
method: "POST",
|
|
1709
|
+
headers: headerParameters,
|
|
1710
|
+
query: queryParameters,
|
|
1711
|
+
body: SearchRequestToJSON(requestParameters["searchRequest"])
|
|
1712
|
+
};
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Fast-pipeline knowledge search. Returns Tako cards (and web results when requested) with no LLM synthesis.
|
|
1716
|
+
* Search
|
|
1717
|
+
*/
|
|
1718
|
+
async searchRaw(requestParameters, initOverrides) {
|
|
1719
|
+
const requestOptions = await this.searchRequestOpts(requestParameters);
|
|
1720
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1721
|
+
return new JSONApiResponse(response, (jsonValue) => SearchResponseFromJSON(jsonValue));
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Fast-pipeline knowledge search. Returns Tako cards (and web results when requested) with no LLM synthesis.
|
|
1725
|
+
* Search
|
|
1726
|
+
*/
|
|
1727
|
+
async search(requestParameters = {}, initOverrides) {
|
|
1728
|
+
const response = await this.searchRaw(requestParameters, initOverrides);
|
|
1729
|
+
return await response.value();
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1733
|
+
// src/generated/models/APIErrorType.ts
|
|
1734
|
+
var APIErrorType = {
|
|
1735
|
+
BadRequest: "BAD_REQUEST",
|
|
1736
|
+
AuthenticationError: "AUTHENTICATION_ERROR",
|
|
1737
|
+
InternalServerError: "INTERNAL_SERVER_ERROR",
|
|
1738
|
+
RelevantResultsNotFound: "RELEVANT_RESULTS_NOT_FOUND",
|
|
1739
|
+
RateLimitExceeded: "RATE_LIMIT_EXCEEDED",
|
|
1740
|
+
PaymentRequired: "PAYMENT_REQUIRED",
|
|
1741
|
+
RequestTimeout: "REQUEST_TIMEOUT",
|
|
1742
|
+
Forbidden: "FORBIDDEN",
|
|
1743
|
+
NotFound: "NOT_FOUND"
|
|
1744
|
+
};
|
|
1745
|
+
function instanceOfAPIErrorType(value) {
|
|
1746
|
+
for (const key in APIErrorType) {
|
|
1747
|
+
if (Object.prototype.hasOwnProperty.call(APIErrorType, key)) {
|
|
1748
|
+
if (APIErrorType[key] === value) {
|
|
1749
|
+
return true;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
return false;
|
|
1754
|
+
}
|
|
1755
|
+
function APIErrorTypeFromJSON(json) {
|
|
1756
|
+
return APIErrorTypeFromJSONTyped(json, false);
|
|
1757
|
+
}
|
|
1758
|
+
function APIErrorTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1759
|
+
return json;
|
|
1760
|
+
}
|
|
1761
|
+
function APIErrorTypeToJSON(value) {
|
|
1762
|
+
return value;
|
|
1763
|
+
}
|
|
1764
|
+
function APIErrorTypeToJSONTyped(value, ignoreDiscriminator) {
|
|
1765
|
+
return value;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
// src/generated/models/AgentResultEvent.ts
|
|
1769
|
+
var AgentResultEventKindEnum = {
|
|
1770
|
+
AgentResult: "agent_result"
|
|
1771
|
+
};
|
|
1772
|
+
function instanceOfAgentResultEvent(value) {
|
|
1773
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1774
|
+
if (!("data" in value) || value["data"] === void 0) return false;
|
|
1775
|
+
return true;
|
|
1776
|
+
}
|
|
1777
|
+
function AgentResultEventFromJSON(json) {
|
|
1778
|
+
return AgentResultEventFromJSONTyped(json, false);
|
|
1779
|
+
}
|
|
1780
|
+
function AgentResultEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1781
|
+
if (json == null) {
|
|
1782
|
+
return json;
|
|
1783
|
+
}
|
|
1784
|
+
return {
|
|
1785
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
1786
|
+
"id": json["id"],
|
|
1787
|
+
"data": AgentResultFromJSON(json["data"])
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
function AgentResultEventToJSON(json) {
|
|
1791
|
+
return AgentResultEventToJSONTyped(json, false);
|
|
1792
|
+
}
|
|
1793
|
+
function AgentResultEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1794
|
+
if (value == null) {
|
|
1795
|
+
return value;
|
|
1796
|
+
}
|
|
1797
|
+
return {
|
|
1798
|
+
"kind": value["kind"],
|
|
1799
|
+
"id": value["id"],
|
|
1800
|
+
"data": AgentResultToJSON(value["data"])
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
// src/generated/models/DataPipelineAnswerEvent.ts
|
|
1805
|
+
var DataPipelineAnswerEventKindEnum = {
|
|
1806
|
+
DataPipelineAnswer: "data_pipeline_answer"
|
|
1807
|
+
};
|
|
1808
|
+
function instanceOfDataPipelineAnswerEvent(value) {
|
|
1809
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1810
|
+
return true;
|
|
1811
|
+
}
|
|
1812
|
+
function DataPipelineAnswerEventFromJSON(json) {
|
|
1813
|
+
return DataPipelineAnswerEventFromJSONTyped(json, false);
|
|
1814
|
+
}
|
|
1815
|
+
function DataPipelineAnswerEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1816
|
+
if (json == null) {
|
|
1817
|
+
return json;
|
|
1818
|
+
}
|
|
1819
|
+
return {
|
|
1820
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
1821
|
+
"id": json["id"],
|
|
1822
|
+
"chart_refs": json["chart_refs"] == null ? void 0 : json["chart_refs"]
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
function DataPipelineAnswerEventToJSON(json) {
|
|
1826
|
+
return DataPipelineAnswerEventToJSONTyped(json, false);
|
|
1827
|
+
}
|
|
1828
|
+
function DataPipelineAnswerEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1829
|
+
if (value == null) {
|
|
1830
|
+
return value;
|
|
1831
|
+
}
|
|
1832
|
+
return {
|
|
1833
|
+
"kind": value["kind"],
|
|
1834
|
+
"id": value["id"],
|
|
1835
|
+
"chart_refs": value["chart_refs"]
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// src/generated/models/HeartbeatEvent.ts
|
|
1840
|
+
var HeartbeatEventKindEnum = {
|
|
1841
|
+
Heartbeat: "heartbeat"
|
|
1842
|
+
};
|
|
1843
|
+
function instanceOfHeartbeatEvent(value) {
|
|
1844
|
+
return true;
|
|
1845
|
+
}
|
|
1846
|
+
function HeartbeatEventFromJSON(json) {
|
|
1847
|
+
return HeartbeatEventFromJSONTyped(json, false);
|
|
1848
|
+
}
|
|
1849
|
+
function HeartbeatEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1850
|
+
if (json == null) {
|
|
1851
|
+
return json;
|
|
1852
|
+
}
|
|
1853
|
+
return {
|
|
1854
|
+
"kind": json["kind"] == null ? void 0 : json["kind"]
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
function HeartbeatEventToJSON(json) {
|
|
1858
|
+
return HeartbeatEventToJSONTyped(json, false);
|
|
1859
|
+
}
|
|
1860
|
+
function HeartbeatEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1861
|
+
if (value == null) {
|
|
1862
|
+
return value;
|
|
1863
|
+
}
|
|
1864
|
+
return {
|
|
1865
|
+
"kind": value["kind"]
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
// src/generated/models/ReasoningEvent.ts
|
|
1870
|
+
var ReasoningEventKindEnum = {
|
|
1871
|
+
Reasoning: "reasoning"
|
|
1872
|
+
};
|
|
1873
|
+
function instanceOfReasoningEvent(value) {
|
|
1874
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1875
|
+
if (!("delta" in value) || value["delta"] === void 0) return false;
|
|
1876
|
+
return true;
|
|
1877
|
+
}
|
|
1878
|
+
function ReasoningEventFromJSON(json) {
|
|
1879
|
+
return ReasoningEventFromJSONTyped(json, false);
|
|
1880
|
+
}
|
|
1881
|
+
function ReasoningEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1882
|
+
if (json == null) {
|
|
1883
|
+
return json;
|
|
1884
|
+
}
|
|
1885
|
+
return {
|
|
1886
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
1887
|
+
"id": json["id"],
|
|
1888
|
+
"delta": json["delta"],
|
|
1889
|
+
"done": json["done"] == null ? void 0 : json["done"]
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
function ReasoningEventToJSON(json) {
|
|
1893
|
+
return ReasoningEventToJSONTyped(json, false);
|
|
1894
|
+
}
|
|
1895
|
+
function ReasoningEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1896
|
+
if (value == null) {
|
|
1897
|
+
return value;
|
|
1898
|
+
}
|
|
1899
|
+
return {
|
|
1900
|
+
"kind": value["kind"],
|
|
1901
|
+
"id": value["id"],
|
|
1902
|
+
"delta": value["delta"],
|
|
1903
|
+
"done": value["done"]
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
// src/generated/models/StatusEvent.ts
|
|
1908
|
+
var StatusEventKindEnum = {
|
|
1909
|
+
Status: "status"
|
|
1910
|
+
};
|
|
1911
|
+
function instanceOfStatusEvent(value) {
|
|
1912
|
+
if (!("message" in value) || value["message"] === void 0) return false;
|
|
1913
|
+
return true;
|
|
1914
|
+
}
|
|
1915
|
+
function StatusEventFromJSON(json) {
|
|
1916
|
+
return StatusEventFromJSONTyped(json, false);
|
|
1917
|
+
}
|
|
1918
|
+
function StatusEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1919
|
+
if (json == null) {
|
|
1920
|
+
return json;
|
|
1921
|
+
}
|
|
1922
|
+
return {
|
|
1923
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
1924
|
+
"message": json["message"],
|
|
1925
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"]
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
function StatusEventToJSON(json) {
|
|
1929
|
+
return StatusEventToJSONTyped(json, false);
|
|
1930
|
+
}
|
|
1931
|
+
function StatusEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1932
|
+
if (value == null) {
|
|
1933
|
+
return value;
|
|
1934
|
+
}
|
|
1935
|
+
return {
|
|
1936
|
+
"kind": value["kind"],
|
|
1937
|
+
"message": value["message"],
|
|
1938
|
+
"parent_id": value["parent_id"]
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// src/generated/models/StreamDoneEvent.ts
|
|
1943
|
+
var StreamDoneEventKindEnum = {
|
|
1944
|
+
StreamDone: "stream_done"
|
|
1945
|
+
};
|
|
1946
|
+
function instanceOfStreamDoneEvent(value) {
|
|
1947
|
+
return true;
|
|
1948
|
+
}
|
|
1949
|
+
function StreamDoneEventFromJSON(json) {
|
|
1950
|
+
return StreamDoneEventFromJSONTyped(json, false);
|
|
1951
|
+
}
|
|
1952
|
+
function StreamDoneEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1953
|
+
if (json == null) {
|
|
1954
|
+
return json;
|
|
1955
|
+
}
|
|
1956
|
+
return {
|
|
1957
|
+
"kind": json["kind"] == null ? void 0 : json["kind"]
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
function StreamDoneEventToJSON(json) {
|
|
1961
|
+
return StreamDoneEventToJSONTyped(json, false);
|
|
1962
|
+
}
|
|
1963
|
+
function StreamDoneEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1964
|
+
if (value == null) {
|
|
1965
|
+
return value;
|
|
1966
|
+
}
|
|
1967
|
+
return {
|
|
1968
|
+
"kind": value["kind"]
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
// src/generated/models/StreamResetEvent.ts
|
|
1973
|
+
var StreamResetEventKindEnum = {
|
|
1974
|
+
StreamReset: "stream_reset"
|
|
1975
|
+
};
|
|
1976
|
+
function instanceOfStreamResetEvent(value) {
|
|
1977
|
+
return true;
|
|
1978
|
+
}
|
|
1979
|
+
function StreamResetEventFromJSON(json) {
|
|
1980
|
+
return StreamResetEventFromJSONTyped(json, false);
|
|
1981
|
+
}
|
|
1982
|
+
function StreamResetEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
1983
|
+
if (json == null) {
|
|
1984
|
+
return json;
|
|
1985
|
+
}
|
|
1986
|
+
return {
|
|
1987
|
+
"kind": json["kind"] == null ? void 0 : json["kind"]
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
function StreamResetEventToJSON(json) {
|
|
1991
|
+
return StreamResetEventToJSONTyped(json, false);
|
|
1992
|
+
}
|
|
1993
|
+
function StreamResetEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1994
|
+
if (value == null) {
|
|
1995
|
+
return value;
|
|
1996
|
+
}
|
|
1997
|
+
return {
|
|
1998
|
+
"kind": value["kind"]
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
// src/generated/models/SubagentEvent.ts
|
|
2003
|
+
var SubagentEventKindEnum = {
|
|
2004
|
+
Subagent: "subagent"
|
|
2005
|
+
};
|
|
2006
|
+
var SubagentEventEventEnum = {
|
|
2007
|
+
Dispatch: "dispatch",
|
|
2008
|
+
Complete: "complete"
|
|
2009
|
+
};
|
|
2010
|
+
function instanceOfSubagentEvent(value) {
|
|
2011
|
+
if (!("agent_id" in value) || value["agent_id"] === void 0) return false;
|
|
2012
|
+
if (!("subagent_type" in value) || value["subagent_type"] === void 0) return false;
|
|
2013
|
+
if (!("event" in value) || value["event"] === void 0) return false;
|
|
2014
|
+
return true;
|
|
2015
|
+
}
|
|
2016
|
+
function SubagentEventFromJSON(json) {
|
|
2017
|
+
return SubagentEventFromJSONTyped(json, false);
|
|
2018
|
+
}
|
|
2019
|
+
function SubagentEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2020
|
+
if (json == null) {
|
|
2021
|
+
return json;
|
|
2022
|
+
}
|
|
2023
|
+
return {
|
|
2024
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2025
|
+
"agent_id": json["agent_id"],
|
|
2026
|
+
"subagent_type": json["subagent_type"],
|
|
2027
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"],
|
|
2028
|
+
"event": json["event"]
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
function SubagentEventToJSON(json) {
|
|
2032
|
+
return SubagentEventToJSONTyped(json, false);
|
|
2033
|
+
}
|
|
2034
|
+
function SubagentEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2035
|
+
if (value == null) {
|
|
2036
|
+
return value;
|
|
2037
|
+
}
|
|
2038
|
+
return {
|
|
2039
|
+
"kind": value["kind"],
|
|
2040
|
+
"agent_id": value["agent_id"],
|
|
2041
|
+
"subagent_type": value["subagent_type"],
|
|
2042
|
+
"parent_id": value["parent_id"],
|
|
2043
|
+
"event": value["event"]
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
// src/generated/models/TextEvent.ts
|
|
2048
|
+
var TextEventKindEnum = {
|
|
2049
|
+
Text: "text"
|
|
2050
|
+
};
|
|
2051
|
+
function instanceOfTextEvent(value) {
|
|
2052
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2053
|
+
if (!("delta" in value) || value["delta"] === void 0) return false;
|
|
2054
|
+
return true;
|
|
2055
|
+
}
|
|
2056
|
+
function TextEventFromJSON(json) {
|
|
2057
|
+
return TextEventFromJSONTyped(json, false);
|
|
2058
|
+
}
|
|
2059
|
+
function TextEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2060
|
+
if (json == null) {
|
|
2061
|
+
return json;
|
|
2062
|
+
}
|
|
2063
|
+
return {
|
|
2064
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2065
|
+
"id": json["id"],
|
|
2066
|
+
"delta": json["delta"],
|
|
2067
|
+
"done": json["done"] == null ? void 0 : json["done"]
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
function TextEventToJSON(json) {
|
|
2071
|
+
return TextEventToJSONTyped(json, false);
|
|
2072
|
+
}
|
|
2073
|
+
function TextEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2074
|
+
if (value == null) {
|
|
2075
|
+
return value;
|
|
2076
|
+
}
|
|
2077
|
+
return {
|
|
2078
|
+
"kind": value["kind"],
|
|
2079
|
+
"id": value["id"],
|
|
2080
|
+
"delta": value["delta"],
|
|
2081
|
+
"done": value["done"]
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
// src/generated/models/ToolCallEvent.ts
|
|
2086
|
+
var ToolCallEventKindEnum = {
|
|
2087
|
+
ToolCall: "tool_call"
|
|
2088
|
+
};
|
|
2089
|
+
function instanceOfToolCallEvent(value) {
|
|
2090
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2091
|
+
if (!("tool" in value) || value["tool"] === void 0) return false;
|
|
2092
|
+
return true;
|
|
2093
|
+
}
|
|
2094
|
+
function ToolCallEventFromJSON(json) {
|
|
2095
|
+
return ToolCallEventFromJSONTyped(json, false);
|
|
2096
|
+
}
|
|
2097
|
+
function ToolCallEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2098
|
+
if (json == null) {
|
|
2099
|
+
return json;
|
|
2100
|
+
}
|
|
2101
|
+
return {
|
|
2102
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2103
|
+
"id": json["id"],
|
|
2104
|
+
"tool": json["tool"],
|
|
2105
|
+
"status_message": json["status_message"] == null ? void 0 : json["status_message"],
|
|
2106
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"],
|
|
2107
|
+
"done": json["done"] == null ? void 0 : json["done"]
|
|
2108
|
+
};
|
|
2109
|
+
}
|
|
2110
|
+
function ToolCallEventToJSON(json) {
|
|
2111
|
+
return ToolCallEventToJSONTyped(json, false);
|
|
2112
|
+
}
|
|
2113
|
+
function ToolCallEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2114
|
+
if (value == null) {
|
|
2115
|
+
return value;
|
|
2116
|
+
}
|
|
2117
|
+
return {
|
|
2118
|
+
"kind": value["kind"],
|
|
2119
|
+
"id": value["id"],
|
|
2120
|
+
"tool": value["tool"],
|
|
2121
|
+
"status_message": value["status_message"],
|
|
2122
|
+
"parent_id": value["parent_id"],
|
|
2123
|
+
"done": value["done"]
|
|
2124
|
+
};
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
// src/generated/models/ToolErrorEvent.ts
|
|
2128
|
+
var ToolErrorEventKindEnum = {
|
|
2129
|
+
ToolError: "tool_error"
|
|
2130
|
+
};
|
|
2131
|
+
function instanceOfToolErrorEvent(value) {
|
|
2132
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2133
|
+
if (!("tool" in value) || value["tool"] === void 0) return false;
|
|
2134
|
+
if (!("error" in value) || value["error"] === void 0) return false;
|
|
2135
|
+
return true;
|
|
2136
|
+
}
|
|
2137
|
+
function ToolErrorEventFromJSON(json) {
|
|
2138
|
+
return ToolErrorEventFromJSONTyped(json, false);
|
|
2139
|
+
}
|
|
2140
|
+
function ToolErrorEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2141
|
+
if (json == null) {
|
|
2142
|
+
return json;
|
|
2143
|
+
}
|
|
2144
|
+
return {
|
|
2145
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2146
|
+
"id": json["id"],
|
|
2147
|
+
"tool": json["tool"],
|
|
2148
|
+
"error": json["error"],
|
|
2149
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"]
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
function ToolErrorEventToJSON(json) {
|
|
2153
|
+
return ToolErrorEventToJSONTyped(json, false);
|
|
2154
|
+
}
|
|
2155
|
+
function ToolErrorEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2156
|
+
if (value == null) {
|
|
2157
|
+
return value;
|
|
2158
|
+
}
|
|
2159
|
+
return {
|
|
2160
|
+
"kind": value["kind"],
|
|
2161
|
+
"id": value["id"],
|
|
2162
|
+
"tool": value["tool"],
|
|
2163
|
+
"error": value["error"],
|
|
2164
|
+
"parent_id": value["parent_id"]
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
// src/generated/models/ToolResultEvent.ts
|
|
2169
|
+
var ToolResultEventKindEnum = {
|
|
2170
|
+
ToolResult: "tool_result"
|
|
2171
|
+
};
|
|
2172
|
+
function instanceOfToolResultEvent(value) {
|
|
2173
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2174
|
+
if (!("tool" in value) || value["tool"] === void 0) return false;
|
|
2175
|
+
return true;
|
|
2176
|
+
}
|
|
2177
|
+
function ToolResultEventFromJSON(json) {
|
|
2178
|
+
return ToolResultEventFromJSONTyped(json, false);
|
|
2179
|
+
}
|
|
2180
|
+
function ToolResultEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2181
|
+
if (json == null) {
|
|
2182
|
+
return json;
|
|
2183
|
+
}
|
|
2184
|
+
return {
|
|
2185
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2186
|
+
"id": json["id"],
|
|
2187
|
+
"tool": json["tool"],
|
|
2188
|
+
"elapsed_ms": json["elapsed_ms"] == null ? void 0 : json["elapsed_ms"],
|
|
2189
|
+
"link": json["link"] == null ? void 0 : json["link"],
|
|
2190
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"]
|
|
2191
|
+
};
|
|
2192
|
+
}
|
|
2193
|
+
function ToolResultEventToJSON(json) {
|
|
2194
|
+
return ToolResultEventToJSONTyped(json, false);
|
|
2195
|
+
}
|
|
2196
|
+
function ToolResultEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2197
|
+
if (value == null) {
|
|
2198
|
+
return value;
|
|
2199
|
+
}
|
|
2200
|
+
return {
|
|
2201
|
+
"kind": value["kind"],
|
|
2202
|
+
"id": value["id"],
|
|
2203
|
+
"tool": value["tool"],
|
|
2204
|
+
"elapsed_ms": value["elapsed_ms"],
|
|
2205
|
+
"link": value["link"],
|
|
2206
|
+
"parent_id": value["parent_id"]
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
// src/generated/models/ToolRetryEvent.ts
|
|
2211
|
+
var ToolRetryEventKindEnum = {
|
|
2212
|
+
ToolRetry: "tool_retry"
|
|
2213
|
+
};
|
|
2214
|
+
function instanceOfToolRetryEvent(value) {
|
|
2215
|
+
if (!("id" in value) || value["id"] === void 0) return false;
|
|
2216
|
+
if (!("tool" in value) || value["tool"] === void 0) return false;
|
|
2217
|
+
if (!("error" in value) || value["error"] === void 0) return false;
|
|
2218
|
+
return true;
|
|
2219
|
+
}
|
|
2220
|
+
function ToolRetryEventFromJSON(json) {
|
|
2221
|
+
return ToolRetryEventFromJSONTyped(json, false);
|
|
2222
|
+
}
|
|
2223
|
+
function ToolRetryEventFromJSONTyped(json, ignoreDiscriminator) {
|
|
2224
|
+
if (json == null) {
|
|
2225
|
+
return json;
|
|
2226
|
+
}
|
|
2227
|
+
return {
|
|
2228
|
+
"kind": json["kind"] == null ? void 0 : json["kind"],
|
|
2229
|
+
"id": json["id"],
|
|
2230
|
+
"tool": json["tool"],
|
|
2231
|
+
"error": json["error"],
|
|
2232
|
+
"elapsed_ms": json["elapsed_ms"] == null ? void 0 : json["elapsed_ms"],
|
|
2233
|
+
"parent_id": json["parent_id"] == null ? void 0 : json["parent_id"]
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
function ToolRetryEventToJSON(json) {
|
|
2237
|
+
return ToolRetryEventToJSONTyped(json, false);
|
|
2238
|
+
}
|
|
2239
|
+
function ToolRetryEventToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2240
|
+
if (value == null) {
|
|
2241
|
+
return value;
|
|
2242
|
+
}
|
|
2243
|
+
return {
|
|
2244
|
+
"kind": value["kind"],
|
|
2245
|
+
"id": value["id"],
|
|
2246
|
+
"tool": value["tool"],
|
|
2247
|
+
"error": value["error"],
|
|
2248
|
+
"elapsed_ms": value["elapsed_ms"],
|
|
2249
|
+
"parent_id": value["parent_id"]
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
// src/generated/models/Block.ts
|
|
2254
|
+
function BlockFromJSON(json) {
|
|
2255
|
+
return BlockFromJSONTyped(json, false);
|
|
2256
|
+
}
|
|
2257
|
+
function BlockFromJSONTyped(json, ignoreDiscriminator) {
|
|
2258
|
+
if (json == null) {
|
|
2259
|
+
return json;
|
|
2260
|
+
}
|
|
2261
|
+
switch (json["kind"]) {
|
|
2262
|
+
case "agent_result":
|
|
2263
|
+
return Object.assign({}, AgentResultEventFromJSONTyped(json, true), { kind: "agent_result" });
|
|
2264
|
+
case "data_pipeline_answer":
|
|
2265
|
+
return Object.assign({}, DataPipelineAnswerEventFromJSONTyped(json, true), { kind: "data_pipeline_answer" });
|
|
2266
|
+
case "heartbeat":
|
|
2267
|
+
return Object.assign({}, HeartbeatEventFromJSONTyped(json, true), { kind: "heartbeat" });
|
|
2268
|
+
case "reasoning":
|
|
2269
|
+
return Object.assign({}, ReasoningEventFromJSONTyped(json, true), { kind: "reasoning" });
|
|
2270
|
+
case "status":
|
|
2271
|
+
return Object.assign({}, StatusEventFromJSONTyped(json, true), { kind: "status" });
|
|
2272
|
+
case "stream_done":
|
|
2273
|
+
return Object.assign({}, StreamDoneEventFromJSONTyped(json, true), { kind: "stream_done" });
|
|
2274
|
+
case "stream_reset":
|
|
2275
|
+
return Object.assign({}, StreamResetEventFromJSONTyped(json, true), { kind: "stream_reset" });
|
|
2276
|
+
case "subagent":
|
|
2277
|
+
return Object.assign({}, SubagentEventFromJSONTyped(json, true), { kind: "subagent" });
|
|
2278
|
+
case "text":
|
|
2279
|
+
return Object.assign({}, TextEventFromJSONTyped(json, true), { kind: "text" });
|
|
2280
|
+
case "tool_call":
|
|
2281
|
+
return Object.assign({}, ToolCallEventFromJSONTyped(json, true), { kind: "tool_call" });
|
|
2282
|
+
case "tool_error":
|
|
2283
|
+
return Object.assign({}, ToolErrorEventFromJSONTyped(json, true), { kind: "tool_error" });
|
|
2284
|
+
case "tool_result":
|
|
2285
|
+
return Object.assign({}, ToolResultEventFromJSONTyped(json, true), { kind: "tool_result" });
|
|
2286
|
+
case "tool_retry":
|
|
2287
|
+
return Object.assign({}, ToolRetryEventFromJSONTyped(json, true), { kind: "tool_retry" });
|
|
2288
|
+
default:
|
|
2289
|
+
return json;
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
function BlockToJSON(json) {
|
|
2293
|
+
return BlockToJSONTyped(json, false);
|
|
2294
|
+
}
|
|
2295
|
+
function BlockToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2296
|
+
if (value == null) {
|
|
2297
|
+
return value;
|
|
2298
|
+
}
|
|
2299
|
+
switch (value["kind"]) {
|
|
2300
|
+
case "agent_result":
|
|
2301
|
+
return Object.assign({}, AgentResultEventToJSON(value), { "kind": "agent_result" });
|
|
2302
|
+
case "data_pipeline_answer":
|
|
2303
|
+
return Object.assign({}, DataPipelineAnswerEventToJSON(value), { "kind": "data_pipeline_answer" });
|
|
2304
|
+
case "heartbeat":
|
|
2305
|
+
return Object.assign({}, HeartbeatEventToJSON(value), { "kind": "heartbeat" });
|
|
2306
|
+
case "reasoning":
|
|
2307
|
+
return Object.assign({}, ReasoningEventToJSON(value), { "kind": "reasoning" });
|
|
2308
|
+
case "status":
|
|
2309
|
+
return Object.assign({}, StatusEventToJSON(value), { "kind": "status" });
|
|
2310
|
+
case "stream_done":
|
|
2311
|
+
return Object.assign({}, StreamDoneEventToJSON(value), { "kind": "stream_done" });
|
|
2312
|
+
case "stream_reset":
|
|
2313
|
+
return Object.assign({}, StreamResetEventToJSON(value), { "kind": "stream_reset" });
|
|
2314
|
+
case "subagent":
|
|
2315
|
+
return Object.assign({}, SubagentEventToJSON(value), { "kind": "subagent" });
|
|
2316
|
+
case "text":
|
|
2317
|
+
return Object.assign({}, TextEventToJSON(value), { "kind": "text" });
|
|
2318
|
+
case "tool_call":
|
|
2319
|
+
return Object.assign({}, ToolCallEventToJSON(value), { "kind": "tool_call" });
|
|
2320
|
+
case "tool_error":
|
|
2321
|
+
return Object.assign({}, ToolErrorEventToJSON(value), { "kind": "tool_error" });
|
|
2322
|
+
case "tool_result":
|
|
2323
|
+
return Object.assign({}, ToolResultEventToJSON(value), { "kind": "tool_result" });
|
|
2324
|
+
case "tool_retry":
|
|
2325
|
+
return Object.assign({}, ToolRetryEventToJSON(value), { "kind": "tool_retry" });
|
|
2326
|
+
default:
|
|
2327
|
+
return value;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
// src/generated/models/StreamCategory.ts
|
|
2332
|
+
var StreamCategory = {
|
|
2333
|
+
Content: "content",
|
|
2334
|
+
Activity: "activity",
|
|
2335
|
+
Control: "control"
|
|
2336
|
+
};
|
|
2337
|
+
function instanceOfStreamCategory(value) {
|
|
2338
|
+
for (const key in StreamCategory) {
|
|
2339
|
+
if (Object.prototype.hasOwnProperty.call(StreamCategory, key)) {
|
|
2340
|
+
if (StreamCategory[key] === value) {
|
|
2341
|
+
return true;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
return false;
|
|
2346
|
+
}
|
|
2347
|
+
function StreamCategoryFromJSON(json) {
|
|
2348
|
+
return StreamCategoryFromJSONTyped(json, false);
|
|
2349
|
+
}
|
|
2350
|
+
function StreamCategoryFromJSONTyped(json, ignoreDiscriminator) {
|
|
2351
|
+
return json;
|
|
2352
|
+
}
|
|
2353
|
+
function StreamCategoryToJSON(value) {
|
|
2354
|
+
return value;
|
|
2355
|
+
}
|
|
2356
|
+
function StreamCategoryToJSONTyped(value, ignoreDiscriminator) {
|
|
2357
|
+
return value;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
// src/generated/models/AgentStreamEnvelope.ts
|
|
2361
|
+
function instanceOfAgentStreamEnvelope(value) {
|
|
2362
|
+
if (!("seq" in value) || value["seq"] === void 0) return false;
|
|
2363
|
+
if (!("run_id" in value) || value["run_id"] === void 0) return false;
|
|
2364
|
+
if (!("category" in value) || value["category"] === void 0) return false;
|
|
2365
|
+
if (!("block" in value) || value["block"] === void 0) return false;
|
|
2366
|
+
return true;
|
|
2367
|
+
}
|
|
2368
|
+
function AgentStreamEnvelopeFromJSON(json) {
|
|
2369
|
+
return AgentStreamEnvelopeFromJSONTyped(json, false);
|
|
2370
|
+
}
|
|
2371
|
+
function AgentStreamEnvelopeFromJSONTyped(json, ignoreDiscriminator) {
|
|
2372
|
+
if (json == null) {
|
|
2373
|
+
return json;
|
|
2374
|
+
}
|
|
2375
|
+
return {
|
|
2376
|
+
"seq": json["seq"],
|
|
2377
|
+
"run_id": json["run_id"],
|
|
2378
|
+
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
2379
|
+
"category": StreamCategoryFromJSON(json["category"]),
|
|
2380
|
+
"block": BlockFromJSON(json["block"])
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
function AgentStreamEnvelopeToJSON(json) {
|
|
2384
|
+
return AgentStreamEnvelopeToJSONTyped(json, false);
|
|
2385
|
+
}
|
|
2386
|
+
function AgentStreamEnvelopeToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2387
|
+
if (value == null) {
|
|
2388
|
+
return value;
|
|
2389
|
+
}
|
|
2390
|
+
return {
|
|
2391
|
+
"seq": value["seq"],
|
|
2392
|
+
"run_id": value["run_id"],
|
|
2393
|
+
"thread_id": value["thread_id"],
|
|
2394
|
+
"category": StreamCategoryToJSON(value["category"]),
|
|
2395
|
+
"block": BlockToJSON(value["block"])
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
// src/generated/models/BaseAPIError.ts
|
|
2400
|
+
function instanceOfBaseAPIError(value) {
|
|
2401
|
+
if (!("error_message" in value) || value["error_message"] === void 0) return false;
|
|
2402
|
+
if (!("error_type" in value) || value["error_type"] === void 0) return false;
|
|
2403
|
+
return true;
|
|
2404
|
+
}
|
|
2405
|
+
function BaseAPIErrorFromJSON(json) {
|
|
2406
|
+
return BaseAPIErrorFromJSONTyped(json, false);
|
|
2407
|
+
}
|
|
2408
|
+
function BaseAPIErrorFromJSONTyped(json, ignoreDiscriminator) {
|
|
2409
|
+
if (json == null) {
|
|
2410
|
+
return json;
|
|
2411
|
+
}
|
|
2412
|
+
return {
|
|
2413
|
+
"error_message": json["error_message"],
|
|
2414
|
+
"error_type": APIErrorTypeFromJSON(json["error_type"])
|
|
2415
|
+
};
|
|
2416
|
+
}
|
|
2417
|
+
function BaseAPIErrorToJSON(json) {
|
|
2418
|
+
return BaseAPIErrorToJSONTyped(json, false);
|
|
2419
|
+
}
|
|
2420
|
+
function BaseAPIErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2421
|
+
if (value == null) {
|
|
2422
|
+
return value;
|
|
2423
|
+
}
|
|
2424
|
+
return {
|
|
2425
|
+
"error_message": value["error_message"],
|
|
2426
|
+
"error_type": APIErrorTypeToJSON(value["error_type"])
|
|
2427
|
+
};
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
// src/generated/models/CardSourceIndexSegment.ts
|
|
2431
|
+
function instanceOfCardSourceIndexSegment(value) {
|
|
2432
|
+
if (!("index_type" in value) || value["index_type"] === void 0) return false;
|
|
2433
|
+
if (!("segment_id" in value) || value["segment_id"] === void 0) return false;
|
|
2434
|
+
return true;
|
|
2435
|
+
}
|
|
2436
|
+
function CardSourceIndexSegmentFromJSON(json) {
|
|
2437
|
+
return CardSourceIndexSegmentFromJSONTyped(json, false);
|
|
2438
|
+
}
|
|
2439
|
+
function CardSourceIndexSegmentFromJSONTyped(json, ignoreDiscriminator) {
|
|
2440
|
+
if (json == null) {
|
|
2441
|
+
return json;
|
|
2442
|
+
}
|
|
2443
|
+
return {
|
|
2444
|
+
"index_type": CardSourceIndexFromJSON(json["index_type"]),
|
|
2445
|
+
"segment_id": json["segment_id"]
|
|
2446
|
+
};
|
|
2447
|
+
}
|
|
2448
|
+
function CardSourceIndexSegmentToJSON(json) {
|
|
2449
|
+
return CardSourceIndexSegmentToJSONTyped(json, false);
|
|
2450
|
+
}
|
|
2451
|
+
function CardSourceIndexSegmentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2452
|
+
if (value == null) {
|
|
2453
|
+
return value;
|
|
2454
|
+
}
|
|
2455
|
+
return {
|
|
2456
|
+
"index_type": CardSourceIndexToJSON(value["index_type"]),
|
|
2457
|
+
"segment_id": value["segment_id"]
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
// src/generated/models/CardSourcePrivateIndex.ts
|
|
2462
|
+
function instanceOfCardSourcePrivateIndex(value) {
|
|
2463
|
+
if (!("index_type" in value) || value["index_type"] === void 0) return false;
|
|
2464
|
+
if (!("private_index_id" in value) || value["private_index_id"] === void 0) return false;
|
|
2465
|
+
return true;
|
|
2466
|
+
}
|
|
2467
|
+
function CardSourcePrivateIndexFromJSON(json) {
|
|
2468
|
+
return CardSourcePrivateIndexFromJSONTyped(json, false);
|
|
2469
|
+
}
|
|
2470
|
+
function CardSourcePrivateIndexFromJSONTyped(json, ignoreDiscriminator) {
|
|
2471
|
+
if (json == null) {
|
|
2472
|
+
return json;
|
|
2473
|
+
}
|
|
2474
|
+
return {
|
|
2475
|
+
"index_type": CardSourceIndexFromJSON(json["index_type"]),
|
|
2476
|
+
"segment_id": json["segment_id"] == null ? void 0 : json["segment_id"],
|
|
2477
|
+
"private_index_id": json["private_index_id"]
|
|
2478
|
+
};
|
|
2479
|
+
}
|
|
2480
|
+
function CardSourcePrivateIndexToJSON(json) {
|
|
2481
|
+
return CardSourcePrivateIndexToJSONTyped(json, false);
|
|
2482
|
+
}
|
|
2483
|
+
function CardSourcePrivateIndexToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2484
|
+
if (value == null) {
|
|
2485
|
+
return value;
|
|
2486
|
+
}
|
|
2487
|
+
return {
|
|
2488
|
+
"index_type": CardSourceIndexToJSON(value["index_type"]),
|
|
2489
|
+
"segment_id": value["segment_id"],
|
|
2490
|
+
"private_index_id": value["private_index_id"]
|
|
2491
|
+
};
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
// src/generated/models/CreateCard400Response.ts
|
|
2495
|
+
function instanceOfCreateCard400Response(value) {
|
|
2496
|
+
if (!("error" in value) || value["error"] === void 0) return false;
|
|
2497
|
+
return true;
|
|
2498
|
+
}
|
|
2499
|
+
function CreateCard400ResponseFromJSON(json) {
|
|
2500
|
+
return CreateCard400ResponseFromJSONTyped(json, false);
|
|
2501
|
+
}
|
|
2502
|
+
function CreateCard400ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
2503
|
+
if (json == null) {
|
|
2504
|
+
return json;
|
|
2505
|
+
}
|
|
2506
|
+
return {
|
|
2507
|
+
"error": json["error"]
|
|
2508
|
+
};
|
|
2509
|
+
}
|
|
2510
|
+
function CreateCard400ResponseToJSON(json) {
|
|
2511
|
+
return CreateCard400ResponseToJSONTyped(json, false);
|
|
2512
|
+
}
|
|
2513
|
+
function CreateCard400ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2514
|
+
if (value == null) {
|
|
2515
|
+
return value;
|
|
2516
|
+
}
|
|
2517
|
+
return {
|
|
2518
|
+
"error": value["error"]
|
|
2519
|
+
};
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// src/lib/streaming.ts
|
|
2523
|
+
var RUNS_PATH = "/v1/agent/runs";
|
|
2524
|
+
var TERMINAL_KIND = "stream_done";
|
|
2525
|
+
function backoffMs(attempt) {
|
|
2526
|
+
return Math.min(500 * 2 ** (attempt - 1), 1e4);
|
|
2527
|
+
}
|
|
2528
|
+
function sleep(ms) {
|
|
2529
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
2530
|
+
}
|
|
2531
|
+
var AgentStream = class {
|
|
2532
|
+
constructor(config, request, options = {}) {
|
|
2533
|
+
this.run_id = null;
|
|
2534
|
+
this.last_seq = -1;
|
|
2535
|
+
this.result = null;
|
|
2536
|
+
this.controller = null;
|
|
2537
|
+
this.reader = null;
|
|
2538
|
+
this.buffer = "";
|
|
2539
|
+
this.closed = false;
|
|
2540
|
+
this.decoder = new TextDecoder();
|
|
2541
|
+
this.base = config.basePath.replace(/\/+$/, "");
|
|
2542
|
+
this.apiKeyFn = config.apiKey;
|
|
2543
|
+
this.request = request;
|
|
2544
|
+
this.maxRetries = options.maxRetries ?? 5;
|
|
2545
|
+
this.readTimeoutMs = options.readTimeoutMs ?? 12e4;
|
|
2546
|
+
}
|
|
2547
|
+
async headers(extra = {}) {
|
|
2548
|
+
const headers = {
|
|
2549
|
+
Accept: "text/event-stream",
|
|
2550
|
+
"Cache-Control": "no-store",
|
|
2551
|
+
...extra
|
|
2552
|
+
};
|
|
2553
|
+
if (this.apiKeyFn) headers["X-API-Key"] = await this.apiKeyFn("X-API-Key");
|
|
2554
|
+
return headers;
|
|
2555
|
+
}
|
|
2556
|
+
async open(method, url, body) {
|
|
2557
|
+
this.controller = new AbortController();
|
|
2558
|
+
const extra = body !== void 0 ? { "Content-Type": "application/json" } : {};
|
|
2559
|
+
const response = await fetch(url, {
|
|
2560
|
+
method,
|
|
2561
|
+
headers: await this.headers(extra),
|
|
2562
|
+
body,
|
|
2563
|
+
signal: this.controller.signal
|
|
2564
|
+
});
|
|
2565
|
+
if (!response.ok || response.body == null) {
|
|
2566
|
+
const detail = await response.text().catch(() => "");
|
|
2567
|
+
throw new ResponseError(response, `Agent stream error: ${response.status} ${detail}`);
|
|
2568
|
+
}
|
|
2569
|
+
this.reader = response.body.getReader();
|
|
2570
|
+
this.buffer = "";
|
|
2571
|
+
this.decoder = new TextDecoder();
|
|
2572
|
+
}
|
|
2573
|
+
async dispatch() {
|
|
2574
|
+
await this.open(
|
|
2575
|
+
"POST",
|
|
2576
|
+
`${this.base}${RUNS_PATH}`,
|
|
2577
|
+
JSON.stringify(AgentRunRequestToJSON(this.request))
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
async reconnect() {
|
|
2581
|
+
await this.closeConnection();
|
|
2582
|
+
const query = this.last_seq >= 0 ? `?starting_after=${this.last_seq}` : "";
|
|
2583
|
+
await this.open("GET", `${this.base}${RUNS_PATH}/${this.run_id}${query}`);
|
|
2584
|
+
}
|
|
2585
|
+
async closeConnection() {
|
|
2586
|
+
if (this.controller) {
|
|
2587
|
+
this.controller.abort();
|
|
2588
|
+
this.controller = null;
|
|
2589
|
+
}
|
|
2590
|
+
if (this.reader) {
|
|
2591
|
+
try {
|
|
2592
|
+
await this.reader.cancel();
|
|
2593
|
+
} catch {
|
|
2594
|
+
}
|
|
2595
|
+
this.reader = null;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
/** Read one chunk, racing an idle-timeout abort. Returns null at end of stream. */
|
|
2599
|
+
async readChunk() {
|
|
2600
|
+
if (!this.reader) throw new Error("stream not open");
|
|
2601
|
+
const reader = this.reader;
|
|
2602
|
+
let timer;
|
|
2603
|
+
const timeout = new Promise((_, reject) => {
|
|
2604
|
+
timer = setTimeout(() => {
|
|
2605
|
+
this.controller?.abort();
|
|
2606
|
+
reject(new Error("read timeout"));
|
|
2607
|
+
}, this.readTimeoutMs);
|
|
2608
|
+
});
|
|
2609
|
+
const readPromise = reader.read();
|
|
2610
|
+
readPromise.catch(() => {
|
|
2611
|
+
});
|
|
2612
|
+
try {
|
|
2613
|
+
const { value, done } = await Promise.race([readPromise, timeout]);
|
|
2614
|
+
return done ? null : value ?? null;
|
|
2615
|
+
} finally {
|
|
2616
|
+
if (timer) clearTimeout(timer);
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
/** Pull the next complete SSE frame's data payload from the buffer, or null if none yet. */
|
|
2620
|
+
nextFrameData() {
|
|
2621
|
+
const normalized = this.buffer.replace(/\r\n/g, "\n");
|
|
2622
|
+
const sep = normalized.indexOf("\n\n");
|
|
2623
|
+
if (sep === -1) return null;
|
|
2624
|
+
const frame = normalized.slice(0, sep);
|
|
2625
|
+
this.buffer = normalized.slice(sep + 2);
|
|
2626
|
+
const data = frame.split("\n").filter((line) => line.startsWith("data:")).map((line) => line.slice(line.startsWith("data: ") ? 6 : 5)).join("\n");
|
|
2627
|
+
return data;
|
|
2628
|
+
}
|
|
2629
|
+
async *[Symbol.asyncIterator]() {
|
|
2630
|
+
let retries = 0;
|
|
2631
|
+
let started = false;
|
|
2632
|
+
try {
|
|
2633
|
+
while (true) {
|
|
2634
|
+
try {
|
|
2635
|
+
if (!started) {
|
|
2636
|
+
await this.dispatch();
|
|
2637
|
+
started = true;
|
|
2638
|
+
}
|
|
2639
|
+
while (true) {
|
|
2640
|
+
const chunk = await this.readChunk();
|
|
2641
|
+
if (chunk === null) return;
|
|
2642
|
+
this.buffer += this.decoder.decode(chunk, { stream: true });
|
|
2643
|
+
let data = this.nextFrameData();
|
|
2644
|
+
while (data !== null) {
|
|
2645
|
+
if (data.trim().length > 0) {
|
|
2646
|
+
const envelope = AgentStreamEnvelopeFromJSON(JSON.parse(data));
|
|
2647
|
+
this.run_id = envelope.run_id;
|
|
2648
|
+
this.last_seq = envelope.seq;
|
|
2649
|
+
retries = 0;
|
|
2650
|
+
if (envelope.block.kind === "agent_result") {
|
|
2651
|
+
this.result = envelope.block.data;
|
|
2652
|
+
}
|
|
2653
|
+
yield envelope;
|
|
2654
|
+
if (envelope.block.kind === TERMINAL_KIND) return;
|
|
2655
|
+
}
|
|
2656
|
+
data = this.nextFrameData();
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
} catch (error) {
|
|
2660
|
+
if (this.closed) return;
|
|
2661
|
+
if (error instanceof ResponseError || error instanceof SyntaxError) throw error;
|
|
2662
|
+
if (this.run_id === null || retries >= this.maxRetries) throw error;
|
|
2663
|
+
retries += 1;
|
|
2664
|
+
await sleep(backoffMs(retries));
|
|
2665
|
+
await this.reconnect();
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
} finally {
|
|
2669
|
+
if (!this.closed) await this.closeConnection();
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
/** Close the underlying connection. Always call this (or use try/finally). */
|
|
2673
|
+
async close() {
|
|
2674
|
+
this.closed = true;
|
|
2675
|
+
await this.closeConnection();
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
|
|
2679
|
+
// src/lib/agent.ts
|
|
2680
|
+
var AgentResource = class {
|
|
2681
|
+
constructor(config) {
|
|
2682
|
+
this.config = config;
|
|
2683
|
+
this.api = new AgentApi(config);
|
|
2684
|
+
}
|
|
2685
|
+
/** Dispatch a new agent run (202). Returns the AgentRun handle. */
|
|
2686
|
+
run(request) {
|
|
2687
|
+
return this.api.createAgentRun({ agentRunRequest: request });
|
|
2688
|
+
}
|
|
2689
|
+
/** Poll a run's status. `startingAfter` replays events after that seq (JSON mode). */
|
|
2690
|
+
async get(runId, startingAfter) {
|
|
2691
|
+
if (!runId) {
|
|
2692
|
+
throw new Error(
|
|
2693
|
+
"run_id is required to poll a run; the stream produced no events to resume from"
|
|
2694
|
+
);
|
|
2695
|
+
}
|
|
2696
|
+
return this.api.getAgentRun({ runId, startingAfter });
|
|
2697
|
+
}
|
|
2698
|
+
/** Open a live SSE stream over a new agent run. */
|
|
2699
|
+
stream(request, options) {
|
|
2700
|
+
return new AgentStream(this.config, request, options);
|
|
2701
|
+
}
|
|
2702
|
+
};
|
|
2703
|
+
|
|
2704
|
+
// src/lib/facade.ts
|
|
2705
|
+
var Tako = class {
|
|
2706
|
+
constructor(options) {
|
|
2707
|
+
if (!options.apiKey?.trim()) {
|
|
2708
|
+
throw new Error("apiKey is required");
|
|
2709
|
+
}
|
|
2710
|
+
this.config = new Configuration({ apiKey: options.apiKey, basePath: options.basePath });
|
|
2711
|
+
this.api = new TakoApi(this.config);
|
|
2712
|
+
this.agent = new AgentResource(this.config);
|
|
2713
|
+
}
|
|
2714
|
+
search(request) {
|
|
2715
|
+
return this.api.search({ searchRequest: request });
|
|
2716
|
+
}
|
|
2717
|
+
answer(request) {
|
|
2718
|
+
return this.api.answer({ searchRequest: request });
|
|
2719
|
+
}
|
|
2720
|
+
contents(request) {
|
|
2721
|
+
return this.api.contents({ contentsRequest: request });
|
|
2722
|
+
}
|
|
2723
|
+
createCard(request) {
|
|
2724
|
+
return this.api.createCard({ createCardRequest: request });
|
|
2725
|
+
}
|
|
2726
|
+
};
|
|
102
2727
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
2728
|
+
APIErrorType,
|
|
2729
|
+
APIErrorTypeFromJSON,
|
|
2730
|
+
APIErrorTypeFromJSONTyped,
|
|
2731
|
+
APIErrorTypeToJSON,
|
|
2732
|
+
APIErrorTypeToJSONTyped,
|
|
2733
|
+
AgentApi,
|
|
2734
|
+
AgentEffortLevel,
|
|
2735
|
+
AgentEffortLevelFromJSON,
|
|
2736
|
+
AgentEffortLevelFromJSONTyped,
|
|
2737
|
+
AgentEffortLevelToJSON,
|
|
2738
|
+
AgentEffortLevelToJSONTyped,
|
|
2739
|
+
AgentOutputSettingsFromJSON,
|
|
2740
|
+
AgentOutputSettingsFromJSONTyped,
|
|
2741
|
+
AgentOutputSettingsToJSON,
|
|
2742
|
+
AgentOutputSettingsToJSONTyped,
|
|
2743
|
+
AgentResource,
|
|
2744
|
+
AgentResultEventFromJSON,
|
|
2745
|
+
AgentResultEventFromJSONTyped,
|
|
2746
|
+
AgentResultEventKindEnum,
|
|
2747
|
+
AgentResultEventToJSON,
|
|
2748
|
+
AgentResultEventToJSONTyped,
|
|
2749
|
+
AgentResultFromJSON,
|
|
2750
|
+
AgentResultFromJSONTyped,
|
|
2751
|
+
AgentResultToJSON,
|
|
2752
|
+
AgentResultToJSONTyped,
|
|
2753
|
+
AgentRunFromJSON,
|
|
2754
|
+
AgentRunFromJSONTyped,
|
|
2755
|
+
AgentRunObjectEnum,
|
|
2756
|
+
AgentRunRequestFromJSON,
|
|
2757
|
+
AgentRunRequestFromJSONTyped,
|
|
2758
|
+
AgentRunRequestSourceIndexesEnum,
|
|
2759
|
+
AgentRunRequestToJSON,
|
|
2760
|
+
AgentRunRequestToJSONTyped,
|
|
2761
|
+
AgentRunStatus,
|
|
2762
|
+
AgentRunStatusFromJSON,
|
|
2763
|
+
AgentRunStatusFromJSONTyped,
|
|
2764
|
+
AgentRunStatusToJSON,
|
|
2765
|
+
AgentRunStatusToJSONTyped,
|
|
2766
|
+
AgentRunToJSON,
|
|
2767
|
+
AgentRunToJSONTyped,
|
|
2768
|
+
AgentStream,
|
|
2769
|
+
AgentStreamEnvelopeFromJSON,
|
|
2770
|
+
AgentStreamEnvelopeFromJSONTyped,
|
|
2771
|
+
AgentStreamEnvelopeToJSON,
|
|
2772
|
+
AgentStreamEnvelopeToJSONTyped,
|
|
2773
|
+
AnswerResponseFromJSON,
|
|
2774
|
+
AnswerResponseFromJSONTyped,
|
|
2775
|
+
AnswerResponseToJSON,
|
|
2776
|
+
AnswerResponseToJSONTyped,
|
|
2777
|
+
BASE_PATH,
|
|
2778
|
+
BaseAPI,
|
|
2779
|
+
BaseAPIErrorFromJSON,
|
|
2780
|
+
BaseAPIErrorFromJSONTyped,
|
|
2781
|
+
BaseAPIErrorToJSON,
|
|
2782
|
+
BaseAPIErrorToJSONTyped,
|
|
2783
|
+
BlobApiResponse,
|
|
2784
|
+
BlockFromJSON,
|
|
2785
|
+
BlockFromJSONTyped,
|
|
2786
|
+
BlockToJSON,
|
|
2787
|
+
BlockToJSONTyped,
|
|
2788
|
+
COLLECTION_FORMATS,
|
|
2789
|
+
CardSourceIndex,
|
|
2790
|
+
CardSourceIndexFromJSON,
|
|
2791
|
+
CardSourceIndexFromJSONTyped,
|
|
2792
|
+
CardSourceIndexSegmentFromJSON,
|
|
2793
|
+
CardSourceIndexSegmentFromJSONTyped,
|
|
2794
|
+
CardSourceIndexSegmentToJSON,
|
|
2795
|
+
CardSourceIndexSegmentToJSONTyped,
|
|
2796
|
+
CardSourceIndexToJSON,
|
|
2797
|
+
CardSourceIndexToJSONTyped,
|
|
2798
|
+
CardSourcePrivateIndexFromJSON,
|
|
2799
|
+
CardSourcePrivateIndexFromJSONTyped,
|
|
2800
|
+
CardSourcePrivateIndexToJSON,
|
|
2801
|
+
CardSourcePrivateIndexToJSONTyped,
|
|
2802
|
+
ComponentConfigFromJSON,
|
|
2803
|
+
ComponentConfigFromJSONTyped,
|
|
2804
|
+
ComponentConfigToJSON,
|
|
2805
|
+
ComponentConfigToJSONTyped,
|
|
2806
|
+
ComponentTypeEnum,
|
|
2807
|
+
ComponentTypeEnumFromJSON,
|
|
2808
|
+
ComponentTypeEnumFromJSONTyped,
|
|
2809
|
+
ComponentTypeEnumToJSON,
|
|
2810
|
+
ComponentTypeEnumToJSONTyped,
|
|
2811
|
+
Configuration,
|
|
2812
|
+
ContentFormat,
|
|
2813
|
+
ContentFormatFromJSON,
|
|
2814
|
+
ContentFormatFromJSONTyped,
|
|
2815
|
+
ContentFormatToJSON,
|
|
2816
|
+
ContentFormatToJSONTyped,
|
|
2817
|
+
ContentItemFromJSON,
|
|
2818
|
+
ContentItemFromJSONTyped,
|
|
2819
|
+
ContentItemToJSON,
|
|
2820
|
+
ContentItemToJSONTyped,
|
|
2821
|
+
ContentsDeliveryMode,
|
|
2822
|
+
ContentsDeliveryModeFromJSON,
|
|
2823
|
+
ContentsDeliveryModeFromJSONTyped,
|
|
2824
|
+
ContentsDeliveryModeToJSON,
|
|
2825
|
+
ContentsDeliveryModeToJSONTyped,
|
|
2826
|
+
ContentsRequestFromJSON,
|
|
2827
|
+
ContentsRequestFromJSONTyped,
|
|
2828
|
+
ContentsRequestToJSON,
|
|
2829
|
+
ContentsRequestToJSONTyped,
|
|
2830
|
+
ContentsResponseFromJSON,
|
|
2831
|
+
ContentsResponseFromJSONTyped,
|
|
2832
|
+
ContentsResponseToJSON,
|
|
2833
|
+
ContentsResponseToJSONTyped,
|
|
2834
|
+
CreateCard400ResponseFromJSON,
|
|
2835
|
+
CreateCard400ResponseFromJSONTyped,
|
|
2836
|
+
CreateCard400ResponseToJSON,
|
|
2837
|
+
CreateCard400ResponseToJSONTyped,
|
|
2838
|
+
CreateCardRequestFromJSON,
|
|
2839
|
+
CreateCardRequestFromJSONTyped,
|
|
2840
|
+
CreateCardRequestToJSON,
|
|
2841
|
+
CreateCardRequestToJSONTyped,
|
|
2842
|
+
DataPipelineAnswerEventFromJSON,
|
|
2843
|
+
DataPipelineAnswerEventFromJSONTyped,
|
|
2844
|
+
DataPipelineAnswerEventKindEnum,
|
|
2845
|
+
DataPipelineAnswerEventToJSON,
|
|
2846
|
+
DataPipelineAnswerEventToJSONTyped,
|
|
2847
|
+
DefaultConfig,
|
|
2848
|
+
ErrorObjectFromJSON,
|
|
2849
|
+
ErrorObjectFromJSONTyped,
|
|
2850
|
+
ErrorObjectToJSON,
|
|
2851
|
+
ErrorObjectToJSONTyped,
|
|
2852
|
+
FetchError,
|
|
2853
|
+
HeartbeatEventFromJSON,
|
|
2854
|
+
HeartbeatEventFromJSONTyped,
|
|
2855
|
+
HeartbeatEventKindEnum,
|
|
2856
|
+
HeartbeatEventToJSON,
|
|
2857
|
+
HeartbeatEventToJSONTyped,
|
|
2858
|
+
IdealVizDecisionFromJSON,
|
|
2859
|
+
IdealVizDecisionFromJSONTyped,
|
|
2860
|
+
IdealVizDecisionToJSON,
|
|
2861
|
+
IdealVizDecisionToJSONTyped,
|
|
2862
|
+
JSONApiResponse,
|
|
2863
|
+
KnowledgeCardFromJSON,
|
|
2864
|
+
KnowledgeCardFromJSONTyped,
|
|
2865
|
+
KnowledgeCardMethodologyFromJSON,
|
|
2866
|
+
KnowledgeCardMethodologyFromJSONTyped,
|
|
2867
|
+
KnowledgeCardMethodologyToJSON,
|
|
2868
|
+
KnowledgeCardMethodologyToJSONTyped,
|
|
2869
|
+
KnowledgeCardRelevance,
|
|
2870
|
+
KnowledgeCardRelevanceFromJSON,
|
|
2871
|
+
KnowledgeCardRelevanceFromJSONTyped,
|
|
2872
|
+
KnowledgeCardRelevanceToJSON,
|
|
2873
|
+
KnowledgeCardRelevanceToJSONTyped,
|
|
2874
|
+
KnowledgeCardSourceFromJSON,
|
|
2875
|
+
KnowledgeCardSourceFromJSONTyped,
|
|
2876
|
+
KnowledgeCardSourceIndexesInnerFromJSON,
|
|
2877
|
+
KnowledgeCardSourceIndexesInnerFromJSONTyped,
|
|
2878
|
+
KnowledgeCardSourceIndexesInnerToJSON,
|
|
2879
|
+
KnowledgeCardSourceIndexesInnerToJSONTyped,
|
|
2880
|
+
KnowledgeCardSourceToJSON,
|
|
2881
|
+
KnowledgeCardSourceToJSONTyped,
|
|
2882
|
+
KnowledgeCardToJSON,
|
|
2883
|
+
KnowledgeCardToJSONTyped,
|
|
2884
|
+
OutputSettingsFromJSON,
|
|
2885
|
+
OutputSettingsFromJSONTyped,
|
|
2886
|
+
OutputSettingsToJSON,
|
|
2887
|
+
OutputSettingsToJSONTyped,
|
|
2888
|
+
ReasoningEventFromJSON,
|
|
2889
|
+
ReasoningEventFromJSONTyped,
|
|
2890
|
+
ReasoningEventKindEnum,
|
|
2891
|
+
ReasoningEventToJSON,
|
|
2892
|
+
ReasoningEventToJSONTyped,
|
|
2893
|
+
RequiredError,
|
|
2894
|
+
ResponseError,
|
|
2895
|
+
ResultContentFromJSON,
|
|
2896
|
+
ResultContentFromJSONTyped,
|
|
2897
|
+
ResultContentToJSON,
|
|
2898
|
+
ResultContentToJSONTyped,
|
|
2899
|
+
SearchEffortLevel,
|
|
2900
|
+
SearchEffortLevelFromJSON,
|
|
2901
|
+
SearchEffortLevelFromJSONTyped,
|
|
2902
|
+
SearchEffortLevelToJSON,
|
|
2903
|
+
SearchEffortLevelToJSONTyped,
|
|
2904
|
+
SearchRequestFromJSON,
|
|
2905
|
+
SearchRequestFromJSONTyped,
|
|
2906
|
+
SearchRequestToJSON,
|
|
2907
|
+
SearchRequestToJSONTyped,
|
|
2908
|
+
SearchResponseFromJSON,
|
|
2909
|
+
SearchResponseFromJSONTyped,
|
|
2910
|
+
SearchResponseToJSON,
|
|
2911
|
+
SearchResponseToJSONTyped,
|
|
2912
|
+
SourceIndexFromJSON,
|
|
2913
|
+
SourceIndexFromJSONTyped,
|
|
2914
|
+
SourceIndexToJSON,
|
|
2915
|
+
SourceIndexToJSONTyped,
|
|
2916
|
+
SourceSettingsFromJSON,
|
|
2917
|
+
SourceSettingsFromJSONTyped,
|
|
2918
|
+
SourceSettingsToJSON,
|
|
2919
|
+
SourceSettingsToJSONTyped,
|
|
2920
|
+
SourcesFromJSON,
|
|
2921
|
+
SourcesFromJSONTyped,
|
|
2922
|
+
SourcesToJSON,
|
|
2923
|
+
SourcesToJSONTyped,
|
|
2924
|
+
StatusEventFromJSON,
|
|
2925
|
+
StatusEventFromJSONTyped,
|
|
2926
|
+
StatusEventKindEnum,
|
|
2927
|
+
StatusEventToJSON,
|
|
2928
|
+
StatusEventToJSONTyped,
|
|
2929
|
+
StreamCategory,
|
|
2930
|
+
StreamCategoryFromJSON,
|
|
2931
|
+
StreamCategoryFromJSONTyped,
|
|
2932
|
+
StreamCategoryToJSON,
|
|
2933
|
+
StreamCategoryToJSONTyped,
|
|
2934
|
+
StreamDoneEventFromJSON,
|
|
2935
|
+
StreamDoneEventFromJSONTyped,
|
|
2936
|
+
StreamDoneEventKindEnum,
|
|
2937
|
+
StreamDoneEventToJSON,
|
|
2938
|
+
StreamDoneEventToJSONTyped,
|
|
2939
|
+
StreamResetEventFromJSON,
|
|
2940
|
+
StreamResetEventFromJSONTyped,
|
|
2941
|
+
StreamResetEventKindEnum,
|
|
2942
|
+
StreamResetEventToJSON,
|
|
2943
|
+
StreamResetEventToJSONTyped,
|
|
2944
|
+
SubagentEventEventEnum,
|
|
2945
|
+
SubagentEventFromJSON,
|
|
2946
|
+
SubagentEventFromJSONTyped,
|
|
2947
|
+
SubagentEventKindEnum,
|
|
2948
|
+
SubagentEventToJSON,
|
|
2949
|
+
SubagentEventToJSONTyped,
|
|
2950
|
+
Tako,
|
|
2951
|
+
TakoApi,
|
|
2952
|
+
TakoCardFromJSON,
|
|
2953
|
+
TakoCardFromJSONTyped,
|
|
2954
|
+
TakoCardToJSON,
|
|
2955
|
+
TakoCardToJSONTyped,
|
|
2956
|
+
TakoSourceSettingsFromJSON,
|
|
2957
|
+
TakoSourceSettingsFromJSONTyped,
|
|
2958
|
+
TakoSourceSettingsToJSON,
|
|
2959
|
+
TakoSourceSettingsToJSONTyped,
|
|
2960
|
+
TextApiResponse,
|
|
2961
|
+
TextEventFromJSON,
|
|
2962
|
+
TextEventFromJSONTyped,
|
|
2963
|
+
TextEventKindEnum,
|
|
2964
|
+
TextEventToJSON,
|
|
2965
|
+
TextEventToJSONTyped,
|
|
2966
|
+
ToolCallEventFromJSON,
|
|
2967
|
+
ToolCallEventFromJSONTyped,
|
|
2968
|
+
ToolCallEventKindEnum,
|
|
2969
|
+
ToolCallEventToJSON,
|
|
2970
|
+
ToolCallEventToJSONTyped,
|
|
2971
|
+
ToolErrorEventFromJSON,
|
|
2972
|
+
ToolErrorEventFromJSONTyped,
|
|
2973
|
+
ToolErrorEventKindEnum,
|
|
2974
|
+
ToolErrorEventToJSON,
|
|
2975
|
+
ToolErrorEventToJSONTyped,
|
|
2976
|
+
ToolResultEventFromJSON,
|
|
2977
|
+
ToolResultEventFromJSONTyped,
|
|
2978
|
+
ToolResultEventKindEnum,
|
|
2979
|
+
ToolResultEventToJSON,
|
|
2980
|
+
ToolResultEventToJSONTyped,
|
|
2981
|
+
ToolRetryEventFromJSON,
|
|
2982
|
+
ToolRetryEventFromJSONTyped,
|
|
2983
|
+
ToolRetryEventKindEnum,
|
|
2984
|
+
ToolRetryEventToJSON,
|
|
2985
|
+
ToolRetryEventToJSONTyped,
|
|
2986
|
+
VoidApiResponse,
|
|
2987
|
+
WebResultFromJSON,
|
|
2988
|
+
WebResultFromJSONTyped,
|
|
2989
|
+
WebResultToJSON,
|
|
2990
|
+
WebResultToJSONTyped,
|
|
2991
|
+
canConsumeForm,
|
|
2992
|
+
exists,
|
|
2993
|
+
instanceOfAPIErrorType,
|
|
2994
|
+
instanceOfAgentEffortLevel,
|
|
2995
|
+
instanceOfAgentOutputSettings,
|
|
2996
|
+
instanceOfAgentResult,
|
|
2997
|
+
instanceOfAgentResultEvent,
|
|
2998
|
+
instanceOfAgentRun,
|
|
2999
|
+
instanceOfAgentRunRequest,
|
|
3000
|
+
instanceOfAgentRunStatus,
|
|
3001
|
+
instanceOfAgentStreamEnvelope,
|
|
3002
|
+
instanceOfAnswerResponse,
|
|
3003
|
+
instanceOfBaseAPIError,
|
|
3004
|
+
instanceOfCardSourceIndex,
|
|
3005
|
+
instanceOfCardSourceIndexSegment,
|
|
3006
|
+
instanceOfCardSourcePrivateIndex,
|
|
3007
|
+
instanceOfComponentConfig,
|
|
3008
|
+
instanceOfComponentTypeEnum,
|
|
3009
|
+
instanceOfContentFormat,
|
|
3010
|
+
instanceOfContentItem,
|
|
3011
|
+
instanceOfContentsDeliveryMode,
|
|
3012
|
+
instanceOfContentsRequest,
|
|
3013
|
+
instanceOfContentsResponse,
|
|
3014
|
+
instanceOfCreateCard400Response,
|
|
3015
|
+
instanceOfCreateCardRequest,
|
|
3016
|
+
instanceOfDataPipelineAnswerEvent,
|
|
3017
|
+
instanceOfErrorObject,
|
|
3018
|
+
instanceOfHeartbeatEvent,
|
|
3019
|
+
instanceOfIdealVizDecision,
|
|
3020
|
+
instanceOfKnowledgeCard,
|
|
3021
|
+
instanceOfKnowledgeCardMethodology,
|
|
3022
|
+
instanceOfKnowledgeCardRelevance,
|
|
3023
|
+
instanceOfKnowledgeCardSource,
|
|
3024
|
+
instanceOfKnowledgeCardSourceIndexesInner,
|
|
3025
|
+
instanceOfOutputSettings,
|
|
3026
|
+
instanceOfReasoningEvent,
|
|
3027
|
+
instanceOfResultContent,
|
|
3028
|
+
instanceOfSearchEffortLevel,
|
|
3029
|
+
instanceOfSearchRequest,
|
|
3030
|
+
instanceOfSearchResponse,
|
|
3031
|
+
instanceOfSourceIndex,
|
|
3032
|
+
instanceOfSourceSettings,
|
|
3033
|
+
instanceOfSources,
|
|
3034
|
+
instanceOfStatusEvent,
|
|
3035
|
+
instanceOfStreamCategory,
|
|
3036
|
+
instanceOfStreamDoneEvent,
|
|
3037
|
+
instanceOfStreamResetEvent,
|
|
3038
|
+
instanceOfSubagentEvent,
|
|
3039
|
+
instanceOfTakoCard,
|
|
3040
|
+
instanceOfTakoSourceSettings,
|
|
3041
|
+
instanceOfTextEvent,
|
|
3042
|
+
instanceOfToolCallEvent,
|
|
3043
|
+
instanceOfToolErrorEvent,
|
|
3044
|
+
instanceOfToolResultEvent,
|
|
3045
|
+
instanceOfToolRetryEvent,
|
|
3046
|
+
instanceOfWebResult,
|
|
3047
|
+
mapValues,
|
|
3048
|
+
querystring
|
|
108
3049
|
};
|