tako-sdk 1.0.2 → 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 +144 -101
- package/dist/index.d.cts +183 -133
- package/dist/index.d.ts +183 -133
- package/dist/index.js +139 -101
- 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,
|
|
@@ -306,6 +310,7 @@ __export(index_exports, {
|
|
|
306
310
|
instanceOfAgentRunRequest: () => instanceOfAgentRunRequest,
|
|
307
311
|
instanceOfAgentRunStatus: () => instanceOfAgentRunStatus,
|
|
308
312
|
instanceOfAgentStreamEnvelope: () => instanceOfAgentStreamEnvelope,
|
|
313
|
+
instanceOfAgentUsage: () => instanceOfAgentUsage,
|
|
309
314
|
instanceOfAnswerResponse: () => instanceOfAnswerResponse,
|
|
310
315
|
instanceOfBaseAPIError: () => instanceOfBaseAPIError,
|
|
311
316
|
instanceOfCardSourceIndex: () => instanceOfCardSourceIndex,
|
|
@@ -662,6 +667,33 @@ var TextApiResponse = class {
|
|
|
662
667
|
}
|
|
663
668
|
};
|
|
664
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
|
+
|
|
665
697
|
// src/generated/models/KnowledgeCardMethodology.ts
|
|
666
698
|
function instanceOfKnowledgeCardMethodology(value) {
|
|
667
699
|
if (!("methodology_name" in value) || value["methodology_name"] === void 0) return false;
|
|
@@ -1047,6 +1079,105 @@ function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1047
1079
|
};
|
|
1048
1080
|
}
|
|
1049
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
|
+
|
|
1050
1181
|
// src/generated/models/AgentRunStatus.ts
|
|
1051
1182
|
var AgentRunStatus = {
|
|
1052
1183
|
Queued: "queued",
|
|
@@ -1133,7 +1264,9 @@ function AgentRunFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1133
1264
|
"created_at": json["created_at"],
|
|
1134
1265
|
"completed_at": json["completed_at"] == null ? void 0 : json["completed_at"],
|
|
1135
1266
|
"result": json["result"] == null ? void 0 : AgentResultFromJSON(json["result"]),
|
|
1136
|
-
"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"])
|
|
1137
1270
|
};
|
|
1138
1271
|
}
|
|
1139
1272
|
function AgentRunToJSON(json) {
|
|
@@ -1151,105 +1284,9 @@ function AgentRunToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1151
1284
|
"created_at": value["created_at"],
|
|
1152
1285
|
"completed_at": value["completed_at"],
|
|
1153
1286
|
"result": AgentResultToJSON(value["result"]),
|
|
1154
|
-
"error": ErrorObjectToJSON(value["error"])
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
// src/generated/models/AgentEffortLevel.ts
|
|
1159
|
-
var AgentEffortLevel = {
|
|
1160
|
-
Medium: "medium"
|
|
1161
|
-
};
|
|
1162
|
-
function instanceOfAgentEffortLevel(value) {
|
|
1163
|
-
for (const key in AgentEffortLevel) {
|
|
1164
|
-
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
1165
|
-
if (AgentEffortLevel[key] === value) {
|
|
1166
|
-
return true;
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
return false;
|
|
1171
|
-
}
|
|
1172
|
-
function AgentEffortLevelFromJSON(json) {
|
|
1173
|
-
return AgentEffortLevelFromJSONTyped(json, false);
|
|
1174
|
-
}
|
|
1175
|
-
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
1176
|
-
return json;
|
|
1177
|
-
}
|
|
1178
|
-
function AgentEffortLevelToJSON(value) {
|
|
1179
|
-
return value;
|
|
1180
|
-
}
|
|
1181
|
-
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
1182
|
-
return value;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
// src/generated/models/AgentOutputSettings.ts
|
|
1186
|
-
function instanceOfAgentOutputSettings(value) {
|
|
1187
|
-
return true;
|
|
1188
|
-
}
|
|
1189
|
-
function AgentOutputSettingsFromJSON(json) {
|
|
1190
|
-
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
1191
|
-
}
|
|
1192
|
-
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1193
|
-
if (json == null) {
|
|
1194
|
-
return json;
|
|
1195
|
-
}
|
|
1196
|
-
return {
|
|
1197
|
-
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
function AgentOutputSettingsToJSON(json) {
|
|
1201
|
-
return AgentOutputSettingsToJSONTyped(json, false);
|
|
1202
|
-
}
|
|
1203
|
-
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1204
|
-
if (value == null) {
|
|
1205
|
-
return value;
|
|
1206
|
-
}
|
|
1207
|
-
return {
|
|
1208
|
-
"image_dark_mode": value["image_dark_mode"]
|
|
1209
|
-
};
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
// src/generated/models/AgentRunRequest.ts
|
|
1213
|
-
var AgentRunRequestSourceIndexesEnum = {
|
|
1214
|
-
Data: "data",
|
|
1215
|
-
Web: "web"
|
|
1216
|
-
};
|
|
1217
|
-
function instanceOfAgentRunRequest(value) {
|
|
1218
|
-
if (!("query" in value) || value["query"] === void 0) return false;
|
|
1219
|
-
return true;
|
|
1220
|
-
}
|
|
1221
|
-
function AgentRunRequestFromJSON(json) {
|
|
1222
|
-
return AgentRunRequestFromJSONTyped(json, false);
|
|
1223
|
-
}
|
|
1224
|
-
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
1225
|
-
if (json == null) {
|
|
1226
|
-
return json;
|
|
1227
|
-
}
|
|
1228
|
-
return {
|
|
1229
|
-
"query": json["query"],
|
|
1230
|
-
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
1231
|
-
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
1232
|
-
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
1233
|
-
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
1234
|
-
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
1235
|
-
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
function AgentRunRequestToJSON(json) {
|
|
1239
|
-
return AgentRunRequestToJSONTyped(json, false);
|
|
1240
|
-
}
|
|
1241
|
-
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1242
|
-
if (value == null) {
|
|
1243
|
-
return value;
|
|
1244
|
-
}
|
|
1245
|
-
return {
|
|
1246
|
-
"query": value["query"],
|
|
1247
|
-
"thread_id": value["thread_id"],
|
|
1248
|
-
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
1249
|
-
"source_indexes": value["source_indexes"],
|
|
1250
|
-
"locale": value["locale"],
|
|
1251
|
-
"timezone": value["timezone"],
|
|
1252
|
-
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
1287
|
+
"error": ErrorObjectToJSON(value["error"]),
|
|
1288
|
+
"usage": AgentUsageToJSON(value["usage"]),
|
|
1289
|
+
"request": AgentRunRequestToJSON(value["request"])
|
|
1253
1290
|
};
|
|
1254
1291
|
}
|
|
1255
1292
|
|
|
@@ -2229,7 +2266,8 @@ var APIErrorType = {
|
|
|
2229
2266
|
PaymentRequired: "PAYMENT_REQUIRED",
|
|
2230
2267
|
RequestTimeout: "REQUEST_TIMEOUT",
|
|
2231
2268
|
Forbidden: "FORBIDDEN",
|
|
2232
|
-
NotFound: "NOT_FOUND"
|
|
2269
|
+
NotFound: "NOT_FOUND",
|
|
2270
|
+
ServiceUnavailable: "SERVICE_UNAVAILABLE"
|
|
2233
2271
|
};
|
|
2234
2272
|
function instanceOfAPIErrorType(value) {
|
|
2235
2273
|
for (const key in APIErrorType) {
|
|
@@ -3260,6 +3298,10 @@ var Tako = class {
|
|
|
3260
3298
|
AgentStreamEnvelopeFromJSONTyped,
|
|
3261
3299
|
AgentStreamEnvelopeToJSON,
|
|
3262
3300
|
AgentStreamEnvelopeToJSONTyped,
|
|
3301
|
+
AgentUsageFromJSON,
|
|
3302
|
+
AgentUsageFromJSONTyped,
|
|
3303
|
+
AgentUsageToJSON,
|
|
3304
|
+
AgentUsageToJSONTyped,
|
|
3263
3305
|
AnswerResponseFromJSON,
|
|
3264
3306
|
AnswerResponseFromJSONTyped,
|
|
3265
3307
|
AnswerResponseToJSON,
|
|
@@ -3501,6 +3543,7 @@ var Tako = class {
|
|
|
3501
3543
|
instanceOfAgentRunRequest,
|
|
3502
3544
|
instanceOfAgentRunStatus,
|
|
3503
3545
|
instanceOfAgentStreamEnvelope,
|
|
3546
|
+
instanceOfAgentUsage,
|
|
3504
3547
|
instanceOfAnswerResponse,
|
|
3505
3548
|
instanceOfBaseAPIError,
|
|
3506
3549
|
instanceOfCardSourceIndex,
|