tako-sdk 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +307 -106
- package/dist/index.d.cts +352 -140
- package/dist/index.d.ts +352 -140
- package/dist/index.js +287 -106
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65,6 +65,10 @@ __export(index_exports, {
|
|
|
65
65
|
AgentStreamEnvelopeFromJSONTyped: () => AgentStreamEnvelopeFromJSONTyped,
|
|
66
66
|
AgentStreamEnvelopeToJSON: () => AgentStreamEnvelopeToJSON,
|
|
67
67
|
AgentStreamEnvelopeToJSONTyped: () => AgentStreamEnvelopeToJSONTyped,
|
|
68
|
+
AgentUsageFromJSON: () => AgentUsageFromJSON,
|
|
69
|
+
AgentUsageFromJSONTyped: () => AgentUsageFromJSONTyped,
|
|
70
|
+
AgentUsageToJSON: () => AgentUsageToJSON,
|
|
71
|
+
AgentUsageToJSONTyped: () => AgentUsageToJSONTyped,
|
|
68
72
|
AnswerResponseFromJSON: () => AnswerResponseFromJSON,
|
|
69
73
|
AnswerResponseFromJSONTyped: () => AnswerResponseFromJSONTyped,
|
|
70
74
|
AnswerResponseToJSON: () => AnswerResponseToJSON,
|
|
@@ -94,6 +98,14 @@ __export(index_exports, {
|
|
|
94
98
|
CardSourcePrivateIndexFromJSONTyped: () => CardSourcePrivateIndexFromJSONTyped,
|
|
95
99
|
CardSourcePrivateIndexToJSON: () => CardSourcePrivateIndexToJSON,
|
|
96
100
|
CardSourcePrivateIndexToJSONTyped: () => CardSourcePrivateIndexToJSONTyped,
|
|
101
|
+
ClassifyRequestFromJSON: () => ClassifyRequestFromJSON,
|
|
102
|
+
ClassifyRequestFromJSONTyped: () => ClassifyRequestFromJSONTyped,
|
|
103
|
+
ClassifyRequestToJSON: () => ClassifyRequestToJSON,
|
|
104
|
+
ClassifyRequestToJSONTyped: () => ClassifyRequestToJSONTyped,
|
|
105
|
+
ClassifyResponseFromJSON: () => ClassifyResponseFromJSON,
|
|
106
|
+
ClassifyResponseFromJSONTyped: () => ClassifyResponseFromJSONTyped,
|
|
107
|
+
ClassifyResponseToJSON: () => ClassifyResponseToJSON,
|
|
108
|
+
ClassifyResponseToJSONTyped: () => ClassifyResponseToJSONTyped,
|
|
97
109
|
ComponentConfigFromJSON: () => ComponentConfigFromJSON,
|
|
98
110
|
ComponentConfigFromJSONTyped: () => ComponentConfigFromJSONTyped,
|
|
99
111
|
ComponentConfigToJSON: () => ComponentConfigToJSON,
|
|
@@ -180,6 +192,10 @@ __export(index_exports, {
|
|
|
180
192
|
OutputSettingsFromJSONTyped: () => OutputSettingsFromJSONTyped,
|
|
181
193
|
OutputSettingsToJSON: () => OutputSettingsToJSON,
|
|
182
194
|
OutputSettingsToJSONTyped: () => OutputSettingsToJSONTyped,
|
|
195
|
+
QueryClassificationFromJSON: () => QueryClassificationFromJSON,
|
|
196
|
+
QueryClassificationFromJSONTyped: () => QueryClassificationFromJSONTyped,
|
|
197
|
+
QueryClassificationToJSON: () => QueryClassificationToJSON,
|
|
198
|
+
QueryClassificationToJSONTyped: () => QueryClassificationToJSONTyped,
|
|
183
199
|
ReasoningEventFromJSON: () => ReasoningEventFromJSON,
|
|
184
200
|
ReasoningEventFromJSONTyped: () => ReasoningEventFromJSONTyped,
|
|
185
201
|
ReasoningEventKindEnum: () => ReasoningEventKindEnum,
|
|
@@ -294,11 +310,14 @@ __export(index_exports, {
|
|
|
294
310
|
instanceOfAgentRunRequest: () => instanceOfAgentRunRequest,
|
|
295
311
|
instanceOfAgentRunStatus: () => instanceOfAgentRunStatus,
|
|
296
312
|
instanceOfAgentStreamEnvelope: () => instanceOfAgentStreamEnvelope,
|
|
313
|
+
instanceOfAgentUsage: () => instanceOfAgentUsage,
|
|
297
314
|
instanceOfAnswerResponse: () => instanceOfAnswerResponse,
|
|
298
315
|
instanceOfBaseAPIError: () => instanceOfBaseAPIError,
|
|
299
316
|
instanceOfCardSourceIndex: () => instanceOfCardSourceIndex,
|
|
300
317
|
instanceOfCardSourceIndexSegment: () => instanceOfCardSourceIndexSegment,
|
|
301
318
|
instanceOfCardSourcePrivateIndex: () => instanceOfCardSourcePrivateIndex,
|
|
319
|
+
instanceOfClassifyRequest: () => instanceOfClassifyRequest,
|
|
320
|
+
instanceOfClassifyResponse: () => instanceOfClassifyResponse,
|
|
302
321
|
instanceOfComponentConfig: () => instanceOfComponentConfig,
|
|
303
322
|
instanceOfComponentTypeEnum: () => instanceOfComponentTypeEnum,
|
|
304
323
|
instanceOfContentFormat: () => instanceOfContentFormat,
|
|
@@ -318,6 +337,7 @@ __export(index_exports, {
|
|
|
318
337
|
instanceOfKnowledgeCardSource: () => instanceOfKnowledgeCardSource,
|
|
319
338
|
instanceOfKnowledgeCardSourceIndexesInner: () => instanceOfKnowledgeCardSourceIndexesInner,
|
|
320
339
|
instanceOfOutputSettings: () => instanceOfOutputSettings,
|
|
340
|
+
instanceOfQueryClassification: () => instanceOfQueryClassification,
|
|
321
341
|
instanceOfReasoningEvent: () => instanceOfReasoningEvent,
|
|
322
342
|
instanceOfResultContent: () => instanceOfResultContent,
|
|
323
343
|
instanceOfSearchEffortLevel: () => instanceOfSearchEffortLevel,
|
|
@@ -647,6 +667,33 @@ var TextApiResponse = class {
|
|
|
647
667
|
}
|
|
648
668
|
};
|
|
649
669
|
|
|
670
|
+
// src/generated/models/AgentUsage.ts
|
|
671
|
+
function instanceOfAgentUsage(value) {
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
function AgentUsageFromJSON(json) {
|
|
675
|
+
return AgentUsageFromJSONTyped(json, false);
|
|
676
|
+
}
|
|
677
|
+
function AgentUsageFromJSONTyped(json, ignoreDiscriminator) {
|
|
678
|
+
if (json == null) {
|
|
679
|
+
return json;
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
"usd_cost": json["usd_cost"] == null ? void 0 : json["usd_cost"]
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
function AgentUsageToJSON(json) {
|
|
686
|
+
return AgentUsageToJSONTyped(json, false);
|
|
687
|
+
}
|
|
688
|
+
function AgentUsageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
689
|
+
if (value == null) {
|
|
690
|
+
return value;
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
"usd_cost": value["usd_cost"]
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
650
697
|
// src/generated/models/KnowledgeCardMethodology.ts
|
|
651
698
|
function instanceOfKnowledgeCardMethodology(value) {
|
|
652
699
|
if (!("methodology_name" in value) || value["methodology_name"] === void 0) return false;
|
|
@@ -929,7 +976,8 @@ function TakoCardFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
929
976
|
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"].map(KnowledgeCardSourceIndexesInnerFromJSON),
|
|
930
977
|
"card_type": json["card_type"] == null ? void 0 : json["card_type"],
|
|
931
978
|
"relevance": json["relevance"] == null ? void 0 : KnowledgeCardRelevanceFromJSON(json["relevance"]),
|
|
932
|
-
"content": json["content"] == null ? void 0 : ResultContentFromJSON(json["content"])
|
|
979
|
+
"content": json["content"] == null ? void 0 : ResultContentFromJSON(json["content"]),
|
|
980
|
+
"relevance_score": json["relevance_score"] == null ? void 0 : json["relevance_score"]
|
|
933
981
|
};
|
|
934
982
|
}
|
|
935
983
|
function TakoCardToJSON(json) {
|
|
@@ -952,7 +1000,8 @@ function TakoCardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
952
1000
|
"source_indexes": value["source_indexes"] == null ? void 0 : value["source_indexes"].map(KnowledgeCardSourceIndexesInnerToJSON),
|
|
953
1001
|
"card_type": value["card_type"],
|
|
954
1002
|
"relevance": KnowledgeCardRelevanceToJSON(value["relevance"]),
|
|
955
|
-
"content": ResultContentToJSON(value["content"])
|
|
1003
|
+
"content": ResultContentToJSON(value["content"]),
|
|
1004
|
+
"relevance_score": value["relevance_score"]
|
|
956
1005
|
};
|
|
957
1006
|
}
|
|
958
1007
|
|
|
@@ -1030,6 +1079,105 @@ function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1030
1079
|
};
|
|
1031
1080
|
}
|
|
1032
1081
|
|
|
1082
|
+
// src/generated/models/AgentEffortLevel.ts
|
|
1083
|
+
var AgentEffortLevel = {
|
|
1084
|
+
Low: "low",
|
|
1085
|
+
Medium: "medium"
|
|
1086
|
+
};
|
|
1087
|
+
function instanceOfAgentEffortLevel(value) {
|
|
1088
|
+
for (const key in AgentEffortLevel) {
|
|
1089
|
+
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
1090
|
+
if (AgentEffortLevel[key] === value) {
|
|
1091
|
+
return true;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
return false;
|
|
1096
|
+
}
|
|
1097
|
+
function AgentEffortLevelFromJSON(json) {
|
|
1098
|
+
return AgentEffortLevelFromJSONTyped(json, false);
|
|
1099
|
+
}
|
|
1100
|
+
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
1101
|
+
return json;
|
|
1102
|
+
}
|
|
1103
|
+
function AgentEffortLevelToJSON(value) {
|
|
1104
|
+
return value;
|
|
1105
|
+
}
|
|
1106
|
+
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
1107
|
+
return value;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// src/generated/models/AgentOutputSettings.ts
|
|
1111
|
+
function instanceOfAgentOutputSettings(value) {
|
|
1112
|
+
return true;
|
|
1113
|
+
}
|
|
1114
|
+
function AgentOutputSettingsFromJSON(json) {
|
|
1115
|
+
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
1116
|
+
}
|
|
1117
|
+
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1118
|
+
if (json == null) {
|
|
1119
|
+
return json;
|
|
1120
|
+
}
|
|
1121
|
+
return {
|
|
1122
|
+
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
function AgentOutputSettingsToJSON(json) {
|
|
1126
|
+
return AgentOutputSettingsToJSONTyped(json, false);
|
|
1127
|
+
}
|
|
1128
|
+
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1129
|
+
if (value == null) {
|
|
1130
|
+
return value;
|
|
1131
|
+
}
|
|
1132
|
+
return {
|
|
1133
|
+
"image_dark_mode": value["image_dark_mode"]
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// src/generated/models/AgentRunRequest.ts
|
|
1138
|
+
var AgentRunRequestSourceIndexesEnum = {
|
|
1139
|
+
Data: "data",
|
|
1140
|
+
Web: "web"
|
|
1141
|
+
};
|
|
1142
|
+
function instanceOfAgentRunRequest(value) {
|
|
1143
|
+
if (!("query" in value) || value["query"] === void 0) return false;
|
|
1144
|
+
return true;
|
|
1145
|
+
}
|
|
1146
|
+
function AgentRunRequestFromJSON(json) {
|
|
1147
|
+
return AgentRunRequestFromJSONTyped(json, false);
|
|
1148
|
+
}
|
|
1149
|
+
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1150
|
+
if (json == null) {
|
|
1151
|
+
return json;
|
|
1152
|
+
}
|
|
1153
|
+
return {
|
|
1154
|
+
"query": json["query"],
|
|
1155
|
+
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
1156
|
+
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
1157
|
+
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
1158
|
+
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
1159
|
+
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
1160
|
+
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
function AgentRunRequestToJSON(json) {
|
|
1164
|
+
return AgentRunRequestToJSONTyped(json, false);
|
|
1165
|
+
}
|
|
1166
|
+
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1167
|
+
if (value == null) {
|
|
1168
|
+
return value;
|
|
1169
|
+
}
|
|
1170
|
+
return {
|
|
1171
|
+
"query": value["query"],
|
|
1172
|
+
"thread_id": value["thread_id"],
|
|
1173
|
+
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
1174
|
+
"source_indexes": value["source_indexes"],
|
|
1175
|
+
"locale": value["locale"],
|
|
1176
|
+
"timezone": value["timezone"],
|
|
1177
|
+
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1033
1181
|
// src/generated/models/AgentRunStatus.ts
|
|
1034
1182
|
var AgentRunStatus = {
|
|
1035
1183
|
Queued: "queued",
|
|
@@ -1116,7 +1264,9 @@ function AgentRunFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1116
1264
|
"created_at": json["created_at"],
|
|
1117
1265
|
"completed_at": json["completed_at"] == null ? void 0 : json["completed_at"],
|
|
1118
1266
|
"result": json["result"] == null ? void 0 : AgentResultFromJSON(json["result"]),
|
|
1119
|
-
"error": json["error"] == null ? void 0 : ErrorObjectFromJSON(json["error"])
|
|
1267
|
+
"error": json["error"] == null ? void 0 : ErrorObjectFromJSON(json["error"]),
|
|
1268
|
+
"usage": json["usage"] == null ? void 0 : AgentUsageFromJSON(json["usage"]),
|
|
1269
|
+
"request": json["request"] == null ? void 0 : AgentRunRequestFromJSON(json["request"])
|
|
1120
1270
|
};
|
|
1121
1271
|
}
|
|
1122
1272
|
function AgentRunToJSON(json) {
|
|
@@ -1134,105 +1284,9 @@ function AgentRunToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1134
1284
|
"created_at": value["created_at"],
|
|
1135
1285
|
"completed_at": value["completed_at"],
|
|
1136
1286
|
"result": AgentResultToJSON(value["result"]),
|
|
1137
|
-
"error": ErrorObjectToJSON(value["error"])
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
// src/generated/models/AgentEffortLevel.ts
|
|
1142
|
-
var AgentEffortLevel = {
|
|
1143
|
-
Medium: "medium"
|
|
1144
|
-
};
|
|
1145
|
-
function instanceOfAgentEffortLevel(value) {
|
|
1146
|
-
for (const key in AgentEffortLevel) {
|
|
1147
|
-
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
1148
|
-
if (AgentEffortLevel[key] === value) {
|
|
1149
|
-
return true;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
return false;
|
|
1154
|
-
}
|
|
1155
|
-
function AgentEffortLevelFromJSON(json) {
|
|
1156
|
-
return AgentEffortLevelFromJSONTyped(json, false);
|
|
1157
|
-
}
|
|
1158
|
-
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
1159
|
-
return json;
|
|
1160
|
-
}
|
|
1161
|
-
function AgentEffortLevelToJSON(value) {
|
|
1162
|
-
return value;
|
|
1163
|
-
}
|
|
1164
|
-
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
1165
|
-
return value;
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
// src/generated/models/AgentOutputSettings.ts
|
|
1169
|
-
function instanceOfAgentOutputSettings(value) {
|
|
1170
|
-
return true;
|
|
1171
|
-
}
|
|
1172
|
-
function AgentOutputSettingsFromJSON(json) {
|
|
1173
|
-
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
1174
|
-
}
|
|
1175
|
-
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1176
|
-
if (json == null) {
|
|
1177
|
-
return json;
|
|
1178
|
-
}
|
|
1179
|
-
return {
|
|
1180
|
-
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
1181
|
-
};
|
|
1182
|
-
}
|
|
1183
|
-
function AgentOutputSettingsToJSON(json) {
|
|
1184
|
-
return AgentOutputSettingsToJSONTyped(json, false);
|
|
1185
|
-
}
|
|
1186
|
-
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1187
|
-
if (value == null) {
|
|
1188
|
-
return value;
|
|
1189
|
-
}
|
|
1190
|
-
return {
|
|
1191
|
-
"image_dark_mode": value["image_dark_mode"]
|
|
1192
|
-
};
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
// src/generated/models/AgentRunRequest.ts
|
|
1196
|
-
var AgentRunRequestSourceIndexesEnum = {
|
|
1197
|
-
Tako: "tako",
|
|
1198
|
-
Web: "web"
|
|
1199
|
-
};
|
|
1200
|
-
function instanceOfAgentRunRequest(value) {
|
|
1201
|
-
if (!("query" in value) || value["query"] === void 0) return false;
|
|
1202
|
-
return true;
|
|
1203
|
-
}
|
|
1204
|
-
function AgentRunRequestFromJSON(json) {
|
|
1205
|
-
return AgentRunRequestFromJSONTyped(json, false);
|
|
1206
|
-
}
|
|
1207
|
-
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1208
|
-
if (json == null) {
|
|
1209
|
-
return json;
|
|
1210
|
-
}
|
|
1211
|
-
return {
|
|
1212
|
-
"query": json["query"],
|
|
1213
|
-
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
1214
|
-
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
1215
|
-
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
1216
|
-
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
1217
|
-
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
1218
|
-
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
1219
|
-
};
|
|
1220
|
-
}
|
|
1221
|
-
function AgentRunRequestToJSON(json) {
|
|
1222
|
-
return AgentRunRequestToJSONTyped(json, false);
|
|
1223
|
-
}
|
|
1224
|
-
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1225
|
-
if (value == null) {
|
|
1226
|
-
return value;
|
|
1227
|
-
}
|
|
1228
|
-
return {
|
|
1229
|
-
"query": value["query"],
|
|
1230
|
-
"thread_id": value["thread_id"],
|
|
1231
|
-
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
1232
|
-
"source_indexes": value["source_indexes"],
|
|
1233
|
-
"locale": value["locale"],
|
|
1234
|
-
"timezone": value["timezone"],
|
|
1235
|
-
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
1287
|
+
"error": ErrorObjectToJSON(value["error"]),
|
|
1288
|
+
"usage": AgentUsageToJSON(value["usage"]),
|
|
1289
|
+
"request": AgentRunRequestToJSON(value["request"])
|
|
1236
1290
|
};
|
|
1237
1291
|
}
|
|
1238
1292
|
|
|
@@ -1357,6 +1411,95 @@ function AnswerResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1357
1411
|
};
|
|
1358
1412
|
}
|
|
1359
1413
|
|
|
1414
|
+
// src/generated/models/ClassifyRequest.ts
|
|
1415
|
+
function instanceOfClassifyRequest(value) {
|
|
1416
|
+
if (!("queries" in value) || value["queries"] === void 0) return false;
|
|
1417
|
+
return true;
|
|
1418
|
+
}
|
|
1419
|
+
function ClassifyRequestFromJSON(json) {
|
|
1420
|
+
return ClassifyRequestFromJSONTyped(json, false);
|
|
1421
|
+
}
|
|
1422
|
+
function ClassifyRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1423
|
+
if (json == null) {
|
|
1424
|
+
return json;
|
|
1425
|
+
}
|
|
1426
|
+
return {
|
|
1427
|
+
"queries": json["queries"]
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
function ClassifyRequestToJSON(json) {
|
|
1431
|
+
return ClassifyRequestToJSONTyped(json, false);
|
|
1432
|
+
}
|
|
1433
|
+
function ClassifyRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1434
|
+
if (value == null) {
|
|
1435
|
+
return value;
|
|
1436
|
+
}
|
|
1437
|
+
return {
|
|
1438
|
+
"queries": value["queries"]
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// src/generated/models/QueryClassification.ts
|
|
1443
|
+
function instanceOfQueryClassification(value) {
|
|
1444
|
+
if (!("query" in value) || value["query"] === void 0) return false;
|
|
1445
|
+
if (!("score" in value) || value["score"] === void 0) return false;
|
|
1446
|
+
if (!("keep" in value) || value["keep"] === void 0) return false;
|
|
1447
|
+
return true;
|
|
1448
|
+
}
|
|
1449
|
+
function QueryClassificationFromJSON(json) {
|
|
1450
|
+
return QueryClassificationFromJSONTyped(json, false);
|
|
1451
|
+
}
|
|
1452
|
+
function QueryClassificationFromJSONTyped(json, ignoreDiscriminator) {
|
|
1453
|
+
if (json == null) {
|
|
1454
|
+
return json;
|
|
1455
|
+
}
|
|
1456
|
+
return {
|
|
1457
|
+
"query": json["query"],
|
|
1458
|
+
"score": json["score"],
|
|
1459
|
+
"keep": json["keep"]
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
function QueryClassificationToJSON(json) {
|
|
1463
|
+
return QueryClassificationToJSONTyped(json, false);
|
|
1464
|
+
}
|
|
1465
|
+
function QueryClassificationToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1466
|
+
if (value == null) {
|
|
1467
|
+
return value;
|
|
1468
|
+
}
|
|
1469
|
+
return {
|
|
1470
|
+
"query": value["query"],
|
|
1471
|
+
"score": value["score"],
|
|
1472
|
+
"keep": value["keep"]
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// src/generated/models/ClassifyResponse.ts
|
|
1477
|
+
function instanceOfClassifyResponse(value) {
|
|
1478
|
+
return true;
|
|
1479
|
+
}
|
|
1480
|
+
function ClassifyResponseFromJSON(json) {
|
|
1481
|
+
return ClassifyResponseFromJSONTyped(json, false);
|
|
1482
|
+
}
|
|
1483
|
+
function ClassifyResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1484
|
+
if (json == null) {
|
|
1485
|
+
return json;
|
|
1486
|
+
}
|
|
1487
|
+
return {
|
|
1488
|
+
"results": json["results"] == null ? void 0 : json["results"].map(QueryClassificationFromJSON)
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
function ClassifyResponseToJSON(json) {
|
|
1492
|
+
return ClassifyResponseToJSONTyped(json, false);
|
|
1493
|
+
}
|
|
1494
|
+
function ClassifyResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1495
|
+
if (value == null) {
|
|
1496
|
+
return value;
|
|
1497
|
+
}
|
|
1498
|
+
return {
|
|
1499
|
+
"results": value["results"] == null ? void 0 : value["results"].map(QueryClassificationToJSON)
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1360
1503
|
// src/generated/models/ContentsDeliveryMode.ts
|
|
1361
1504
|
var ContentsDeliveryMode = {
|
|
1362
1505
|
Url: "url",
|
|
@@ -1713,7 +1856,8 @@ function KnowledgeCardToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1713
1856
|
// src/generated/models/SearchEffortLevel.ts
|
|
1714
1857
|
var SearchEffortLevel = {
|
|
1715
1858
|
Fast: "fast",
|
|
1716
|
-
Instant: "instant"
|
|
1859
|
+
Instant: "instant",
|
|
1860
|
+
Deep: "deep"
|
|
1717
1861
|
};
|
|
1718
1862
|
function instanceOfSearchEffortLevel(value) {
|
|
1719
1863
|
for (const key in SearchEffortLevel) {
|
|
@@ -1839,7 +1983,7 @@ function SourcesFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1839
1983
|
return json;
|
|
1840
1984
|
}
|
|
1841
1985
|
return {
|
|
1842
|
-
"
|
|
1986
|
+
"data": json["data"] == null ? void 0 : TakoSourceSettingsFromJSON(json["data"]),
|
|
1843
1987
|
"web": json["web"] == null ? void 0 : SourceSettingsFromJSON(json["web"])
|
|
1844
1988
|
};
|
|
1845
1989
|
}
|
|
@@ -1851,7 +1995,7 @@ function SourcesToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1851
1995
|
return value;
|
|
1852
1996
|
}
|
|
1853
1997
|
return {
|
|
1854
|
-
"
|
|
1998
|
+
"data": TakoSourceSettingsToJSON(value["data"]),
|
|
1855
1999
|
"web": SourceSettingsToJSON(value["web"])
|
|
1856
2000
|
};
|
|
1857
2001
|
}
|
|
@@ -1968,6 +2112,42 @@ var TakoApi = class extends BaseAPI {
|
|
|
1968
2112
|
const response = await this.answerRaw(requestParameters, initOverrides);
|
|
1969
2113
|
return await response.value();
|
|
1970
2114
|
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Creates request options for classify without sending the request
|
|
2117
|
+
*/
|
|
2118
|
+
async classifyRequestOpts(requestParameters) {
|
|
2119
|
+
const queryParameters = {};
|
|
2120
|
+
const headerParameters = {};
|
|
2121
|
+
headerParameters["Content-Type"] = "application/json";
|
|
2122
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
2123
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
2124
|
+
}
|
|
2125
|
+
let urlPath = `/v1/classify`;
|
|
2126
|
+
return {
|
|
2127
|
+
path: urlPath,
|
|
2128
|
+
method: "POST",
|
|
2129
|
+
headers: headerParameters,
|
|
2130
|
+
query: queryParameters,
|
|
2131
|
+
body: ClassifyRequestToJSON(requestParameters["classifyRequest"])
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Score a batch of queries for whether Tako search will return a result. Returns a probability and a recall-skewed keep flag per query. Free; intended for pre-filtering before /v3/search.
|
|
2136
|
+
* Classify queries
|
|
2137
|
+
*/
|
|
2138
|
+
async classifyRaw(requestParameters, initOverrides) {
|
|
2139
|
+
const requestOptions = await this.classifyRequestOpts(requestParameters);
|
|
2140
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
2141
|
+
return new JSONApiResponse(response, (jsonValue) => ClassifyResponseFromJSON(jsonValue));
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Score a batch of queries for whether Tako search will return a result. Returns a probability and a recall-skewed keep flag per query. Free; intended for pre-filtering before /v3/search.
|
|
2145
|
+
* Classify queries
|
|
2146
|
+
*/
|
|
2147
|
+
async classify(requestParameters = {}, initOverrides) {
|
|
2148
|
+
const response = await this.classifyRaw(requestParameters, initOverrides);
|
|
2149
|
+
return await response.value();
|
|
2150
|
+
}
|
|
1971
2151
|
/**
|
|
1972
2152
|
* Creates request options for contents without sending the request
|
|
1973
2153
|
*/
|
|
@@ -2086,7 +2266,8 @@ var APIErrorType = {
|
|
|
2086
2266
|
PaymentRequired: "PAYMENT_REQUIRED",
|
|
2087
2267
|
RequestTimeout: "REQUEST_TIMEOUT",
|
|
2088
2268
|
Forbidden: "FORBIDDEN",
|
|
2089
|
-
NotFound: "NOT_FOUND"
|
|
2269
|
+
NotFound: "NOT_FOUND",
|
|
2270
|
+
ServiceUnavailable: "SERVICE_UNAVAILABLE"
|
|
2090
2271
|
};
|
|
2091
2272
|
function instanceOfAPIErrorType(value) {
|
|
2092
2273
|
for (const key in APIErrorType) {
|
|
@@ -3117,6 +3298,10 @@ var Tako = class {
|
|
|
3117
3298
|
AgentStreamEnvelopeFromJSONTyped,
|
|
3118
3299
|
AgentStreamEnvelopeToJSON,
|
|
3119
3300
|
AgentStreamEnvelopeToJSONTyped,
|
|
3301
|
+
AgentUsageFromJSON,
|
|
3302
|
+
AgentUsageFromJSONTyped,
|
|
3303
|
+
AgentUsageToJSON,
|
|
3304
|
+
AgentUsageToJSONTyped,
|
|
3120
3305
|
AnswerResponseFromJSON,
|
|
3121
3306
|
AnswerResponseFromJSONTyped,
|
|
3122
3307
|
AnswerResponseToJSON,
|
|
@@ -3146,6 +3331,14 @@ var Tako = class {
|
|
|
3146
3331
|
CardSourcePrivateIndexFromJSONTyped,
|
|
3147
3332
|
CardSourcePrivateIndexToJSON,
|
|
3148
3333
|
CardSourcePrivateIndexToJSONTyped,
|
|
3334
|
+
ClassifyRequestFromJSON,
|
|
3335
|
+
ClassifyRequestFromJSONTyped,
|
|
3336
|
+
ClassifyRequestToJSON,
|
|
3337
|
+
ClassifyRequestToJSONTyped,
|
|
3338
|
+
ClassifyResponseFromJSON,
|
|
3339
|
+
ClassifyResponseFromJSONTyped,
|
|
3340
|
+
ClassifyResponseToJSON,
|
|
3341
|
+
ClassifyResponseToJSONTyped,
|
|
3149
3342
|
ComponentConfigFromJSON,
|
|
3150
3343
|
ComponentConfigFromJSONTyped,
|
|
3151
3344
|
ComponentConfigToJSON,
|
|
@@ -3232,6 +3425,10 @@ var Tako = class {
|
|
|
3232
3425
|
OutputSettingsFromJSONTyped,
|
|
3233
3426
|
OutputSettingsToJSON,
|
|
3234
3427
|
OutputSettingsToJSONTyped,
|
|
3428
|
+
QueryClassificationFromJSON,
|
|
3429
|
+
QueryClassificationFromJSONTyped,
|
|
3430
|
+
QueryClassificationToJSON,
|
|
3431
|
+
QueryClassificationToJSONTyped,
|
|
3235
3432
|
ReasoningEventFromJSON,
|
|
3236
3433
|
ReasoningEventFromJSONTyped,
|
|
3237
3434
|
ReasoningEventKindEnum,
|
|
@@ -3346,11 +3543,14 @@ var Tako = class {
|
|
|
3346
3543
|
instanceOfAgentRunRequest,
|
|
3347
3544
|
instanceOfAgentRunStatus,
|
|
3348
3545
|
instanceOfAgentStreamEnvelope,
|
|
3546
|
+
instanceOfAgentUsage,
|
|
3349
3547
|
instanceOfAnswerResponse,
|
|
3350
3548
|
instanceOfBaseAPIError,
|
|
3351
3549
|
instanceOfCardSourceIndex,
|
|
3352
3550
|
instanceOfCardSourceIndexSegment,
|
|
3353
3551
|
instanceOfCardSourcePrivateIndex,
|
|
3552
|
+
instanceOfClassifyRequest,
|
|
3553
|
+
instanceOfClassifyResponse,
|
|
3354
3554
|
instanceOfComponentConfig,
|
|
3355
3555
|
instanceOfComponentTypeEnum,
|
|
3356
3556
|
instanceOfContentFormat,
|
|
@@ -3370,6 +3570,7 @@ var Tako = class {
|
|
|
3370
3570
|
instanceOfKnowledgeCardSource,
|
|
3371
3571
|
instanceOfKnowledgeCardSourceIndexesInner,
|
|
3372
3572
|
instanceOfOutputSettings,
|
|
3573
|
+
instanceOfQueryClassification,
|
|
3373
3574
|
instanceOfReasoningEvent,
|
|
3374
3575
|
instanceOfResultContent,
|
|
3375
3576
|
instanceOfSearchEffortLevel,
|