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.js
CHANGED
|
@@ -301,6 +301,33 @@ var TextApiResponse = class {
|
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
+
// src/generated/models/AgentUsage.ts
|
|
305
|
+
function instanceOfAgentUsage(value) {
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
function AgentUsageFromJSON(json) {
|
|
309
|
+
return AgentUsageFromJSONTyped(json, false);
|
|
310
|
+
}
|
|
311
|
+
function AgentUsageFromJSONTyped(json, ignoreDiscriminator) {
|
|
312
|
+
if (json == null) {
|
|
313
|
+
return json;
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
"usd_cost": json["usd_cost"] == null ? void 0 : json["usd_cost"]
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function AgentUsageToJSON(json) {
|
|
320
|
+
return AgentUsageToJSONTyped(json, false);
|
|
321
|
+
}
|
|
322
|
+
function AgentUsageToJSONTyped(value, ignoreDiscriminator = false) {
|
|
323
|
+
if (value == null) {
|
|
324
|
+
return value;
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
"usd_cost": value["usd_cost"]
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
304
331
|
// src/generated/models/KnowledgeCardMethodology.ts
|
|
305
332
|
function instanceOfKnowledgeCardMethodology(value) {
|
|
306
333
|
if (!("methodology_name" in value) || value["methodology_name"] === void 0) return false;
|
|
@@ -686,6 +713,105 @@ function AgentResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
686
713
|
};
|
|
687
714
|
}
|
|
688
715
|
|
|
716
|
+
// src/generated/models/AgentEffortLevel.ts
|
|
717
|
+
var AgentEffortLevel = {
|
|
718
|
+
Low: "low",
|
|
719
|
+
Medium: "medium"
|
|
720
|
+
};
|
|
721
|
+
function instanceOfAgentEffortLevel(value) {
|
|
722
|
+
for (const key in AgentEffortLevel) {
|
|
723
|
+
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
724
|
+
if (AgentEffortLevel[key] === value) {
|
|
725
|
+
return true;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
function AgentEffortLevelFromJSON(json) {
|
|
732
|
+
return AgentEffortLevelFromJSONTyped(json, false);
|
|
733
|
+
}
|
|
734
|
+
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
735
|
+
return json;
|
|
736
|
+
}
|
|
737
|
+
function AgentEffortLevelToJSON(value) {
|
|
738
|
+
return value;
|
|
739
|
+
}
|
|
740
|
+
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
741
|
+
return value;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// src/generated/models/AgentOutputSettings.ts
|
|
745
|
+
function instanceOfAgentOutputSettings(value) {
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
function AgentOutputSettingsFromJSON(json) {
|
|
749
|
+
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
750
|
+
}
|
|
751
|
+
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
752
|
+
if (json == null) {
|
|
753
|
+
return json;
|
|
754
|
+
}
|
|
755
|
+
return {
|
|
756
|
+
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function AgentOutputSettingsToJSON(json) {
|
|
760
|
+
return AgentOutputSettingsToJSONTyped(json, false);
|
|
761
|
+
}
|
|
762
|
+
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
763
|
+
if (value == null) {
|
|
764
|
+
return value;
|
|
765
|
+
}
|
|
766
|
+
return {
|
|
767
|
+
"image_dark_mode": value["image_dark_mode"]
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// src/generated/models/AgentRunRequest.ts
|
|
772
|
+
var AgentRunRequestSourceIndexesEnum = {
|
|
773
|
+
Data: "data",
|
|
774
|
+
Web: "web"
|
|
775
|
+
};
|
|
776
|
+
function instanceOfAgentRunRequest(value) {
|
|
777
|
+
if (!("query" in value) || value["query"] === void 0) return false;
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
function AgentRunRequestFromJSON(json) {
|
|
781
|
+
return AgentRunRequestFromJSONTyped(json, false);
|
|
782
|
+
}
|
|
783
|
+
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
784
|
+
if (json == null) {
|
|
785
|
+
return json;
|
|
786
|
+
}
|
|
787
|
+
return {
|
|
788
|
+
"query": json["query"],
|
|
789
|
+
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
790
|
+
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
791
|
+
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
792
|
+
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
793
|
+
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
794
|
+
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function AgentRunRequestToJSON(json) {
|
|
798
|
+
return AgentRunRequestToJSONTyped(json, false);
|
|
799
|
+
}
|
|
800
|
+
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
801
|
+
if (value == null) {
|
|
802
|
+
return value;
|
|
803
|
+
}
|
|
804
|
+
return {
|
|
805
|
+
"query": value["query"],
|
|
806
|
+
"thread_id": value["thread_id"],
|
|
807
|
+
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
808
|
+
"source_indexes": value["source_indexes"],
|
|
809
|
+
"locale": value["locale"],
|
|
810
|
+
"timezone": value["timezone"],
|
|
811
|
+
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
|
|
689
815
|
// src/generated/models/AgentRunStatus.ts
|
|
690
816
|
var AgentRunStatus = {
|
|
691
817
|
Queued: "queued",
|
|
@@ -772,7 +898,9 @@ function AgentRunFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
772
898
|
"created_at": json["created_at"],
|
|
773
899
|
"completed_at": json["completed_at"] == null ? void 0 : json["completed_at"],
|
|
774
900
|
"result": json["result"] == null ? void 0 : AgentResultFromJSON(json["result"]),
|
|
775
|
-
"error": json["error"] == null ? void 0 : ErrorObjectFromJSON(json["error"])
|
|
901
|
+
"error": json["error"] == null ? void 0 : ErrorObjectFromJSON(json["error"]),
|
|
902
|
+
"usage": json["usage"] == null ? void 0 : AgentUsageFromJSON(json["usage"]),
|
|
903
|
+
"request": json["request"] == null ? void 0 : AgentRunRequestFromJSON(json["request"])
|
|
776
904
|
};
|
|
777
905
|
}
|
|
778
906
|
function AgentRunToJSON(json) {
|
|
@@ -790,105 +918,9 @@ function AgentRunToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
790
918
|
"created_at": value["created_at"],
|
|
791
919
|
"completed_at": value["completed_at"],
|
|
792
920
|
"result": AgentResultToJSON(value["result"]),
|
|
793
|
-
"error": ErrorObjectToJSON(value["error"])
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
// src/generated/models/AgentEffortLevel.ts
|
|
798
|
-
var AgentEffortLevel = {
|
|
799
|
-
Medium: "medium"
|
|
800
|
-
};
|
|
801
|
-
function instanceOfAgentEffortLevel(value) {
|
|
802
|
-
for (const key in AgentEffortLevel) {
|
|
803
|
-
if (Object.prototype.hasOwnProperty.call(AgentEffortLevel, key)) {
|
|
804
|
-
if (AgentEffortLevel[key] === value) {
|
|
805
|
-
return true;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
function AgentEffortLevelFromJSON(json) {
|
|
812
|
-
return AgentEffortLevelFromJSONTyped(json, false);
|
|
813
|
-
}
|
|
814
|
-
function AgentEffortLevelFromJSONTyped(json, ignoreDiscriminator) {
|
|
815
|
-
return json;
|
|
816
|
-
}
|
|
817
|
-
function AgentEffortLevelToJSON(value) {
|
|
818
|
-
return value;
|
|
819
|
-
}
|
|
820
|
-
function AgentEffortLevelToJSONTyped(value, ignoreDiscriminator) {
|
|
821
|
-
return value;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
// src/generated/models/AgentOutputSettings.ts
|
|
825
|
-
function instanceOfAgentOutputSettings(value) {
|
|
826
|
-
return true;
|
|
827
|
-
}
|
|
828
|
-
function AgentOutputSettingsFromJSON(json) {
|
|
829
|
-
return AgentOutputSettingsFromJSONTyped(json, false);
|
|
830
|
-
}
|
|
831
|
-
function AgentOutputSettingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
832
|
-
if (json == null) {
|
|
833
|
-
return json;
|
|
834
|
-
}
|
|
835
|
-
return {
|
|
836
|
-
"image_dark_mode": json["image_dark_mode"] == null ? void 0 : json["image_dark_mode"]
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
function AgentOutputSettingsToJSON(json) {
|
|
840
|
-
return AgentOutputSettingsToJSONTyped(json, false);
|
|
841
|
-
}
|
|
842
|
-
function AgentOutputSettingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
843
|
-
if (value == null) {
|
|
844
|
-
return value;
|
|
845
|
-
}
|
|
846
|
-
return {
|
|
847
|
-
"image_dark_mode": value["image_dark_mode"]
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
// src/generated/models/AgentRunRequest.ts
|
|
852
|
-
var AgentRunRequestSourceIndexesEnum = {
|
|
853
|
-
Data: "data",
|
|
854
|
-
Web: "web"
|
|
855
|
-
};
|
|
856
|
-
function instanceOfAgentRunRequest(value) {
|
|
857
|
-
if (!("query" in value) || value["query"] === void 0) return false;
|
|
858
|
-
return true;
|
|
859
|
-
}
|
|
860
|
-
function AgentRunRequestFromJSON(json) {
|
|
861
|
-
return AgentRunRequestFromJSONTyped(json, false);
|
|
862
|
-
}
|
|
863
|
-
function AgentRunRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
864
|
-
if (json == null) {
|
|
865
|
-
return json;
|
|
866
|
-
}
|
|
867
|
-
return {
|
|
868
|
-
"query": json["query"],
|
|
869
|
-
"thread_id": json["thread_id"] == null ? void 0 : json["thread_id"],
|
|
870
|
-
"effort": json["effort"] == null ? void 0 : AgentEffortLevelFromJSON(json["effort"]),
|
|
871
|
-
"source_indexes": json["source_indexes"] == null ? void 0 : json["source_indexes"],
|
|
872
|
-
"locale": json["locale"] == null ? void 0 : json["locale"],
|
|
873
|
-
"timezone": json["timezone"] == null ? void 0 : json["timezone"],
|
|
874
|
-
"output_settings": json["output_settings"] == null ? void 0 : AgentOutputSettingsFromJSON(json["output_settings"])
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
function AgentRunRequestToJSON(json) {
|
|
878
|
-
return AgentRunRequestToJSONTyped(json, false);
|
|
879
|
-
}
|
|
880
|
-
function AgentRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
881
|
-
if (value == null) {
|
|
882
|
-
return value;
|
|
883
|
-
}
|
|
884
|
-
return {
|
|
885
|
-
"query": value["query"],
|
|
886
|
-
"thread_id": value["thread_id"],
|
|
887
|
-
"effort": AgentEffortLevelToJSON(value["effort"]),
|
|
888
|
-
"source_indexes": value["source_indexes"],
|
|
889
|
-
"locale": value["locale"],
|
|
890
|
-
"timezone": value["timezone"],
|
|
891
|
-
"output_settings": AgentOutputSettingsToJSON(value["output_settings"])
|
|
921
|
+
"error": ErrorObjectToJSON(value["error"]),
|
|
922
|
+
"usage": AgentUsageToJSON(value["usage"]),
|
|
923
|
+
"request": AgentRunRequestToJSON(value["request"])
|
|
892
924
|
};
|
|
893
925
|
}
|
|
894
926
|
|
|
@@ -1868,7 +1900,8 @@ var APIErrorType = {
|
|
|
1868
1900
|
PaymentRequired: "PAYMENT_REQUIRED",
|
|
1869
1901
|
RequestTimeout: "REQUEST_TIMEOUT",
|
|
1870
1902
|
Forbidden: "FORBIDDEN",
|
|
1871
|
-
NotFound: "NOT_FOUND"
|
|
1903
|
+
NotFound: "NOT_FOUND",
|
|
1904
|
+
ServiceUnavailable: "SERVICE_UNAVAILABLE"
|
|
1872
1905
|
};
|
|
1873
1906
|
function instanceOfAPIErrorType(value) {
|
|
1874
1907
|
for (const key in APIErrorType) {
|
|
@@ -2898,6 +2931,10 @@ export {
|
|
|
2898
2931
|
AgentStreamEnvelopeFromJSONTyped,
|
|
2899
2932
|
AgentStreamEnvelopeToJSON,
|
|
2900
2933
|
AgentStreamEnvelopeToJSONTyped,
|
|
2934
|
+
AgentUsageFromJSON,
|
|
2935
|
+
AgentUsageFromJSONTyped,
|
|
2936
|
+
AgentUsageToJSON,
|
|
2937
|
+
AgentUsageToJSONTyped,
|
|
2901
2938
|
AnswerResponseFromJSON,
|
|
2902
2939
|
AnswerResponseFromJSONTyped,
|
|
2903
2940
|
AnswerResponseToJSON,
|
|
@@ -3139,6 +3176,7 @@ export {
|
|
|
3139
3176
|
instanceOfAgentRunRequest,
|
|
3140
3177
|
instanceOfAgentRunStatus,
|
|
3141
3178
|
instanceOfAgentStreamEnvelope,
|
|
3179
|
+
instanceOfAgentUsage,
|
|
3142
3180
|
instanceOfAnswerResponse,
|
|
3143
3181
|
instanceOfBaseAPIError,
|
|
3144
3182
|
instanceOfCardSourceIndex,
|