@orq-ai/node 4.0.0-rc.67 → 4.0.0-rc.68

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.
Files changed (143) hide show
  1. package/README.md +23 -18
  2. package/bin/mcp-server.js +2320 -1152
  3. package/bin/mcp-server.js.map +49 -46
  4. package/docs/sdks/responses/README.md +139 -0
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/agentsResponsesCreate.d.ts +17 -0
  7. package/funcs/agentsResponsesCreate.d.ts.map +1 -0
  8. package/funcs/agentsResponsesCreate.js +120 -0
  9. package/funcs/agentsResponsesCreate.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/mcp-server/mcp-server.js +1 -1
  14. package/mcp-server/server.d.ts.map +1 -1
  15. package/mcp-server/server.js +3 -1
  16. package/mcp-server/server.js.map +1 -1
  17. package/mcp-server/tools/agentsResponsesCreate.d.ts +8 -0
  18. package/mcp-server/tools/agentsResponsesCreate.d.ts.map +1 -0
  19. package/mcp-server/tools/agentsResponsesCreate.js +64 -0
  20. package/mcp-server/tools/agentsResponsesCreate.js.map +1 -0
  21. package/models/operations/createagent.js +4 -4
  22. package/models/operations/createagent.js.map +1 -1
  23. package/models/operations/createagentresponse.d.ts +564 -0
  24. package/models/operations/createagentresponse.d.ts.map +1 -0
  25. package/models/operations/createagentresponse.js +605 -0
  26. package/models/operations/createagentresponse.js.map +1 -0
  27. package/models/operations/createbudget.js +2 -2
  28. package/models/operations/createcontact.js +2 -2
  29. package/models/operations/createdataset.js +2 -2
  30. package/models/operations/createdatasetitem.js +8 -8
  31. package/models/operations/createdatasource.js +2 -2
  32. package/models/operations/createeval.js +28 -28
  33. package/models/operations/createtool.js +12 -12
  34. package/models/operations/fileget.js +2 -2
  35. package/models/operations/filelist.js +2 -2
  36. package/models/operations/fileupload.js +2 -2
  37. package/models/operations/getagent.js +2 -2
  38. package/models/operations/getagent.js.map +1 -1
  39. package/models/operations/getagenttask.d.ts +32 -32
  40. package/models/operations/getagenttask.d.ts.map +1 -1
  41. package/models/operations/getagenttask.js +50 -50
  42. package/models/operations/getagenttask.js.map +1 -1
  43. package/models/operations/getalltools.js +12 -12
  44. package/models/operations/getbudget.js +2 -2
  45. package/models/operations/getevals.js +28 -28
  46. package/models/operations/index.d.ts +1 -0
  47. package/models/operations/index.d.ts.map +1 -1
  48. package/models/operations/index.js +1 -0
  49. package/models/operations/index.js.map +1 -1
  50. package/models/operations/invokeagent.d.ts +95 -95
  51. package/models/operations/invokeagent.d.ts.map +1 -1
  52. package/models/operations/invokeagent.js +143 -134
  53. package/models/operations/invokeagent.js.map +1 -1
  54. package/models/operations/listagents.js +2 -2
  55. package/models/operations/listagents.js.map +1 -1
  56. package/models/operations/listbudgets.js +2 -2
  57. package/models/operations/listcontacts.js +2 -2
  58. package/models/operations/listdatasetdatapoints.js +8 -8
  59. package/models/operations/listdatasets.js +2 -2
  60. package/models/operations/listdatasources.js +2 -2
  61. package/models/operations/retrievecontact.js +2 -2
  62. package/models/operations/retrievedatapoint.js +8 -8
  63. package/models/operations/retrievedataset.js +2 -2
  64. package/models/operations/retrievedatasource.js +2 -2
  65. package/models/operations/retrievetool.js +12 -12
  66. package/models/operations/runagent.d.ts +54 -54
  67. package/models/operations/runagent.d.ts.map +1 -1
  68. package/models/operations/runagent.js +90 -90
  69. package/models/operations/runagent.js.map +1 -1
  70. package/models/operations/streamagent.d.ts +541 -68
  71. package/models/operations/streamagent.d.ts.map +1 -1
  72. package/models/operations/streamagent.js +649 -118
  73. package/models/operations/streamagent.js.map +1 -1
  74. package/models/operations/streamrunagent.d.ts +541 -68
  75. package/models/operations/streamrunagent.d.ts.map +1 -1
  76. package/models/operations/streamrunagent.js +657 -127
  77. package/models/operations/streamrunagent.js.map +1 -1
  78. package/models/operations/updateagent.js +4 -4
  79. package/models/operations/updateagent.js.map +1 -1
  80. package/models/operations/updatebudget.js +2 -2
  81. package/models/operations/updatecontact.js +2 -2
  82. package/models/operations/updatedatapoint.js +8 -8
  83. package/models/operations/updatedataset.js +2 -2
  84. package/models/operations/updatedatasource.js +2 -2
  85. package/models/operations/updateeval.js +28 -28
  86. package/models/operations/updatetool.js +14 -14
  87. package/package.json +1 -1
  88. package/sdk/agents.d.ts +3 -0
  89. package/sdk/agents.d.ts.map +1 -1
  90. package/sdk/agents.js +4 -0
  91. package/sdk/agents.js.map +1 -1
  92. package/sdk/responses.d.ts +12 -0
  93. package/sdk/responses.d.ts.map +1 -0
  94. package/sdk/responses.js +22 -0
  95. package/sdk/responses.js.map +1 -0
  96. package/src/funcs/agentsResponsesCreate.ts +168 -0
  97. package/src/lib/config.ts +2 -2
  98. package/src/mcp-server/mcp-server.ts +1 -1
  99. package/src/mcp-server/server.ts +3 -1
  100. package/src/mcp-server/tools/agentsResponsesCreate.ts +37 -0
  101. package/src/models/operations/createagent.ts +4 -4
  102. package/src/models/operations/createagentresponse.ts +1339 -0
  103. package/src/models/operations/createbudget.ts +2 -2
  104. package/src/models/operations/createcontact.ts +2 -2
  105. package/src/models/operations/createdataset.ts +2 -2
  106. package/src/models/operations/createdatasetitem.ts +8 -8
  107. package/src/models/operations/createdatasource.ts +2 -2
  108. package/src/models/operations/createeval.ts +28 -28
  109. package/src/models/operations/createtool.ts +12 -12
  110. package/src/models/operations/fileget.ts +2 -2
  111. package/src/models/operations/filelist.ts +2 -2
  112. package/src/models/operations/fileupload.ts +2 -2
  113. package/src/models/operations/getagent.ts +2 -2
  114. package/src/models/operations/getagenttask.ts +94 -94
  115. package/src/models/operations/getalltools.ts +12 -12
  116. package/src/models/operations/getbudget.ts +2 -2
  117. package/src/models/operations/getevals.ts +28 -28
  118. package/src/models/operations/index.ts +1 -0
  119. package/src/models/operations/invokeagent.ts +322 -246
  120. package/src/models/operations/listagents.ts +2 -2
  121. package/src/models/operations/listbudgets.ts +2 -2
  122. package/src/models/operations/listcontacts.ts +2 -2
  123. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  124. package/src/models/operations/listdatasets.ts +2 -2
  125. package/src/models/operations/listdatasources.ts +2 -2
  126. package/src/models/operations/retrievecontact.ts +2 -2
  127. package/src/models/operations/retrievedatapoint.ts +8 -8
  128. package/src/models/operations/retrievedataset.ts +2 -2
  129. package/src/models/operations/retrievedatasource.ts +2 -2
  130. package/src/models/operations/retrievetool.ts +12 -12
  131. package/src/models/operations/runagent.ts +174 -157
  132. package/src/models/operations/streamagent.ts +1739 -297
  133. package/src/models/operations/streamrunagent.ts +1742 -307
  134. package/src/models/operations/updateagent.ts +4 -4
  135. package/src/models/operations/updatebudget.ts +2 -2
  136. package/src/models/operations/updatecontact.ts +2 -2
  137. package/src/models/operations/updatedatapoint.ts +8 -8
  138. package/src/models/operations/updatedataset.ts +2 -2
  139. package/src/models/operations/updatedatasource.ts +2 -2
  140. package/src/models/operations/updateeval.ts +28 -28
  141. package/src/models/operations/updatetool.ts +14 -14
  142. package/src/sdk/agents.ts +6 -0
  143. package/src/sdk/responses.ts +27 -0
@@ -370,6 +370,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody15Data =
370
370
  error: DataError;
371
371
  actionType: string;
372
372
  toolExecutionContext: StreamAgentDataAgentsResponseToolExecutionContext;
373
+ responseId?: string | undefined;
373
374
  };
374
375
 
375
376
  export type Data15 = {
@@ -442,6 +443,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody14Data =
442
443
  result?: any | undefined;
443
444
  actionType: string;
444
445
  toolExecutionContext: StreamAgentDataAgentsToolExecutionContext;
446
+ responseId?: string | undefined;
445
447
  };
446
448
 
447
449
  export type Data14 = {
@@ -515,6 +517,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody13Data =
515
517
  actionType: string;
516
518
  toolArguments: { [k: string]: any };
517
519
  toolExecutionContext: StreamAgentDataToolExecutionContext;
520
+ responseId?: string | undefined;
518
521
  };
519
522
 
520
523
  export type Data13 = {
@@ -535,12 +538,12 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody12Type =
535
538
  typeof StreamAgentDataAgentsResponse200TextEventStreamResponseBody12Type
536
539
  >;
537
540
 
538
- export const StreamAgentDataAgentsResponseRole = {
541
+ export const StreamAgentDataAgentsResponse200Role = {
539
542
  User: "user",
540
543
  Tool: "tool",
541
544
  } as const;
542
- export type StreamAgentDataAgentsResponseRole = ClosedEnum<
543
- typeof StreamAgentDataAgentsResponseRole
545
+ export type StreamAgentDataAgentsResponse200Role = ClosedEnum<
546
+ typeof StreamAgentDataAgentsResponse200Role
544
547
  >;
545
548
 
546
549
  export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage5Kind =
@@ -555,7 +558,7 @@ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Da
555
558
  /**
556
559
  * The result of a tool execution. Contains the tool call ID for correlation and the result data from the tool invocation.
557
560
  */
558
- export type StreamAgentPartsAgentsResponseToolResultPart = {
561
+ export type StreamAgentPartsAgentsResponse200ToolResultPart = {
559
562
  kind:
560
563
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage5Kind;
561
564
  toolCallId: string;
@@ -575,7 +578,7 @@ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Da
575
578
  /**
576
579
  * A tool invocation request from an agent. Contains the tool name, unique call ID, and arguments for the tool execution.
577
580
  */
578
- export type StreamAgentPartsAgentsResponseToolCallPart = {
581
+ export type StreamAgentPartsAgentsResponse200ToolCallPart = {
579
582
  kind:
580
583
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage4Kind;
581
584
  toolName: string;
@@ -596,7 +599,7 @@ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Da
596
599
  /**
597
600
  * File in URI format. Check in the model's documentation for the supported mime types for the URI format
598
601
  */
599
- export type StreamAgentFileAgentsResponse200FileInURIFormat = {
602
+ export type StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat = {
600
603
  /**
601
604
  * URL for the File content
602
605
  */
@@ -614,7 +617,7 @@ export type StreamAgentFileAgentsResponse200FileInURIFormat = {
614
617
  /**
615
618
  * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
616
619
  */
617
- export type StreamAgentFileAgentsResponse200BinaryFormat = {
620
+ export type StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat = {
618
621
  /**
619
622
  * base64 encoded content of the file
620
623
  */
@@ -629,19 +632,19 @@ export type StreamAgentFileAgentsResponse200BinaryFormat = {
629
632
  name?: string | undefined;
630
633
  };
631
634
 
632
- export type StreamAgentPartsAgentsResponseFile =
633
- | StreamAgentFileAgentsResponse200BinaryFormat
634
- | StreamAgentFileAgentsResponse200FileInURIFormat;
635
+ export type StreamAgentPartsAgentsResponse200File =
636
+ | StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat
637
+ | StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat;
635
638
 
636
639
  /**
637
640
  * A file content part that can contain either base64-encoded bytes or a URI reference. Used for images, documents, and other binary content in agent communications.
638
641
  */
639
- export type StreamAgentPartsAgentsResponseFilePart = {
642
+ export type StreamAgentPartsAgentsResponse200FilePart = {
640
643
  kind:
641
644
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessageKind;
642
645
  file:
643
- | StreamAgentFileAgentsResponse200BinaryFormat
644
- | StreamAgentFileAgentsResponse200FileInURIFormat;
646
+ | StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat
647
+ | StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat;
645
648
  metadata?: { [k: string]: any } | undefined;
646
649
  };
647
650
 
@@ -657,7 +660,7 @@ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Da
657
660
  /**
658
661
  * A structured data part containing JSON-serializable key-value pairs. Used for passing structured information between agents and tools.
659
662
  */
660
- export type StreamAgentPartsAgentsResponseDataPart = {
663
+ export type StreamAgentPartsAgentsResponse200DataPart = {
661
664
  kind:
662
665
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataKind;
663
666
  data: { [k: string]: any };
@@ -676,27 +679,27 @@ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Ki
676
679
  /**
677
680
  * A text content part containing plain text or markdown. Used for agent messages, user input, and text-based responses.
678
681
  */
679
- export type StreamAgentPartsAgentsResponseTextPart = {
682
+ export type StreamAgentPartsAgentsResponse200TextPart = {
680
683
  kind: StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Kind;
681
684
  text: string;
682
685
  };
683
686
 
684
- export type StreamAgentDataAgentsResponseParts =
685
- | StreamAgentPartsAgentsResponseToolCallPart
686
- | StreamAgentPartsAgentsResponseTextPart
687
- | StreamAgentPartsAgentsResponseDataPart
688
- | StreamAgentPartsAgentsResponseFilePart
689
- | StreamAgentPartsAgentsResponseToolResultPart;
687
+ export type StreamAgentDataAgentsResponse200Parts =
688
+ | StreamAgentPartsAgentsResponse200ToolCallPart
689
+ | StreamAgentPartsAgentsResponse200TextPart
690
+ | StreamAgentPartsAgentsResponse200DataPart
691
+ | StreamAgentPartsAgentsResponse200FilePart
692
+ | StreamAgentPartsAgentsResponse200ToolResultPart;
690
693
 
691
694
  export type StreamAgentDataMessage = {
692
695
  messageId?: string | undefined;
693
- role: StreamAgentDataAgentsResponseRole;
696
+ role: StreamAgentDataAgentsResponse200Role;
694
697
  parts: Array<
695
- | StreamAgentPartsAgentsResponseToolCallPart
696
- | StreamAgentPartsAgentsResponseTextPart
697
- | StreamAgentPartsAgentsResponseDataPart
698
- | StreamAgentPartsAgentsResponseFilePart
699
- | StreamAgentPartsAgentsResponseToolResultPart
698
+ | StreamAgentPartsAgentsResponse200ToolCallPart
699
+ | StreamAgentPartsAgentsResponse200TextPart
700
+ | StreamAgentPartsAgentsResponse200DataPart
701
+ | StreamAgentPartsAgentsResponse200FilePart
702
+ | StreamAgentPartsAgentsResponse200ToolResultPart
700
703
  >;
701
704
  metadata?: { [k: string]: any } | undefined;
702
705
  };
@@ -900,6 +903,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBodyData = {
900
903
  tool: DataTool;
901
904
  input: { [k: string]: any };
902
905
  agentToolCallId: string;
906
+ responseId?: string | undefined;
903
907
  };
904
908
 
905
909
  export type Data6 = {
@@ -921,6 +925,10 @@ export type StreamAgentDataAgentsResponse200TextEventStreamType = ClosedEnum<
921
925
  export type StreamAgentDataAgentsResponse200TextEventStreamData = {
922
926
  error: string;
923
927
  code: number;
928
+ /**
929
+ * ID of the response tracking this execution
930
+ */
931
+ responseId?: string | undefined;
924
932
  };
925
933
 
926
934
  export type Data5 = {
@@ -939,6 +947,186 @@ export type StreamAgentDataAgentsResponse200Type = ClosedEnum<
939
947
  typeof StreamAgentDataAgentsResponse200Type
940
948
  >;
941
949
 
950
+ /**
951
+ * Extended A2A message role
952
+ */
953
+ export const StreamAgentDataAgentsResponseRole = {
954
+ User: "user",
955
+ Agent: "agent",
956
+ Tool: "tool",
957
+ System: "system",
958
+ } as const;
959
+ /**
960
+ * Extended A2A message role
961
+ */
962
+ export type StreamAgentDataAgentsResponseRole = ClosedEnum<
963
+ typeof StreamAgentDataAgentsResponseRole
964
+ >;
965
+
966
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind =
967
+ {
968
+ ToolResult: "tool_result",
969
+ } as const;
970
+ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind =
971
+ ClosedEnum<
972
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind
973
+ >;
974
+
975
+ /**
976
+ * The result of a tool execution. Contains the tool call ID for correlation and the result data from the tool invocation.
977
+ */
978
+ export type StreamAgentPartsAgentsResponseToolResultPart = {
979
+ kind:
980
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind;
981
+ toolCallId: string;
982
+ result?: any | undefined;
983
+ metadata?: { [k: string]: any } | undefined;
984
+ };
985
+
986
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind =
987
+ {
988
+ ToolCall: "tool_call",
989
+ } as const;
990
+ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind =
991
+ ClosedEnum<
992
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind
993
+ >;
994
+
995
+ /**
996
+ * A tool invocation request from an agent. Contains the tool name, unique call ID, and arguments for the tool execution.
997
+ */
998
+ export type StreamAgentPartsAgentsResponseToolCallPart = {
999
+ kind:
1000
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind;
1001
+ toolName: string;
1002
+ toolCallId: string;
1003
+ arguments: { [k: string]: any };
1004
+ metadata?: { [k: string]: any } | undefined;
1005
+ };
1006
+
1007
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind =
1008
+ {
1009
+ File: "file",
1010
+ } as const;
1011
+ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind =
1012
+ ClosedEnum<
1013
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind
1014
+ >;
1015
+
1016
+ /**
1017
+ * File in URI format. Check in the model's documentation for the supported mime types for the URI format
1018
+ */
1019
+ export type StreamAgentFileAgentsResponse200FileInURIFormat = {
1020
+ /**
1021
+ * URL for the File content
1022
+ */
1023
+ uri: string;
1024
+ /**
1025
+ * Optional mimeType for the file
1026
+ */
1027
+ mimeType?: string | undefined;
1028
+ /**
1029
+ * Optional name for the file
1030
+ */
1031
+ name?: string | undefined;
1032
+ };
1033
+
1034
+ /**
1035
+ * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
1036
+ */
1037
+ export type StreamAgentFileAgentsResponse200BinaryFormat = {
1038
+ /**
1039
+ * base64 encoded content of the file
1040
+ */
1041
+ bytes: string;
1042
+ /**
1043
+ * Optional mimeType for the file
1044
+ */
1045
+ mimeType?: string | undefined;
1046
+ /**
1047
+ * Optional name for the file
1048
+ */
1049
+ name?: string | undefined;
1050
+ };
1051
+
1052
+ export type StreamAgentPartsAgentsResponseFile =
1053
+ | StreamAgentFileAgentsResponse200BinaryFormat
1054
+ | StreamAgentFileAgentsResponse200FileInURIFormat;
1055
+
1056
+ /**
1057
+ * A file content part that can contain either base64-encoded bytes or a URI reference. Used for images, documents, and other binary content in agent communications.
1058
+ */
1059
+ export type StreamAgentPartsAgentsResponseFilePart = {
1060
+ kind:
1061
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind;
1062
+ file:
1063
+ | StreamAgentFileAgentsResponse200BinaryFormat
1064
+ | StreamAgentFileAgentsResponse200FileInURIFormat;
1065
+ metadata?: { [k: string]: any } | undefined;
1066
+ };
1067
+
1068
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind =
1069
+ {
1070
+ Data: "data",
1071
+ } as const;
1072
+ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind =
1073
+ ClosedEnum<
1074
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind
1075
+ >;
1076
+
1077
+ /**
1078
+ * A structured data part containing JSON-serializable key-value pairs. Used for passing structured information between agents and tools.
1079
+ */
1080
+ export type StreamAgentPartsAgentsResponseDataPart = {
1081
+ kind:
1082
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind;
1083
+ data: { [k: string]: any };
1084
+ metadata?: { [k: string]: any } | undefined;
1085
+ };
1086
+
1087
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind =
1088
+ {
1089
+ Text: "text",
1090
+ } as const;
1091
+ export type StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind =
1092
+ ClosedEnum<
1093
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind
1094
+ >;
1095
+
1096
+ /**
1097
+ * A text content part containing plain text or markdown. Used for agent messages, user input, and text-based responses.
1098
+ */
1099
+ export type StreamAgentPartsAgentsResponseTextPart = {
1100
+ kind: StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind;
1101
+ text: string;
1102
+ };
1103
+
1104
+ export type StreamAgentDataAgentsResponseParts =
1105
+ | StreamAgentPartsAgentsResponseToolCallPart
1106
+ | StreamAgentPartsAgentsResponseTextPart
1107
+ | StreamAgentPartsAgentsResponseDataPart
1108
+ | StreamAgentPartsAgentsResponseFilePart
1109
+ | StreamAgentPartsAgentsResponseToolResultPart;
1110
+
1111
+ /**
1112
+ * Full last message in A2A format (for backwards compatibility)
1113
+ */
1114
+ export type DataLastMessageFull = {
1115
+ messageId?: string | undefined;
1116
+ /**
1117
+ * Extended A2A message role
1118
+ */
1119
+ role: StreamAgentDataAgentsResponseRole;
1120
+ parts: Array<
1121
+ | StreamAgentPartsAgentsResponseToolCallPart
1122
+ | StreamAgentPartsAgentsResponseTextPart
1123
+ | StreamAgentPartsAgentsResponseDataPart
1124
+ | StreamAgentPartsAgentsResponseFilePart
1125
+ | StreamAgentPartsAgentsResponseToolResultPart
1126
+ >;
1127
+ metadata?: { [k: string]: any } | undefined;
1128
+ };
1129
+
942
1130
  /**
943
1131
  * The reason why the agent execution became inactive
944
1132
  */
@@ -976,8 +1164,56 @@ export type DataPendingToolCalls = {
976
1164
  function: StreamAgentDataFunction;
977
1165
  };
978
1166
 
1167
+ export type StreamAgentDataAgentsPromptTokensDetails = {
1168
+ cachedTokens?: number | null | undefined;
1169
+ /**
1170
+ * The number of audio input tokens consumed by the request.
1171
+ */
1172
+ audioTokens?: number | null | undefined;
1173
+ };
1174
+
1175
+ export type StreamAgentDataAgentsCompletionTokensDetails = {
1176
+ reasoningTokens?: number | null | undefined;
1177
+ acceptedPredictionTokens?: number | null | undefined;
1178
+ rejectedPredictionTokens?: number | null | undefined;
1179
+ /**
1180
+ * The number of audio output tokens produced by the response.
1181
+ */
1182
+ audioTokens?: number | null | undefined;
1183
+ };
1184
+
1185
+ /**
1186
+ * Token usage from the last agent message
1187
+ */
1188
+ export type StreamAgentDataAgentsUsage = {
1189
+ /**
1190
+ * Number of tokens in the generated completion.
1191
+ */
1192
+ completionTokens?: number | undefined;
1193
+ /**
1194
+ * Number of tokens in the prompt.
1195
+ */
1196
+ promptTokens?: number | undefined;
1197
+ /**
1198
+ * Total number of tokens used in the request (prompt + completion).
1199
+ */
1200
+ totalTokens?: number | undefined;
1201
+ promptTokensDetails?:
1202
+ | StreamAgentDataAgentsPromptTokensDetails
1203
+ | null
1204
+ | undefined;
1205
+ completionTokensDetails?:
1206
+ | StreamAgentDataAgentsCompletionTokensDetails
1207
+ | null
1208
+ | undefined;
1209
+ };
1210
+
979
1211
  export type StreamAgentDataAgentsResponse200Data = {
980
1212
  lastMessage: string;
1213
+ /**
1214
+ * Full last message in A2A format (for backwards compatibility)
1215
+ */
1216
+ lastMessageFull?: DataLastMessageFull | undefined;
981
1217
  /**
982
1218
  * The reason why the agent execution became inactive
983
1219
  */
@@ -986,6 +1222,14 @@ export type StreamAgentDataAgentsResponse200Data = {
986
1222
  * Tool calls that are pending user response (for function_call finish reason)
987
1223
  */
988
1224
  pendingToolCalls?: Array<DataPendingToolCalls> | undefined;
1225
+ /**
1226
+ * Token usage from the last agent message
1227
+ */
1228
+ usage?: StreamAgentDataAgentsUsage | undefined;
1229
+ /**
1230
+ * ID of the response tracking this execution
1231
+ */
1232
+ responseId?: string | undefined;
989
1233
  };
990
1234
 
991
1235
  export type StreamAgentData4 = {
@@ -1218,11 +1462,11 @@ export type StreamAgentDataToolCalls = {
1218
1462
  function?: StreamAgentDataAgentsFunction | undefined;
1219
1463
  };
1220
1464
 
1221
- export const StreamAgentDataAgentsResponse200Role = {
1465
+ export const StreamAgentDataAgentsResponse200TextEventStreamRole = {
1222
1466
  Assistant: "assistant",
1223
1467
  } as const;
1224
- export type StreamAgentDataAgentsResponse200Role = ClosedEnum<
1225
- typeof StreamAgentDataAgentsResponse200Role
1468
+ export type StreamAgentDataAgentsResponse200TextEventStreamRole = ClosedEnum<
1469
+ typeof StreamAgentDataAgentsResponse200TextEventStreamRole
1226
1470
  >;
1227
1471
 
1228
1472
  /**
@@ -1242,7 +1486,7 @@ export type StreamAgentDataAgentsMessage = {
1242
1486
  content?: string | null | undefined;
1243
1487
  refusal?: string | null | undefined;
1244
1488
  toolCalls?: Array<StreamAgentDataToolCalls> | undefined;
1245
- role?: StreamAgentDataAgentsResponse200Role | undefined;
1489
+ role?: StreamAgentDataAgentsResponse200TextEventStreamRole | undefined;
1246
1490
  /**
1247
1491
  * Internal thought process of the model
1248
1492
  */
@@ -1362,6 +1606,47 @@ export type DataChoice = {
1362
1606
  logprobs?: DataLogprobs | null | undefined;
1363
1607
  };
1364
1608
 
1609
+ export type StreamAgentDataPromptTokensDetails = {
1610
+ cachedTokens?: number | null | undefined;
1611
+ /**
1612
+ * The number of audio input tokens consumed by the request.
1613
+ */
1614
+ audioTokens?: number | null | undefined;
1615
+ };
1616
+
1617
+ export type StreamAgentDataCompletionTokensDetails = {
1618
+ reasoningTokens?: number | null | undefined;
1619
+ acceptedPredictionTokens?: number | null | undefined;
1620
+ rejectedPredictionTokens?: number | null | undefined;
1621
+ /**
1622
+ * The number of audio output tokens produced by the response.
1623
+ */
1624
+ audioTokens?: number | null | undefined;
1625
+ };
1626
+
1627
+ /**
1628
+ * Usage statistics for the completion request.
1629
+ */
1630
+ export type StreamAgentDataUsage = {
1631
+ /**
1632
+ * Number of tokens in the generated completion.
1633
+ */
1634
+ completionTokens?: number | undefined;
1635
+ /**
1636
+ * Number of tokens in the prompt.
1637
+ */
1638
+ promptTokens?: number | undefined;
1639
+ /**
1640
+ * Total number of tokens used in the request (prompt + completion).
1641
+ */
1642
+ totalTokens?: number | undefined;
1643
+ promptTokensDetails?: StreamAgentDataPromptTokensDetails | null | undefined;
1644
+ completionTokensDetails?:
1645
+ | StreamAgentDataCompletionTokensDetails
1646
+ | null
1647
+ | undefined;
1648
+ };
1649
+
1365
1650
  export type StreamAgentDataAgentsResponseData = {
1366
1651
  agentId: string;
1367
1652
  messageDifference: { [k: string]: DataMessageDifference };
@@ -1369,6 +1654,11 @@ export type StreamAgentDataAgentsResponseData = {
1369
1654
  choiceIndex?: number | undefined;
1370
1655
  iteration: number;
1371
1656
  accumulatedExecutionTime: number;
1657
+ responseId?: string | undefined;
1658
+ /**
1659
+ * Usage statistics for the completion request.
1660
+ */
1661
+ usage?: StreamAgentDataUsage | undefined;
1372
1662
  };
1373
1663
 
1374
1664
  export type StreamAgentData3 = {
@@ -1698,6 +1988,7 @@ export type StreamAgentDataAgentsData = {
1698
1988
  toolExecutionId?: string | undefined;
1699
1989
  isContinuation?: boolean | undefined;
1700
1990
  stream?: boolean | undefined;
1991
+ responseId?: string | undefined;
1701
1992
  };
1702
1993
 
1703
1994
  export type StreamAgentData2 = {
@@ -2986,6 +3277,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody15Data$i
2986
3277
  tool_execution_context: z.lazy(() =>
2987
3278
  StreamAgentDataAgentsResponseToolExecutionContext$inboundSchema
2988
3279
  ),
3280
+ responseId: z.string().optional(),
2989
3281
  }).transform((v) => {
2990
3282
  return remap$(v, {
2991
3283
  "action_type": "actionType",
@@ -2999,6 +3291,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody15Data$Ou
2999
3291
  action_type: string;
3000
3292
  tool_execution_context:
3001
3293
  StreamAgentDataAgentsResponseToolExecutionContext$Outbound;
3294
+ responseId?: string | undefined;
3002
3295
  };
3003
3296
 
3004
3297
  /** @internal */
@@ -3013,6 +3306,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody15Data$o
3013
3306
  toolExecutionContext: z.lazy(() =>
3014
3307
  StreamAgentDataAgentsResponseToolExecutionContext$outboundSchema
3015
3308
  ),
3309
+ responseId: z.string().optional(),
3016
3310
  }).transform((v) => {
3017
3311
  return remap$(v, {
3018
3312
  actionType: "action_type",
@@ -3261,6 +3555,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody14Data$i
3261
3555
  tool_execution_context: z.lazy(() =>
3262
3556
  StreamAgentDataAgentsToolExecutionContext$inboundSchema
3263
3557
  ),
3558
+ responseId: z.string().optional(),
3264
3559
  }).transform((v) => {
3265
3560
  return remap$(v, {
3266
3561
  "action_type": "actionType",
@@ -3273,6 +3568,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody14Data$Ou
3273
3568
  result?: any | undefined;
3274
3569
  action_type: string;
3275
3570
  tool_execution_context: StreamAgentDataAgentsToolExecutionContext$Outbound;
3571
+ responseId?: string | undefined;
3276
3572
  };
3277
3573
 
3278
3574
  /** @internal */
@@ -3287,6 +3583,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody14Data$o
3287
3583
  toolExecutionContext: z.lazy(() =>
3288
3584
  StreamAgentDataAgentsToolExecutionContext$outboundSchema
3289
3585
  ),
3586
+ responseId: z.string().optional(),
3290
3587
  }).transform((v) => {
3291
3588
  return remap$(v, {
3292
3589
  actionType: "action_type",
@@ -3529,6 +3826,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody13Data$i
3529
3826
  tool_execution_context: z.lazy(() =>
3530
3827
  StreamAgentDataToolExecutionContext$inboundSchema
3531
3828
  ),
3829
+ responseId: z.string().optional(),
3532
3830
  }).transform((v) => {
3533
3831
  return remap$(v, {
3534
3832
  "tool_id": "toolId",
@@ -3548,6 +3846,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBody13Data$Ou
3548
3846
  action_type: string;
3549
3847
  tool_arguments: { [k: string]: any };
3550
3848
  tool_execution_context: StreamAgentDataToolExecutionContext$Outbound;
3849
+ responseId?: string | undefined;
3551
3850
  };
3552
3851
 
3553
3852
  /** @internal */
@@ -3565,6 +3864,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody13Data$o
3565
3864
  toolExecutionContext: z.lazy(() =>
3566
3865
  StreamAgentDataToolExecutionContext$outboundSchema
3567
3866
  ),
3867
+ responseId: z.string().optional(),
3568
3868
  }).transform((v) => {
3569
3869
  return remap$(v, {
3570
3870
  toolId: "tool_id",
@@ -3660,13 +3960,14 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBody12Type$o
3660
3960
  StreamAgentDataAgentsResponse200TextEventStreamResponseBody12Type$inboundSchema;
3661
3961
 
3662
3962
  /** @internal */
3663
- export const StreamAgentDataAgentsResponseRole$inboundSchema: z.ZodNativeEnum<
3664
- typeof StreamAgentDataAgentsResponseRole
3665
- > = z.nativeEnum(StreamAgentDataAgentsResponseRole);
3963
+ export const StreamAgentDataAgentsResponse200Role$inboundSchema:
3964
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Role> = z.nativeEnum(
3965
+ StreamAgentDataAgentsResponse200Role,
3966
+ );
3666
3967
  /** @internal */
3667
- export const StreamAgentDataAgentsResponseRole$outboundSchema: z.ZodNativeEnum<
3668
- typeof StreamAgentDataAgentsResponseRole
3669
- > = StreamAgentDataAgentsResponseRole$inboundSchema;
3968
+ export const StreamAgentDataAgentsResponse200Role$outboundSchema:
3969
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Role> =
3970
+ StreamAgentDataAgentsResponse200Role$inboundSchema;
3670
3971
 
3671
3972
  /** @internal */
3672
3973
  export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage5Kind$inboundSchema:
@@ -3683,9 +3984,9 @@ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12D
3683
3984
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage5Kind$inboundSchema;
3684
3985
 
3685
3986
  /** @internal */
3686
- export const StreamAgentPartsAgentsResponseToolResultPart$inboundSchema:
3987
+ export const StreamAgentPartsAgentsResponse200ToolResultPart$inboundSchema:
3687
3988
  z.ZodType<
3688
- StreamAgentPartsAgentsResponseToolResultPart,
3989
+ StreamAgentPartsAgentsResponse200ToolResultPart,
3689
3990
  z.ZodTypeDef,
3690
3991
  unknown
3691
3992
  > = z.object({
@@ -3700,7 +4001,7 @@ export const StreamAgentPartsAgentsResponseToolResultPart$inboundSchema:
3700
4001
  });
3701
4002
  });
3702
4003
  /** @internal */
3703
- export type StreamAgentPartsAgentsResponseToolResultPart$Outbound = {
4004
+ export type StreamAgentPartsAgentsResponse200ToolResultPart$Outbound = {
3704
4005
  kind: string;
3705
4006
  tool_call_id: string;
3706
4007
  result?: any | undefined;
@@ -3708,11 +4009,11 @@ export type StreamAgentPartsAgentsResponseToolResultPart$Outbound = {
3708
4009
  };
3709
4010
 
3710
4011
  /** @internal */
3711
- export const StreamAgentPartsAgentsResponseToolResultPart$outboundSchema:
4012
+ export const StreamAgentPartsAgentsResponse200ToolResultPart$outboundSchema:
3712
4013
  z.ZodType<
3713
- StreamAgentPartsAgentsResponseToolResultPart$Outbound,
4014
+ StreamAgentPartsAgentsResponse200ToolResultPart$Outbound,
3714
4015
  z.ZodTypeDef,
3715
- StreamAgentPartsAgentsResponseToolResultPart
4016
+ StreamAgentPartsAgentsResponse200ToolResultPart
3716
4017
  > = z.object({
3717
4018
  kind:
3718
4019
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage5Kind$outboundSchema,
@@ -3725,29 +4026,29 @@ export const StreamAgentPartsAgentsResponseToolResultPart$outboundSchema:
3725
4026
  });
3726
4027
  });
3727
4028
 
3728
- export function streamAgentPartsAgentsResponseToolResultPartToJSON(
3729
- streamAgentPartsAgentsResponseToolResultPart:
3730
- StreamAgentPartsAgentsResponseToolResultPart,
4029
+ export function streamAgentPartsAgentsResponse200ToolResultPartToJSON(
4030
+ streamAgentPartsAgentsResponse200ToolResultPart:
4031
+ StreamAgentPartsAgentsResponse200ToolResultPart,
3731
4032
  ): string {
3732
4033
  return JSON.stringify(
3733
- StreamAgentPartsAgentsResponseToolResultPart$outboundSchema.parse(
3734
- streamAgentPartsAgentsResponseToolResultPart,
4034
+ StreamAgentPartsAgentsResponse200ToolResultPart$outboundSchema.parse(
4035
+ streamAgentPartsAgentsResponse200ToolResultPart,
3735
4036
  ),
3736
4037
  );
3737
4038
  }
3738
- export function streamAgentPartsAgentsResponseToolResultPartFromJSON(
4039
+ export function streamAgentPartsAgentsResponse200ToolResultPartFromJSON(
3739
4040
  jsonString: string,
3740
4041
  ): SafeParseResult<
3741
- StreamAgentPartsAgentsResponseToolResultPart,
4042
+ StreamAgentPartsAgentsResponse200ToolResultPart,
3742
4043
  SDKValidationError
3743
4044
  > {
3744
4045
  return safeParse(
3745
4046
  jsonString,
3746
4047
  (x) =>
3747
- StreamAgentPartsAgentsResponseToolResultPart$inboundSchema.parse(
4048
+ StreamAgentPartsAgentsResponse200ToolResultPart$inboundSchema.parse(
3748
4049
  JSON.parse(x),
3749
4050
  ),
3750
- `Failed to parse 'StreamAgentPartsAgentsResponseToolResultPart' from JSON`,
4051
+ `Failed to parse 'StreamAgentPartsAgentsResponse200ToolResultPart' from JSON`,
3751
4052
  );
3752
4053
  }
3753
4054
 
@@ -3766,23 +4067,26 @@ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12D
3766
4067
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage4Kind$inboundSchema;
3767
4068
 
3768
4069
  /** @internal */
3769
- export const StreamAgentPartsAgentsResponseToolCallPart$inboundSchema:
3770
- z.ZodType<StreamAgentPartsAgentsResponseToolCallPart, z.ZodTypeDef, unknown> =
3771
- z.object({
3772
- kind:
3773
- StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage4Kind$inboundSchema,
3774
- tool_name: z.string(),
3775
- tool_call_id: z.string(),
3776
- arguments: z.record(z.any()),
3777
- metadata: z.record(z.any()).optional(),
3778
- }).transform((v) => {
3779
- return remap$(v, {
3780
- "tool_name": "toolName",
3781
- "tool_call_id": "toolCallId",
3782
- });
4070
+ export const StreamAgentPartsAgentsResponse200ToolCallPart$inboundSchema:
4071
+ z.ZodType<
4072
+ StreamAgentPartsAgentsResponse200ToolCallPart,
4073
+ z.ZodTypeDef,
4074
+ unknown
4075
+ > = z.object({
4076
+ kind:
4077
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage4Kind$inboundSchema,
4078
+ tool_name: z.string(),
4079
+ tool_call_id: z.string(),
4080
+ arguments: z.record(z.any()),
4081
+ metadata: z.record(z.any()).optional(),
4082
+ }).transform((v) => {
4083
+ return remap$(v, {
4084
+ "tool_name": "toolName",
4085
+ "tool_call_id": "toolCallId",
3783
4086
  });
4087
+ });
3784
4088
  /** @internal */
3785
- export type StreamAgentPartsAgentsResponseToolCallPart$Outbound = {
4089
+ export type StreamAgentPartsAgentsResponse200ToolCallPart$Outbound = {
3786
4090
  kind: string;
3787
4091
  tool_name: string;
3788
4092
  tool_call_id: string;
@@ -3791,11 +4095,11 @@ export type StreamAgentPartsAgentsResponseToolCallPart$Outbound = {
3791
4095
  };
3792
4096
 
3793
4097
  /** @internal */
3794
- export const StreamAgentPartsAgentsResponseToolCallPart$outboundSchema:
4098
+ export const StreamAgentPartsAgentsResponse200ToolCallPart$outboundSchema:
3795
4099
  z.ZodType<
3796
- StreamAgentPartsAgentsResponseToolCallPart$Outbound,
4100
+ StreamAgentPartsAgentsResponse200ToolCallPart$Outbound,
3797
4101
  z.ZodTypeDef,
3798
- StreamAgentPartsAgentsResponseToolCallPart
4102
+ StreamAgentPartsAgentsResponse200ToolCallPart
3799
4103
  > = z.object({
3800
4104
  kind:
3801
4105
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessage4Kind$outboundSchema,
@@ -3810,29 +4114,29 @@ export const StreamAgentPartsAgentsResponseToolCallPart$outboundSchema:
3810
4114
  });
3811
4115
  });
3812
4116
 
3813
- export function streamAgentPartsAgentsResponseToolCallPartToJSON(
3814
- streamAgentPartsAgentsResponseToolCallPart:
3815
- StreamAgentPartsAgentsResponseToolCallPart,
4117
+ export function streamAgentPartsAgentsResponse200ToolCallPartToJSON(
4118
+ streamAgentPartsAgentsResponse200ToolCallPart:
4119
+ StreamAgentPartsAgentsResponse200ToolCallPart,
3816
4120
  ): string {
3817
4121
  return JSON.stringify(
3818
- StreamAgentPartsAgentsResponseToolCallPart$outboundSchema.parse(
3819
- streamAgentPartsAgentsResponseToolCallPart,
4122
+ StreamAgentPartsAgentsResponse200ToolCallPart$outboundSchema.parse(
4123
+ streamAgentPartsAgentsResponse200ToolCallPart,
3820
4124
  ),
3821
4125
  );
3822
4126
  }
3823
- export function streamAgentPartsAgentsResponseToolCallPartFromJSON(
4127
+ export function streamAgentPartsAgentsResponse200ToolCallPartFromJSON(
3824
4128
  jsonString: string,
3825
4129
  ): SafeParseResult<
3826
- StreamAgentPartsAgentsResponseToolCallPart,
4130
+ StreamAgentPartsAgentsResponse200ToolCallPart,
3827
4131
  SDKValidationError
3828
4132
  > {
3829
4133
  return safeParse(
3830
4134
  jsonString,
3831
4135
  (x) =>
3832
- StreamAgentPartsAgentsResponseToolCallPart$inboundSchema.parse(
4136
+ StreamAgentPartsAgentsResponse200ToolCallPart$inboundSchema.parse(
3833
4137
  JSON.parse(x),
3834
4138
  ),
3835
- `Failed to parse 'StreamAgentPartsAgentsResponseToolCallPart' from JSON`,
4139
+ `Failed to parse 'StreamAgentPartsAgentsResponse200ToolCallPart' from JSON`,
3836
4140
  );
3837
4141
  }
3838
4142
 
@@ -3851,9 +4155,9 @@ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12D
3851
4155
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessageKind$inboundSchema;
3852
4156
 
3853
4157
  /** @internal */
3854
- export const StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema:
4158
+ export const StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$inboundSchema:
3855
4159
  z.ZodType<
3856
- StreamAgentFileAgentsResponse200FileInURIFormat,
4160
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat,
3857
4161
  z.ZodTypeDef,
3858
4162
  unknown
3859
4163
  > = z.object({
@@ -3862,54 +4166,53 @@ export const StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema:
3862
4166
  name: z.string().optional(),
3863
4167
  });
3864
4168
  /** @internal */
3865
- export type StreamAgentFileAgentsResponse200FileInURIFormat$Outbound = {
3866
- uri: string;
3867
- mimeType?: string | undefined;
3868
- name?: string | undefined;
3869
- };
4169
+ export type StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$Outbound =
4170
+ {
4171
+ uri: string;
4172
+ mimeType?: string | undefined;
4173
+ name?: string | undefined;
4174
+ };
3870
4175
 
3871
4176
  /** @internal */
3872
- export const StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema:
4177
+ export const StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$outboundSchema:
3873
4178
  z.ZodType<
3874
- StreamAgentFileAgentsResponse200FileInURIFormat$Outbound,
4179
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$Outbound,
3875
4180
  z.ZodTypeDef,
3876
- StreamAgentFileAgentsResponse200FileInURIFormat
4181
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat
3877
4182
  > = z.object({
3878
4183
  uri: z.string(),
3879
4184
  mimeType: z.string().optional(),
3880
4185
  name: z.string().optional(),
3881
4186
  });
3882
4187
 
3883
- export function streamAgentFileAgentsResponse200FileInURIFormatToJSON(
3884
- streamAgentFileAgentsResponse200FileInURIFormat:
3885
- StreamAgentFileAgentsResponse200FileInURIFormat,
4188
+ export function streamAgentFileAgentsResponse200TextEventStreamFileInURIFormatToJSON(
4189
+ streamAgentFileAgentsResponse200TextEventStreamFileInURIFormat:
4190
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat,
3886
4191
  ): string {
3887
4192
  return JSON.stringify(
3888
- StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema.parse(
3889
- streamAgentFileAgentsResponse200FileInURIFormat,
3890
- ),
4193
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$outboundSchema
4194
+ .parse(streamAgentFileAgentsResponse200TextEventStreamFileInURIFormat),
3891
4195
  );
3892
4196
  }
3893
- export function streamAgentFileAgentsResponse200FileInURIFormatFromJSON(
4197
+ export function streamAgentFileAgentsResponse200TextEventStreamFileInURIFormatFromJSON(
3894
4198
  jsonString: string,
3895
4199
  ): SafeParseResult<
3896
- StreamAgentFileAgentsResponse200FileInURIFormat,
4200
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat,
3897
4201
  SDKValidationError
3898
4202
  > {
3899
4203
  return safeParse(
3900
4204
  jsonString,
3901
4205
  (x) =>
3902
- StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema.parse(
3903
- JSON.parse(x),
3904
- ),
3905
- `Failed to parse 'StreamAgentFileAgentsResponse200FileInURIFormat' from JSON`,
4206
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$inboundSchema
4207
+ .parse(JSON.parse(x)),
4208
+ `Failed to parse 'StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat' from JSON`,
3906
4209
  );
3907
4210
  }
3908
4211
 
3909
4212
  /** @internal */
3910
- export const StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema:
4213
+ export const StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$inboundSchema:
3911
4214
  z.ZodType<
3912
- StreamAgentFileAgentsResponse200BinaryFormat,
4215
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat,
3913
4216
  z.ZodTypeDef,
3914
4217
  unknown
3915
4218
  > = z.object({
@@ -3918,152 +4221,171 @@ export const StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema:
3918
4221
  name: z.string().optional(),
3919
4222
  });
3920
4223
  /** @internal */
3921
- export type StreamAgentFileAgentsResponse200BinaryFormat$Outbound = {
3922
- bytes: string;
3923
- mimeType?: string | undefined;
3924
- name?: string | undefined;
3925
- };
4224
+ export type StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$Outbound =
4225
+ {
4226
+ bytes: string;
4227
+ mimeType?: string | undefined;
4228
+ name?: string | undefined;
4229
+ };
3926
4230
 
3927
4231
  /** @internal */
3928
- export const StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema:
4232
+ export const StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$outboundSchema:
3929
4233
  z.ZodType<
3930
- StreamAgentFileAgentsResponse200BinaryFormat$Outbound,
4234
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$Outbound,
3931
4235
  z.ZodTypeDef,
3932
- StreamAgentFileAgentsResponse200BinaryFormat
4236
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat
3933
4237
  > = z.object({
3934
4238
  bytes: z.string(),
3935
4239
  mimeType: z.string().optional(),
3936
4240
  name: z.string().optional(),
3937
4241
  });
3938
4242
 
3939
- export function streamAgentFileAgentsResponse200BinaryFormatToJSON(
3940
- streamAgentFileAgentsResponse200BinaryFormat:
3941
- StreamAgentFileAgentsResponse200BinaryFormat,
4243
+ export function streamAgentFileAgentsResponse200TextEventStreamBinaryFormatToJSON(
4244
+ streamAgentFileAgentsResponse200TextEventStreamBinaryFormat:
4245
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat,
3942
4246
  ): string {
3943
4247
  return JSON.stringify(
3944
- StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema.parse(
3945
- streamAgentFileAgentsResponse200BinaryFormat,
3946
- ),
4248
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$outboundSchema
4249
+ .parse(streamAgentFileAgentsResponse200TextEventStreamBinaryFormat),
3947
4250
  );
3948
4251
  }
3949
- export function streamAgentFileAgentsResponse200BinaryFormatFromJSON(
4252
+ export function streamAgentFileAgentsResponse200TextEventStreamBinaryFormatFromJSON(
3950
4253
  jsonString: string,
3951
4254
  ): SafeParseResult<
3952
- StreamAgentFileAgentsResponse200BinaryFormat,
4255
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat,
3953
4256
  SDKValidationError
3954
4257
  > {
3955
4258
  return safeParse(
3956
4259
  jsonString,
3957
4260
  (x) =>
3958
- StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema.parse(
3959
- JSON.parse(x),
3960
- ),
3961
- `Failed to parse 'StreamAgentFileAgentsResponse200BinaryFormat' from JSON`,
4261
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$inboundSchema
4262
+ .parse(JSON.parse(x)),
4263
+ `Failed to parse 'StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat' from JSON`,
3962
4264
  );
3963
4265
  }
3964
4266
 
3965
4267
  /** @internal */
3966
- export const StreamAgentPartsAgentsResponseFile$inboundSchema: z.ZodType<
3967
- StreamAgentPartsAgentsResponseFile,
4268
+ export const StreamAgentPartsAgentsResponse200File$inboundSchema: z.ZodType<
4269
+ StreamAgentPartsAgentsResponse200File,
3968
4270
  z.ZodTypeDef,
3969
4271
  unknown
3970
4272
  > = z.union([
3971
- z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema),
3972
- z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema),
4273
+ z.lazy(() =>
4274
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$inboundSchema
4275
+ ),
4276
+ z.lazy(() =>
4277
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$inboundSchema
4278
+ ),
3973
4279
  ]);
3974
4280
  /** @internal */
3975
- export type StreamAgentPartsAgentsResponseFile$Outbound =
3976
- | StreamAgentFileAgentsResponse200BinaryFormat$Outbound
3977
- | StreamAgentFileAgentsResponse200FileInURIFormat$Outbound;
4281
+ export type StreamAgentPartsAgentsResponse200File$Outbound =
4282
+ | StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$Outbound
4283
+ | StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$Outbound;
3978
4284
 
3979
4285
  /** @internal */
3980
- export const StreamAgentPartsAgentsResponseFile$outboundSchema: z.ZodType<
3981
- StreamAgentPartsAgentsResponseFile$Outbound,
4286
+ export const StreamAgentPartsAgentsResponse200File$outboundSchema: z.ZodType<
4287
+ StreamAgentPartsAgentsResponse200File$Outbound,
3982
4288
  z.ZodTypeDef,
3983
- StreamAgentPartsAgentsResponseFile
4289
+ StreamAgentPartsAgentsResponse200File
3984
4290
  > = z.union([
3985
- z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema),
3986
- z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema),
4291
+ z.lazy(() =>
4292
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$outboundSchema
4293
+ ),
4294
+ z.lazy(() =>
4295
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$outboundSchema
4296
+ ),
3987
4297
  ]);
3988
4298
 
3989
- export function streamAgentPartsAgentsResponseFileToJSON(
3990
- streamAgentPartsAgentsResponseFile: StreamAgentPartsAgentsResponseFile,
4299
+ export function streamAgentPartsAgentsResponse200FileToJSON(
4300
+ streamAgentPartsAgentsResponse200File: StreamAgentPartsAgentsResponse200File,
3991
4301
  ): string {
3992
4302
  return JSON.stringify(
3993
- StreamAgentPartsAgentsResponseFile$outboundSchema.parse(
3994
- streamAgentPartsAgentsResponseFile,
4303
+ StreamAgentPartsAgentsResponse200File$outboundSchema.parse(
4304
+ streamAgentPartsAgentsResponse200File,
3995
4305
  ),
3996
4306
  );
3997
4307
  }
3998
- export function streamAgentPartsAgentsResponseFileFromJSON(
4308
+ export function streamAgentPartsAgentsResponse200FileFromJSON(
3999
4309
  jsonString: string,
4000
- ): SafeParseResult<StreamAgentPartsAgentsResponseFile, SDKValidationError> {
4310
+ ): SafeParseResult<StreamAgentPartsAgentsResponse200File, SDKValidationError> {
4001
4311
  return safeParse(
4002
4312
  jsonString,
4003
4313
  (x) =>
4004
- StreamAgentPartsAgentsResponseFile$inboundSchema.parse(JSON.parse(x)),
4005
- `Failed to parse 'StreamAgentPartsAgentsResponseFile' from JSON`,
4314
+ StreamAgentPartsAgentsResponse200File$inboundSchema.parse(JSON.parse(x)),
4315
+ `Failed to parse 'StreamAgentPartsAgentsResponse200File' from JSON`,
4006
4316
  );
4007
4317
  }
4008
4318
 
4009
4319
  /** @internal */
4010
- export const StreamAgentPartsAgentsResponseFilePart$inboundSchema: z.ZodType<
4011
- StreamAgentPartsAgentsResponseFilePart,
4320
+ export const StreamAgentPartsAgentsResponse200FilePart$inboundSchema: z.ZodType<
4321
+ StreamAgentPartsAgentsResponse200FilePart,
4012
4322
  z.ZodTypeDef,
4013
4323
  unknown
4014
4324
  > = z.object({
4015
4325
  kind:
4016
4326
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessageKind$inboundSchema,
4017
4327
  file: z.union([
4018
- z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema),
4019
- z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema),
4328
+ z.lazy(() =>
4329
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$inboundSchema
4330
+ ),
4331
+ z.lazy(() =>
4332
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$inboundSchema
4333
+ ),
4020
4334
  ]),
4021
4335
  metadata: z.record(z.any()).optional(),
4022
4336
  });
4023
4337
  /** @internal */
4024
- export type StreamAgentPartsAgentsResponseFilePart$Outbound = {
4338
+ export type StreamAgentPartsAgentsResponse200FilePart$Outbound = {
4025
4339
  kind: string;
4026
4340
  file:
4027
- | StreamAgentFileAgentsResponse200BinaryFormat$Outbound
4028
- | StreamAgentFileAgentsResponse200FileInURIFormat$Outbound;
4341
+ | StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$Outbound
4342
+ | StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$Outbound;
4029
4343
  metadata?: { [k: string]: any } | undefined;
4030
4344
  };
4031
4345
 
4032
4346
  /** @internal */
4033
- export const StreamAgentPartsAgentsResponseFilePart$outboundSchema: z.ZodType<
4034
- StreamAgentPartsAgentsResponseFilePart$Outbound,
4035
- z.ZodTypeDef,
4036
- StreamAgentPartsAgentsResponseFilePart
4037
- > = z.object({
4038
- kind:
4039
- StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessageKind$outboundSchema,
4040
- file: z.union([
4041
- z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema),
4042
- z.lazy(() =>
4043
- StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema
4044
- ),
4045
- ]),
4046
- metadata: z.record(z.any()).optional(),
4047
- });
4347
+ export const StreamAgentPartsAgentsResponse200FilePart$outboundSchema:
4348
+ z.ZodType<
4349
+ StreamAgentPartsAgentsResponse200FilePart$Outbound,
4350
+ z.ZodTypeDef,
4351
+ StreamAgentPartsAgentsResponse200FilePart
4352
+ > = z.object({
4353
+ kind:
4354
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataMessageKind$outboundSchema,
4355
+ file: z.union([
4356
+ z.lazy(() =>
4357
+ StreamAgentFileAgentsResponse200TextEventStreamBinaryFormat$outboundSchema
4358
+ ),
4359
+ z.lazy(() =>
4360
+ StreamAgentFileAgentsResponse200TextEventStreamFileInURIFormat$outboundSchema
4361
+ ),
4362
+ ]),
4363
+ metadata: z.record(z.any()).optional(),
4364
+ });
4048
4365
 
4049
- export function streamAgentPartsAgentsResponseFilePartToJSON(
4050
- streamAgentPartsAgentsResponseFilePart:
4051
- StreamAgentPartsAgentsResponseFilePart,
4366
+ export function streamAgentPartsAgentsResponse200FilePartToJSON(
4367
+ streamAgentPartsAgentsResponse200FilePart:
4368
+ StreamAgentPartsAgentsResponse200FilePart,
4052
4369
  ): string {
4053
4370
  return JSON.stringify(
4054
- StreamAgentPartsAgentsResponseFilePart$outboundSchema.parse(
4055
- streamAgentPartsAgentsResponseFilePart,
4371
+ StreamAgentPartsAgentsResponse200FilePart$outboundSchema.parse(
4372
+ streamAgentPartsAgentsResponse200FilePart,
4056
4373
  ),
4057
4374
  );
4058
4375
  }
4059
- export function streamAgentPartsAgentsResponseFilePartFromJSON(
4376
+ export function streamAgentPartsAgentsResponse200FilePartFromJSON(
4060
4377
  jsonString: string,
4061
- ): SafeParseResult<StreamAgentPartsAgentsResponseFilePart, SDKValidationError> {
4378
+ ): SafeParseResult<
4379
+ StreamAgentPartsAgentsResponse200FilePart,
4380
+ SDKValidationError
4381
+ > {
4062
4382
  return safeParse(
4063
4383
  jsonString,
4064
4384
  (x) =>
4065
- StreamAgentPartsAgentsResponseFilePart$inboundSchema.parse(JSON.parse(x)),
4066
- `Failed to parse 'StreamAgentPartsAgentsResponseFilePart' from JSON`,
4385
+ StreamAgentPartsAgentsResponse200FilePart$inboundSchema.parse(
4386
+ JSON.parse(x),
4387
+ ),
4388
+ `Failed to parse 'StreamAgentPartsAgentsResponse200FilePart' from JSON`,
4067
4389
  );
4068
4390
  }
4069
4391
 
@@ -4082,8 +4404,8 @@ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12D
4082
4404
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataKind$inboundSchema;
4083
4405
 
4084
4406
  /** @internal */
4085
- export const StreamAgentPartsAgentsResponseDataPart$inboundSchema: z.ZodType<
4086
- StreamAgentPartsAgentsResponseDataPart,
4407
+ export const StreamAgentPartsAgentsResponse200DataPart$inboundSchema: z.ZodType<
4408
+ StreamAgentPartsAgentsResponse200DataPart,
4087
4409
  z.ZodTypeDef,
4088
4410
  unknown
4089
4411
  > = z.object({
@@ -4093,42 +4415,48 @@ export const StreamAgentPartsAgentsResponseDataPart$inboundSchema: z.ZodType<
4093
4415
  metadata: z.record(z.any()).optional(),
4094
4416
  });
4095
4417
  /** @internal */
4096
- export type StreamAgentPartsAgentsResponseDataPart$Outbound = {
4418
+ export type StreamAgentPartsAgentsResponse200DataPart$Outbound = {
4097
4419
  kind: string;
4098
4420
  data: { [k: string]: any };
4099
4421
  metadata?: { [k: string]: any } | undefined;
4100
4422
  };
4101
4423
 
4102
4424
  /** @internal */
4103
- export const StreamAgentPartsAgentsResponseDataPart$outboundSchema: z.ZodType<
4104
- StreamAgentPartsAgentsResponseDataPart$Outbound,
4105
- z.ZodTypeDef,
4106
- StreamAgentPartsAgentsResponseDataPart
4107
- > = z.object({
4108
- kind:
4109
- StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataKind$outboundSchema,
4110
- data: z.record(z.any()),
4111
- metadata: z.record(z.any()).optional(),
4112
- });
4425
+ export const StreamAgentPartsAgentsResponse200DataPart$outboundSchema:
4426
+ z.ZodType<
4427
+ StreamAgentPartsAgentsResponse200DataPart$Outbound,
4428
+ z.ZodTypeDef,
4429
+ StreamAgentPartsAgentsResponse200DataPart
4430
+ > = z.object({
4431
+ kind:
4432
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12DataKind$outboundSchema,
4433
+ data: z.record(z.any()),
4434
+ metadata: z.record(z.any()).optional(),
4435
+ });
4113
4436
 
4114
- export function streamAgentPartsAgentsResponseDataPartToJSON(
4115
- streamAgentPartsAgentsResponseDataPart:
4116
- StreamAgentPartsAgentsResponseDataPart,
4437
+ export function streamAgentPartsAgentsResponse200DataPartToJSON(
4438
+ streamAgentPartsAgentsResponse200DataPart:
4439
+ StreamAgentPartsAgentsResponse200DataPart,
4117
4440
  ): string {
4118
4441
  return JSON.stringify(
4119
- StreamAgentPartsAgentsResponseDataPart$outboundSchema.parse(
4120
- streamAgentPartsAgentsResponseDataPart,
4442
+ StreamAgentPartsAgentsResponse200DataPart$outboundSchema.parse(
4443
+ streamAgentPartsAgentsResponse200DataPart,
4121
4444
  ),
4122
4445
  );
4123
4446
  }
4124
- export function streamAgentPartsAgentsResponseDataPartFromJSON(
4447
+ export function streamAgentPartsAgentsResponse200DataPartFromJSON(
4125
4448
  jsonString: string,
4126
- ): SafeParseResult<StreamAgentPartsAgentsResponseDataPart, SDKValidationError> {
4449
+ ): SafeParseResult<
4450
+ StreamAgentPartsAgentsResponse200DataPart,
4451
+ SDKValidationError
4452
+ > {
4127
4453
  return safeParse(
4128
4454
  jsonString,
4129
4455
  (x) =>
4130
- StreamAgentPartsAgentsResponseDataPart$inboundSchema.parse(JSON.parse(x)),
4131
- `Failed to parse 'StreamAgentPartsAgentsResponseDataPart' from JSON`,
4456
+ StreamAgentPartsAgentsResponse200DataPart$inboundSchema.parse(
4457
+ JSON.parse(x),
4458
+ ),
4459
+ `Failed to parse 'StreamAgentPartsAgentsResponse200DataPart' from JSON`,
4132
4460
  );
4133
4461
  }
4134
4462
 
@@ -4147,8 +4475,8 @@ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12K
4147
4475
  StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Kind$inboundSchema;
4148
4476
 
4149
4477
  /** @internal */
4150
- export const StreamAgentPartsAgentsResponseTextPart$inboundSchema: z.ZodType<
4151
- StreamAgentPartsAgentsResponseTextPart,
4478
+ export const StreamAgentPartsAgentsResponse200TextPart$inboundSchema: z.ZodType<
4479
+ StreamAgentPartsAgentsResponse200TextPart,
4152
4480
  z.ZodTypeDef,
4153
4481
  unknown
4154
4482
  > = z.object({
@@ -4157,93 +4485,99 @@ export const StreamAgentPartsAgentsResponseTextPart$inboundSchema: z.ZodType<
4157
4485
  text: z.string(),
4158
4486
  });
4159
4487
  /** @internal */
4160
- export type StreamAgentPartsAgentsResponseTextPart$Outbound = {
4488
+ export type StreamAgentPartsAgentsResponse200TextPart$Outbound = {
4161
4489
  kind: string;
4162
4490
  text: string;
4163
4491
  };
4164
4492
 
4165
4493
  /** @internal */
4166
- export const StreamAgentPartsAgentsResponseTextPart$outboundSchema: z.ZodType<
4167
- StreamAgentPartsAgentsResponseTextPart$Outbound,
4168
- z.ZodTypeDef,
4169
- StreamAgentPartsAgentsResponseTextPart
4170
- > = z.object({
4171
- kind:
4172
- StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Kind$outboundSchema,
4173
- text: z.string(),
4174
- });
4494
+ export const StreamAgentPartsAgentsResponse200TextPart$outboundSchema:
4495
+ z.ZodType<
4496
+ StreamAgentPartsAgentsResponse200TextPart$Outbound,
4497
+ z.ZodTypeDef,
4498
+ StreamAgentPartsAgentsResponse200TextPart
4499
+ > = z.object({
4500
+ kind:
4501
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData12Kind$outboundSchema,
4502
+ text: z.string(),
4503
+ });
4175
4504
 
4176
- export function streamAgentPartsAgentsResponseTextPartToJSON(
4177
- streamAgentPartsAgentsResponseTextPart:
4178
- StreamAgentPartsAgentsResponseTextPart,
4505
+ export function streamAgentPartsAgentsResponse200TextPartToJSON(
4506
+ streamAgentPartsAgentsResponse200TextPart:
4507
+ StreamAgentPartsAgentsResponse200TextPart,
4179
4508
  ): string {
4180
4509
  return JSON.stringify(
4181
- StreamAgentPartsAgentsResponseTextPart$outboundSchema.parse(
4182
- streamAgentPartsAgentsResponseTextPart,
4510
+ StreamAgentPartsAgentsResponse200TextPart$outboundSchema.parse(
4511
+ streamAgentPartsAgentsResponse200TextPart,
4183
4512
  ),
4184
4513
  );
4185
4514
  }
4186
- export function streamAgentPartsAgentsResponseTextPartFromJSON(
4515
+ export function streamAgentPartsAgentsResponse200TextPartFromJSON(
4187
4516
  jsonString: string,
4188
- ): SafeParseResult<StreamAgentPartsAgentsResponseTextPart, SDKValidationError> {
4517
+ ): SafeParseResult<
4518
+ StreamAgentPartsAgentsResponse200TextPart,
4519
+ SDKValidationError
4520
+ > {
4189
4521
  return safeParse(
4190
4522
  jsonString,
4191
4523
  (x) =>
4192
- StreamAgentPartsAgentsResponseTextPart$inboundSchema.parse(JSON.parse(x)),
4193
- `Failed to parse 'StreamAgentPartsAgentsResponseTextPart' from JSON`,
4524
+ StreamAgentPartsAgentsResponse200TextPart$inboundSchema.parse(
4525
+ JSON.parse(x),
4526
+ ),
4527
+ `Failed to parse 'StreamAgentPartsAgentsResponse200TextPart' from JSON`,
4194
4528
  );
4195
4529
  }
4196
4530
 
4197
4531
  /** @internal */
4198
- export const StreamAgentDataAgentsResponseParts$inboundSchema: z.ZodType<
4199
- StreamAgentDataAgentsResponseParts,
4532
+ export const StreamAgentDataAgentsResponse200Parts$inboundSchema: z.ZodType<
4533
+ StreamAgentDataAgentsResponse200Parts,
4200
4534
  z.ZodTypeDef,
4201
4535
  unknown
4202
4536
  > = z.union([
4203
- z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$inboundSchema),
4204
- z.lazy(() => StreamAgentPartsAgentsResponseTextPart$inboundSchema),
4205
- z.lazy(() => StreamAgentPartsAgentsResponseDataPart$inboundSchema),
4206
- z.lazy(() => StreamAgentPartsAgentsResponseFilePart$inboundSchema),
4207
- z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$inboundSchema),
4537
+ z.lazy(() => StreamAgentPartsAgentsResponse200ToolCallPart$inboundSchema),
4538
+ z.lazy(() => StreamAgentPartsAgentsResponse200TextPart$inboundSchema),
4539
+ z.lazy(() => StreamAgentPartsAgentsResponse200DataPart$inboundSchema),
4540
+ z.lazy(() => StreamAgentPartsAgentsResponse200FilePart$inboundSchema),
4541
+ z.lazy(() => StreamAgentPartsAgentsResponse200ToolResultPart$inboundSchema),
4208
4542
  ]);
4209
4543
  /** @internal */
4210
- export type StreamAgentDataAgentsResponseParts$Outbound =
4211
- | StreamAgentPartsAgentsResponseToolCallPart$Outbound
4212
- | StreamAgentPartsAgentsResponseTextPart$Outbound
4213
- | StreamAgentPartsAgentsResponseDataPart$Outbound
4214
- | StreamAgentPartsAgentsResponseFilePart$Outbound
4215
- | StreamAgentPartsAgentsResponseToolResultPart$Outbound;
4544
+ export type StreamAgentDataAgentsResponse200Parts$Outbound =
4545
+ | StreamAgentPartsAgentsResponse200ToolCallPart$Outbound
4546
+ | StreamAgentPartsAgentsResponse200TextPart$Outbound
4547
+ | StreamAgentPartsAgentsResponse200DataPart$Outbound
4548
+ | StreamAgentPartsAgentsResponse200FilePart$Outbound
4549
+ | StreamAgentPartsAgentsResponse200ToolResultPart$Outbound;
4216
4550
 
4217
4551
  /** @internal */
4218
- export const StreamAgentDataAgentsResponseParts$outboundSchema: z.ZodType<
4219
- StreamAgentDataAgentsResponseParts$Outbound,
4552
+ export const StreamAgentDataAgentsResponse200Parts$outboundSchema: z.ZodType<
4553
+ StreamAgentDataAgentsResponse200Parts$Outbound,
4220
4554
  z.ZodTypeDef,
4221
- StreamAgentDataAgentsResponseParts
4555
+ StreamAgentDataAgentsResponse200Parts
4222
4556
  > = z.union([
4223
- z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$outboundSchema),
4224
- z.lazy(() => StreamAgentPartsAgentsResponseTextPart$outboundSchema),
4225
- z.lazy(() => StreamAgentPartsAgentsResponseDataPart$outboundSchema),
4226
- z.lazy(() => StreamAgentPartsAgentsResponseFilePart$outboundSchema),
4227
- z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$outboundSchema),
4557
+ z.lazy(() => StreamAgentPartsAgentsResponse200ToolCallPart$outboundSchema),
4558
+ z.lazy(() => StreamAgentPartsAgentsResponse200TextPart$outboundSchema),
4559
+ z.lazy(() => StreamAgentPartsAgentsResponse200DataPart$outboundSchema),
4560
+ z.lazy(() => StreamAgentPartsAgentsResponse200FilePart$outboundSchema),
4561
+ z.lazy(() => StreamAgentPartsAgentsResponse200ToolResultPart$outboundSchema),
4228
4562
  ]);
4229
4563
 
4230
- export function streamAgentDataAgentsResponsePartsToJSON(
4231
- streamAgentDataAgentsResponseParts: StreamAgentDataAgentsResponseParts,
4564
+ export function streamAgentDataAgentsResponse200PartsToJSON(
4565
+ streamAgentDataAgentsResponse200Parts: StreamAgentDataAgentsResponse200Parts,
4232
4566
  ): string {
4233
4567
  return JSON.stringify(
4234
- StreamAgentDataAgentsResponseParts$outboundSchema.parse(
4235
- streamAgentDataAgentsResponseParts,
4568
+ StreamAgentDataAgentsResponse200Parts$outboundSchema.parse(
4569
+ streamAgentDataAgentsResponse200Parts,
4236
4570
  ),
4237
4571
  );
4238
4572
  }
4239
- export function streamAgentDataAgentsResponsePartsFromJSON(
4573
+ export function streamAgentDataAgentsResponse200PartsFromJSON(
4240
4574
  jsonString: string,
4241
- ): SafeParseResult<StreamAgentDataAgentsResponseParts, SDKValidationError> {
4575
+ ): SafeParseResult<StreamAgentDataAgentsResponse200Parts, SDKValidationError> {
4242
4576
  return safeParse(
4243
4577
  jsonString,
4244
4578
  (x) =>
4245
- StreamAgentDataAgentsResponseParts$inboundSchema.parse(JSON.parse(x)),
4246
- `Failed to parse 'StreamAgentDataAgentsResponseParts' from JSON`,
4579
+ StreamAgentDataAgentsResponse200Parts$inboundSchema.parse(JSON.parse(x)),
4580
+ `Failed to parse 'StreamAgentDataAgentsResponse200Parts' from JSON`,
4247
4581
  );
4248
4582
  }
4249
4583
 
@@ -4254,14 +4588,16 @@ export const StreamAgentDataMessage$inboundSchema: z.ZodType<
4254
4588
  unknown
4255
4589
  > = z.object({
4256
4590
  messageId: z.string().optional(),
4257
- role: StreamAgentDataAgentsResponseRole$inboundSchema,
4591
+ role: StreamAgentDataAgentsResponse200Role$inboundSchema,
4258
4592
  parts: z.array(
4259
4593
  z.union([
4260
- z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$inboundSchema),
4261
- z.lazy(() => StreamAgentPartsAgentsResponseTextPart$inboundSchema),
4262
- z.lazy(() => StreamAgentPartsAgentsResponseDataPart$inboundSchema),
4263
- z.lazy(() => StreamAgentPartsAgentsResponseFilePart$inboundSchema),
4264
- z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$inboundSchema),
4594
+ z.lazy(() => StreamAgentPartsAgentsResponse200ToolCallPart$inboundSchema),
4595
+ z.lazy(() => StreamAgentPartsAgentsResponse200TextPart$inboundSchema),
4596
+ z.lazy(() => StreamAgentPartsAgentsResponse200DataPart$inboundSchema),
4597
+ z.lazy(() => StreamAgentPartsAgentsResponse200FilePart$inboundSchema),
4598
+ z.lazy(() =>
4599
+ StreamAgentPartsAgentsResponse200ToolResultPart$inboundSchema
4600
+ ),
4265
4601
  ]),
4266
4602
  ),
4267
4603
  metadata: z.record(z.any()).optional(),
@@ -4271,11 +4607,11 @@ export type StreamAgentDataMessage$Outbound = {
4271
4607
  messageId?: string | undefined;
4272
4608
  role: string;
4273
4609
  parts: Array<
4274
- | StreamAgentPartsAgentsResponseToolCallPart$Outbound
4275
- | StreamAgentPartsAgentsResponseTextPart$Outbound
4276
- | StreamAgentPartsAgentsResponseDataPart$Outbound
4277
- | StreamAgentPartsAgentsResponseFilePart$Outbound
4278
- | StreamAgentPartsAgentsResponseToolResultPart$Outbound
4610
+ | StreamAgentPartsAgentsResponse200ToolCallPart$Outbound
4611
+ | StreamAgentPartsAgentsResponse200TextPart$Outbound
4612
+ | StreamAgentPartsAgentsResponse200DataPart$Outbound
4613
+ | StreamAgentPartsAgentsResponse200FilePart$Outbound
4614
+ | StreamAgentPartsAgentsResponse200ToolResultPart$Outbound
4279
4615
  >;
4280
4616
  metadata?: { [k: string]: any } | undefined;
4281
4617
  };
@@ -4287,14 +4623,18 @@ export const StreamAgentDataMessage$outboundSchema: z.ZodType<
4287
4623
  StreamAgentDataMessage
4288
4624
  > = z.object({
4289
4625
  messageId: z.string().optional(),
4290
- role: StreamAgentDataAgentsResponseRole$outboundSchema,
4626
+ role: StreamAgentDataAgentsResponse200Role$outboundSchema,
4291
4627
  parts: z.array(
4292
4628
  z.union([
4293
- z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$outboundSchema),
4294
- z.lazy(() => StreamAgentPartsAgentsResponseTextPart$outboundSchema),
4295
- z.lazy(() => StreamAgentPartsAgentsResponseDataPart$outboundSchema),
4296
- z.lazy(() => StreamAgentPartsAgentsResponseFilePart$outboundSchema),
4297
- z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$outboundSchema),
4629
+ z.lazy(() =>
4630
+ StreamAgentPartsAgentsResponse200ToolCallPart$outboundSchema
4631
+ ),
4632
+ z.lazy(() => StreamAgentPartsAgentsResponse200TextPart$outboundSchema),
4633
+ z.lazy(() => StreamAgentPartsAgentsResponse200DataPart$outboundSchema),
4634
+ z.lazy(() => StreamAgentPartsAgentsResponse200FilePart$outboundSchema),
4635
+ z.lazy(() =>
4636
+ StreamAgentPartsAgentsResponse200ToolResultPart$outboundSchema
4637
+ ),
4298
4638
  ]),
4299
4639
  ),
4300
4640
  metadata: z.record(z.any()).optional(),
@@ -5160,6 +5500,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBodyData$inb
5160
5500
  tool: z.lazy(() => DataTool$inboundSchema),
5161
5501
  input: z.record(z.any()),
5162
5502
  agent_tool_call_id: z.string(),
5503
+ responseId: z.string().optional(),
5163
5504
  }).transform((v) => {
5164
5505
  return remap$(v, {
5165
5506
  "agent_id": "agentId",
@@ -5177,6 +5518,7 @@ export type StreamAgentDataAgentsResponse200TextEventStreamResponseBodyData$Outb
5177
5518
  tool: DataTool$Outbound;
5178
5519
  input: { [k: string]: any };
5179
5520
  agent_tool_call_id: string;
5521
+ responseId?: string | undefined;
5180
5522
  };
5181
5523
 
5182
5524
  /** @internal */
@@ -5192,6 +5534,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamResponseBodyData$out
5192
5534
  tool: z.lazy(() => DataTool$outboundSchema),
5193
5535
  input: z.record(z.any()),
5194
5536
  agentToolCallId: z.string(),
5537
+ responseId: z.string().optional(),
5195
5538
  }).transform((v) => {
5196
5539
  return remap$(v, {
5197
5540
  agentId: "agent_id",
@@ -5288,11 +5631,13 @@ export const StreamAgentDataAgentsResponse200TextEventStreamData$inboundSchema:
5288
5631
  > = z.object({
5289
5632
  error: z.string(),
5290
5633
  code: z.number(),
5634
+ responseId: z.string().optional(),
5291
5635
  });
5292
5636
  /** @internal */
5293
5637
  export type StreamAgentDataAgentsResponse200TextEventStreamData$Outbound = {
5294
5638
  error: string;
5295
5639
  code: number;
5640
+ responseId?: string | undefined;
5296
5641
  };
5297
5642
 
5298
5643
  /** @internal */
@@ -5304,6 +5649,7 @@ export const StreamAgentDataAgentsResponse200TextEventStreamData$outboundSchema:
5304
5649
  > = z.object({
5305
5650
  error: z.string(),
5306
5651
  code: z.number(),
5652
+ responseId: z.string().optional(),
5307
5653
  });
5308
5654
 
5309
5655
  export function streamAgentDataAgentsResponse200TextEventStreamDataToJSON(
@@ -5349,41 +5695,699 @@ export type Data5$Outbound = {
5349
5695
  };
5350
5696
 
5351
5697
  /** @internal */
5352
- export const Data5$outboundSchema: z.ZodType<
5353
- Data5$Outbound,
5698
+ export const Data5$outboundSchema: z.ZodType<
5699
+ Data5$Outbound,
5700
+ z.ZodTypeDef,
5701
+ Data5
5702
+ > = z.object({
5703
+ type: StreamAgentDataAgentsResponse200TextEventStreamType$outboundSchema,
5704
+ timestamp: z.string(),
5705
+ data: z.lazy(() =>
5706
+ StreamAgentDataAgentsResponse200TextEventStreamData$outboundSchema
5707
+ ),
5708
+ });
5709
+
5710
+ export function data5ToJSON(data5: Data5): string {
5711
+ return JSON.stringify(Data5$outboundSchema.parse(data5));
5712
+ }
5713
+ export function data5FromJSON(
5714
+ jsonString: string,
5715
+ ): SafeParseResult<Data5, SDKValidationError> {
5716
+ return safeParse(
5717
+ jsonString,
5718
+ (x) => Data5$inboundSchema.parse(JSON.parse(x)),
5719
+ `Failed to parse 'Data5' from JSON`,
5720
+ );
5721
+ }
5722
+
5723
+ /** @internal */
5724
+ export const StreamAgentDataAgentsResponse200Type$inboundSchema:
5725
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Type> = z.nativeEnum(
5726
+ StreamAgentDataAgentsResponse200Type,
5727
+ );
5728
+ /** @internal */
5729
+ export const StreamAgentDataAgentsResponse200Type$outboundSchema:
5730
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Type> =
5731
+ StreamAgentDataAgentsResponse200Type$inboundSchema;
5732
+
5733
+ /** @internal */
5734
+ export const StreamAgentDataAgentsResponseRole$inboundSchema: z.ZodNativeEnum<
5735
+ typeof StreamAgentDataAgentsResponseRole
5736
+ > = z.nativeEnum(StreamAgentDataAgentsResponseRole);
5737
+ /** @internal */
5738
+ export const StreamAgentDataAgentsResponseRole$outboundSchema: z.ZodNativeEnum<
5739
+ typeof StreamAgentDataAgentsResponseRole
5740
+ > = StreamAgentDataAgentsResponseRole$inboundSchema;
5741
+
5742
+ /** @internal */
5743
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind$inboundSchema:
5744
+ z.ZodNativeEnum<
5745
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind
5746
+ > = z.nativeEnum(
5747
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind,
5748
+ );
5749
+ /** @internal */
5750
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind$outboundSchema:
5751
+ z.ZodNativeEnum<
5752
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind
5753
+ > =
5754
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind$inboundSchema;
5755
+
5756
+ /** @internal */
5757
+ export const StreamAgentPartsAgentsResponseToolResultPart$inboundSchema:
5758
+ z.ZodType<
5759
+ StreamAgentPartsAgentsResponseToolResultPart,
5760
+ z.ZodTypeDef,
5761
+ unknown
5762
+ > = z.object({
5763
+ kind:
5764
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind$inboundSchema,
5765
+ tool_call_id: z.string(),
5766
+ result: z.any().optional(),
5767
+ metadata: z.record(z.any()).optional(),
5768
+ }).transform((v) => {
5769
+ return remap$(v, {
5770
+ "tool_call_id": "toolCallId",
5771
+ });
5772
+ });
5773
+ /** @internal */
5774
+ export type StreamAgentPartsAgentsResponseToolResultPart$Outbound = {
5775
+ kind: string;
5776
+ tool_call_id: string;
5777
+ result?: any | undefined;
5778
+ metadata?: { [k: string]: any } | undefined;
5779
+ };
5780
+
5781
+ /** @internal */
5782
+ export const StreamAgentPartsAgentsResponseToolResultPart$outboundSchema:
5783
+ z.ZodType<
5784
+ StreamAgentPartsAgentsResponseToolResultPart$Outbound,
5785
+ z.ZodTypeDef,
5786
+ StreamAgentPartsAgentsResponseToolResultPart
5787
+ > = z.object({
5788
+ kind:
5789
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull5Kind$outboundSchema,
5790
+ toolCallId: z.string(),
5791
+ result: z.any().optional(),
5792
+ metadata: z.record(z.any()).optional(),
5793
+ }).transform((v) => {
5794
+ return remap$(v, {
5795
+ toolCallId: "tool_call_id",
5796
+ });
5797
+ });
5798
+
5799
+ export function streamAgentPartsAgentsResponseToolResultPartToJSON(
5800
+ streamAgentPartsAgentsResponseToolResultPart:
5801
+ StreamAgentPartsAgentsResponseToolResultPart,
5802
+ ): string {
5803
+ return JSON.stringify(
5804
+ StreamAgentPartsAgentsResponseToolResultPart$outboundSchema.parse(
5805
+ streamAgentPartsAgentsResponseToolResultPart,
5806
+ ),
5807
+ );
5808
+ }
5809
+ export function streamAgentPartsAgentsResponseToolResultPartFromJSON(
5810
+ jsonString: string,
5811
+ ): SafeParseResult<
5812
+ StreamAgentPartsAgentsResponseToolResultPart,
5813
+ SDKValidationError
5814
+ > {
5815
+ return safeParse(
5816
+ jsonString,
5817
+ (x) =>
5818
+ StreamAgentPartsAgentsResponseToolResultPart$inboundSchema.parse(
5819
+ JSON.parse(x),
5820
+ ),
5821
+ `Failed to parse 'StreamAgentPartsAgentsResponseToolResultPart' from JSON`,
5822
+ );
5823
+ }
5824
+
5825
+ /** @internal */
5826
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind$inboundSchema:
5827
+ z.ZodNativeEnum<
5828
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind
5829
+ > = z.nativeEnum(
5830
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind,
5831
+ );
5832
+ /** @internal */
5833
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind$outboundSchema:
5834
+ z.ZodNativeEnum<
5835
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind
5836
+ > =
5837
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind$inboundSchema;
5838
+
5839
+ /** @internal */
5840
+ export const StreamAgentPartsAgentsResponseToolCallPart$inboundSchema:
5841
+ z.ZodType<StreamAgentPartsAgentsResponseToolCallPart, z.ZodTypeDef, unknown> =
5842
+ z.object({
5843
+ kind:
5844
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind$inboundSchema,
5845
+ tool_name: z.string(),
5846
+ tool_call_id: z.string(),
5847
+ arguments: z.record(z.any()),
5848
+ metadata: z.record(z.any()).optional(),
5849
+ }).transform((v) => {
5850
+ return remap$(v, {
5851
+ "tool_name": "toolName",
5852
+ "tool_call_id": "toolCallId",
5853
+ });
5854
+ });
5855
+ /** @internal */
5856
+ export type StreamAgentPartsAgentsResponseToolCallPart$Outbound = {
5857
+ kind: string;
5858
+ tool_name: string;
5859
+ tool_call_id: string;
5860
+ arguments: { [k: string]: any };
5861
+ metadata?: { [k: string]: any } | undefined;
5862
+ };
5863
+
5864
+ /** @internal */
5865
+ export const StreamAgentPartsAgentsResponseToolCallPart$outboundSchema:
5866
+ z.ZodType<
5867
+ StreamAgentPartsAgentsResponseToolCallPart$Outbound,
5868
+ z.ZodTypeDef,
5869
+ StreamAgentPartsAgentsResponseToolCallPart
5870
+ > = z.object({
5871
+ kind:
5872
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFull4Kind$outboundSchema,
5873
+ toolName: z.string(),
5874
+ toolCallId: z.string(),
5875
+ arguments: z.record(z.any()),
5876
+ metadata: z.record(z.any()).optional(),
5877
+ }).transform((v) => {
5878
+ return remap$(v, {
5879
+ toolName: "tool_name",
5880
+ toolCallId: "tool_call_id",
5881
+ });
5882
+ });
5883
+
5884
+ export function streamAgentPartsAgentsResponseToolCallPartToJSON(
5885
+ streamAgentPartsAgentsResponseToolCallPart:
5886
+ StreamAgentPartsAgentsResponseToolCallPart,
5887
+ ): string {
5888
+ return JSON.stringify(
5889
+ StreamAgentPartsAgentsResponseToolCallPart$outboundSchema.parse(
5890
+ streamAgentPartsAgentsResponseToolCallPart,
5891
+ ),
5892
+ );
5893
+ }
5894
+ export function streamAgentPartsAgentsResponseToolCallPartFromJSON(
5895
+ jsonString: string,
5896
+ ): SafeParseResult<
5897
+ StreamAgentPartsAgentsResponseToolCallPart,
5898
+ SDKValidationError
5899
+ > {
5900
+ return safeParse(
5901
+ jsonString,
5902
+ (x) =>
5903
+ StreamAgentPartsAgentsResponseToolCallPart$inboundSchema.parse(
5904
+ JSON.parse(x),
5905
+ ),
5906
+ `Failed to parse 'StreamAgentPartsAgentsResponseToolCallPart' from JSON`,
5907
+ );
5908
+ }
5909
+
5910
+ /** @internal */
5911
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind$inboundSchema:
5912
+ z.ZodNativeEnum<
5913
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind
5914
+ > = z.nativeEnum(
5915
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind,
5916
+ );
5917
+ /** @internal */
5918
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind$outboundSchema:
5919
+ z.ZodNativeEnum<
5920
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind
5921
+ > =
5922
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind$inboundSchema;
5923
+
5924
+ /** @internal */
5925
+ export const StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema:
5926
+ z.ZodType<
5927
+ StreamAgentFileAgentsResponse200FileInURIFormat,
5928
+ z.ZodTypeDef,
5929
+ unknown
5930
+ > = z.object({
5931
+ uri: z.string(),
5932
+ mimeType: z.string().optional(),
5933
+ name: z.string().optional(),
5934
+ });
5935
+ /** @internal */
5936
+ export type StreamAgentFileAgentsResponse200FileInURIFormat$Outbound = {
5937
+ uri: string;
5938
+ mimeType?: string | undefined;
5939
+ name?: string | undefined;
5940
+ };
5941
+
5942
+ /** @internal */
5943
+ export const StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema:
5944
+ z.ZodType<
5945
+ StreamAgentFileAgentsResponse200FileInURIFormat$Outbound,
5946
+ z.ZodTypeDef,
5947
+ StreamAgentFileAgentsResponse200FileInURIFormat
5948
+ > = z.object({
5949
+ uri: z.string(),
5950
+ mimeType: z.string().optional(),
5951
+ name: z.string().optional(),
5952
+ });
5953
+
5954
+ export function streamAgentFileAgentsResponse200FileInURIFormatToJSON(
5955
+ streamAgentFileAgentsResponse200FileInURIFormat:
5956
+ StreamAgentFileAgentsResponse200FileInURIFormat,
5957
+ ): string {
5958
+ return JSON.stringify(
5959
+ StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema.parse(
5960
+ streamAgentFileAgentsResponse200FileInURIFormat,
5961
+ ),
5962
+ );
5963
+ }
5964
+ export function streamAgentFileAgentsResponse200FileInURIFormatFromJSON(
5965
+ jsonString: string,
5966
+ ): SafeParseResult<
5967
+ StreamAgentFileAgentsResponse200FileInURIFormat,
5968
+ SDKValidationError
5969
+ > {
5970
+ return safeParse(
5971
+ jsonString,
5972
+ (x) =>
5973
+ StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema.parse(
5974
+ JSON.parse(x),
5975
+ ),
5976
+ `Failed to parse 'StreamAgentFileAgentsResponse200FileInURIFormat' from JSON`,
5977
+ );
5978
+ }
5979
+
5980
+ /** @internal */
5981
+ export const StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema:
5982
+ z.ZodType<
5983
+ StreamAgentFileAgentsResponse200BinaryFormat,
5984
+ z.ZodTypeDef,
5985
+ unknown
5986
+ > = z.object({
5987
+ bytes: z.string(),
5988
+ mimeType: z.string().optional(),
5989
+ name: z.string().optional(),
5990
+ });
5991
+ /** @internal */
5992
+ export type StreamAgentFileAgentsResponse200BinaryFormat$Outbound = {
5993
+ bytes: string;
5994
+ mimeType?: string | undefined;
5995
+ name?: string | undefined;
5996
+ };
5997
+
5998
+ /** @internal */
5999
+ export const StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema:
6000
+ z.ZodType<
6001
+ StreamAgentFileAgentsResponse200BinaryFormat$Outbound,
6002
+ z.ZodTypeDef,
6003
+ StreamAgentFileAgentsResponse200BinaryFormat
6004
+ > = z.object({
6005
+ bytes: z.string(),
6006
+ mimeType: z.string().optional(),
6007
+ name: z.string().optional(),
6008
+ });
6009
+
6010
+ export function streamAgentFileAgentsResponse200BinaryFormatToJSON(
6011
+ streamAgentFileAgentsResponse200BinaryFormat:
6012
+ StreamAgentFileAgentsResponse200BinaryFormat,
6013
+ ): string {
6014
+ return JSON.stringify(
6015
+ StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema.parse(
6016
+ streamAgentFileAgentsResponse200BinaryFormat,
6017
+ ),
6018
+ );
6019
+ }
6020
+ export function streamAgentFileAgentsResponse200BinaryFormatFromJSON(
6021
+ jsonString: string,
6022
+ ): SafeParseResult<
6023
+ StreamAgentFileAgentsResponse200BinaryFormat,
6024
+ SDKValidationError
6025
+ > {
6026
+ return safeParse(
6027
+ jsonString,
6028
+ (x) =>
6029
+ StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema.parse(
6030
+ JSON.parse(x),
6031
+ ),
6032
+ `Failed to parse 'StreamAgentFileAgentsResponse200BinaryFormat' from JSON`,
6033
+ );
6034
+ }
6035
+
6036
+ /** @internal */
6037
+ export const StreamAgentPartsAgentsResponseFile$inboundSchema: z.ZodType<
6038
+ StreamAgentPartsAgentsResponseFile,
6039
+ z.ZodTypeDef,
6040
+ unknown
6041
+ > = z.union([
6042
+ z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema),
6043
+ z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema),
6044
+ ]);
6045
+ /** @internal */
6046
+ export type StreamAgentPartsAgentsResponseFile$Outbound =
6047
+ | StreamAgentFileAgentsResponse200BinaryFormat$Outbound
6048
+ | StreamAgentFileAgentsResponse200FileInURIFormat$Outbound;
6049
+
6050
+ /** @internal */
6051
+ export const StreamAgentPartsAgentsResponseFile$outboundSchema: z.ZodType<
6052
+ StreamAgentPartsAgentsResponseFile$Outbound,
6053
+ z.ZodTypeDef,
6054
+ StreamAgentPartsAgentsResponseFile
6055
+ > = z.union([
6056
+ z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema),
6057
+ z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema),
6058
+ ]);
6059
+
6060
+ export function streamAgentPartsAgentsResponseFileToJSON(
6061
+ streamAgentPartsAgentsResponseFile: StreamAgentPartsAgentsResponseFile,
6062
+ ): string {
6063
+ return JSON.stringify(
6064
+ StreamAgentPartsAgentsResponseFile$outboundSchema.parse(
6065
+ streamAgentPartsAgentsResponseFile,
6066
+ ),
6067
+ );
6068
+ }
6069
+ export function streamAgentPartsAgentsResponseFileFromJSON(
6070
+ jsonString: string,
6071
+ ): SafeParseResult<StreamAgentPartsAgentsResponseFile, SDKValidationError> {
6072
+ return safeParse(
6073
+ jsonString,
6074
+ (x) =>
6075
+ StreamAgentPartsAgentsResponseFile$inboundSchema.parse(JSON.parse(x)),
6076
+ `Failed to parse 'StreamAgentPartsAgentsResponseFile' from JSON`,
6077
+ );
6078
+ }
6079
+
6080
+ /** @internal */
6081
+ export const StreamAgentPartsAgentsResponseFilePart$inboundSchema: z.ZodType<
6082
+ StreamAgentPartsAgentsResponseFilePart,
6083
+ z.ZodTypeDef,
6084
+ unknown
6085
+ > = z.object({
6086
+ kind:
6087
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind$inboundSchema,
6088
+ file: z.union([
6089
+ z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$inboundSchema),
6090
+ z.lazy(() => StreamAgentFileAgentsResponse200FileInURIFormat$inboundSchema),
6091
+ ]),
6092
+ metadata: z.record(z.any()).optional(),
6093
+ });
6094
+ /** @internal */
6095
+ export type StreamAgentPartsAgentsResponseFilePart$Outbound = {
6096
+ kind: string;
6097
+ file:
6098
+ | StreamAgentFileAgentsResponse200BinaryFormat$Outbound
6099
+ | StreamAgentFileAgentsResponse200FileInURIFormat$Outbound;
6100
+ metadata?: { [k: string]: any } | undefined;
6101
+ };
6102
+
6103
+ /** @internal */
6104
+ export const StreamAgentPartsAgentsResponseFilePart$outboundSchema: z.ZodType<
6105
+ StreamAgentPartsAgentsResponseFilePart$Outbound,
6106
+ z.ZodTypeDef,
6107
+ StreamAgentPartsAgentsResponseFilePart
6108
+ > = z.object({
6109
+ kind:
6110
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataLastMessageFullKind$outboundSchema,
6111
+ file: z.union([
6112
+ z.lazy(() => StreamAgentFileAgentsResponse200BinaryFormat$outboundSchema),
6113
+ z.lazy(() =>
6114
+ StreamAgentFileAgentsResponse200FileInURIFormat$outboundSchema
6115
+ ),
6116
+ ]),
6117
+ metadata: z.record(z.any()).optional(),
6118
+ });
6119
+
6120
+ export function streamAgentPartsAgentsResponseFilePartToJSON(
6121
+ streamAgentPartsAgentsResponseFilePart:
6122
+ StreamAgentPartsAgentsResponseFilePart,
6123
+ ): string {
6124
+ return JSON.stringify(
6125
+ StreamAgentPartsAgentsResponseFilePart$outboundSchema.parse(
6126
+ streamAgentPartsAgentsResponseFilePart,
6127
+ ),
6128
+ );
6129
+ }
6130
+ export function streamAgentPartsAgentsResponseFilePartFromJSON(
6131
+ jsonString: string,
6132
+ ): SafeParseResult<StreamAgentPartsAgentsResponseFilePart, SDKValidationError> {
6133
+ return safeParse(
6134
+ jsonString,
6135
+ (x) =>
6136
+ StreamAgentPartsAgentsResponseFilePart$inboundSchema.parse(JSON.parse(x)),
6137
+ `Failed to parse 'StreamAgentPartsAgentsResponseFilePart' from JSON`,
6138
+ );
6139
+ }
6140
+
6141
+ /** @internal */
6142
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind$inboundSchema:
6143
+ z.ZodNativeEnum<
6144
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind
6145
+ > = z.nativeEnum(
6146
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind,
6147
+ );
6148
+ /** @internal */
6149
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind$outboundSchema:
6150
+ z.ZodNativeEnum<
6151
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind
6152
+ > =
6153
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind$inboundSchema;
6154
+
6155
+ /** @internal */
6156
+ export const StreamAgentPartsAgentsResponseDataPart$inboundSchema: z.ZodType<
6157
+ StreamAgentPartsAgentsResponseDataPart,
6158
+ z.ZodTypeDef,
6159
+ unknown
6160
+ > = z.object({
6161
+ kind:
6162
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind$inboundSchema,
6163
+ data: z.record(z.any()),
6164
+ metadata: z.record(z.any()).optional(),
6165
+ });
6166
+ /** @internal */
6167
+ export type StreamAgentPartsAgentsResponseDataPart$Outbound = {
6168
+ kind: string;
6169
+ data: { [k: string]: any };
6170
+ metadata?: { [k: string]: any } | undefined;
6171
+ };
6172
+
6173
+ /** @internal */
6174
+ export const StreamAgentPartsAgentsResponseDataPart$outboundSchema: z.ZodType<
6175
+ StreamAgentPartsAgentsResponseDataPart$Outbound,
6176
+ z.ZodTypeDef,
6177
+ StreamAgentPartsAgentsResponseDataPart
6178
+ > = z.object({
6179
+ kind:
6180
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4DataKind$outboundSchema,
6181
+ data: z.record(z.any()),
6182
+ metadata: z.record(z.any()).optional(),
6183
+ });
6184
+
6185
+ export function streamAgentPartsAgentsResponseDataPartToJSON(
6186
+ streamAgentPartsAgentsResponseDataPart:
6187
+ StreamAgentPartsAgentsResponseDataPart,
6188
+ ): string {
6189
+ return JSON.stringify(
6190
+ StreamAgentPartsAgentsResponseDataPart$outboundSchema.parse(
6191
+ streamAgentPartsAgentsResponseDataPart,
6192
+ ),
6193
+ );
6194
+ }
6195
+ export function streamAgentPartsAgentsResponseDataPartFromJSON(
6196
+ jsonString: string,
6197
+ ): SafeParseResult<StreamAgentPartsAgentsResponseDataPart, SDKValidationError> {
6198
+ return safeParse(
6199
+ jsonString,
6200
+ (x) =>
6201
+ StreamAgentPartsAgentsResponseDataPart$inboundSchema.parse(JSON.parse(x)),
6202
+ `Failed to parse 'StreamAgentPartsAgentsResponseDataPart' from JSON`,
6203
+ );
6204
+ }
6205
+
6206
+ /** @internal */
6207
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind$inboundSchema:
6208
+ z.ZodNativeEnum<
6209
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind
6210
+ > = z.nativeEnum(
6211
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind,
6212
+ );
6213
+ /** @internal */
6214
+ export const StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind$outboundSchema:
6215
+ z.ZodNativeEnum<
6216
+ typeof StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind
6217
+ > =
6218
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind$inboundSchema;
6219
+
6220
+ /** @internal */
6221
+ export const StreamAgentPartsAgentsResponseTextPart$inboundSchema: z.ZodType<
6222
+ StreamAgentPartsAgentsResponseTextPart,
6223
+ z.ZodTypeDef,
6224
+ unknown
6225
+ > = z.object({
6226
+ kind:
6227
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind$inboundSchema,
6228
+ text: z.string(),
6229
+ });
6230
+ /** @internal */
6231
+ export type StreamAgentPartsAgentsResponseTextPart$Outbound = {
6232
+ kind: string;
6233
+ text: string;
6234
+ };
6235
+
6236
+ /** @internal */
6237
+ export const StreamAgentPartsAgentsResponseTextPart$outboundSchema: z.ZodType<
6238
+ StreamAgentPartsAgentsResponseTextPart$Outbound,
6239
+ z.ZodTypeDef,
6240
+ StreamAgentPartsAgentsResponseTextPart
6241
+ > = z.object({
6242
+ kind:
6243
+ StreamAgentPartsAgentsResponse200TextEventStreamResponseBodyData4Kind$outboundSchema,
6244
+ text: z.string(),
6245
+ });
6246
+
6247
+ export function streamAgentPartsAgentsResponseTextPartToJSON(
6248
+ streamAgentPartsAgentsResponseTextPart:
6249
+ StreamAgentPartsAgentsResponseTextPart,
6250
+ ): string {
6251
+ return JSON.stringify(
6252
+ StreamAgentPartsAgentsResponseTextPart$outboundSchema.parse(
6253
+ streamAgentPartsAgentsResponseTextPart,
6254
+ ),
6255
+ );
6256
+ }
6257
+ export function streamAgentPartsAgentsResponseTextPartFromJSON(
6258
+ jsonString: string,
6259
+ ): SafeParseResult<StreamAgentPartsAgentsResponseTextPart, SDKValidationError> {
6260
+ return safeParse(
6261
+ jsonString,
6262
+ (x) =>
6263
+ StreamAgentPartsAgentsResponseTextPart$inboundSchema.parse(JSON.parse(x)),
6264
+ `Failed to parse 'StreamAgentPartsAgentsResponseTextPart' from JSON`,
6265
+ );
6266
+ }
6267
+
6268
+ /** @internal */
6269
+ export const StreamAgentDataAgentsResponseParts$inboundSchema: z.ZodType<
6270
+ StreamAgentDataAgentsResponseParts,
6271
+ z.ZodTypeDef,
6272
+ unknown
6273
+ > = z.union([
6274
+ z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$inboundSchema),
6275
+ z.lazy(() => StreamAgentPartsAgentsResponseTextPart$inboundSchema),
6276
+ z.lazy(() => StreamAgentPartsAgentsResponseDataPart$inboundSchema),
6277
+ z.lazy(() => StreamAgentPartsAgentsResponseFilePart$inboundSchema),
6278
+ z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$inboundSchema),
6279
+ ]);
6280
+ /** @internal */
6281
+ export type StreamAgentDataAgentsResponseParts$Outbound =
6282
+ | StreamAgentPartsAgentsResponseToolCallPart$Outbound
6283
+ | StreamAgentPartsAgentsResponseTextPart$Outbound
6284
+ | StreamAgentPartsAgentsResponseDataPart$Outbound
6285
+ | StreamAgentPartsAgentsResponseFilePart$Outbound
6286
+ | StreamAgentPartsAgentsResponseToolResultPart$Outbound;
6287
+
6288
+ /** @internal */
6289
+ export const StreamAgentDataAgentsResponseParts$outboundSchema: z.ZodType<
6290
+ StreamAgentDataAgentsResponseParts$Outbound,
6291
+ z.ZodTypeDef,
6292
+ StreamAgentDataAgentsResponseParts
6293
+ > = z.union([
6294
+ z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$outboundSchema),
6295
+ z.lazy(() => StreamAgentPartsAgentsResponseTextPart$outboundSchema),
6296
+ z.lazy(() => StreamAgentPartsAgentsResponseDataPart$outboundSchema),
6297
+ z.lazy(() => StreamAgentPartsAgentsResponseFilePart$outboundSchema),
6298
+ z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$outboundSchema),
6299
+ ]);
6300
+
6301
+ export function streamAgentDataAgentsResponsePartsToJSON(
6302
+ streamAgentDataAgentsResponseParts: StreamAgentDataAgentsResponseParts,
6303
+ ): string {
6304
+ return JSON.stringify(
6305
+ StreamAgentDataAgentsResponseParts$outboundSchema.parse(
6306
+ streamAgentDataAgentsResponseParts,
6307
+ ),
6308
+ );
6309
+ }
6310
+ export function streamAgentDataAgentsResponsePartsFromJSON(
6311
+ jsonString: string,
6312
+ ): SafeParseResult<StreamAgentDataAgentsResponseParts, SDKValidationError> {
6313
+ return safeParse(
6314
+ jsonString,
6315
+ (x) =>
6316
+ StreamAgentDataAgentsResponseParts$inboundSchema.parse(JSON.parse(x)),
6317
+ `Failed to parse 'StreamAgentDataAgentsResponseParts' from JSON`,
6318
+ );
6319
+ }
6320
+
6321
+ /** @internal */
6322
+ export const DataLastMessageFull$inboundSchema: z.ZodType<
6323
+ DataLastMessageFull,
6324
+ z.ZodTypeDef,
6325
+ unknown
6326
+ > = z.object({
6327
+ messageId: z.string().optional(),
6328
+ role: StreamAgentDataAgentsResponseRole$inboundSchema,
6329
+ parts: z.array(
6330
+ z.union([
6331
+ z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$inboundSchema),
6332
+ z.lazy(() => StreamAgentPartsAgentsResponseTextPart$inboundSchema),
6333
+ z.lazy(() => StreamAgentPartsAgentsResponseDataPart$inboundSchema),
6334
+ z.lazy(() => StreamAgentPartsAgentsResponseFilePart$inboundSchema),
6335
+ z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$inboundSchema),
6336
+ ]),
6337
+ ),
6338
+ metadata: z.record(z.any()).optional(),
6339
+ });
6340
+ /** @internal */
6341
+ export type DataLastMessageFull$Outbound = {
6342
+ messageId?: string | undefined;
6343
+ role: string;
6344
+ parts: Array<
6345
+ | StreamAgentPartsAgentsResponseToolCallPart$Outbound
6346
+ | StreamAgentPartsAgentsResponseTextPart$Outbound
6347
+ | StreamAgentPartsAgentsResponseDataPart$Outbound
6348
+ | StreamAgentPartsAgentsResponseFilePart$Outbound
6349
+ | StreamAgentPartsAgentsResponseToolResultPart$Outbound
6350
+ >;
6351
+ metadata?: { [k: string]: any } | undefined;
6352
+ };
6353
+
6354
+ /** @internal */
6355
+ export const DataLastMessageFull$outboundSchema: z.ZodType<
6356
+ DataLastMessageFull$Outbound,
5354
6357
  z.ZodTypeDef,
5355
- Data5
6358
+ DataLastMessageFull
5356
6359
  > = z.object({
5357
- type: StreamAgentDataAgentsResponse200TextEventStreamType$outboundSchema,
5358
- timestamp: z.string(),
5359
- data: z.lazy(() =>
5360
- StreamAgentDataAgentsResponse200TextEventStreamData$outboundSchema
6360
+ messageId: z.string().optional(),
6361
+ role: StreamAgentDataAgentsResponseRole$outboundSchema,
6362
+ parts: z.array(
6363
+ z.union([
6364
+ z.lazy(() => StreamAgentPartsAgentsResponseToolCallPart$outboundSchema),
6365
+ z.lazy(() => StreamAgentPartsAgentsResponseTextPart$outboundSchema),
6366
+ z.lazy(() => StreamAgentPartsAgentsResponseDataPart$outboundSchema),
6367
+ z.lazy(() => StreamAgentPartsAgentsResponseFilePart$outboundSchema),
6368
+ z.lazy(() => StreamAgentPartsAgentsResponseToolResultPart$outboundSchema),
6369
+ ]),
5361
6370
  ),
6371
+ metadata: z.record(z.any()).optional(),
5362
6372
  });
5363
6373
 
5364
- export function data5ToJSON(data5: Data5): string {
5365
- return JSON.stringify(Data5$outboundSchema.parse(data5));
6374
+ export function dataLastMessageFullToJSON(
6375
+ dataLastMessageFull: DataLastMessageFull,
6376
+ ): string {
6377
+ return JSON.stringify(
6378
+ DataLastMessageFull$outboundSchema.parse(dataLastMessageFull),
6379
+ );
5366
6380
  }
5367
- export function data5FromJSON(
6381
+ export function dataLastMessageFullFromJSON(
5368
6382
  jsonString: string,
5369
- ): SafeParseResult<Data5, SDKValidationError> {
6383
+ ): SafeParseResult<DataLastMessageFull, SDKValidationError> {
5370
6384
  return safeParse(
5371
6385
  jsonString,
5372
- (x) => Data5$inboundSchema.parse(JSON.parse(x)),
5373
- `Failed to parse 'Data5' from JSON`,
6386
+ (x) => DataLastMessageFull$inboundSchema.parse(JSON.parse(x)),
6387
+ `Failed to parse 'DataLastMessageFull' from JSON`,
5374
6388
  );
5375
6389
  }
5376
6390
 
5377
- /** @internal */
5378
- export const StreamAgentDataAgentsResponse200Type$inboundSchema:
5379
- z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Type> = z.nativeEnum(
5380
- StreamAgentDataAgentsResponse200Type,
5381
- );
5382
- /** @internal */
5383
- export const StreamAgentDataAgentsResponse200Type$outboundSchema:
5384
- z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Type> =
5385
- StreamAgentDataAgentsResponse200Type$inboundSchema;
5386
-
5387
6391
  /** @internal */
5388
6392
  export const DataFinishReason$inboundSchema: z.ZodNativeEnum<
5389
6393
  typeof DataFinishReason
@@ -5496,6 +6500,221 @@ export function dataPendingToolCallsFromJSON(
5496
6500
  );
5497
6501
  }
5498
6502
 
6503
+ /** @internal */
6504
+ export const StreamAgentDataAgentsPromptTokensDetails$inboundSchema: z.ZodType<
6505
+ StreamAgentDataAgentsPromptTokensDetails,
6506
+ z.ZodTypeDef,
6507
+ unknown
6508
+ > = z.object({
6509
+ cached_tokens: z.nullable(z.number().int()).optional(),
6510
+ audio_tokens: z.nullable(z.number().int()).optional(),
6511
+ }).transform((v) => {
6512
+ return remap$(v, {
6513
+ "cached_tokens": "cachedTokens",
6514
+ "audio_tokens": "audioTokens",
6515
+ });
6516
+ });
6517
+ /** @internal */
6518
+ export type StreamAgentDataAgentsPromptTokensDetails$Outbound = {
6519
+ cached_tokens?: number | null | undefined;
6520
+ audio_tokens?: number | null | undefined;
6521
+ };
6522
+
6523
+ /** @internal */
6524
+ export const StreamAgentDataAgentsPromptTokensDetails$outboundSchema: z.ZodType<
6525
+ StreamAgentDataAgentsPromptTokensDetails$Outbound,
6526
+ z.ZodTypeDef,
6527
+ StreamAgentDataAgentsPromptTokensDetails
6528
+ > = z.object({
6529
+ cachedTokens: z.nullable(z.number().int()).optional(),
6530
+ audioTokens: z.nullable(z.number().int()).optional(),
6531
+ }).transform((v) => {
6532
+ return remap$(v, {
6533
+ cachedTokens: "cached_tokens",
6534
+ audioTokens: "audio_tokens",
6535
+ });
6536
+ });
6537
+
6538
+ export function streamAgentDataAgentsPromptTokensDetailsToJSON(
6539
+ streamAgentDataAgentsPromptTokensDetails:
6540
+ StreamAgentDataAgentsPromptTokensDetails,
6541
+ ): string {
6542
+ return JSON.stringify(
6543
+ StreamAgentDataAgentsPromptTokensDetails$outboundSchema.parse(
6544
+ streamAgentDataAgentsPromptTokensDetails,
6545
+ ),
6546
+ );
6547
+ }
6548
+ export function streamAgentDataAgentsPromptTokensDetailsFromJSON(
6549
+ jsonString: string,
6550
+ ): SafeParseResult<
6551
+ StreamAgentDataAgentsPromptTokensDetails,
6552
+ SDKValidationError
6553
+ > {
6554
+ return safeParse(
6555
+ jsonString,
6556
+ (x) =>
6557
+ StreamAgentDataAgentsPromptTokensDetails$inboundSchema.parse(
6558
+ JSON.parse(x),
6559
+ ),
6560
+ `Failed to parse 'StreamAgentDataAgentsPromptTokensDetails' from JSON`,
6561
+ );
6562
+ }
6563
+
6564
+ /** @internal */
6565
+ export const StreamAgentDataAgentsCompletionTokensDetails$inboundSchema:
6566
+ z.ZodType<
6567
+ StreamAgentDataAgentsCompletionTokensDetails,
6568
+ z.ZodTypeDef,
6569
+ unknown
6570
+ > = z.object({
6571
+ reasoning_tokens: z.nullable(z.number()).optional(),
6572
+ accepted_prediction_tokens: z.nullable(z.number()).optional(),
6573
+ rejected_prediction_tokens: z.nullable(z.number()).optional(),
6574
+ audio_tokens: z.nullable(z.number().int()).optional(),
6575
+ }).transform((v) => {
6576
+ return remap$(v, {
6577
+ "reasoning_tokens": "reasoningTokens",
6578
+ "accepted_prediction_tokens": "acceptedPredictionTokens",
6579
+ "rejected_prediction_tokens": "rejectedPredictionTokens",
6580
+ "audio_tokens": "audioTokens",
6581
+ });
6582
+ });
6583
+ /** @internal */
6584
+ export type StreamAgentDataAgentsCompletionTokensDetails$Outbound = {
6585
+ reasoning_tokens?: number | null | undefined;
6586
+ accepted_prediction_tokens?: number | null | undefined;
6587
+ rejected_prediction_tokens?: number | null | undefined;
6588
+ audio_tokens?: number | null | undefined;
6589
+ };
6590
+
6591
+ /** @internal */
6592
+ export const StreamAgentDataAgentsCompletionTokensDetails$outboundSchema:
6593
+ z.ZodType<
6594
+ StreamAgentDataAgentsCompletionTokensDetails$Outbound,
6595
+ z.ZodTypeDef,
6596
+ StreamAgentDataAgentsCompletionTokensDetails
6597
+ > = z.object({
6598
+ reasoningTokens: z.nullable(z.number()).optional(),
6599
+ acceptedPredictionTokens: z.nullable(z.number()).optional(),
6600
+ rejectedPredictionTokens: z.nullable(z.number()).optional(),
6601
+ audioTokens: z.nullable(z.number().int()).optional(),
6602
+ }).transform((v) => {
6603
+ return remap$(v, {
6604
+ reasoningTokens: "reasoning_tokens",
6605
+ acceptedPredictionTokens: "accepted_prediction_tokens",
6606
+ rejectedPredictionTokens: "rejected_prediction_tokens",
6607
+ audioTokens: "audio_tokens",
6608
+ });
6609
+ });
6610
+
6611
+ export function streamAgentDataAgentsCompletionTokensDetailsToJSON(
6612
+ streamAgentDataAgentsCompletionTokensDetails:
6613
+ StreamAgentDataAgentsCompletionTokensDetails,
6614
+ ): string {
6615
+ return JSON.stringify(
6616
+ StreamAgentDataAgentsCompletionTokensDetails$outboundSchema.parse(
6617
+ streamAgentDataAgentsCompletionTokensDetails,
6618
+ ),
6619
+ );
6620
+ }
6621
+ export function streamAgentDataAgentsCompletionTokensDetailsFromJSON(
6622
+ jsonString: string,
6623
+ ): SafeParseResult<
6624
+ StreamAgentDataAgentsCompletionTokensDetails,
6625
+ SDKValidationError
6626
+ > {
6627
+ return safeParse(
6628
+ jsonString,
6629
+ (x) =>
6630
+ StreamAgentDataAgentsCompletionTokensDetails$inboundSchema.parse(
6631
+ JSON.parse(x),
6632
+ ),
6633
+ `Failed to parse 'StreamAgentDataAgentsCompletionTokensDetails' from JSON`,
6634
+ );
6635
+ }
6636
+
6637
+ /** @internal */
6638
+ export const StreamAgentDataAgentsUsage$inboundSchema: z.ZodType<
6639
+ StreamAgentDataAgentsUsage,
6640
+ z.ZodTypeDef,
6641
+ unknown
6642
+ > = z.object({
6643
+ completion_tokens: z.number().optional(),
6644
+ prompt_tokens: z.number().optional(),
6645
+ total_tokens: z.number().optional(),
6646
+ prompt_tokens_details: z.nullable(
6647
+ z.lazy(() => StreamAgentDataAgentsPromptTokensDetails$inboundSchema),
6648
+ ).optional(),
6649
+ completion_tokens_details: z.nullable(
6650
+ z.lazy(() => StreamAgentDataAgentsCompletionTokensDetails$inboundSchema),
6651
+ ).optional(),
6652
+ }).transform((v) => {
6653
+ return remap$(v, {
6654
+ "completion_tokens": "completionTokens",
6655
+ "prompt_tokens": "promptTokens",
6656
+ "total_tokens": "totalTokens",
6657
+ "prompt_tokens_details": "promptTokensDetails",
6658
+ "completion_tokens_details": "completionTokensDetails",
6659
+ });
6660
+ });
6661
+ /** @internal */
6662
+ export type StreamAgentDataAgentsUsage$Outbound = {
6663
+ completion_tokens?: number | undefined;
6664
+ prompt_tokens?: number | undefined;
6665
+ total_tokens?: number | undefined;
6666
+ prompt_tokens_details?:
6667
+ | StreamAgentDataAgentsPromptTokensDetails$Outbound
6668
+ | null
6669
+ | undefined;
6670
+ completion_tokens_details?:
6671
+ | StreamAgentDataAgentsCompletionTokensDetails$Outbound
6672
+ | null
6673
+ | undefined;
6674
+ };
6675
+
6676
+ /** @internal */
6677
+ export const StreamAgentDataAgentsUsage$outboundSchema: z.ZodType<
6678
+ StreamAgentDataAgentsUsage$Outbound,
6679
+ z.ZodTypeDef,
6680
+ StreamAgentDataAgentsUsage
6681
+ > = z.object({
6682
+ completionTokens: z.number().optional(),
6683
+ promptTokens: z.number().optional(),
6684
+ totalTokens: z.number().optional(),
6685
+ promptTokensDetails: z.nullable(
6686
+ z.lazy(() => StreamAgentDataAgentsPromptTokensDetails$outboundSchema),
6687
+ ).optional(),
6688
+ completionTokensDetails: z.nullable(
6689
+ z.lazy(() => StreamAgentDataAgentsCompletionTokensDetails$outboundSchema),
6690
+ ).optional(),
6691
+ }).transform((v) => {
6692
+ return remap$(v, {
6693
+ completionTokens: "completion_tokens",
6694
+ promptTokens: "prompt_tokens",
6695
+ totalTokens: "total_tokens",
6696
+ promptTokensDetails: "prompt_tokens_details",
6697
+ completionTokensDetails: "completion_tokens_details",
6698
+ });
6699
+ });
6700
+
6701
+ export function streamAgentDataAgentsUsageToJSON(
6702
+ streamAgentDataAgentsUsage: StreamAgentDataAgentsUsage,
6703
+ ): string {
6704
+ return JSON.stringify(
6705
+ StreamAgentDataAgentsUsage$outboundSchema.parse(streamAgentDataAgentsUsage),
6706
+ );
6707
+ }
6708
+ export function streamAgentDataAgentsUsageFromJSON(
6709
+ jsonString: string,
6710
+ ): SafeParseResult<StreamAgentDataAgentsUsage, SDKValidationError> {
6711
+ return safeParse(
6712
+ jsonString,
6713
+ (x) => StreamAgentDataAgentsUsage$inboundSchema.parse(JSON.parse(x)),
6714
+ `Failed to parse 'StreamAgentDataAgentsUsage' from JSON`,
6715
+ );
6716
+ }
6717
+
5499
6718
  /** @internal */
5500
6719
  export const StreamAgentDataAgentsResponse200Data$inboundSchema: z.ZodType<
5501
6720
  StreamAgentDataAgentsResponse200Data,
@@ -5503,12 +6722,16 @@ export const StreamAgentDataAgentsResponse200Data$inboundSchema: z.ZodType<
5503
6722
  unknown
5504
6723
  > = z.object({
5505
6724
  last_message: z.string(),
6725
+ last_message_full: z.lazy(() => DataLastMessageFull$inboundSchema).optional(),
5506
6726
  finish_reason: DataFinishReason$inboundSchema,
5507
6727
  pending_tool_calls: z.array(z.lazy(() => DataPendingToolCalls$inboundSchema))
5508
6728
  .optional(),
6729
+ usage: z.lazy(() => StreamAgentDataAgentsUsage$inboundSchema).optional(),
6730
+ responseId: z.string().optional(),
5509
6731
  }).transform((v) => {
5510
6732
  return remap$(v, {
5511
6733
  "last_message": "lastMessage",
6734
+ "last_message_full": "lastMessageFull",
5512
6735
  "finish_reason": "finishReason",
5513
6736
  "pending_tool_calls": "pendingToolCalls",
5514
6737
  });
@@ -5516,8 +6739,11 @@ export const StreamAgentDataAgentsResponse200Data$inboundSchema: z.ZodType<
5516
6739
  /** @internal */
5517
6740
  export type StreamAgentDataAgentsResponse200Data$Outbound = {
5518
6741
  last_message: string;
6742
+ last_message_full?: DataLastMessageFull$Outbound | undefined;
5519
6743
  finish_reason: string;
5520
6744
  pending_tool_calls?: Array<DataPendingToolCalls$Outbound> | undefined;
6745
+ usage?: StreamAgentDataAgentsUsage$Outbound | undefined;
6746
+ responseId?: string | undefined;
5521
6747
  };
5522
6748
 
5523
6749
  /** @internal */
@@ -5527,12 +6753,16 @@ export const StreamAgentDataAgentsResponse200Data$outboundSchema: z.ZodType<
5527
6753
  StreamAgentDataAgentsResponse200Data
5528
6754
  > = z.object({
5529
6755
  lastMessage: z.string(),
6756
+ lastMessageFull: z.lazy(() => DataLastMessageFull$outboundSchema).optional(),
5530
6757
  finishReason: DataFinishReason$outboundSchema,
5531
6758
  pendingToolCalls: z.array(z.lazy(() => DataPendingToolCalls$outboundSchema))
5532
6759
  .optional(),
6760
+ usage: z.lazy(() => StreamAgentDataAgentsUsage$outboundSchema).optional(),
6761
+ responseId: z.string().optional(),
5533
6762
  }).transform((v) => {
5534
6763
  return remap$(v, {
5535
6764
  lastMessage: "last_message",
6765
+ lastMessageFull: "last_message_full",
5536
6766
  finishReason: "finish_reason",
5537
6767
  pendingToolCalls: "pending_tool_calls",
5538
6768
  });
@@ -6382,14 +7612,13 @@ export function streamAgentDataToolCallsFromJSON(
6382
7612
  }
6383
7613
 
6384
7614
  /** @internal */
6385
- export const StreamAgentDataAgentsResponse200Role$inboundSchema:
6386
- z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Role> = z.nativeEnum(
6387
- StreamAgentDataAgentsResponse200Role,
6388
- );
7615
+ export const StreamAgentDataAgentsResponse200TextEventStreamRole$inboundSchema:
7616
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200TextEventStreamRole> =
7617
+ z.nativeEnum(StreamAgentDataAgentsResponse200TextEventStreamRole);
6389
7618
  /** @internal */
6390
- export const StreamAgentDataAgentsResponse200Role$outboundSchema:
6391
- z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200Role> =
6392
- StreamAgentDataAgentsResponse200Role$inboundSchema;
7619
+ export const StreamAgentDataAgentsResponse200TextEventStreamRole$outboundSchema:
7620
+ z.ZodNativeEnum<typeof StreamAgentDataAgentsResponse200TextEventStreamRole> =
7621
+ StreamAgentDataAgentsResponse200TextEventStreamRole$inboundSchema;
6393
7622
 
6394
7623
  /** @internal */
6395
7624
  export const StreamAgentDataAudio$inboundSchema: z.ZodType<
@@ -6457,7 +7686,8 @@ export const StreamAgentDataAgentsMessage$inboundSchema: z.ZodType<
6457
7686
  refusal: z.nullable(z.string()).optional(),
6458
7687
  tool_calls: z.array(z.lazy(() => StreamAgentDataToolCalls$inboundSchema))
6459
7688
  .optional(),
6460
- role: StreamAgentDataAgentsResponse200Role$inboundSchema.optional(),
7689
+ role: StreamAgentDataAgentsResponse200TextEventStreamRole$inboundSchema
7690
+ .optional(),
6461
7691
  reasoning: z.nullable(z.string()).optional(),
6462
7692
  reasoning_signature: z.nullable(z.string()).optional(),
6463
7693
  redacted_reasoning: z.string().optional(),
@@ -6492,7 +7722,8 @@ export const StreamAgentDataAgentsMessage$outboundSchema: z.ZodType<
6492
7722
  refusal: z.nullable(z.string()).optional(),
6493
7723
  toolCalls: z.array(z.lazy(() => StreamAgentDataToolCalls$outboundSchema))
6494
7724
  .optional(),
6495
- role: StreamAgentDataAgentsResponse200Role$outboundSchema.optional(),
7725
+ role: StreamAgentDataAgentsResponse200TextEventStreamRole$outboundSchema
7726
+ .optional(),
6496
7727
  reasoning: z.nullable(z.string()).optional(),
6497
7728
  reasoningSignature: z.nullable(z.string()).optional(),
6498
7729
  redactedReasoning: z.string().optional(),
@@ -6823,6 +8054,208 @@ export function dataChoiceFromJSON(
6823
8054
  );
6824
8055
  }
6825
8056
 
8057
+ /** @internal */
8058
+ export const StreamAgentDataPromptTokensDetails$inboundSchema: z.ZodType<
8059
+ StreamAgentDataPromptTokensDetails,
8060
+ z.ZodTypeDef,
8061
+ unknown
8062
+ > = z.object({
8063
+ cached_tokens: z.nullable(z.number().int()).optional(),
8064
+ audio_tokens: z.nullable(z.number().int()).optional(),
8065
+ }).transform((v) => {
8066
+ return remap$(v, {
8067
+ "cached_tokens": "cachedTokens",
8068
+ "audio_tokens": "audioTokens",
8069
+ });
8070
+ });
8071
+ /** @internal */
8072
+ export type StreamAgentDataPromptTokensDetails$Outbound = {
8073
+ cached_tokens?: number | null | undefined;
8074
+ audio_tokens?: number | null | undefined;
8075
+ };
8076
+
8077
+ /** @internal */
8078
+ export const StreamAgentDataPromptTokensDetails$outboundSchema: z.ZodType<
8079
+ StreamAgentDataPromptTokensDetails$Outbound,
8080
+ z.ZodTypeDef,
8081
+ StreamAgentDataPromptTokensDetails
8082
+ > = z.object({
8083
+ cachedTokens: z.nullable(z.number().int()).optional(),
8084
+ audioTokens: z.nullable(z.number().int()).optional(),
8085
+ }).transform((v) => {
8086
+ return remap$(v, {
8087
+ cachedTokens: "cached_tokens",
8088
+ audioTokens: "audio_tokens",
8089
+ });
8090
+ });
8091
+
8092
+ export function streamAgentDataPromptTokensDetailsToJSON(
8093
+ streamAgentDataPromptTokensDetails: StreamAgentDataPromptTokensDetails,
8094
+ ): string {
8095
+ return JSON.stringify(
8096
+ StreamAgentDataPromptTokensDetails$outboundSchema.parse(
8097
+ streamAgentDataPromptTokensDetails,
8098
+ ),
8099
+ );
8100
+ }
8101
+ export function streamAgentDataPromptTokensDetailsFromJSON(
8102
+ jsonString: string,
8103
+ ): SafeParseResult<StreamAgentDataPromptTokensDetails, SDKValidationError> {
8104
+ return safeParse(
8105
+ jsonString,
8106
+ (x) =>
8107
+ StreamAgentDataPromptTokensDetails$inboundSchema.parse(JSON.parse(x)),
8108
+ `Failed to parse 'StreamAgentDataPromptTokensDetails' from JSON`,
8109
+ );
8110
+ }
8111
+
8112
+ /** @internal */
8113
+ export const StreamAgentDataCompletionTokensDetails$inboundSchema: z.ZodType<
8114
+ StreamAgentDataCompletionTokensDetails,
8115
+ z.ZodTypeDef,
8116
+ unknown
8117
+ > = z.object({
8118
+ reasoning_tokens: z.nullable(z.number()).optional(),
8119
+ accepted_prediction_tokens: z.nullable(z.number()).optional(),
8120
+ rejected_prediction_tokens: z.nullable(z.number()).optional(),
8121
+ audio_tokens: z.nullable(z.number().int()).optional(),
8122
+ }).transform((v) => {
8123
+ return remap$(v, {
8124
+ "reasoning_tokens": "reasoningTokens",
8125
+ "accepted_prediction_tokens": "acceptedPredictionTokens",
8126
+ "rejected_prediction_tokens": "rejectedPredictionTokens",
8127
+ "audio_tokens": "audioTokens",
8128
+ });
8129
+ });
8130
+ /** @internal */
8131
+ export type StreamAgentDataCompletionTokensDetails$Outbound = {
8132
+ reasoning_tokens?: number | null | undefined;
8133
+ accepted_prediction_tokens?: number | null | undefined;
8134
+ rejected_prediction_tokens?: number | null | undefined;
8135
+ audio_tokens?: number | null | undefined;
8136
+ };
8137
+
8138
+ /** @internal */
8139
+ export const StreamAgentDataCompletionTokensDetails$outboundSchema: z.ZodType<
8140
+ StreamAgentDataCompletionTokensDetails$Outbound,
8141
+ z.ZodTypeDef,
8142
+ StreamAgentDataCompletionTokensDetails
8143
+ > = z.object({
8144
+ reasoningTokens: z.nullable(z.number()).optional(),
8145
+ acceptedPredictionTokens: z.nullable(z.number()).optional(),
8146
+ rejectedPredictionTokens: z.nullable(z.number()).optional(),
8147
+ audioTokens: z.nullable(z.number().int()).optional(),
8148
+ }).transform((v) => {
8149
+ return remap$(v, {
8150
+ reasoningTokens: "reasoning_tokens",
8151
+ acceptedPredictionTokens: "accepted_prediction_tokens",
8152
+ rejectedPredictionTokens: "rejected_prediction_tokens",
8153
+ audioTokens: "audio_tokens",
8154
+ });
8155
+ });
8156
+
8157
+ export function streamAgentDataCompletionTokensDetailsToJSON(
8158
+ streamAgentDataCompletionTokensDetails:
8159
+ StreamAgentDataCompletionTokensDetails,
8160
+ ): string {
8161
+ return JSON.stringify(
8162
+ StreamAgentDataCompletionTokensDetails$outboundSchema.parse(
8163
+ streamAgentDataCompletionTokensDetails,
8164
+ ),
8165
+ );
8166
+ }
8167
+ export function streamAgentDataCompletionTokensDetailsFromJSON(
8168
+ jsonString: string,
8169
+ ): SafeParseResult<StreamAgentDataCompletionTokensDetails, SDKValidationError> {
8170
+ return safeParse(
8171
+ jsonString,
8172
+ (x) =>
8173
+ StreamAgentDataCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)),
8174
+ `Failed to parse 'StreamAgentDataCompletionTokensDetails' from JSON`,
8175
+ );
8176
+ }
8177
+
8178
+ /** @internal */
8179
+ export const StreamAgentDataUsage$inboundSchema: z.ZodType<
8180
+ StreamAgentDataUsage,
8181
+ z.ZodTypeDef,
8182
+ unknown
8183
+ > = z.object({
8184
+ completion_tokens: z.number().optional(),
8185
+ prompt_tokens: z.number().optional(),
8186
+ total_tokens: z.number().optional(),
8187
+ prompt_tokens_details: z.nullable(
8188
+ z.lazy(() => StreamAgentDataPromptTokensDetails$inboundSchema),
8189
+ ).optional(),
8190
+ completion_tokens_details: z.nullable(
8191
+ z.lazy(() => StreamAgentDataCompletionTokensDetails$inboundSchema),
8192
+ ).optional(),
8193
+ }).transform((v) => {
8194
+ return remap$(v, {
8195
+ "completion_tokens": "completionTokens",
8196
+ "prompt_tokens": "promptTokens",
8197
+ "total_tokens": "totalTokens",
8198
+ "prompt_tokens_details": "promptTokensDetails",
8199
+ "completion_tokens_details": "completionTokensDetails",
8200
+ });
8201
+ });
8202
+ /** @internal */
8203
+ export type StreamAgentDataUsage$Outbound = {
8204
+ completion_tokens?: number | undefined;
8205
+ prompt_tokens?: number | undefined;
8206
+ total_tokens?: number | undefined;
8207
+ prompt_tokens_details?:
8208
+ | StreamAgentDataPromptTokensDetails$Outbound
8209
+ | null
8210
+ | undefined;
8211
+ completion_tokens_details?:
8212
+ | StreamAgentDataCompletionTokensDetails$Outbound
8213
+ | null
8214
+ | undefined;
8215
+ };
8216
+
8217
+ /** @internal */
8218
+ export const StreamAgentDataUsage$outboundSchema: z.ZodType<
8219
+ StreamAgentDataUsage$Outbound,
8220
+ z.ZodTypeDef,
8221
+ StreamAgentDataUsage
8222
+ > = z.object({
8223
+ completionTokens: z.number().optional(),
8224
+ promptTokens: z.number().optional(),
8225
+ totalTokens: z.number().optional(),
8226
+ promptTokensDetails: z.nullable(
8227
+ z.lazy(() => StreamAgentDataPromptTokensDetails$outboundSchema),
8228
+ ).optional(),
8229
+ completionTokensDetails: z.nullable(
8230
+ z.lazy(() => StreamAgentDataCompletionTokensDetails$outboundSchema),
8231
+ ).optional(),
8232
+ }).transform((v) => {
8233
+ return remap$(v, {
8234
+ completionTokens: "completion_tokens",
8235
+ promptTokens: "prompt_tokens",
8236
+ totalTokens: "total_tokens",
8237
+ promptTokensDetails: "prompt_tokens_details",
8238
+ completionTokensDetails: "completion_tokens_details",
8239
+ });
8240
+ });
8241
+
8242
+ export function streamAgentDataUsageToJSON(
8243
+ streamAgentDataUsage: StreamAgentDataUsage,
8244
+ ): string {
8245
+ return JSON.stringify(
8246
+ StreamAgentDataUsage$outboundSchema.parse(streamAgentDataUsage),
8247
+ );
8248
+ }
8249
+ export function streamAgentDataUsageFromJSON(
8250
+ jsonString: string,
8251
+ ): SafeParseResult<StreamAgentDataUsage, SDKValidationError> {
8252
+ return safeParse(
8253
+ jsonString,
8254
+ (x) => StreamAgentDataUsage$inboundSchema.parse(JSON.parse(x)),
8255
+ `Failed to parse 'StreamAgentDataUsage' from JSON`,
8256
+ );
8257
+ }
8258
+
6826
8259
  /** @internal */
6827
8260
  export const StreamAgentDataAgentsResponseData$inboundSchema: z.ZodType<
6828
8261
  StreamAgentDataAgentsResponseData,
@@ -6837,6 +8270,8 @@ export const StreamAgentDataAgentsResponseData$inboundSchema: z.ZodType<
6837
8270
  choiceIndex: z.number().optional(),
6838
8271
  iteration: z.number(),
6839
8272
  accumulated_execution_time: z.number(),
8273
+ responseId: z.string().optional(),
8274
+ usage: z.lazy(() => StreamAgentDataUsage$inboundSchema).optional(),
6840
8275
  }).transform((v) => {
6841
8276
  return remap$(v, {
6842
8277
  "agent_id": "agentId",
@@ -6852,6 +8287,8 @@ export type StreamAgentDataAgentsResponseData$Outbound = {
6852
8287
  choiceIndex?: number | undefined;
6853
8288
  iteration: number;
6854
8289
  accumulated_execution_time: number;
8290
+ responseId?: string | undefined;
8291
+ usage?: StreamAgentDataUsage$Outbound | undefined;
6855
8292
  };
6856
8293
 
6857
8294
  /** @internal */
@@ -6868,6 +8305,8 @@ export const StreamAgentDataAgentsResponseData$outboundSchema: z.ZodType<
6868
8305
  choiceIndex: z.number().optional(),
6869
8306
  iteration: z.number(),
6870
8307
  accumulatedExecutionTime: z.number(),
8308
+ responseId: z.string().optional(),
8309
+ usage: z.lazy(() => StreamAgentDataUsage$outboundSchema).optional(),
6871
8310
  }).transform((v) => {
6872
8311
  return remap$(v, {
6873
8312
  agentId: "agent_id",
@@ -7792,7 +9231,7 @@ export const StreamAgentDataSettings$inboundSchema: z.ZodType<
7792
9231
  z.ZodTypeDef,
7793
9232
  unknown
7794
9233
  > = z.object({
7795
- max_iterations: z.number().int().default(15),
9234
+ max_iterations: z.number().int().default(100),
7796
9235
  max_execution_time: z.number().int().default(300),
7797
9236
  tool_approval_required: StreamAgentDataToolApprovalRequired$inboundSchema
7798
9237
  .default("respect_tool"),
@@ -7824,7 +9263,7 @@ export const StreamAgentDataSettings$outboundSchema: z.ZodType<
7824
9263
  z.ZodTypeDef,
7825
9264
  StreamAgentDataSettings
7826
9265
  > = z.object({
7827
- maxIterations: z.number().int().default(15),
9266
+ maxIterations: z.number().int().default(100),
7828
9267
  maxExecutionTime: z.number().int().default(300),
7829
9268
  toolApprovalRequired: StreamAgentDataToolApprovalRequired$outboundSchema
7830
9269
  .default("respect_tool"),
@@ -7876,6 +9315,7 @@ export const StreamAgentDataAgentsData$inboundSchema: z.ZodType<
7876
9315
  tool_execution_id: z.string().optional(),
7877
9316
  is_continuation: z.boolean().optional(),
7878
9317
  stream: z.boolean().optional(),
9318
+ responseId: z.string().optional(),
7879
9319
  }).transform((v) => {
7880
9320
  return remap$(v, {
7881
9321
  "integration_id": "integrationId",
@@ -7900,6 +9340,7 @@ export type StreamAgentDataAgentsData$Outbound = {
7900
9340
  tool_execution_id?: string | undefined;
7901
9341
  is_continuation?: boolean | undefined;
7902
9342
  stream?: boolean | undefined;
9343
+ responseId?: string | undefined;
7903
9344
  };
7904
9345
 
7905
9346
  /** @internal */
@@ -7920,6 +9361,7 @@ export const StreamAgentDataAgentsData$outboundSchema: z.ZodType<
7920
9361
  toolExecutionId: z.string().optional(),
7921
9362
  isContinuation: z.boolean().optional(),
7922
9363
  stream: z.boolean().optional(),
9364
+ responseId: z.string().optional(),
7923
9365
  }).transform((v) => {
7924
9366
  return remap$(v, {
7925
9367
  integrationId: "integration_id",