@orq-ai/node 4.1.0-rc.45 → 4.1.0-rc.50

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 (199) hide show
  1. package/README.md +31 -24
  2. package/bin/mcp-server.js +3439 -531
  3. package/bin/mcp-server.js.map +65 -58
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/routerChatCompletions.d.ts +23 -0
  6. package/funcs/routerChatCompletions.d.ts.map +1 -0
  7. package/funcs/routerChatCompletions.js +121 -0
  8. package/funcs/routerChatCompletions.js.map +1 -0
  9. package/funcs/routerImagesGenerate.d.ts +17 -0
  10. package/funcs/routerImagesGenerate.d.ts.map +1 -0
  11. package/funcs/routerImagesGenerate.js +114 -0
  12. package/funcs/routerImagesGenerate.js.map +1 -0
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +3 -3
  15. package/lib/config.js +3 -3
  16. package/lib/event-streams.js +1 -1
  17. package/lib/event-streams.js.map +1 -1
  18. package/mcp-server/mcp-server.js +1 -1
  19. package/mcp-server/server.d.ts.map +1 -1
  20. package/mcp-server/server.js +5 -1
  21. package/mcp-server/server.js.map +1 -1
  22. package/mcp-server/tools/routerChatCompletions.d.ts +8 -0
  23. package/mcp-server/tools/routerChatCompletions.d.ts.map +1 -0
  24. package/mcp-server/tools/routerChatCompletions.js +64 -0
  25. package/mcp-server/tools/routerChatCompletions.js.map +1 -0
  26. package/mcp-server/tools/routerImagesGenerate.d.ts +8 -0
  27. package/mcp-server/tools/routerImagesGenerate.d.ts.map +1 -0
  28. package/mcp-server/tools/routerImagesGenerate.js +64 -0
  29. package/mcp-server/tools/routerImagesGenerate.js.map +1 -0
  30. package/models/components/conversationresponse.js +2 -2
  31. package/models/components/index.d.ts +1 -0
  32. package/models/components/index.d.ts.map +1 -1
  33. package/models/components/index.js +1 -0
  34. package/models/components/index.js.map +1 -1
  35. package/models/components/partdoneevent.js +2 -2
  36. package/models/components/publiccontact.d.ts +52 -0
  37. package/models/components/publiccontact.d.ts.map +1 -0
  38. package/models/components/publiccontact.js +79 -0
  39. package/models/components/publiccontact.js.map +1 -0
  40. package/models/components/reasoningpart.js +2 -2
  41. package/models/operations/createagentrequest.d.ts +280 -36
  42. package/models/operations/createagentrequest.d.ts.map +1 -1
  43. package/models/operations/createagentrequest.js +308 -51
  44. package/models/operations/createagentrequest.js.map +1 -1
  45. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  46. package/models/operations/createagentresponserequest.js +3 -1
  47. package/models/operations/createagentresponserequest.js.map +1 -1
  48. package/models/operations/createbudget.js +2 -2
  49. package/models/operations/createchatcompletion.d.ts +3152 -0
  50. package/models/operations/createchatcompletion.d.ts.map +1 -0
  51. package/models/operations/createchatcompletion.js +3398 -0
  52. package/models/operations/createchatcompletion.js.map +1 -0
  53. package/models/operations/createcontact.js +2 -2
  54. package/models/operations/createconversation.js +2 -2
  55. package/models/operations/createdataset.js +2 -2
  56. package/models/operations/createdatasetitem.js +8 -8
  57. package/models/operations/createdatasource.js +2 -2
  58. package/models/operations/createeval.js +28 -28
  59. package/models/operations/createimage.d.ts +433 -0
  60. package/models/operations/createimage.d.ts.map +1 -0
  61. package/models/operations/createimage.js +455 -0
  62. package/models/operations/createimage.js.map +1 -0
  63. package/models/operations/creatememory.d.ts +1 -1
  64. package/models/operations/createtool.js +12 -12
  65. package/models/operations/deploymentstream.d.ts.map +1 -1
  66. package/models/operations/deploymentstream.js +3 -1
  67. package/models/operations/deploymentstream.js.map +1 -1
  68. package/models/operations/fileget.js +2 -2
  69. package/models/operations/filelist.js +2 -2
  70. package/models/operations/fileupload.js +2 -2
  71. package/models/operations/generateconversationname.js +2 -2
  72. package/models/operations/getallprompts.d.ts +8 -8
  73. package/models/operations/getallprompts.d.ts.map +1 -1
  74. package/models/operations/getallprompts.js +11 -12
  75. package/models/operations/getallprompts.js.map +1 -1
  76. package/models/operations/getalltools.js +12 -12
  77. package/models/operations/getbudget.js +2 -2
  78. package/models/operations/getevals.js +28 -28
  79. package/models/operations/index.d.ts +2 -0
  80. package/models/operations/index.d.ts.map +1 -1
  81. package/models/operations/index.js +2 -0
  82. package/models/operations/index.js.map +1 -1
  83. package/models/operations/invokeeval.d.ts +5 -5
  84. package/models/operations/invokeeval.d.ts.map +1 -1
  85. package/models/operations/invokeeval.js +7 -7
  86. package/models/operations/invokeeval.js.map +1 -1
  87. package/models/operations/listagents.d.ts +122 -0
  88. package/models/operations/listagents.d.ts.map +1 -1
  89. package/models/operations/listagents.js +129 -3
  90. package/models/operations/listagents.js.map +1 -1
  91. package/models/operations/listbudgets.js +2 -2
  92. package/models/operations/listcontacts.js +2 -2
  93. package/models/operations/listdatasetdatapoints.js +8 -8
  94. package/models/operations/listdatasets.js +2 -2
  95. package/models/operations/listdatasources.js +2 -2
  96. package/models/operations/retrieveagentrequest.d.ts +122 -0
  97. package/models/operations/retrieveagentrequest.d.ts.map +1 -1
  98. package/models/operations/retrieveagentrequest.js +128 -3
  99. package/models/operations/retrieveagentrequest.js.map +1 -1
  100. package/models/operations/retrievecontact.js +2 -2
  101. package/models/operations/retrieveconversation.js +2 -2
  102. package/models/operations/retrievedatapoint.js +8 -8
  103. package/models/operations/retrievedataset.js +2 -2
  104. package/models/operations/retrievedatasource.js +2 -2
  105. package/models/operations/retrievetool.js +12 -12
  106. package/models/operations/runagent.d.ts +122 -0
  107. package/models/operations/runagent.d.ts.map +1 -1
  108. package/models/operations/runagent.js +132 -7
  109. package/models/operations/runagent.js.map +1 -1
  110. package/models/operations/streamrunagent.d.ts +122 -0
  111. package/models/operations/streamrunagent.d.ts.map +1 -1
  112. package/models/operations/streamrunagent.js +131 -7
  113. package/models/operations/streamrunagent.js.map +1 -1
  114. package/models/operations/updateagent.d.ts +244 -0
  115. package/models/operations/updateagent.d.ts.map +1 -1
  116. package/models/operations/updateagent.js +255 -7
  117. package/models/operations/updateagent.js.map +1 -1
  118. package/models/operations/updatebudget.js +2 -2
  119. package/models/operations/updatecontact.js +2 -2
  120. package/models/operations/updateconversation.js +2 -2
  121. package/models/operations/updatedatapoint.js +8 -8
  122. package/models/operations/updatedataset.js +2 -2
  123. package/models/operations/updatedatasource.js +2 -2
  124. package/models/operations/updateeval.js +28 -28
  125. package/models/operations/updatememory.d.ts +1 -1
  126. package/models/operations/updatetool.js +14 -14
  127. package/package.json +1 -1
  128. package/sdk/router.d.ts +23 -0
  129. package/sdk/router.d.ts.map +1 -0
  130. package/sdk/router.js +34 -0
  131. package/sdk/router.js.map +1 -0
  132. package/sdk/sdk.d.ts +3 -0
  133. package/sdk/sdk.d.ts.map +1 -1
  134. package/sdk/sdk.js +4 -0
  135. package/sdk/sdk.js.map +1 -1
  136. package/src/funcs/routerChatCompletions.ts +172 -0
  137. package/src/funcs/routerImagesGenerate.ts +160 -0
  138. package/src/lib/config.ts +3 -3
  139. package/src/lib/event-streams.ts +1 -1
  140. package/src/mcp-server/mcp-server.ts +1 -1
  141. package/src/mcp-server/server.ts +5 -1
  142. package/src/mcp-server/tools/routerChatCompletions.ts +37 -0
  143. package/src/mcp-server/tools/routerImagesGenerate.ts +37 -0
  144. package/src/models/components/conversationresponse.ts +2 -2
  145. package/src/models/components/index.ts +1 -0
  146. package/src/models/components/partdoneevent.ts +2 -2
  147. package/src/models/components/publiccontact.ts +99 -0
  148. package/src/models/components/reasoningpart.ts +2 -2
  149. package/src/models/operations/createagentrequest.ts +760 -113
  150. package/src/models/operations/createagentresponserequest.ts +2 -1
  151. package/src/models/operations/createbudget.ts +2 -2
  152. package/src/models/operations/createchatcompletion.ts +8911 -0
  153. package/src/models/operations/createcontact.ts +2 -2
  154. package/src/models/operations/createconversation.ts +2 -2
  155. package/src/models/operations/createdataset.ts +2 -2
  156. package/src/models/operations/createdatasetitem.ts +8 -8
  157. package/src/models/operations/createdatasource.ts +2 -2
  158. package/src/models/operations/createeval.ts +28 -28
  159. package/src/models/operations/createimage.ts +966 -0
  160. package/src/models/operations/creatememory.ts +1 -1
  161. package/src/models/operations/createtool.ts +12 -12
  162. package/src/models/operations/deploymentstream.ts +2 -1
  163. package/src/models/operations/fileget.ts +2 -2
  164. package/src/models/operations/filelist.ts +2 -2
  165. package/src/models/operations/fileupload.ts +2 -2
  166. package/src/models/operations/generateconversationname.ts +2 -2
  167. package/src/models/operations/getallprompts.ts +45 -38
  168. package/src/models/operations/getalltools.ts +12 -12
  169. package/src/models/operations/getbudget.ts +2 -2
  170. package/src/models/operations/getevals.ts +28 -28
  171. package/src/models/operations/index.ts +2 -0
  172. package/src/models/operations/invokeeval.ts +11 -10
  173. package/src/models/operations/listagents.ts +313 -0
  174. package/src/models/operations/listbudgets.ts +2 -2
  175. package/src/models/operations/listcontacts.ts +2 -2
  176. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  177. package/src/models/operations/listdatasets.ts +2 -2
  178. package/src/models/operations/listdatasources.ts +2 -2
  179. package/src/models/operations/retrieveagentrequest.ts +337 -0
  180. package/src/models/operations/retrievecontact.ts +2 -2
  181. package/src/models/operations/retrieveconversation.ts +2 -2
  182. package/src/models/operations/retrievedatapoint.ts +8 -8
  183. package/src/models/operations/retrievedataset.ts +2 -2
  184. package/src/models/operations/retrievedatasource.ts +2 -2
  185. package/src/models/operations/retrievetool.ts +12 -12
  186. package/src/models/operations/runagent.ts +315 -2
  187. package/src/models/operations/streamrunagent.ts +342 -2
  188. package/src/models/operations/updateagent.ts +659 -0
  189. package/src/models/operations/updatebudget.ts +2 -2
  190. package/src/models/operations/updatecontact.ts +2 -2
  191. package/src/models/operations/updateconversation.ts +2 -2
  192. package/src/models/operations/updatedatapoint.ts +8 -8
  193. package/src/models/operations/updatedataset.ts +2 -2
  194. package/src/models/operations/updatedatasource.ts +2 -2
  195. package/src/models/operations/updateeval.ts +28 -28
  196. package/src/models/operations/updatememory.ts +1 -1
  197. package/src/models/operations/updatetool.ts +14 -14
  198. package/src/sdk/router.ts +52 -0
  199. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,3398 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.CreateChatCompletionMessagesToolCalls$inboundSchema = exports.CreateChatCompletionMessagesFunction$outboundSchema = exports.CreateChatCompletionMessagesFunction$inboundSchema = exports.CreateChatCompletionMessagesType$outboundSchema = exports.CreateChatCompletionMessagesType$inboundSchema = exports.CreateChatCompletionMessagesAudio$outboundSchema = exports.CreateChatCompletionMessagesAudio$inboundSchema = exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$outboundSchema = exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$inboundSchema = exports.CreateChatCompletionContentRouter2$outboundSchema = exports.CreateChatCompletionContentRouter2$inboundSchema = exports.CreateChatCompletionMessagesToolMessage$outboundSchema = exports.CreateChatCompletionMessagesToolMessage$inboundSchema = exports.CreateChatCompletionMessagesCacheControl$outboundSchema = exports.CreateChatCompletionMessagesCacheControl$inboundSchema = exports.CreateChatCompletionMessagesTtl$outboundSchema = exports.CreateChatCompletionMessagesTtl$inboundSchema = exports.CreateChatCompletionMessagesRouterType$outboundSchema = exports.CreateChatCompletionMessagesRouterType$inboundSchema = exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$outboundSchema = exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$inboundSchema = exports.CreateChatCompletionContentRouterRequest2$outboundSchema = exports.CreateChatCompletionContentRouterRequest2$inboundSchema = exports.CreateChatCompletionObject = exports.CreateChatCompletionRole = exports.CreateChatCompletionRouterResponseType = exports.FinishReason = exports.CreateChatCompletionRouterObject = exports.CreateChatCompletionRouterRole = exports.CreateChatCompletionRouterResponse200Type = exports.CreateChatCompletionFinishReason = exports.LoadBalancerType = exports.CreateChatCompletionSearchType = exports.CreateChatCompletionRouterRequestType = exports.Version = exports.CreateChatCompletionExecuteOn = exports.CreateChatCompletionId1 = exports.CreateChatCompletionModalities = exports.CreateChatCompletionToolChoice1 = exports.CreateChatCompletionToolChoiceType = exports.CreateChatCompletionRouterType = exports.CreateChatCompletionType = exports.CreateChatCompletionReasoningEffort = exports.CreateChatCompletionFormat = exports.CreateChatCompletionVoice = exports.CreateChatCompletion2Ttl = exports.CreateChatCompletion2RouterType = exports.CreateChatCompletionMessagesType = exports.CreateChatCompletionMessagesTtl = exports.CreateChatCompletionMessagesRouterType = void 0;
40
+ exports.CreateChatCompletionThinking$inboundSchema = exports.CreateChatCompletionStreamOptions$outboundSchema = exports.CreateChatCompletionStreamOptions$inboundSchema = exports.CreateChatCompletionStop$outboundSchema = exports.CreateChatCompletionStop$inboundSchema = exports.CreateChatCompletionReasoningEffort$outboundSchema = exports.CreateChatCompletionReasoningEffort$inboundSchema = exports.CreateChatCompletionResponseFormat$outboundSchema = exports.CreateChatCompletionResponseFormat$inboundSchema = exports.CreateChatCompletionResponseFormatText$outboundSchema = exports.CreateChatCompletionResponseFormatText$inboundSchema = exports.CreateChatCompletionResponseFormatJSONObject$outboundSchema = exports.CreateChatCompletionResponseFormatJSONObject$inboundSchema = exports.CreateChatCompletionResponseFormatJSONSchema$outboundSchema = exports.CreateChatCompletionResponseFormatJSONSchema$inboundSchema = exports.CreateChatCompletionResponseFormatRouterJsonSchema$outboundSchema = exports.CreateChatCompletionResponseFormatRouterJsonSchema$inboundSchema = exports.CreateChatCompletionAudio$outboundSchema = exports.CreateChatCompletionAudio$inboundSchema = exports.CreateChatCompletionFormat$outboundSchema = exports.CreateChatCompletionFormat$inboundSchema = exports.CreateChatCompletionVoice$outboundSchema = exports.CreateChatCompletionVoice$inboundSchema = exports.CreateChatCompletionMessages$outboundSchema = exports.CreateChatCompletionMessages$inboundSchema = exports.CreateChatCompletionMessagesSystemMessage$outboundSchema = exports.CreateChatCompletionMessagesSystemMessage$inboundSchema = exports.CreateChatCompletionMessagesContent$outboundSchema = exports.CreateChatCompletionMessagesContent$inboundSchema = exports.CreateChatCompletionMessagesDeveloperMessage$outboundSchema = exports.CreateChatCompletionMessagesDeveloperMessage$inboundSchema = exports.CreateChatCompletionMessagesRouterContent$outboundSchema = exports.CreateChatCompletionMessagesRouterContent$inboundSchema = exports.CreateChatCompletionMessagesUserMessage$outboundSchema = exports.CreateChatCompletionMessagesUserMessage$inboundSchema = exports.CreateChatCompletionMessagesRouterRequestContent$outboundSchema = exports.CreateChatCompletionMessagesRouterRequestContent$inboundSchema = exports.CreateChatCompletionContent2$outboundSchema = exports.CreateChatCompletionContent2$inboundSchema = exports.CreateChatCompletion24$outboundSchema = exports.CreateChatCompletion24$inboundSchema = exports.CreateChatCompletion2CacheControl$outboundSchema = exports.CreateChatCompletion2CacheControl$inboundSchema = exports.CreateChatCompletion2Ttl$outboundSchema = exports.CreateChatCompletion2Ttl$inboundSchema = exports.CreateChatCompletion2RouterType$outboundSchema = exports.CreateChatCompletion2RouterType$inboundSchema = exports.CreateChatCompletionMessagesAssistantMessage$outboundSchema = exports.CreateChatCompletionMessagesAssistantMessage$inboundSchema = exports.CreateChatCompletionMessagesToolCalls$outboundSchema = void 0;
41
+ exports.CreateChatCompletionSearchType$inboundSchema = exports.Cache$outboundSchema = exports.Cache$inboundSchema = exports.CreateChatCompletionRouterRequestType$outboundSchema = exports.CreateChatCompletionRouterRequestType$inboundSchema = exports.Inputs$outboundSchema = exports.Inputs$inboundSchema = exports.Inputs2$outboundSchema = exports.Inputs2$inboundSchema = exports.CreateChatCompletionThread$outboundSchema = exports.CreateChatCompletionThread$inboundSchema = exports.Prompt$outboundSchema = exports.Prompt$inboundSchema = exports.Version$outboundSchema = exports.Version$inboundSchema = exports.Fallbacks$outboundSchema = exports.Fallbacks$inboundSchema = exports.CreateChatCompletionRetry$outboundSchema = exports.CreateChatCompletionRetry$inboundSchema = exports.CreateChatCompletionGuardrails$outboundSchema = exports.CreateChatCompletionGuardrails$inboundSchema = exports.CreateChatCompletionExecuteOn$outboundSchema = exports.CreateChatCompletionExecuteOn$inboundSchema = exports.CreateChatCompletionId$outboundSchema = exports.CreateChatCompletionId$inboundSchema = exports.CreateChatCompletionId1$outboundSchema = exports.CreateChatCompletionId1$inboundSchema = exports.CreateChatCompletionModalities$outboundSchema = exports.CreateChatCompletionModalities$inboundSchema = exports.CreateChatCompletionToolChoice$outboundSchema = exports.CreateChatCompletionToolChoice$inboundSchema = exports.CreateChatCompletionToolChoice1$outboundSchema = exports.CreateChatCompletionToolChoice1$inboundSchema = exports.CreateChatCompletionToolChoice2$outboundSchema = exports.CreateChatCompletionToolChoice2$inboundSchema = exports.CreateChatCompletionToolChoiceFunction$outboundSchema = exports.CreateChatCompletionToolChoiceFunction$inboundSchema = exports.CreateChatCompletionToolChoiceType$outboundSchema = exports.CreateChatCompletionToolChoiceType$inboundSchema = exports.CreateChatCompletionTools$outboundSchema = exports.CreateChatCompletionTools$inboundSchema = exports.CreateChatCompletionFunction$outboundSchema = exports.CreateChatCompletionFunction$inboundSchema = exports.CreateChatCompletionParameters$outboundSchema = exports.CreateChatCompletionParameters$inboundSchema = exports.CreateChatCompletionRouterType$outboundSchema = exports.CreateChatCompletionRouterType$inboundSchema = exports.CreateChatCompletionType$outboundSchema = exports.CreateChatCompletionType$inboundSchema = exports.CreateChatCompletionThinking$outboundSchema = void 0;
42
+ exports.CreateChatCompletionAndRouterNe$inboundSchema = exports.CreateChatCompletionAndGt$outboundSchema = exports.CreateChatCompletionAndGt$inboundSchema = exports.CreateChatCompletionAndGte$outboundSchema = exports.CreateChatCompletionAndGte$inboundSchema = exports.CreateChatCompletionAndLt$outboundSchema = exports.CreateChatCompletionAndLt$inboundSchema = exports.CreateChatCompletionAndLte$outboundSchema = exports.CreateChatCompletionAndLte$inboundSchema = exports.CreateChatCompletionAndIn$outboundSchema = exports.CreateChatCompletionAndIn$inboundSchema = exports.CreateChatCompletionAndRouterIn$outboundSchema = exports.CreateChatCompletionAndRouterIn$inboundSchema = exports.CreateChatCompletionAndNin$outboundSchema = exports.CreateChatCompletionAndNin$inboundSchema = exports.CreateChatCompletionAndRouterNin$outboundSchema = exports.CreateChatCompletionAndRouterNin$inboundSchema = exports.CreateChatCompletionAndExists$outboundSchema = exports.CreateChatCompletionAndExists$inboundSchema = exports.CreateChatCompletionFilterByOr$outboundSchema = exports.CreateChatCompletionFilterByOr$inboundSchema = exports.CreateChatCompletionFilterByRouterOr$outboundSchema = exports.CreateChatCompletionFilterByRouterOr$inboundSchema = exports.CreateChatCompletionOrEq$outboundSchema = exports.CreateChatCompletionOrEq$inboundSchema = exports.CreateChatCompletionOrRouterEq$outboundSchema = exports.CreateChatCompletionOrRouterEq$inboundSchema = exports.CreateChatCompletionOrNe$outboundSchema = exports.CreateChatCompletionOrNe$inboundSchema = exports.CreateChatCompletionOrRouterNe$outboundSchema = exports.CreateChatCompletionOrRouterNe$inboundSchema = exports.CreateChatCompletionOrGt$outboundSchema = exports.CreateChatCompletionOrGt$inboundSchema = exports.CreateChatCompletionOrGte$outboundSchema = exports.CreateChatCompletionOrGte$inboundSchema = exports.CreateChatCompletionOrLt$outboundSchema = exports.CreateChatCompletionOrLt$inboundSchema = exports.CreateChatCompletionOrLte$outboundSchema = exports.CreateChatCompletionOrLte$inboundSchema = exports.CreateChatCompletionOrIn$outboundSchema = exports.CreateChatCompletionOrIn$inboundSchema = exports.CreateChatCompletionOrRouterIn$outboundSchema = exports.CreateChatCompletionOrRouterIn$inboundSchema = exports.CreateChatCompletionOrNin$outboundSchema = exports.CreateChatCompletionOrNin$inboundSchema = exports.CreateChatCompletionOrRouterNin$outboundSchema = exports.CreateChatCompletionOrRouterNin$inboundSchema = exports.CreateChatCompletionOrExists$outboundSchema = exports.CreateChatCompletionOrExists$inboundSchema = exports.CreateChatCompletionSearchType$outboundSchema = void 0;
43
+ exports.LoadBalancerType$inboundSchema = exports.CreateChatCompletionKnowledgeBases$outboundSchema = exports.CreateChatCompletionKnowledgeBases$inboundSchema = exports.CreateChatCompletionAgenticRagConfig$outboundSchema = exports.CreateChatCompletionAgenticRagConfig$inboundSchema = exports.CreateChatCompletionRerankConfig$outboundSchema = exports.CreateChatCompletionRerankConfig$inboundSchema = exports.CreateChatCompletionSearchOptions$outboundSchema = exports.CreateChatCompletionSearchOptions$inboundSchema = exports.CreateChatCompletionFilterBy$outboundSchema = exports.CreateChatCompletionFilterBy$inboundSchema = exports.CreateChatCompletionFilterBy1$outboundSchema = exports.CreateChatCompletionFilterBy1$inboundSchema = exports.CreateChatCompletion1Eq$outboundSchema = exports.CreateChatCompletion1Eq$inboundSchema = exports.CreateChatCompletion1RouterEq$outboundSchema = exports.CreateChatCompletion1RouterEq$inboundSchema = exports.CreateChatCompletion1Ne$outboundSchema = exports.CreateChatCompletion1Ne$inboundSchema = exports.CreateChatCompletion1RouterNe$outboundSchema = exports.CreateChatCompletion1RouterNe$inboundSchema = exports.CreateChatCompletion1Gt$outboundSchema = exports.CreateChatCompletion1Gt$inboundSchema = exports.CreateChatCompletion1Gte$outboundSchema = exports.CreateChatCompletion1Gte$inboundSchema = exports.CreateChatCompletion1Lt$outboundSchema = exports.CreateChatCompletion1Lt$inboundSchema = exports.CreateChatCompletion1Lte$outboundSchema = exports.CreateChatCompletion1Lte$inboundSchema = exports.CreateChatCompletion1In$outboundSchema = exports.CreateChatCompletion1In$inboundSchema = exports.CreateChatCompletion1RouterIn$outboundSchema = exports.CreateChatCompletion1RouterIn$inboundSchema = exports.CreateChatCompletion1Nin$outboundSchema = exports.CreateChatCompletion1Nin$inboundSchema = exports.CreateChatCompletion1RouterNin$outboundSchema = exports.CreateChatCompletion1RouterNin$inboundSchema = exports.CreateChatCompletion1Exists$outboundSchema = exports.CreateChatCompletion1Exists$inboundSchema = exports.CreateChatCompletionFilterByAnd$outboundSchema = exports.CreateChatCompletionFilterByAnd$inboundSchema = exports.CreateChatCompletionFilterByRouterAnd$outboundSchema = exports.CreateChatCompletionFilterByRouterAnd$inboundSchema = exports.CreateChatCompletionAndEq$outboundSchema = exports.CreateChatCompletionAndEq$inboundSchema = exports.CreateChatCompletionAndRouterEq$outboundSchema = exports.CreateChatCompletionAndRouterEq$inboundSchema = exports.CreateChatCompletionAndNe$outboundSchema = exports.CreateChatCompletionAndNe$inboundSchema = exports.CreateChatCompletionAndRouterNe$outboundSchema = void 0;
44
+ exports.FinishReason$inboundSchema = exports.CreateChatCompletionRouterResponseBody$outboundSchema = exports.CreateChatCompletionRouterResponseBody$inboundSchema = exports.CreateChatCompletionData$outboundSchema = exports.CreateChatCompletionData$inboundSchema = exports.CreateChatCompletionRouterObject$outboundSchema = exports.CreateChatCompletionRouterObject$inboundSchema = exports.CreateChatCompletionRouterUsage$outboundSchema = exports.CreateChatCompletionRouterUsage$inboundSchema = exports.CreateChatCompletionCompletionTokensDetails$outboundSchema = exports.CreateChatCompletionCompletionTokensDetails$inboundSchema = exports.CreateChatCompletionPromptTokensDetails$outboundSchema = exports.CreateChatCompletionPromptTokensDetails$inboundSchema = exports.CreateChatCompletionRouterChoices$outboundSchema = exports.CreateChatCompletionRouterChoices$inboundSchema = exports.Delta$outboundSchema = exports.Delta$inboundSchema = exports.CreateChatCompletionRouterResponseAudio$outboundSchema = exports.CreateChatCompletionRouterResponseAudio$inboundSchema = exports.CreateChatCompletionRouterRole$outboundSchema = exports.CreateChatCompletionRouterRole$inboundSchema = exports.CreateChatCompletionRouterToolCalls$outboundSchema = exports.CreateChatCompletionRouterToolCalls$inboundSchema = exports.CreateChatCompletionRouterResponseFunction$outboundSchema = exports.CreateChatCompletionRouterResponseFunction$inboundSchema = exports.CreateChatCompletionRouterResponse200Type$outboundSchema = exports.CreateChatCompletionRouterResponse200Type$inboundSchema = exports.CreateChatCompletionLogprobs$outboundSchema = exports.CreateChatCompletionLogprobs$inboundSchema = exports.CreateChatCompletionRefusal$outboundSchema = exports.CreateChatCompletionRefusal$inboundSchema = exports.CreateChatCompletionRouterResponseTopLogprobs$outboundSchema = exports.CreateChatCompletionRouterResponseTopLogprobs$inboundSchema = exports.CreateChatCompletionRouterContent$outboundSchema = exports.CreateChatCompletionRouterContent$inboundSchema = exports.CreateChatCompletionRouterTopLogprobs$outboundSchema = exports.CreateChatCompletionRouterTopLogprobs$inboundSchema = exports.CreateChatCompletionFinishReason$outboundSchema = exports.CreateChatCompletionFinishReason$inboundSchema = exports.CreateChatCompletionRequestBody$outboundSchema = exports.CreateChatCompletionRequestBody$inboundSchema = exports.Orq$outboundSchema = exports.Orq$inboundSchema = exports.Timeout$outboundSchema = exports.Timeout$inboundSchema = exports.LoadBalancer$outboundSchema = exports.LoadBalancer$inboundSchema = exports.LoadBalancer1$outboundSchema = exports.LoadBalancer1$inboundSchema = exports.LoadBalancerType$outboundSchema = void 0;
45
+ exports.CreateChatCompletionResponse$outboundSchema = exports.CreateChatCompletionResponse$inboundSchema = exports.CreateChatCompletionResponseBody$outboundSchema = exports.CreateChatCompletionResponseBody$inboundSchema = exports.CreateChatCompletionObject$outboundSchema = exports.CreateChatCompletionObject$inboundSchema = exports.CreateChatCompletionUsage$outboundSchema = exports.CreateChatCompletionUsage$inboundSchema = exports.CompletionTokensDetails$outboundSchema = exports.CompletionTokensDetails$inboundSchema = exports.PromptTokensDetails$outboundSchema = exports.PromptTokensDetails$inboundSchema = exports.CreateChatCompletionChoices$outboundSchema = exports.CreateChatCompletionChoices$inboundSchema = exports.Logprobs$outboundSchema = exports.Logprobs$inboundSchema = exports.Refusal$outboundSchema = exports.Refusal$inboundSchema = exports.CreateChatCompletionTopLogprobs$outboundSchema = exports.CreateChatCompletionTopLogprobs$inboundSchema = exports.CreateChatCompletionContent$outboundSchema = exports.CreateChatCompletionContent$inboundSchema = exports.TopLogprobs$outboundSchema = exports.TopLogprobs$inboundSchema = exports.CreateChatCompletionMessage$outboundSchema = exports.CreateChatCompletionMessage$inboundSchema = exports.CreateChatCompletionRouterAudio$outboundSchema = exports.CreateChatCompletionRouterAudio$inboundSchema = exports.CreateChatCompletionRole$outboundSchema = exports.CreateChatCompletionRole$inboundSchema = exports.CreateChatCompletionToolCalls$outboundSchema = exports.CreateChatCompletionToolCalls$inboundSchema = exports.CreateChatCompletionRouterFunction$outboundSchema = exports.CreateChatCompletionRouterFunction$inboundSchema = exports.CreateChatCompletionRouterResponseType$outboundSchema = exports.CreateChatCompletionRouterResponseType$inboundSchema = exports.FinishReason$outboundSchema = void 0;
46
+ exports.createChatCompletionContentRouterRequest2ToJSON = createChatCompletionContentRouterRequest2ToJSON;
47
+ exports.createChatCompletionContentRouterRequest2FromJSON = createChatCompletionContentRouterRequest2FromJSON;
48
+ exports.createChatCompletionMessagesRouterRequestRequestBody5ContentToJSON = createChatCompletionMessagesRouterRequestRequestBody5ContentToJSON;
49
+ exports.createChatCompletionMessagesRouterRequestRequestBody5ContentFromJSON = createChatCompletionMessagesRouterRequestRequestBody5ContentFromJSON;
50
+ exports.createChatCompletionMessagesCacheControlToJSON = createChatCompletionMessagesCacheControlToJSON;
51
+ exports.createChatCompletionMessagesCacheControlFromJSON = createChatCompletionMessagesCacheControlFromJSON;
52
+ exports.createChatCompletionMessagesToolMessageToJSON = createChatCompletionMessagesToolMessageToJSON;
53
+ exports.createChatCompletionMessagesToolMessageFromJSON = createChatCompletionMessagesToolMessageFromJSON;
54
+ exports.createChatCompletionContentRouter2ToJSON = createChatCompletionContentRouter2ToJSON;
55
+ exports.createChatCompletionContentRouter2FromJSON = createChatCompletionContentRouter2FromJSON;
56
+ exports.createChatCompletionMessagesRouterRequestRequestBodyContentToJSON = createChatCompletionMessagesRouterRequestRequestBodyContentToJSON;
57
+ exports.createChatCompletionMessagesRouterRequestRequestBodyContentFromJSON = createChatCompletionMessagesRouterRequestRequestBodyContentFromJSON;
58
+ exports.createChatCompletionMessagesAudioToJSON = createChatCompletionMessagesAudioToJSON;
59
+ exports.createChatCompletionMessagesAudioFromJSON = createChatCompletionMessagesAudioFromJSON;
60
+ exports.createChatCompletionMessagesFunctionToJSON = createChatCompletionMessagesFunctionToJSON;
61
+ exports.createChatCompletionMessagesFunctionFromJSON = createChatCompletionMessagesFunctionFromJSON;
62
+ exports.createChatCompletionMessagesToolCallsToJSON = createChatCompletionMessagesToolCallsToJSON;
63
+ exports.createChatCompletionMessagesToolCallsFromJSON = createChatCompletionMessagesToolCallsFromJSON;
64
+ exports.createChatCompletionMessagesAssistantMessageToJSON = createChatCompletionMessagesAssistantMessageToJSON;
65
+ exports.createChatCompletionMessagesAssistantMessageFromJSON = createChatCompletionMessagesAssistantMessageFromJSON;
66
+ exports.createChatCompletion2CacheControlToJSON = createChatCompletion2CacheControlToJSON;
67
+ exports.createChatCompletion2CacheControlFromJSON = createChatCompletion2CacheControlFromJSON;
68
+ exports.createChatCompletion24ToJSON = createChatCompletion24ToJSON;
69
+ exports.createChatCompletion24FromJSON = createChatCompletion24FromJSON;
70
+ exports.createChatCompletionContent2ToJSON = createChatCompletionContent2ToJSON;
71
+ exports.createChatCompletionContent2FromJSON = createChatCompletionContent2FromJSON;
72
+ exports.createChatCompletionMessagesRouterRequestContentToJSON = createChatCompletionMessagesRouterRequestContentToJSON;
73
+ exports.createChatCompletionMessagesRouterRequestContentFromJSON = createChatCompletionMessagesRouterRequestContentFromJSON;
74
+ exports.createChatCompletionMessagesUserMessageToJSON = createChatCompletionMessagesUserMessageToJSON;
75
+ exports.createChatCompletionMessagesUserMessageFromJSON = createChatCompletionMessagesUserMessageFromJSON;
76
+ exports.createChatCompletionMessagesRouterContentToJSON = createChatCompletionMessagesRouterContentToJSON;
77
+ exports.createChatCompletionMessagesRouterContentFromJSON = createChatCompletionMessagesRouterContentFromJSON;
78
+ exports.createChatCompletionMessagesDeveloperMessageToJSON = createChatCompletionMessagesDeveloperMessageToJSON;
79
+ exports.createChatCompletionMessagesDeveloperMessageFromJSON = createChatCompletionMessagesDeveloperMessageFromJSON;
80
+ exports.createChatCompletionMessagesContentToJSON = createChatCompletionMessagesContentToJSON;
81
+ exports.createChatCompletionMessagesContentFromJSON = createChatCompletionMessagesContentFromJSON;
82
+ exports.createChatCompletionMessagesSystemMessageToJSON = createChatCompletionMessagesSystemMessageToJSON;
83
+ exports.createChatCompletionMessagesSystemMessageFromJSON = createChatCompletionMessagesSystemMessageFromJSON;
84
+ exports.createChatCompletionMessagesToJSON = createChatCompletionMessagesToJSON;
85
+ exports.createChatCompletionMessagesFromJSON = createChatCompletionMessagesFromJSON;
86
+ exports.createChatCompletionAudioToJSON = createChatCompletionAudioToJSON;
87
+ exports.createChatCompletionAudioFromJSON = createChatCompletionAudioFromJSON;
88
+ exports.createChatCompletionResponseFormatRouterJsonSchemaToJSON = createChatCompletionResponseFormatRouterJsonSchemaToJSON;
89
+ exports.createChatCompletionResponseFormatRouterJsonSchemaFromJSON = createChatCompletionResponseFormatRouterJsonSchemaFromJSON;
90
+ exports.createChatCompletionResponseFormatJSONSchemaToJSON = createChatCompletionResponseFormatJSONSchemaToJSON;
91
+ exports.createChatCompletionResponseFormatJSONSchemaFromJSON = createChatCompletionResponseFormatJSONSchemaFromJSON;
92
+ exports.createChatCompletionResponseFormatJSONObjectToJSON = createChatCompletionResponseFormatJSONObjectToJSON;
93
+ exports.createChatCompletionResponseFormatJSONObjectFromJSON = createChatCompletionResponseFormatJSONObjectFromJSON;
94
+ exports.createChatCompletionResponseFormatTextToJSON = createChatCompletionResponseFormatTextToJSON;
95
+ exports.createChatCompletionResponseFormatTextFromJSON = createChatCompletionResponseFormatTextFromJSON;
96
+ exports.createChatCompletionResponseFormatToJSON = createChatCompletionResponseFormatToJSON;
97
+ exports.createChatCompletionResponseFormatFromJSON = createChatCompletionResponseFormatFromJSON;
98
+ exports.createChatCompletionStopToJSON = createChatCompletionStopToJSON;
99
+ exports.createChatCompletionStopFromJSON = createChatCompletionStopFromJSON;
100
+ exports.createChatCompletionStreamOptionsToJSON = createChatCompletionStreamOptionsToJSON;
101
+ exports.createChatCompletionStreamOptionsFromJSON = createChatCompletionStreamOptionsFromJSON;
102
+ exports.createChatCompletionThinkingToJSON = createChatCompletionThinkingToJSON;
103
+ exports.createChatCompletionThinkingFromJSON = createChatCompletionThinkingFromJSON;
104
+ exports.createChatCompletionParametersToJSON = createChatCompletionParametersToJSON;
105
+ exports.createChatCompletionParametersFromJSON = createChatCompletionParametersFromJSON;
106
+ exports.createChatCompletionFunctionToJSON = createChatCompletionFunctionToJSON;
107
+ exports.createChatCompletionFunctionFromJSON = createChatCompletionFunctionFromJSON;
108
+ exports.createChatCompletionToolsToJSON = createChatCompletionToolsToJSON;
109
+ exports.createChatCompletionToolsFromJSON = createChatCompletionToolsFromJSON;
110
+ exports.createChatCompletionToolChoiceFunctionToJSON = createChatCompletionToolChoiceFunctionToJSON;
111
+ exports.createChatCompletionToolChoiceFunctionFromJSON = createChatCompletionToolChoiceFunctionFromJSON;
112
+ exports.createChatCompletionToolChoice2ToJSON = createChatCompletionToolChoice2ToJSON;
113
+ exports.createChatCompletionToolChoice2FromJSON = createChatCompletionToolChoice2FromJSON;
114
+ exports.createChatCompletionToolChoiceToJSON = createChatCompletionToolChoiceToJSON;
115
+ exports.createChatCompletionToolChoiceFromJSON = createChatCompletionToolChoiceFromJSON;
116
+ exports.createChatCompletionIdToJSON = createChatCompletionIdToJSON;
117
+ exports.createChatCompletionIdFromJSON = createChatCompletionIdFromJSON;
118
+ exports.createChatCompletionGuardrailsToJSON = createChatCompletionGuardrailsToJSON;
119
+ exports.createChatCompletionGuardrailsFromJSON = createChatCompletionGuardrailsFromJSON;
120
+ exports.createChatCompletionRetryToJSON = createChatCompletionRetryToJSON;
121
+ exports.createChatCompletionRetryFromJSON = createChatCompletionRetryFromJSON;
122
+ exports.fallbacksToJSON = fallbacksToJSON;
123
+ exports.fallbacksFromJSON = fallbacksFromJSON;
124
+ exports.promptToJSON = promptToJSON;
125
+ exports.promptFromJSON = promptFromJSON;
126
+ exports.createChatCompletionThreadToJSON = createChatCompletionThreadToJSON;
127
+ exports.createChatCompletionThreadFromJSON = createChatCompletionThreadFromJSON;
128
+ exports.inputs2ToJSON = inputs2ToJSON;
129
+ exports.inputs2FromJSON = inputs2FromJSON;
130
+ exports.inputsToJSON = inputsToJSON;
131
+ exports.inputsFromJSON = inputsFromJSON;
132
+ exports.cacheToJSON = cacheToJSON;
133
+ exports.cacheFromJSON = cacheFromJSON;
134
+ exports.createChatCompletionOrExistsToJSON = createChatCompletionOrExistsToJSON;
135
+ exports.createChatCompletionOrExistsFromJSON = createChatCompletionOrExistsFromJSON;
136
+ exports.createChatCompletionOrRouterNinToJSON = createChatCompletionOrRouterNinToJSON;
137
+ exports.createChatCompletionOrRouterNinFromJSON = createChatCompletionOrRouterNinFromJSON;
138
+ exports.createChatCompletionOrNinToJSON = createChatCompletionOrNinToJSON;
139
+ exports.createChatCompletionOrNinFromJSON = createChatCompletionOrNinFromJSON;
140
+ exports.createChatCompletionOrRouterInToJSON = createChatCompletionOrRouterInToJSON;
141
+ exports.createChatCompletionOrRouterInFromJSON = createChatCompletionOrRouterInFromJSON;
142
+ exports.createChatCompletionOrInToJSON = createChatCompletionOrInToJSON;
143
+ exports.createChatCompletionOrInFromJSON = createChatCompletionOrInFromJSON;
144
+ exports.createChatCompletionOrLteToJSON = createChatCompletionOrLteToJSON;
145
+ exports.createChatCompletionOrLteFromJSON = createChatCompletionOrLteFromJSON;
146
+ exports.createChatCompletionOrLtToJSON = createChatCompletionOrLtToJSON;
147
+ exports.createChatCompletionOrLtFromJSON = createChatCompletionOrLtFromJSON;
148
+ exports.createChatCompletionOrGteToJSON = createChatCompletionOrGteToJSON;
149
+ exports.createChatCompletionOrGteFromJSON = createChatCompletionOrGteFromJSON;
150
+ exports.createChatCompletionOrGtToJSON = createChatCompletionOrGtToJSON;
151
+ exports.createChatCompletionOrGtFromJSON = createChatCompletionOrGtFromJSON;
152
+ exports.createChatCompletionOrRouterNeToJSON = createChatCompletionOrRouterNeToJSON;
153
+ exports.createChatCompletionOrRouterNeFromJSON = createChatCompletionOrRouterNeFromJSON;
154
+ exports.createChatCompletionOrNeToJSON = createChatCompletionOrNeToJSON;
155
+ exports.createChatCompletionOrNeFromJSON = createChatCompletionOrNeFromJSON;
156
+ exports.createChatCompletionOrRouterEqToJSON = createChatCompletionOrRouterEqToJSON;
157
+ exports.createChatCompletionOrRouterEqFromJSON = createChatCompletionOrRouterEqFromJSON;
158
+ exports.createChatCompletionOrEqToJSON = createChatCompletionOrEqToJSON;
159
+ exports.createChatCompletionOrEqFromJSON = createChatCompletionOrEqFromJSON;
160
+ exports.createChatCompletionFilterByRouterOrToJSON = createChatCompletionFilterByRouterOrToJSON;
161
+ exports.createChatCompletionFilterByRouterOrFromJSON = createChatCompletionFilterByRouterOrFromJSON;
162
+ exports.createChatCompletionFilterByOrToJSON = createChatCompletionFilterByOrToJSON;
163
+ exports.createChatCompletionFilterByOrFromJSON = createChatCompletionFilterByOrFromJSON;
164
+ exports.createChatCompletionAndExistsToJSON = createChatCompletionAndExistsToJSON;
165
+ exports.createChatCompletionAndExistsFromJSON = createChatCompletionAndExistsFromJSON;
166
+ exports.createChatCompletionAndRouterNinToJSON = createChatCompletionAndRouterNinToJSON;
167
+ exports.createChatCompletionAndRouterNinFromJSON = createChatCompletionAndRouterNinFromJSON;
168
+ exports.createChatCompletionAndNinToJSON = createChatCompletionAndNinToJSON;
169
+ exports.createChatCompletionAndNinFromJSON = createChatCompletionAndNinFromJSON;
170
+ exports.createChatCompletionAndRouterInToJSON = createChatCompletionAndRouterInToJSON;
171
+ exports.createChatCompletionAndRouterInFromJSON = createChatCompletionAndRouterInFromJSON;
172
+ exports.createChatCompletionAndInToJSON = createChatCompletionAndInToJSON;
173
+ exports.createChatCompletionAndInFromJSON = createChatCompletionAndInFromJSON;
174
+ exports.createChatCompletionAndLteToJSON = createChatCompletionAndLteToJSON;
175
+ exports.createChatCompletionAndLteFromJSON = createChatCompletionAndLteFromJSON;
176
+ exports.createChatCompletionAndLtToJSON = createChatCompletionAndLtToJSON;
177
+ exports.createChatCompletionAndLtFromJSON = createChatCompletionAndLtFromJSON;
178
+ exports.createChatCompletionAndGteToJSON = createChatCompletionAndGteToJSON;
179
+ exports.createChatCompletionAndGteFromJSON = createChatCompletionAndGteFromJSON;
180
+ exports.createChatCompletionAndGtToJSON = createChatCompletionAndGtToJSON;
181
+ exports.createChatCompletionAndGtFromJSON = createChatCompletionAndGtFromJSON;
182
+ exports.createChatCompletionAndRouterNeToJSON = createChatCompletionAndRouterNeToJSON;
183
+ exports.createChatCompletionAndRouterNeFromJSON = createChatCompletionAndRouterNeFromJSON;
184
+ exports.createChatCompletionAndNeToJSON = createChatCompletionAndNeToJSON;
185
+ exports.createChatCompletionAndNeFromJSON = createChatCompletionAndNeFromJSON;
186
+ exports.createChatCompletionAndRouterEqToJSON = createChatCompletionAndRouterEqToJSON;
187
+ exports.createChatCompletionAndRouterEqFromJSON = createChatCompletionAndRouterEqFromJSON;
188
+ exports.createChatCompletionAndEqToJSON = createChatCompletionAndEqToJSON;
189
+ exports.createChatCompletionAndEqFromJSON = createChatCompletionAndEqFromJSON;
190
+ exports.createChatCompletionFilterByRouterAndToJSON = createChatCompletionFilterByRouterAndToJSON;
191
+ exports.createChatCompletionFilterByRouterAndFromJSON = createChatCompletionFilterByRouterAndFromJSON;
192
+ exports.createChatCompletionFilterByAndToJSON = createChatCompletionFilterByAndToJSON;
193
+ exports.createChatCompletionFilterByAndFromJSON = createChatCompletionFilterByAndFromJSON;
194
+ exports.createChatCompletion1ExistsToJSON = createChatCompletion1ExistsToJSON;
195
+ exports.createChatCompletion1ExistsFromJSON = createChatCompletion1ExistsFromJSON;
196
+ exports.createChatCompletion1RouterNinToJSON = createChatCompletion1RouterNinToJSON;
197
+ exports.createChatCompletion1RouterNinFromJSON = createChatCompletion1RouterNinFromJSON;
198
+ exports.createChatCompletion1NinToJSON = createChatCompletion1NinToJSON;
199
+ exports.createChatCompletion1NinFromJSON = createChatCompletion1NinFromJSON;
200
+ exports.createChatCompletion1RouterInToJSON = createChatCompletion1RouterInToJSON;
201
+ exports.createChatCompletion1RouterInFromJSON = createChatCompletion1RouterInFromJSON;
202
+ exports.createChatCompletion1InToJSON = createChatCompletion1InToJSON;
203
+ exports.createChatCompletion1InFromJSON = createChatCompletion1InFromJSON;
204
+ exports.createChatCompletion1LteToJSON = createChatCompletion1LteToJSON;
205
+ exports.createChatCompletion1LteFromJSON = createChatCompletion1LteFromJSON;
206
+ exports.createChatCompletion1LtToJSON = createChatCompletion1LtToJSON;
207
+ exports.createChatCompletion1LtFromJSON = createChatCompletion1LtFromJSON;
208
+ exports.createChatCompletion1GteToJSON = createChatCompletion1GteToJSON;
209
+ exports.createChatCompletion1GteFromJSON = createChatCompletion1GteFromJSON;
210
+ exports.createChatCompletion1GtToJSON = createChatCompletion1GtToJSON;
211
+ exports.createChatCompletion1GtFromJSON = createChatCompletion1GtFromJSON;
212
+ exports.createChatCompletion1RouterNeToJSON = createChatCompletion1RouterNeToJSON;
213
+ exports.createChatCompletion1RouterNeFromJSON = createChatCompletion1RouterNeFromJSON;
214
+ exports.createChatCompletion1NeToJSON = createChatCompletion1NeToJSON;
215
+ exports.createChatCompletion1NeFromJSON = createChatCompletion1NeFromJSON;
216
+ exports.createChatCompletion1RouterEqToJSON = createChatCompletion1RouterEqToJSON;
217
+ exports.createChatCompletion1RouterEqFromJSON = createChatCompletion1RouterEqFromJSON;
218
+ exports.createChatCompletion1EqToJSON = createChatCompletion1EqToJSON;
219
+ exports.createChatCompletion1EqFromJSON = createChatCompletion1EqFromJSON;
220
+ exports.createChatCompletionFilterBy1ToJSON = createChatCompletionFilterBy1ToJSON;
221
+ exports.createChatCompletionFilterBy1FromJSON = createChatCompletionFilterBy1FromJSON;
222
+ exports.createChatCompletionFilterByToJSON = createChatCompletionFilterByToJSON;
223
+ exports.createChatCompletionFilterByFromJSON = createChatCompletionFilterByFromJSON;
224
+ exports.createChatCompletionSearchOptionsToJSON = createChatCompletionSearchOptionsToJSON;
225
+ exports.createChatCompletionSearchOptionsFromJSON = createChatCompletionSearchOptionsFromJSON;
226
+ exports.createChatCompletionRerankConfigToJSON = createChatCompletionRerankConfigToJSON;
227
+ exports.createChatCompletionRerankConfigFromJSON = createChatCompletionRerankConfigFromJSON;
228
+ exports.createChatCompletionAgenticRagConfigToJSON = createChatCompletionAgenticRagConfigToJSON;
229
+ exports.createChatCompletionAgenticRagConfigFromJSON = createChatCompletionAgenticRagConfigFromJSON;
230
+ exports.createChatCompletionKnowledgeBasesToJSON = createChatCompletionKnowledgeBasesToJSON;
231
+ exports.createChatCompletionKnowledgeBasesFromJSON = createChatCompletionKnowledgeBasesFromJSON;
232
+ exports.loadBalancer1ToJSON = loadBalancer1ToJSON;
233
+ exports.loadBalancer1FromJSON = loadBalancer1FromJSON;
234
+ exports.loadBalancerToJSON = loadBalancerToJSON;
235
+ exports.loadBalancerFromJSON = loadBalancerFromJSON;
236
+ exports.timeoutToJSON = timeoutToJSON;
237
+ exports.timeoutFromJSON = timeoutFromJSON;
238
+ exports.orqToJSON = orqToJSON;
239
+ exports.orqFromJSON = orqFromJSON;
240
+ exports.createChatCompletionRequestBodyToJSON = createChatCompletionRequestBodyToJSON;
241
+ exports.createChatCompletionRequestBodyFromJSON = createChatCompletionRequestBodyFromJSON;
242
+ exports.createChatCompletionRouterTopLogprobsToJSON = createChatCompletionRouterTopLogprobsToJSON;
243
+ exports.createChatCompletionRouterTopLogprobsFromJSON = createChatCompletionRouterTopLogprobsFromJSON;
244
+ exports.createChatCompletionRouterContentToJSON = createChatCompletionRouterContentToJSON;
245
+ exports.createChatCompletionRouterContentFromJSON = createChatCompletionRouterContentFromJSON;
246
+ exports.createChatCompletionRouterResponseTopLogprobsToJSON = createChatCompletionRouterResponseTopLogprobsToJSON;
247
+ exports.createChatCompletionRouterResponseTopLogprobsFromJSON = createChatCompletionRouterResponseTopLogprobsFromJSON;
248
+ exports.createChatCompletionRefusalToJSON = createChatCompletionRefusalToJSON;
249
+ exports.createChatCompletionRefusalFromJSON = createChatCompletionRefusalFromJSON;
250
+ exports.createChatCompletionLogprobsToJSON = createChatCompletionLogprobsToJSON;
251
+ exports.createChatCompletionLogprobsFromJSON = createChatCompletionLogprobsFromJSON;
252
+ exports.createChatCompletionRouterResponseFunctionToJSON = createChatCompletionRouterResponseFunctionToJSON;
253
+ exports.createChatCompletionRouterResponseFunctionFromJSON = createChatCompletionRouterResponseFunctionFromJSON;
254
+ exports.createChatCompletionRouterToolCallsToJSON = createChatCompletionRouterToolCallsToJSON;
255
+ exports.createChatCompletionRouterToolCallsFromJSON = createChatCompletionRouterToolCallsFromJSON;
256
+ exports.createChatCompletionRouterResponseAudioToJSON = createChatCompletionRouterResponseAudioToJSON;
257
+ exports.createChatCompletionRouterResponseAudioFromJSON = createChatCompletionRouterResponseAudioFromJSON;
258
+ exports.deltaToJSON = deltaToJSON;
259
+ exports.deltaFromJSON = deltaFromJSON;
260
+ exports.createChatCompletionRouterChoicesToJSON = createChatCompletionRouterChoicesToJSON;
261
+ exports.createChatCompletionRouterChoicesFromJSON = createChatCompletionRouterChoicesFromJSON;
262
+ exports.createChatCompletionPromptTokensDetailsToJSON = createChatCompletionPromptTokensDetailsToJSON;
263
+ exports.createChatCompletionPromptTokensDetailsFromJSON = createChatCompletionPromptTokensDetailsFromJSON;
264
+ exports.createChatCompletionCompletionTokensDetailsToJSON = createChatCompletionCompletionTokensDetailsToJSON;
265
+ exports.createChatCompletionCompletionTokensDetailsFromJSON = createChatCompletionCompletionTokensDetailsFromJSON;
266
+ exports.createChatCompletionRouterUsageToJSON = createChatCompletionRouterUsageToJSON;
267
+ exports.createChatCompletionRouterUsageFromJSON = createChatCompletionRouterUsageFromJSON;
268
+ exports.createChatCompletionDataToJSON = createChatCompletionDataToJSON;
269
+ exports.createChatCompletionDataFromJSON = createChatCompletionDataFromJSON;
270
+ exports.createChatCompletionRouterResponseBodyToJSON = createChatCompletionRouterResponseBodyToJSON;
271
+ exports.createChatCompletionRouterResponseBodyFromJSON = createChatCompletionRouterResponseBodyFromJSON;
272
+ exports.createChatCompletionRouterFunctionToJSON = createChatCompletionRouterFunctionToJSON;
273
+ exports.createChatCompletionRouterFunctionFromJSON = createChatCompletionRouterFunctionFromJSON;
274
+ exports.createChatCompletionToolCallsToJSON = createChatCompletionToolCallsToJSON;
275
+ exports.createChatCompletionToolCallsFromJSON = createChatCompletionToolCallsFromJSON;
276
+ exports.createChatCompletionRouterAudioToJSON = createChatCompletionRouterAudioToJSON;
277
+ exports.createChatCompletionRouterAudioFromJSON = createChatCompletionRouterAudioFromJSON;
278
+ exports.createChatCompletionMessageToJSON = createChatCompletionMessageToJSON;
279
+ exports.createChatCompletionMessageFromJSON = createChatCompletionMessageFromJSON;
280
+ exports.topLogprobsToJSON = topLogprobsToJSON;
281
+ exports.topLogprobsFromJSON = topLogprobsFromJSON;
282
+ exports.createChatCompletionContentToJSON = createChatCompletionContentToJSON;
283
+ exports.createChatCompletionContentFromJSON = createChatCompletionContentFromJSON;
284
+ exports.createChatCompletionTopLogprobsToJSON = createChatCompletionTopLogprobsToJSON;
285
+ exports.createChatCompletionTopLogprobsFromJSON = createChatCompletionTopLogprobsFromJSON;
286
+ exports.refusalToJSON = refusalToJSON;
287
+ exports.refusalFromJSON = refusalFromJSON;
288
+ exports.logprobsToJSON = logprobsToJSON;
289
+ exports.logprobsFromJSON = logprobsFromJSON;
290
+ exports.createChatCompletionChoicesToJSON = createChatCompletionChoicesToJSON;
291
+ exports.createChatCompletionChoicesFromJSON = createChatCompletionChoicesFromJSON;
292
+ exports.promptTokensDetailsToJSON = promptTokensDetailsToJSON;
293
+ exports.promptTokensDetailsFromJSON = promptTokensDetailsFromJSON;
294
+ exports.completionTokensDetailsToJSON = completionTokensDetailsToJSON;
295
+ exports.completionTokensDetailsFromJSON = completionTokensDetailsFromJSON;
296
+ exports.createChatCompletionUsageToJSON = createChatCompletionUsageToJSON;
297
+ exports.createChatCompletionUsageFromJSON = createChatCompletionUsageFromJSON;
298
+ exports.createChatCompletionResponseBodyToJSON = createChatCompletionResponseBodyToJSON;
299
+ exports.createChatCompletionResponseBodyFromJSON = createChatCompletionResponseBodyFromJSON;
300
+ exports.createChatCompletionResponseToJSON = createChatCompletionResponseToJSON;
301
+ exports.createChatCompletionResponseFromJSON = createChatCompletionResponseFromJSON;
302
+ const z = __importStar(require("zod/v3"));
303
+ const event_streams_js_1 = require("../../lib/event-streams.js");
304
+ const primitives_js_1 = require("../../lib/primitives.js");
305
+ const schemas_js_1 = require("../../lib/schemas.js");
306
+ const components = __importStar(require("../components/index.js"));
307
+ /**
308
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
309
+ */
310
+ exports.CreateChatCompletionMessagesRouterType = {
311
+ Ephemeral: "ephemeral",
312
+ };
313
+ /**
314
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
315
+ *
316
+ * @remarks
317
+ *
318
+ * - `5m`: 5 minutes
319
+ * - `1h`: 1 hour
320
+ *
321
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
322
+ */
323
+ exports.CreateChatCompletionMessagesTtl = {
324
+ Fivem: "5m",
325
+ Oneh: "1h",
326
+ };
327
+ /**
328
+ * The type of the tool. Currently, only `function` is supported.
329
+ */
330
+ exports.CreateChatCompletionMessagesType = {
331
+ Function: "function",
332
+ };
333
+ /**
334
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
335
+ */
336
+ exports.CreateChatCompletion2RouterType = {
337
+ Ephemeral: "ephemeral",
338
+ };
339
+ /**
340
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
341
+ *
342
+ * @remarks
343
+ *
344
+ * - `5m`: 5 minutes
345
+ * - `1h`: 1 hour
346
+ *
347
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
348
+ */
349
+ exports.CreateChatCompletion2Ttl = {
350
+ Fivem: "5m",
351
+ Oneh: "1h",
352
+ };
353
+ /**
354
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
355
+ */
356
+ exports.CreateChatCompletionVoice = {
357
+ Alloy: "alloy",
358
+ Echo: "echo",
359
+ Fable: "fable",
360
+ Onyx: "onyx",
361
+ Nova: "nova",
362
+ Shimmer: "shimmer",
363
+ };
364
+ /**
365
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
366
+ */
367
+ exports.CreateChatCompletionFormat = {
368
+ Wav: "wav",
369
+ Mp3: "mp3",
370
+ Flac: "flac",
371
+ Opus: "opus",
372
+ Pcm16: "pcm16",
373
+ };
374
+ /**
375
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
376
+ *
377
+ * @remarks
378
+ *
379
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
380
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
381
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
382
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
383
+ *
384
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
385
+ */
386
+ exports.CreateChatCompletionReasoningEffort = {
387
+ None: "none",
388
+ Minimal: "minimal",
389
+ Low: "low",
390
+ Medium: "medium",
391
+ High: "high",
392
+ Xhigh: "xhigh",
393
+ };
394
+ /**
395
+ * The type of the tool. Currently, only function is supported.
396
+ */
397
+ exports.CreateChatCompletionType = {
398
+ Function: "function",
399
+ };
400
+ exports.CreateChatCompletionRouterType = {
401
+ Object: "object",
402
+ };
403
+ /**
404
+ * The type of the tool. Currently, only function is supported.
405
+ */
406
+ exports.CreateChatCompletionToolChoiceType = {
407
+ Function: "function",
408
+ };
409
+ exports.CreateChatCompletionToolChoice1 = {
410
+ None: "none",
411
+ Auto: "auto",
412
+ Required: "required",
413
+ };
414
+ exports.CreateChatCompletionModalities = {
415
+ Text: "text",
416
+ Audio: "audio",
417
+ };
418
+ /**
419
+ * The key of the guardrail.
420
+ */
421
+ exports.CreateChatCompletionId1 = {
422
+ OrqPiiDetection: "orq_pii_detection",
423
+ };
424
+ /**
425
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
426
+ */
427
+ exports.CreateChatCompletionExecuteOn = {
428
+ Input: "input",
429
+ Output: "output",
430
+ };
431
+ /**
432
+ * Version of the prompt to use (currently only "latest" supported)
433
+ */
434
+ exports.Version = {
435
+ Latest: "latest",
436
+ };
437
+ exports.CreateChatCompletionRouterRequestType = {
438
+ ExactMatch: "exact_match",
439
+ };
440
+ /**
441
+ * The type of search to perform. If not provided, will default to the knowledge base configured `retrieval_type`
442
+ */
443
+ exports.CreateChatCompletionSearchType = {
444
+ VectorSearch: "vector_search",
445
+ KeywordSearch: "keyword_search",
446
+ HybridSearch: "hybrid_search",
447
+ };
448
+ exports.LoadBalancerType = {
449
+ WeightBased: "weight_based",
450
+ };
451
+ /**
452
+ * The reason the model stopped generating tokens.
453
+ */
454
+ exports.CreateChatCompletionFinishReason = {
455
+ Stop: "stop",
456
+ Length: "length",
457
+ ToolCalls: "tool_calls",
458
+ ContentFilter: "content_filter",
459
+ FunctionCall: "function_call",
460
+ };
461
+ /**
462
+ * The type of the tool. Currently, only `function` is supported.
463
+ */
464
+ exports.CreateChatCompletionRouterResponse200Type = {
465
+ Function: "function",
466
+ };
467
+ exports.CreateChatCompletionRouterRole = {
468
+ Assistant: "assistant",
469
+ };
470
+ exports.CreateChatCompletionRouterObject = {
471
+ ChatCompletionChunk: "chat.completion.chunk",
472
+ };
473
+ /**
474
+ * The reason the model stopped generating tokens.
475
+ */
476
+ exports.FinishReason = {
477
+ Stop: "stop",
478
+ Length: "length",
479
+ ToolCalls: "tool_calls",
480
+ ContentFilter: "content_filter",
481
+ FunctionCall: "function_call",
482
+ };
483
+ exports.CreateChatCompletionRouterResponseType = {
484
+ Function: "function",
485
+ };
486
+ exports.CreateChatCompletionRole = {
487
+ Assistant: "assistant",
488
+ };
489
+ exports.CreateChatCompletionObject = {
490
+ ChatCompletion: "chat.completion",
491
+ };
492
+ /** @internal */
493
+ exports.CreateChatCompletionContentRouterRequest2$inboundSchema = components.TextContentPartSchema$inboundSchema;
494
+ /** @internal */
495
+ exports.CreateChatCompletionContentRouterRequest2$outboundSchema = components.TextContentPartSchema$outboundSchema;
496
+ function createChatCompletionContentRouterRequest2ToJSON(createChatCompletionContentRouterRequest2) {
497
+ return JSON.stringify(exports.CreateChatCompletionContentRouterRequest2$outboundSchema.parse(createChatCompletionContentRouterRequest2));
498
+ }
499
+ function createChatCompletionContentRouterRequest2FromJSON(jsonString) {
500
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionContentRouterRequest2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionContentRouterRequest2' from JSON`);
501
+ }
502
+ /** @internal */
503
+ exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$inboundSchema = z.union([
504
+ z.string(),
505
+ z.array(components.TextContentPartSchema$inboundSchema),
506
+ ]);
507
+ /** @internal */
508
+ exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$outboundSchema = z.union([
509
+ z.string(),
510
+ z.array(components.TextContentPartSchema$outboundSchema),
511
+ ]);
512
+ function createChatCompletionMessagesRouterRequestRequestBody5ContentToJSON(createChatCompletionMessagesRouterRequestRequestBody5Content) {
513
+ return JSON.stringify(exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$outboundSchema
514
+ .parse(createChatCompletionMessagesRouterRequestRequestBody5Content));
515
+ }
516
+ function createChatCompletionMessagesRouterRequestRequestBody5ContentFromJSON(jsonString) {
517
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesRouterRequestRequestBody5Content$inboundSchema
518
+ .parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesRouterRequestRequestBody5Content' from JSON`);
519
+ }
520
+ /** @internal */
521
+ exports.CreateChatCompletionMessagesRouterType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionMessagesRouterType);
522
+ /** @internal */
523
+ exports.CreateChatCompletionMessagesRouterType$outboundSchema = exports.CreateChatCompletionMessagesRouterType$inboundSchema;
524
+ /** @internal */
525
+ exports.CreateChatCompletionMessagesTtl$inboundSchema = z.nativeEnum(exports.CreateChatCompletionMessagesTtl);
526
+ /** @internal */
527
+ exports.CreateChatCompletionMessagesTtl$outboundSchema = exports.CreateChatCompletionMessagesTtl$inboundSchema;
528
+ /** @internal */
529
+ exports.CreateChatCompletionMessagesCacheControl$inboundSchema = z.object({
530
+ type: exports.CreateChatCompletionMessagesRouterType$inboundSchema,
531
+ ttl: exports.CreateChatCompletionMessagesTtl$inboundSchema.default("5m"),
532
+ });
533
+ /** @internal */
534
+ exports.CreateChatCompletionMessagesCacheControl$outboundSchema = z.object({
535
+ type: exports.CreateChatCompletionMessagesRouterType$outboundSchema,
536
+ ttl: exports.CreateChatCompletionMessagesTtl$outboundSchema.default("5m"),
537
+ });
538
+ function createChatCompletionMessagesCacheControlToJSON(createChatCompletionMessagesCacheControl) {
539
+ return JSON.stringify(exports.CreateChatCompletionMessagesCacheControl$outboundSchema.parse(createChatCompletionMessagesCacheControl));
540
+ }
541
+ function createChatCompletionMessagesCacheControlFromJSON(jsonString) {
542
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesCacheControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesCacheControl' from JSON`);
543
+ }
544
+ /** @internal */
545
+ exports.CreateChatCompletionMessagesToolMessage$inboundSchema = z.object({
546
+ role: z.literal("tool"),
547
+ content: z.union([
548
+ z.string(),
549
+ z.array(components.TextContentPartSchema$inboundSchema),
550
+ ]),
551
+ tool_call_id: z.nullable(z.string()),
552
+ cache_control: z.lazy(() => exports.CreateChatCompletionMessagesCacheControl$inboundSchema).optional(),
553
+ }).transform((v) => {
554
+ return (0, primitives_js_1.remap)(v, {
555
+ "tool_call_id": "toolCallId",
556
+ "cache_control": "cacheControl",
557
+ });
558
+ });
559
+ /** @internal */
560
+ exports.CreateChatCompletionMessagesToolMessage$outboundSchema = z.object({
561
+ role: z.literal("tool"),
562
+ content: z.union([
563
+ z.string(),
564
+ z.array(components.TextContentPartSchema$outboundSchema),
565
+ ]),
566
+ toolCallId: z.nullable(z.string()),
567
+ cacheControl: z.lazy(() => exports.CreateChatCompletionMessagesCacheControl$outboundSchema).optional(),
568
+ }).transform((v) => {
569
+ return (0, primitives_js_1.remap)(v, {
570
+ toolCallId: "tool_call_id",
571
+ cacheControl: "cache_control",
572
+ });
573
+ });
574
+ function createChatCompletionMessagesToolMessageToJSON(createChatCompletionMessagesToolMessage) {
575
+ return JSON.stringify(exports.CreateChatCompletionMessagesToolMessage$outboundSchema.parse(createChatCompletionMessagesToolMessage));
576
+ }
577
+ function createChatCompletionMessagesToolMessageFromJSON(jsonString) {
578
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesToolMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesToolMessage' from JSON`);
579
+ }
580
+ /** @internal */
581
+ exports.CreateChatCompletionContentRouter2$inboundSchema = z.union([
582
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
583
+ components.RefusalPartSchema$inboundSchema,
584
+ components.ReasoningPartSchema$inboundSchema,
585
+ components.RedactedReasoningPartSchema$inboundSchema,
586
+ ]);
587
+ /** @internal */
588
+ exports.CreateChatCompletionContentRouter2$outboundSchema = z.union([
589
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
590
+ components.RefusalPartSchema$outboundSchema,
591
+ components.ReasoningPartSchema$outboundSchema,
592
+ components.RedactedReasoningPartSchema$outboundSchema,
593
+ ]);
594
+ function createChatCompletionContentRouter2ToJSON(createChatCompletionContentRouter2) {
595
+ return JSON.stringify(exports.CreateChatCompletionContentRouter2$outboundSchema.parse(createChatCompletionContentRouter2));
596
+ }
597
+ function createChatCompletionContentRouter2FromJSON(jsonString) {
598
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionContentRouter2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionContentRouter2' from JSON`);
599
+ }
600
+ /** @internal */
601
+ exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$inboundSchema = z.union([
602
+ z.string(),
603
+ z.array(z.union([
604
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
605
+ components.RefusalPartSchema$inboundSchema,
606
+ components.ReasoningPartSchema$inboundSchema,
607
+ components.RedactedReasoningPartSchema$inboundSchema,
608
+ ])),
609
+ ]);
610
+ /** @internal */
611
+ exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$outboundSchema = z.union([
612
+ z.string(),
613
+ z.array(z.union([
614
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
615
+ components.RefusalPartSchema$outboundSchema,
616
+ components.ReasoningPartSchema$outboundSchema,
617
+ components.RedactedReasoningPartSchema$outboundSchema,
618
+ ])),
619
+ ]);
620
+ function createChatCompletionMessagesRouterRequestRequestBodyContentToJSON(createChatCompletionMessagesRouterRequestRequestBodyContent) {
621
+ return JSON.stringify(exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$outboundSchema
622
+ .parse(createChatCompletionMessagesRouterRequestRequestBodyContent));
623
+ }
624
+ function createChatCompletionMessagesRouterRequestRequestBodyContentFromJSON(jsonString) {
625
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesRouterRequestRequestBodyContent$inboundSchema
626
+ .parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesRouterRequestRequestBodyContent' from JSON`);
627
+ }
628
+ /** @internal */
629
+ exports.CreateChatCompletionMessagesAudio$inboundSchema = z.object({
630
+ id: z.string(),
631
+ });
632
+ /** @internal */
633
+ exports.CreateChatCompletionMessagesAudio$outboundSchema = z.object({
634
+ id: z.string(),
635
+ });
636
+ function createChatCompletionMessagesAudioToJSON(createChatCompletionMessagesAudio) {
637
+ return JSON.stringify(exports.CreateChatCompletionMessagesAudio$outboundSchema.parse(createChatCompletionMessagesAudio));
638
+ }
639
+ function createChatCompletionMessagesAudioFromJSON(jsonString) {
640
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesAudio$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesAudio' from JSON`);
641
+ }
642
+ /** @internal */
643
+ exports.CreateChatCompletionMessagesType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionMessagesType);
644
+ /** @internal */
645
+ exports.CreateChatCompletionMessagesType$outboundSchema = exports.CreateChatCompletionMessagesType$inboundSchema;
646
+ /** @internal */
647
+ exports.CreateChatCompletionMessagesFunction$inboundSchema = z.object({
648
+ name: z.string().optional(),
649
+ arguments: z.string().optional(),
650
+ });
651
+ /** @internal */
652
+ exports.CreateChatCompletionMessagesFunction$outboundSchema = z.object({
653
+ name: z.string().optional(),
654
+ arguments: z.string().optional(),
655
+ });
656
+ function createChatCompletionMessagesFunctionToJSON(createChatCompletionMessagesFunction) {
657
+ return JSON.stringify(exports.CreateChatCompletionMessagesFunction$outboundSchema.parse(createChatCompletionMessagesFunction));
658
+ }
659
+ function createChatCompletionMessagesFunctionFromJSON(jsonString) {
660
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesFunction' from JSON`);
661
+ }
662
+ /** @internal */
663
+ exports.CreateChatCompletionMessagesToolCalls$inboundSchema = z.object({
664
+ id: z.string(),
665
+ type: exports.CreateChatCompletionMessagesType$inboundSchema,
666
+ function: z.lazy(() => exports.CreateChatCompletionMessagesFunction$inboundSchema),
667
+ thought_signature: z.string().optional(),
668
+ }).transform((v) => {
669
+ return (0, primitives_js_1.remap)(v, {
670
+ "thought_signature": "thoughtSignature",
671
+ });
672
+ });
673
+ /** @internal */
674
+ exports.CreateChatCompletionMessagesToolCalls$outboundSchema = z.object({
675
+ id: z.string(),
676
+ type: exports.CreateChatCompletionMessagesType$outboundSchema,
677
+ function: z.lazy(() => exports.CreateChatCompletionMessagesFunction$outboundSchema),
678
+ thoughtSignature: z.string().optional(),
679
+ }).transform((v) => {
680
+ return (0, primitives_js_1.remap)(v, {
681
+ thoughtSignature: "thought_signature",
682
+ });
683
+ });
684
+ function createChatCompletionMessagesToolCallsToJSON(createChatCompletionMessagesToolCalls) {
685
+ return JSON.stringify(exports.CreateChatCompletionMessagesToolCalls$outboundSchema.parse(createChatCompletionMessagesToolCalls));
686
+ }
687
+ function createChatCompletionMessagesToolCallsFromJSON(jsonString) {
688
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesToolCalls$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesToolCalls' from JSON`);
689
+ }
690
+ /** @internal */
691
+ exports.CreateChatCompletionMessagesAssistantMessage$inboundSchema = z.object({
692
+ content: z.nullable(z.union([
693
+ z.string(),
694
+ z.array(z.union([
695
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
696
+ components.RefusalPartSchema$inboundSchema,
697
+ components.ReasoningPartSchema$inboundSchema,
698
+ components.RedactedReasoningPartSchema$inboundSchema,
699
+ ])),
700
+ ])).optional(),
701
+ refusal: z.nullable(z.string()).optional(),
702
+ role: z.literal("assistant"),
703
+ name: z.string().optional(),
704
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionMessagesAudio$inboundSchema)).optional(),
705
+ tool_calls: z.array(z.lazy(() => exports.CreateChatCompletionMessagesToolCalls$inboundSchema)).optional(),
706
+ }).transform((v) => {
707
+ return (0, primitives_js_1.remap)(v, {
708
+ "tool_calls": "toolCalls",
709
+ });
710
+ });
711
+ /** @internal */
712
+ exports.CreateChatCompletionMessagesAssistantMessage$outboundSchema = z.object({
713
+ content: z.nullable(z.union([
714
+ z.string(),
715
+ z.array(z.union([
716
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
717
+ components.RefusalPartSchema$outboundSchema,
718
+ components.ReasoningPartSchema$outboundSchema,
719
+ components.RedactedReasoningPartSchema$outboundSchema,
720
+ ])),
721
+ ])).optional(),
722
+ refusal: z.nullable(z.string()).optional(),
723
+ role: z.literal("assistant"),
724
+ name: z.string().optional(),
725
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionMessagesAudio$outboundSchema)).optional(),
726
+ toolCalls: z.array(z.lazy(() => exports.CreateChatCompletionMessagesToolCalls$outboundSchema)).optional(),
727
+ }).transform((v) => {
728
+ return (0, primitives_js_1.remap)(v, {
729
+ toolCalls: "tool_calls",
730
+ });
731
+ });
732
+ function createChatCompletionMessagesAssistantMessageToJSON(createChatCompletionMessagesAssistantMessage) {
733
+ return JSON.stringify(exports.CreateChatCompletionMessagesAssistantMessage$outboundSchema.parse(createChatCompletionMessagesAssistantMessage));
734
+ }
735
+ function createChatCompletionMessagesAssistantMessageFromJSON(jsonString) {
736
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesAssistantMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesAssistantMessage' from JSON`);
737
+ }
738
+ /** @internal */
739
+ exports.CreateChatCompletion2RouterType$inboundSchema = z.nativeEnum(exports.CreateChatCompletion2RouterType);
740
+ /** @internal */
741
+ exports.CreateChatCompletion2RouterType$outboundSchema = exports.CreateChatCompletion2RouterType$inboundSchema;
742
+ /** @internal */
743
+ exports.CreateChatCompletion2Ttl$inboundSchema = z.nativeEnum(exports.CreateChatCompletion2Ttl);
744
+ /** @internal */
745
+ exports.CreateChatCompletion2Ttl$outboundSchema = exports.CreateChatCompletion2Ttl$inboundSchema;
746
+ /** @internal */
747
+ exports.CreateChatCompletion2CacheControl$inboundSchema = z.object({
748
+ type: exports.CreateChatCompletion2RouterType$inboundSchema,
749
+ ttl: exports.CreateChatCompletion2Ttl$inboundSchema.default("5m"),
750
+ });
751
+ /** @internal */
752
+ exports.CreateChatCompletion2CacheControl$outboundSchema = z.object({
753
+ type: exports.CreateChatCompletion2RouterType$outboundSchema,
754
+ ttl: exports.CreateChatCompletion2Ttl$outboundSchema.default("5m"),
755
+ });
756
+ function createChatCompletion2CacheControlToJSON(createChatCompletion2CacheControl) {
757
+ return JSON.stringify(exports.CreateChatCompletion2CacheControl$outboundSchema.parse(createChatCompletion2CacheControl));
758
+ }
759
+ function createChatCompletion2CacheControlFromJSON(jsonString) {
760
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion2CacheControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion2CacheControl' from JSON`);
761
+ }
762
+ /** @internal */
763
+ exports.CreateChatCompletion24$inboundSchema = z.object({
764
+ type: z.literal("file"),
765
+ cache_control: z.lazy(() => exports.CreateChatCompletion2CacheControl$inboundSchema)
766
+ .optional(),
767
+ file: components.FileContentPartSchema$inboundSchema,
768
+ }).transform((v) => {
769
+ return (0, primitives_js_1.remap)(v, {
770
+ "cache_control": "cacheControl",
771
+ });
772
+ });
773
+ /** @internal */
774
+ exports.CreateChatCompletion24$outboundSchema = z.object({
775
+ type: z.literal("file"),
776
+ cacheControl: z.lazy(() => exports.CreateChatCompletion2CacheControl$outboundSchema)
777
+ .optional(),
778
+ file: components.FileContentPartSchema$outboundSchema,
779
+ }).transform((v) => {
780
+ return (0, primitives_js_1.remap)(v, {
781
+ cacheControl: "cache_control",
782
+ });
783
+ });
784
+ function createChatCompletion24ToJSON(createChatCompletion24) {
785
+ return JSON.stringify(exports.CreateChatCompletion24$outboundSchema.parse(createChatCompletion24));
786
+ }
787
+ function createChatCompletion24FromJSON(jsonString) {
788
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion24$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion24' from JSON`);
789
+ }
790
+ /** @internal */
791
+ exports.CreateChatCompletionContent2$inboundSchema = z.union([
792
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
793
+ components.ImageContentPartSchema$inboundSchema,
794
+ components.AudioContentPartSchema$inboundSchema,
795
+ z.lazy(() => exports.CreateChatCompletion24$inboundSchema),
796
+ ]);
797
+ /** @internal */
798
+ exports.CreateChatCompletionContent2$outboundSchema = z.union([
799
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
800
+ components.ImageContentPartSchema$outboundSchema,
801
+ components.AudioContentPartSchema$outboundSchema,
802
+ z.lazy(() => exports.CreateChatCompletion24$outboundSchema),
803
+ ]);
804
+ function createChatCompletionContent2ToJSON(createChatCompletionContent2) {
805
+ return JSON.stringify(exports.CreateChatCompletionContent2$outboundSchema.parse(createChatCompletionContent2));
806
+ }
807
+ function createChatCompletionContent2FromJSON(jsonString) {
808
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionContent2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionContent2' from JSON`);
809
+ }
810
+ /** @internal */
811
+ exports.CreateChatCompletionMessagesRouterRequestContent$inboundSchema = z.union([
812
+ z.string(),
813
+ z.array(z.union([
814
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
815
+ components.ImageContentPartSchema$inboundSchema,
816
+ components.AudioContentPartSchema$inboundSchema,
817
+ z.lazy(() => exports.CreateChatCompletion24$inboundSchema),
818
+ ])),
819
+ ]);
820
+ /** @internal */
821
+ exports.CreateChatCompletionMessagesRouterRequestContent$outboundSchema = z.union([
822
+ z.string(),
823
+ z.array(z.union([
824
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
825
+ components.ImageContentPartSchema$outboundSchema,
826
+ components.AudioContentPartSchema$outboundSchema,
827
+ z.lazy(() => exports.CreateChatCompletion24$outboundSchema),
828
+ ])),
829
+ ]);
830
+ function createChatCompletionMessagesRouterRequestContentToJSON(createChatCompletionMessagesRouterRequestContent) {
831
+ return JSON.stringify(exports.CreateChatCompletionMessagesRouterRequestContent$outboundSchema.parse(createChatCompletionMessagesRouterRequestContent));
832
+ }
833
+ function createChatCompletionMessagesRouterRequestContentFromJSON(jsonString) {
834
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesRouterRequestContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesRouterRequestContent' from JSON`);
835
+ }
836
+ /** @internal */
837
+ exports.CreateChatCompletionMessagesUserMessage$inboundSchema = z.object({
838
+ role: z.literal("user"),
839
+ name: z.string().optional(),
840
+ content: z.union([
841
+ z.string(),
842
+ z.array(z.union([
843
+ components.TextContentPartSchema$inboundSchema.and(z.object({ type: z.literal("text") })),
844
+ components.ImageContentPartSchema$inboundSchema,
845
+ components.AudioContentPartSchema$inboundSchema,
846
+ z.lazy(() => exports.CreateChatCompletion24$inboundSchema),
847
+ ])),
848
+ ]),
849
+ });
850
+ /** @internal */
851
+ exports.CreateChatCompletionMessagesUserMessage$outboundSchema = z.object({
852
+ role: z.literal("user"),
853
+ name: z.string().optional(),
854
+ content: z.union([
855
+ z.string(),
856
+ z.array(z.union([
857
+ components.TextContentPartSchema$outboundSchema.and(z.object({ type: z.literal("text") })),
858
+ components.ImageContentPartSchema$outboundSchema,
859
+ components.AudioContentPartSchema$outboundSchema,
860
+ z.lazy(() => exports.CreateChatCompletion24$outboundSchema),
861
+ ])),
862
+ ]),
863
+ });
864
+ function createChatCompletionMessagesUserMessageToJSON(createChatCompletionMessagesUserMessage) {
865
+ return JSON.stringify(exports.CreateChatCompletionMessagesUserMessage$outboundSchema.parse(createChatCompletionMessagesUserMessage));
866
+ }
867
+ function createChatCompletionMessagesUserMessageFromJSON(jsonString) {
868
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesUserMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesUserMessage' from JSON`);
869
+ }
870
+ /** @internal */
871
+ exports.CreateChatCompletionMessagesRouterContent$inboundSchema = z.union([
872
+ z.string(),
873
+ z.array(components.TextContentPartSchema$inboundSchema),
874
+ ]);
875
+ /** @internal */
876
+ exports.CreateChatCompletionMessagesRouterContent$outboundSchema = z.union([
877
+ z.string(),
878
+ z.array(components.TextContentPartSchema$outboundSchema),
879
+ ]);
880
+ function createChatCompletionMessagesRouterContentToJSON(createChatCompletionMessagesRouterContent) {
881
+ return JSON.stringify(exports.CreateChatCompletionMessagesRouterContent$outboundSchema.parse(createChatCompletionMessagesRouterContent));
882
+ }
883
+ function createChatCompletionMessagesRouterContentFromJSON(jsonString) {
884
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesRouterContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesRouterContent' from JSON`);
885
+ }
886
+ /** @internal */
887
+ exports.CreateChatCompletionMessagesDeveloperMessage$inboundSchema = z.object({
888
+ role: z.literal("developer"),
889
+ content: z.union([
890
+ z.string(),
891
+ z.array(components.TextContentPartSchema$inboundSchema),
892
+ ]),
893
+ name: z.string().optional(),
894
+ });
895
+ /** @internal */
896
+ exports.CreateChatCompletionMessagesDeveloperMessage$outboundSchema = z.object({
897
+ role: z.literal("developer"),
898
+ content: z.union([
899
+ z.string(),
900
+ z.array(components.TextContentPartSchema$outboundSchema),
901
+ ]),
902
+ name: z.string().optional(),
903
+ });
904
+ function createChatCompletionMessagesDeveloperMessageToJSON(createChatCompletionMessagesDeveloperMessage) {
905
+ return JSON.stringify(exports.CreateChatCompletionMessagesDeveloperMessage$outboundSchema.parse(createChatCompletionMessagesDeveloperMessage));
906
+ }
907
+ function createChatCompletionMessagesDeveloperMessageFromJSON(jsonString) {
908
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesDeveloperMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesDeveloperMessage' from JSON`);
909
+ }
910
+ /** @internal */
911
+ exports.CreateChatCompletionMessagesContent$inboundSchema = z.union([
912
+ z.string(),
913
+ z.array(components.TextContentPartSchema$inboundSchema),
914
+ ]);
915
+ /** @internal */
916
+ exports.CreateChatCompletionMessagesContent$outboundSchema = z.union([
917
+ z.string(),
918
+ z.array(components.TextContentPartSchema$outboundSchema),
919
+ ]);
920
+ function createChatCompletionMessagesContentToJSON(createChatCompletionMessagesContent) {
921
+ return JSON.stringify(exports.CreateChatCompletionMessagesContent$outboundSchema.parse(createChatCompletionMessagesContent));
922
+ }
923
+ function createChatCompletionMessagesContentFromJSON(jsonString) {
924
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesContent' from JSON`);
925
+ }
926
+ /** @internal */
927
+ exports.CreateChatCompletionMessagesSystemMessage$inboundSchema = z.object({
928
+ role: z.literal("system"),
929
+ content: z.union([
930
+ z.string(),
931
+ z.array(components.TextContentPartSchema$inboundSchema),
932
+ ]),
933
+ name: z.string().optional(),
934
+ });
935
+ /** @internal */
936
+ exports.CreateChatCompletionMessagesSystemMessage$outboundSchema = z.object({
937
+ role: z.literal("system"),
938
+ content: z.union([
939
+ z.string(),
940
+ z.array(components.TextContentPartSchema$outboundSchema),
941
+ ]),
942
+ name: z.string().optional(),
943
+ });
944
+ function createChatCompletionMessagesSystemMessageToJSON(createChatCompletionMessagesSystemMessage) {
945
+ return JSON.stringify(exports.CreateChatCompletionMessagesSystemMessage$outboundSchema.parse(createChatCompletionMessagesSystemMessage));
946
+ }
947
+ function createChatCompletionMessagesSystemMessageFromJSON(jsonString) {
948
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessagesSystemMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessagesSystemMessage' from JSON`);
949
+ }
950
+ /** @internal */
951
+ exports.CreateChatCompletionMessages$inboundSchema = z.union([
952
+ z.lazy(() => exports.CreateChatCompletionMessagesSystemMessage$inboundSchema),
953
+ z.lazy(() => exports.CreateChatCompletionMessagesDeveloperMessage$inboundSchema),
954
+ z.lazy(() => exports.CreateChatCompletionMessagesUserMessage$inboundSchema),
955
+ z.lazy(() => exports.CreateChatCompletionMessagesAssistantMessage$inboundSchema),
956
+ z.lazy(() => exports.CreateChatCompletionMessagesToolMessage$inboundSchema),
957
+ ]);
958
+ /** @internal */
959
+ exports.CreateChatCompletionMessages$outboundSchema = z.union([
960
+ z.lazy(() => exports.CreateChatCompletionMessagesSystemMessage$outboundSchema),
961
+ z.lazy(() => exports.CreateChatCompletionMessagesDeveloperMessage$outboundSchema),
962
+ z.lazy(() => exports.CreateChatCompletionMessagesUserMessage$outboundSchema),
963
+ z.lazy(() => exports.CreateChatCompletionMessagesAssistantMessage$outboundSchema),
964
+ z.lazy(() => exports.CreateChatCompletionMessagesToolMessage$outboundSchema),
965
+ ]);
966
+ function createChatCompletionMessagesToJSON(createChatCompletionMessages) {
967
+ return JSON.stringify(exports.CreateChatCompletionMessages$outboundSchema.parse(createChatCompletionMessages));
968
+ }
969
+ function createChatCompletionMessagesFromJSON(jsonString) {
970
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessages' from JSON`);
971
+ }
972
+ /** @internal */
973
+ exports.CreateChatCompletionVoice$inboundSchema = z.nativeEnum(exports.CreateChatCompletionVoice);
974
+ /** @internal */
975
+ exports.CreateChatCompletionVoice$outboundSchema = exports.CreateChatCompletionVoice$inboundSchema;
976
+ /** @internal */
977
+ exports.CreateChatCompletionFormat$inboundSchema = z.nativeEnum(exports.CreateChatCompletionFormat);
978
+ /** @internal */
979
+ exports.CreateChatCompletionFormat$outboundSchema = exports.CreateChatCompletionFormat$inboundSchema;
980
+ /** @internal */
981
+ exports.CreateChatCompletionAudio$inboundSchema = z.object({
982
+ voice: exports.CreateChatCompletionVoice$inboundSchema,
983
+ format: exports.CreateChatCompletionFormat$inboundSchema,
984
+ });
985
+ /** @internal */
986
+ exports.CreateChatCompletionAudio$outboundSchema = z.object({
987
+ voice: exports.CreateChatCompletionVoice$outboundSchema,
988
+ format: exports.CreateChatCompletionFormat$outboundSchema,
989
+ });
990
+ function createChatCompletionAudioToJSON(createChatCompletionAudio) {
991
+ return JSON.stringify(exports.CreateChatCompletionAudio$outboundSchema.parse(createChatCompletionAudio));
992
+ }
993
+ function createChatCompletionAudioFromJSON(jsonString) {
994
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAudio$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAudio' from JSON`);
995
+ }
996
+ /** @internal */
997
+ exports.CreateChatCompletionResponseFormatRouterJsonSchema$inboundSchema = z.object({
998
+ description: z.string().optional(),
999
+ name: z.string(),
1000
+ schema: z.any().optional(),
1001
+ strict: z.boolean().default(false),
1002
+ });
1003
+ /** @internal */
1004
+ exports.CreateChatCompletionResponseFormatRouterJsonSchema$outboundSchema = z.object({
1005
+ description: z.string().optional(),
1006
+ name: z.string(),
1007
+ schema: z.any().optional(),
1008
+ strict: z.boolean().default(false),
1009
+ });
1010
+ function createChatCompletionResponseFormatRouterJsonSchemaToJSON(createChatCompletionResponseFormatRouterJsonSchema) {
1011
+ return JSON.stringify(exports.CreateChatCompletionResponseFormatRouterJsonSchema$outboundSchema.parse(createChatCompletionResponseFormatRouterJsonSchema));
1012
+ }
1013
+ function createChatCompletionResponseFormatRouterJsonSchemaFromJSON(jsonString) {
1014
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseFormatRouterJsonSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseFormatRouterJsonSchema' from JSON`);
1015
+ }
1016
+ /** @internal */
1017
+ exports.CreateChatCompletionResponseFormatJSONSchema$inboundSchema = z.object({
1018
+ type: z.literal("json_schema"),
1019
+ json_schema: z.lazy(() => exports.CreateChatCompletionResponseFormatRouterJsonSchema$inboundSchema),
1020
+ }).transform((v) => {
1021
+ return (0, primitives_js_1.remap)(v, {
1022
+ "json_schema": "jsonSchema",
1023
+ });
1024
+ });
1025
+ /** @internal */
1026
+ exports.CreateChatCompletionResponseFormatJSONSchema$outboundSchema = z.object({
1027
+ type: z.literal("json_schema"),
1028
+ jsonSchema: z.lazy(() => exports.CreateChatCompletionResponseFormatRouterJsonSchema$outboundSchema),
1029
+ }).transform((v) => {
1030
+ return (0, primitives_js_1.remap)(v, {
1031
+ jsonSchema: "json_schema",
1032
+ });
1033
+ });
1034
+ function createChatCompletionResponseFormatJSONSchemaToJSON(createChatCompletionResponseFormatJSONSchema) {
1035
+ return JSON.stringify(exports.CreateChatCompletionResponseFormatJSONSchema$outboundSchema.parse(createChatCompletionResponseFormatJSONSchema));
1036
+ }
1037
+ function createChatCompletionResponseFormatJSONSchemaFromJSON(jsonString) {
1038
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseFormatJSONSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseFormatJSONSchema' from JSON`);
1039
+ }
1040
+ /** @internal */
1041
+ exports.CreateChatCompletionResponseFormatJSONObject$inboundSchema = z.object({
1042
+ type: z.literal("json_object"),
1043
+ });
1044
+ /** @internal */
1045
+ exports.CreateChatCompletionResponseFormatJSONObject$outboundSchema = z.object({
1046
+ type: z.literal("json_object"),
1047
+ });
1048
+ function createChatCompletionResponseFormatJSONObjectToJSON(createChatCompletionResponseFormatJSONObject) {
1049
+ return JSON.stringify(exports.CreateChatCompletionResponseFormatJSONObject$outboundSchema.parse(createChatCompletionResponseFormatJSONObject));
1050
+ }
1051
+ function createChatCompletionResponseFormatJSONObjectFromJSON(jsonString) {
1052
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseFormatJSONObject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseFormatJSONObject' from JSON`);
1053
+ }
1054
+ /** @internal */
1055
+ exports.CreateChatCompletionResponseFormatText$inboundSchema = z.object({
1056
+ type: z.literal("text"),
1057
+ });
1058
+ /** @internal */
1059
+ exports.CreateChatCompletionResponseFormatText$outboundSchema = z.object({
1060
+ type: z.literal("text"),
1061
+ });
1062
+ function createChatCompletionResponseFormatTextToJSON(createChatCompletionResponseFormatText) {
1063
+ return JSON.stringify(exports.CreateChatCompletionResponseFormatText$outboundSchema.parse(createChatCompletionResponseFormatText));
1064
+ }
1065
+ function createChatCompletionResponseFormatTextFromJSON(jsonString) {
1066
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseFormatText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseFormatText' from JSON`);
1067
+ }
1068
+ /** @internal */
1069
+ exports.CreateChatCompletionResponseFormat$inboundSchema = z.union([
1070
+ z.lazy(() => exports.CreateChatCompletionResponseFormatText$inboundSchema),
1071
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONObject$inboundSchema),
1072
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONSchema$inboundSchema),
1073
+ ]);
1074
+ /** @internal */
1075
+ exports.CreateChatCompletionResponseFormat$outboundSchema = z.union([
1076
+ z.lazy(() => exports.CreateChatCompletionResponseFormatText$outboundSchema),
1077
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONObject$outboundSchema),
1078
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONSchema$outboundSchema),
1079
+ ]);
1080
+ function createChatCompletionResponseFormatToJSON(createChatCompletionResponseFormat) {
1081
+ return JSON.stringify(exports.CreateChatCompletionResponseFormat$outboundSchema.parse(createChatCompletionResponseFormat));
1082
+ }
1083
+ function createChatCompletionResponseFormatFromJSON(jsonString) {
1084
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseFormat' from JSON`);
1085
+ }
1086
+ /** @internal */
1087
+ exports.CreateChatCompletionReasoningEffort$inboundSchema = z.nativeEnum(exports.CreateChatCompletionReasoningEffort);
1088
+ /** @internal */
1089
+ exports.CreateChatCompletionReasoningEffort$outboundSchema = exports.CreateChatCompletionReasoningEffort$inboundSchema;
1090
+ /** @internal */
1091
+ exports.CreateChatCompletionStop$inboundSchema = z.union([z.string(), z.array(z.string())]);
1092
+ /** @internal */
1093
+ exports.CreateChatCompletionStop$outboundSchema = z.union([z.string(), z.array(z.string())]);
1094
+ function createChatCompletionStopToJSON(createChatCompletionStop) {
1095
+ return JSON.stringify(exports.CreateChatCompletionStop$outboundSchema.parse(createChatCompletionStop));
1096
+ }
1097
+ function createChatCompletionStopFromJSON(jsonString) {
1098
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionStop$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionStop' from JSON`);
1099
+ }
1100
+ /** @internal */
1101
+ exports.CreateChatCompletionStreamOptions$inboundSchema = z.object({
1102
+ include_usage: z.boolean().optional(),
1103
+ }).transform((v) => {
1104
+ return (0, primitives_js_1.remap)(v, {
1105
+ "include_usage": "includeUsage",
1106
+ });
1107
+ });
1108
+ /** @internal */
1109
+ exports.CreateChatCompletionStreamOptions$outboundSchema = z.object({
1110
+ includeUsage: z.boolean().optional(),
1111
+ }).transform((v) => {
1112
+ return (0, primitives_js_1.remap)(v, {
1113
+ includeUsage: "include_usage",
1114
+ });
1115
+ });
1116
+ function createChatCompletionStreamOptionsToJSON(createChatCompletionStreamOptions) {
1117
+ return JSON.stringify(exports.CreateChatCompletionStreamOptions$outboundSchema.parse(createChatCompletionStreamOptions));
1118
+ }
1119
+ function createChatCompletionStreamOptionsFromJSON(jsonString) {
1120
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionStreamOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionStreamOptions' from JSON`);
1121
+ }
1122
+ /** @internal */
1123
+ exports.CreateChatCompletionThinking$inboundSchema = z.union([
1124
+ components.ThinkingConfigDisabledSchema$inboundSchema,
1125
+ components.ThinkingConfigEnabledSchema$inboundSchema,
1126
+ ]);
1127
+ /** @internal */
1128
+ exports.CreateChatCompletionThinking$outboundSchema = z.union([
1129
+ components.ThinkingConfigDisabledSchema$outboundSchema,
1130
+ components.ThinkingConfigEnabledSchema$outboundSchema,
1131
+ ]);
1132
+ function createChatCompletionThinkingToJSON(createChatCompletionThinking) {
1133
+ return JSON.stringify(exports.CreateChatCompletionThinking$outboundSchema.parse(createChatCompletionThinking));
1134
+ }
1135
+ function createChatCompletionThinkingFromJSON(jsonString) {
1136
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionThinking$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionThinking' from JSON`);
1137
+ }
1138
+ /** @internal */
1139
+ exports.CreateChatCompletionType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionType);
1140
+ /** @internal */
1141
+ exports.CreateChatCompletionType$outboundSchema = exports.CreateChatCompletionType$inboundSchema;
1142
+ /** @internal */
1143
+ exports.CreateChatCompletionRouterType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRouterType);
1144
+ /** @internal */
1145
+ exports.CreateChatCompletionRouterType$outboundSchema = exports.CreateChatCompletionRouterType$inboundSchema;
1146
+ /** @internal */
1147
+ exports.CreateChatCompletionParameters$inboundSchema = z.object({
1148
+ type: exports.CreateChatCompletionRouterType$inboundSchema,
1149
+ properties: z.record(z.any()),
1150
+ required: z.array(z.string()).optional(),
1151
+ additionalProperties: z.boolean().optional(),
1152
+ });
1153
+ /** @internal */
1154
+ exports.CreateChatCompletionParameters$outboundSchema = z.object({
1155
+ type: exports.CreateChatCompletionRouterType$outboundSchema,
1156
+ properties: z.record(z.any()),
1157
+ required: z.array(z.string()).optional(),
1158
+ additionalProperties: z.boolean().optional(),
1159
+ });
1160
+ function createChatCompletionParametersToJSON(createChatCompletionParameters) {
1161
+ return JSON.stringify(exports.CreateChatCompletionParameters$outboundSchema.parse(createChatCompletionParameters));
1162
+ }
1163
+ function createChatCompletionParametersFromJSON(jsonString) {
1164
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionParameters' from JSON`);
1165
+ }
1166
+ /** @internal */
1167
+ exports.CreateChatCompletionFunction$inboundSchema = z.object({
1168
+ name: z.string(),
1169
+ description: z.string().optional(),
1170
+ parameters: z.lazy(() => exports.CreateChatCompletionParameters$inboundSchema)
1171
+ .optional(),
1172
+ strict: z.boolean().optional(),
1173
+ });
1174
+ /** @internal */
1175
+ exports.CreateChatCompletionFunction$outboundSchema = z.object({
1176
+ name: z.string(),
1177
+ description: z.string().optional(),
1178
+ parameters: z.lazy(() => exports.CreateChatCompletionParameters$outboundSchema)
1179
+ .optional(),
1180
+ strict: z.boolean().optional(),
1181
+ });
1182
+ function createChatCompletionFunctionToJSON(createChatCompletionFunction) {
1183
+ return JSON.stringify(exports.CreateChatCompletionFunction$outboundSchema.parse(createChatCompletionFunction));
1184
+ }
1185
+ function createChatCompletionFunctionFromJSON(jsonString) {
1186
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFunction' from JSON`);
1187
+ }
1188
+ /** @internal */
1189
+ exports.CreateChatCompletionTools$inboundSchema = z.object({
1190
+ type: exports.CreateChatCompletionType$inboundSchema.optional(),
1191
+ function: z.lazy(() => exports.CreateChatCompletionFunction$inboundSchema),
1192
+ });
1193
+ /** @internal */
1194
+ exports.CreateChatCompletionTools$outboundSchema = z.object({
1195
+ type: exports.CreateChatCompletionType$outboundSchema.optional(),
1196
+ function: z.lazy(() => exports.CreateChatCompletionFunction$outboundSchema),
1197
+ });
1198
+ function createChatCompletionToolsToJSON(createChatCompletionTools) {
1199
+ return JSON.stringify(exports.CreateChatCompletionTools$outboundSchema.parse(createChatCompletionTools));
1200
+ }
1201
+ function createChatCompletionToolsFromJSON(jsonString) {
1202
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionTools' from JSON`);
1203
+ }
1204
+ /** @internal */
1205
+ exports.CreateChatCompletionToolChoiceType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionToolChoiceType);
1206
+ /** @internal */
1207
+ exports.CreateChatCompletionToolChoiceType$outboundSchema = exports.CreateChatCompletionToolChoiceType$inboundSchema;
1208
+ /** @internal */
1209
+ exports.CreateChatCompletionToolChoiceFunction$inboundSchema = z.object({
1210
+ name: z.string(),
1211
+ });
1212
+ /** @internal */
1213
+ exports.CreateChatCompletionToolChoiceFunction$outboundSchema = z.object({
1214
+ name: z.string(),
1215
+ });
1216
+ function createChatCompletionToolChoiceFunctionToJSON(createChatCompletionToolChoiceFunction) {
1217
+ return JSON.stringify(exports.CreateChatCompletionToolChoiceFunction$outboundSchema.parse(createChatCompletionToolChoiceFunction));
1218
+ }
1219
+ function createChatCompletionToolChoiceFunctionFromJSON(jsonString) {
1220
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionToolChoiceFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionToolChoiceFunction' from JSON`);
1221
+ }
1222
+ /** @internal */
1223
+ exports.CreateChatCompletionToolChoice2$inboundSchema = z.object({
1224
+ type: exports.CreateChatCompletionToolChoiceType$inboundSchema.optional(),
1225
+ function: z.lazy(() => exports.CreateChatCompletionToolChoiceFunction$inboundSchema),
1226
+ });
1227
+ /** @internal */
1228
+ exports.CreateChatCompletionToolChoice2$outboundSchema = z.object({
1229
+ type: exports.CreateChatCompletionToolChoiceType$outboundSchema.optional(),
1230
+ function: z.lazy(() => exports.CreateChatCompletionToolChoiceFunction$outboundSchema),
1231
+ });
1232
+ function createChatCompletionToolChoice2ToJSON(createChatCompletionToolChoice2) {
1233
+ return JSON.stringify(exports.CreateChatCompletionToolChoice2$outboundSchema.parse(createChatCompletionToolChoice2));
1234
+ }
1235
+ function createChatCompletionToolChoice2FromJSON(jsonString) {
1236
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionToolChoice2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionToolChoice2' from JSON`);
1237
+ }
1238
+ /** @internal */
1239
+ exports.CreateChatCompletionToolChoice1$inboundSchema = z.nativeEnum(exports.CreateChatCompletionToolChoice1);
1240
+ /** @internal */
1241
+ exports.CreateChatCompletionToolChoice1$outboundSchema = exports.CreateChatCompletionToolChoice1$inboundSchema;
1242
+ /** @internal */
1243
+ exports.CreateChatCompletionToolChoice$inboundSchema = z.union([
1244
+ z.lazy(() => exports.CreateChatCompletionToolChoice2$inboundSchema),
1245
+ exports.CreateChatCompletionToolChoice1$inboundSchema,
1246
+ ]);
1247
+ /** @internal */
1248
+ exports.CreateChatCompletionToolChoice$outboundSchema = z.union([
1249
+ z.lazy(() => exports.CreateChatCompletionToolChoice2$outboundSchema),
1250
+ exports.CreateChatCompletionToolChoice1$outboundSchema,
1251
+ ]);
1252
+ function createChatCompletionToolChoiceToJSON(createChatCompletionToolChoice) {
1253
+ return JSON.stringify(exports.CreateChatCompletionToolChoice$outboundSchema.parse(createChatCompletionToolChoice));
1254
+ }
1255
+ function createChatCompletionToolChoiceFromJSON(jsonString) {
1256
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionToolChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionToolChoice' from JSON`);
1257
+ }
1258
+ /** @internal */
1259
+ exports.CreateChatCompletionModalities$inboundSchema = z.nativeEnum(exports.CreateChatCompletionModalities);
1260
+ /** @internal */
1261
+ exports.CreateChatCompletionModalities$outboundSchema = exports.CreateChatCompletionModalities$inboundSchema;
1262
+ /** @internal */
1263
+ exports.CreateChatCompletionId1$inboundSchema = z.nativeEnum(exports.CreateChatCompletionId1);
1264
+ /** @internal */
1265
+ exports.CreateChatCompletionId1$outboundSchema = exports.CreateChatCompletionId1$inboundSchema;
1266
+ /** @internal */
1267
+ exports.CreateChatCompletionId$inboundSchema = z.union([exports.CreateChatCompletionId1$inboundSchema, z.string()]);
1268
+ /** @internal */
1269
+ exports.CreateChatCompletionId$outboundSchema = z.union([exports.CreateChatCompletionId1$outboundSchema, z.string()]);
1270
+ function createChatCompletionIdToJSON(createChatCompletionId) {
1271
+ return JSON.stringify(exports.CreateChatCompletionId$outboundSchema.parse(createChatCompletionId));
1272
+ }
1273
+ function createChatCompletionIdFromJSON(jsonString) {
1274
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionId' from JSON`);
1275
+ }
1276
+ /** @internal */
1277
+ exports.CreateChatCompletionExecuteOn$inboundSchema = z.nativeEnum(exports.CreateChatCompletionExecuteOn);
1278
+ /** @internal */
1279
+ exports.CreateChatCompletionExecuteOn$outboundSchema = exports.CreateChatCompletionExecuteOn$inboundSchema;
1280
+ /** @internal */
1281
+ exports.CreateChatCompletionGuardrails$inboundSchema = z.object({
1282
+ id: z.union([exports.CreateChatCompletionId1$inboundSchema, z.string()]),
1283
+ execute_on: exports.CreateChatCompletionExecuteOn$inboundSchema,
1284
+ }).transform((v) => {
1285
+ return (0, primitives_js_1.remap)(v, {
1286
+ "execute_on": "executeOn",
1287
+ });
1288
+ });
1289
+ /** @internal */
1290
+ exports.CreateChatCompletionGuardrails$outboundSchema = z.object({
1291
+ id: z.union([exports.CreateChatCompletionId1$outboundSchema, z.string()]),
1292
+ executeOn: exports.CreateChatCompletionExecuteOn$outboundSchema,
1293
+ }).transform((v) => {
1294
+ return (0, primitives_js_1.remap)(v, {
1295
+ executeOn: "execute_on",
1296
+ });
1297
+ });
1298
+ function createChatCompletionGuardrailsToJSON(createChatCompletionGuardrails) {
1299
+ return JSON.stringify(exports.CreateChatCompletionGuardrails$outboundSchema.parse(createChatCompletionGuardrails));
1300
+ }
1301
+ function createChatCompletionGuardrailsFromJSON(jsonString) {
1302
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionGuardrails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionGuardrails' from JSON`);
1303
+ }
1304
+ /** @internal */
1305
+ exports.CreateChatCompletionRetry$inboundSchema = z.object({
1306
+ count: z.number().default(3),
1307
+ on_codes: z.array(z.number()).optional(),
1308
+ }).transform((v) => {
1309
+ return (0, primitives_js_1.remap)(v, {
1310
+ "on_codes": "onCodes",
1311
+ });
1312
+ });
1313
+ /** @internal */
1314
+ exports.CreateChatCompletionRetry$outboundSchema = z.object({
1315
+ count: z.number().default(3),
1316
+ onCodes: z.array(z.number()).optional(),
1317
+ }).transform((v) => {
1318
+ return (0, primitives_js_1.remap)(v, {
1319
+ onCodes: "on_codes",
1320
+ });
1321
+ });
1322
+ function createChatCompletionRetryToJSON(createChatCompletionRetry) {
1323
+ return JSON.stringify(exports.CreateChatCompletionRetry$outboundSchema.parse(createChatCompletionRetry));
1324
+ }
1325
+ function createChatCompletionRetryFromJSON(jsonString) {
1326
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRetry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRetry' from JSON`);
1327
+ }
1328
+ /** @internal */
1329
+ exports.Fallbacks$inboundSchema = z.object({
1330
+ model: z.string(),
1331
+ });
1332
+ /** @internal */
1333
+ exports.Fallbacks$outboundSchema = z.object({
1334
+ model: z.string(),
1335
+ });
1336
+ function fallbacksToJSON(fallbacks) {
1337
+ return JSON.stringify(exports.Fallbacks$outboundSchema.parse(fallbacks));
1338
+ }
1339
+ function fallbacksFromJSON(jsonString) {
1340
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Fallbacks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Fallbacks' from JSON`);
1341
+ }
1342
+ /** @internal */
1343
+ exports.Version$inboundSchema = z
1344
+ .nativeEnum(exports.Version);
1345
+ /** @internal */
1346
+ exports.Version$outboundSchema = exports.Version$inboundSchema;
1347
+ /** @internal */
1348
+ exports.Prompt$inboundSchema = z
1349
+ .object({
1350
+ id: z.string(),
1351
+ version: exports.Version$inboundSchema,
1352
+ });
1353
+ /** @internal */
1354
+ exports.Prompt$outboundSchema = z.object({
1355
+ id: z.string(),
1356
+ version: exports.Version$outboundSchema,
1357
+ });
1358
+ function promptToJSON(prompt) {
1359
+ return JSON.stringify(exports.Prompt$outboundSchema.parse(prompt));
1360
+ }
1361
+ function promptFromJSON(jsonString) {
1362
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Prompt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Prompt' from JSON`);
1363
+ }
1364
+ /** @internal */
1365
+ exports.CreateChatCompletionThread$inboundSchema = z.object({
1366
+ id: z.string(),
1367
+ tags: z.array(z.string()).optional(),
1368
+ });
1369
+ /** @internal */
1370
+ exports.CreateChatCompletionThread$outboundSchema = z.object({
1371
+ id: z.string(),
1372
+ tags: z.array(z.string()).optional(),
1373
+ });
1374
+ function createChatCompletionThreadToJSON(createChatCompletionThread) {
1375
+ return JSON.stringify(exports.CreateChatCompletionThread$outboundSchema.parse(createChatCompletionThread));
1376
+ }
1377
+ function createChatCompletionThreadFromJSON(jsonString) {
1378
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionThread$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionThread' from JSON`);
1379
+ }
1380
+ /** @internal */
1381
+ exports.Inputs2$inboundSchema = z.object({
1382
+ key: z.string(),
1383
+ value: z.any().optional(),
1384
+ is_pii: z.boolean().optional(),
1385
+ }).transform((v) => {
1386
+ return (0, primitives_js_1.remap)(v, {
1387
+ "is_pii": "isPii",
1388
+ });
1389
+ });
1390
+ /** @internal */
1391
+ exports.Inputs2$outboundSchema = z.object({
1392
+ key: z.string(),
1393
+ value: z.any().optional(),
1394
+ isPii: z.boolean().optional(),
1395
+ }).transform((v) => {
1396
+ return (0, primitives_js_1.remap)(v, {
1397
+ isPii: "is_pii",
1398
+ });
1399
+ });
1400
+ function inputs2ToJSON(inputs2) {
1401
+ return JSON.stringify(exports.Inputs2$outboundSchema.parse(inputs2));
1402
+ }
1403
+ function inputs2FromJSON(jsonString) {
1404
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Inputs2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Inputs2' from JSON`);
1405
+ }
1406
+ /** @internal */
1407
+ exports.Inputs$inboundSchema = z
1408
+ .union([z.record(z.any()), z.array(z.lazy(() => exports.Inputs2$inboundSchema))]);
1409
+ /** @internal */
1410
+ exports.Inputs$outboundSchema = z.union([z.record(z.any()), z.array(z.lazy(() => exports.Inputs2$outboundSchema))]);
1411
+ function inputsToJSON(inputs) {
1412
+ return JSON.stringify(exports.Inputs$outboundSchema.parse(inputs));
1413
+ }
1414
+ function inputsFromJSON(jsonString) {
1415
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Inputs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Inputs' from JSON`);
1416
+ }
1417
+ /** @internal */
1418
+ exports.CreateChatCompletionRouterRequestType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRouterRequestType);
1419
+ /** @internal */
1420
+ exports.CreateChatCompletionRouterRequestType$outboundSchema = exports.CreateChatCompletionRouterRequestType$inboundSchema;
1421
+ /** @internal */
1422
+ exports.Cache$inboundSchema = z
1423
+ .object({
1424
+ ttl: z.number().default(1800),
1425
+ type: exports.CreateChatCompletionRouterRequestType$inboundSchema,
1426
+ });
1427
+ /** @internal */
1428
+ exports.Cache$outboundSchema = z.object({
1429
+ ttl: z.number().default(1800),
1430
+ type: exports.CreateChatCompletionRouterRequestType$outboundSchema,
1431
+ });
1432
+ function cacheToJSON(cache) {
1433
+ return JSON.stringify(exports.Cache$outboundSchema.parse(cache));
1434
+ }
1435
+ function cacheFromJSON(jsonString) {
1436
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Cache$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Cache' from JSON`);
1437
+ }
1438
+ /** @internal */
1439
+ exports.CreateChatCompletionSearchType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionSearchType);
1440
+ /** @internal */
1441
+ exports.CreateChatCompletionSearchType$outboundSchema = exports.CreateChatCompletionSearchType$inboundSchema;
1442
+ /** @internal */
1443
+ exports.CreateChatCompletionOrExists$inboundSchema = z.object({
1444
+ exists: z.boolean(),
1445
+ });
1446
+ /** @internal */
1447
+ exports.CreateChatCompletionOrExists$outboundSchema = z.object({
1448
+ exists: z.boolean(),
1449
+ });
1450
+ function createChatCompletionOrExistsToJSON(createChatCompletionOrExists) {
1451
+ return JSON.stringify(exports.CreateChatCompletionOrExists$outboundSchema.parse(createChatCompletionOrExists));
1452
+ }
1453
+ function createChatCompletionOrExistsFromJSON(jsonString) {
1454
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrExists$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrExists' from JSON`);
1455
+ }
1456
+ /** @internal */
1457
+ exports.CreateChatCompletionOrRouterNin$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1458
+ /** @internal */
1459
+ exports.CreateChatCompletionOrRouterNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1460
+ function createChatCompletionOrRouterNinToJSON(createChatCompletionOrRouterNin) {
1461
+ return JSON.stringify(exports.CreateChatCompletionOrRouterNin$outboundSchema.parse(createChatCompletionOrRouterNin));
1462
+ }
1463
+ function createChatCompletionOrRouterNinFromJSON(jsonString) {
1464
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrRouterNin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrRouterNin' from JSON`);
1465
+ }
1466
+ /** @internal */
1467
+ exports.CreateChatCompletionOrNin$inboundSchema = z.object({
1468
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1469
+ });
1470
+ /** @internal */
1471
+ exports.CreateChatCompletionOrNin$outboundSchema = z.object({
1472
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1473
+ });
1474
+ function createChatCompletionOrNinToJSON(createChatCompletionOrNin) {
1475
+ return JSON.stringify(exports.CreateChatCompletionOrNin$outboundSchema.parse(createChatCompletionOrNin));
1476
+ }
1477
+ function createChatCompletionOrNinFromJSON(jsonString) {
1478
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrNin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrNin' from JSON`);
1479
+ }
1480
+ /** @internal */
1481
+ exports.CreateChatCompletionOrRouterIn$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1482
+ /** @internal */
1483
+ exports.CreateChatCompletionOrRouterIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1484
+ function createChatCompletionOrRouterInToJSON(createChatCompletionOrRouterIn) {
1485
+ return JSON.stringify(exports.CreateChatCompletionOrRouterIn$outboundSchema.parse(createChatCompletionOrRouterIn));
1486
+ }
1487
+ function createChatCompletionOrRouterInFromJSON(jsonString) {
1488
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrRouterIn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrRouterIn' from JSON`);
1489
+ }
1490
+ /** @internal */
1491
+ exports.CreateChatCompletionOrIn$inboundSchema = z.object({
1492
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1493
+ });
1494
+ /** @internal */
1495
+ exports.CreateChatCompletionOrIn$outboundSchema = z.object({
1496
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1497
+ });
1498
+ function createChatCompletionOrInToJSON(createChatCompletionOrIn) {
1499
+ return JSON.stringify(exports.CreateChatCompletionOrIn$outboundSchema.parse(createChatCompletionOrIn));
1500
+ }
1501
+ function createChatCompletionOrInFromJSON(jsonString) {
1502
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrIn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrIn' from JSON`);
1503
+ }
1504
+ /** @internal */
1505
+ exports.CreateChatCompletionOrLte$inboundSchema = z.object({
1506
+ lte: z.number(),
1507
+ });
1508
+ /** @internal */
1509
+ exports.CreateChatCompletionOrLte$outboundSchema = z.object({
1510
+ lte: z.number(),
1511
+ });
1512
+ function createChatCompletionOrLteToJSON(createChatCompletionOrLte) {
1513
+ return JSON.stringify(exports.CreateChatCompletionOrLte$outboundSchema.parse(createChatCompletionOrLte));
1514
+ }
1515
+ function createChatCompletionOrLteFromJSON(jsonString) {
1516
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrLte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrLte' from JSON`);
1517
+ }
1518
+ /** @internal */
1519
+ exports.CreateChatCompletionOrLt$inboundSchema = z.object({
1520
+ lt: z.number(),
1521
+ });
1522
+ /** @internal */
1523
+ exports.CreateChatCompletionOrLt$outboundSchema = z.object({
1524
+ lt: z.number(),
1525
+ });
1526
+ function createChatCompletionOrLtToJSON(createChatCompletionOrLt) {
1527
+ return JSON.stringify(exports.CreateChatCompletionOrLt$outboundSchema.parse(createChatCompletionOrLt));
1528
+ }
1529
+ function createChatCompletionOrLtFromJSON(jsonString) {
1530
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrLt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrLt' from JSON`);
1531
+ }
1532
+ /** @internal */
1533
+ exports.CreateChatCompletionOrGte$inboundSchema = z.object({
1534
+ gte: z.number(),
1535
+ });
1536
+ /** @internal */
1537
+ exports.CreateChatCompletionOrGte$outboundSchema = z.object({
1538
+ gte: z.number(),
1539
+ });
1540
+ function createChatCompletionOrGteToJSON(createChatCompletionOrGte) {
1541
+ return JSON.stringify(exports.CreateChatCompletionOrGte$outboundSchema.parse(createChatCompletionOrGte));
1542
+ }
1543
+ function createChatCompletionOrGteFromJSON(jsonString) {
1544
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrGte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrGte' from JSON`);
1545
+ }
1546
+ /** @internal */
1547
+ exports.CreateChatCompletionOrGt$inboundSchema = z.object({
1548
+ gt: z.number(),
1549
+ });
1550
+ /** @internal */
1551
+ exports.CreateChatCompletionOrGt$outboundSchema = z.object({
1552
+ gt: z.number(),
1553
+ });
1554
+ function createChatCompletionOrGtToJSON(createChatCompletionOrGt) {
1555
+ return JSON.stringify(exports.CreateChatCompletionOrGt$outboundSchema.parse(createChatCompletionOrGt));
1556
+ }
1557
+ function createChatCompletionOrGtFromJSON(jsonString) {
1558
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrGt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrGt' from JSON`);
1559
+ }
1560
+ /** @internal */
1561
+ exports.CreateChatCompletionOrRouterNe$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1562
+ /** @internal */
1563
+ exports.CreateChatCompletionOrRouterNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1564
+ function createChatCompletionOrRouterNeToJSON(createChatCompletionOrRouterNe) {
1565
+ return JSON.stringify(exports.CreateChatCompletionOrRouterNe$outboundSchema.parse(createChatCompletionOrRouterNe));
1566
+ }
1567
+ function createChatCompletionOrRouterNeFromJSON(jsonString) {
1568
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrRouterNe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrRouterNe' from JSON`);
1569
+ }
1570
+ /** @internal */
1571
+ exports.CreateChatCompletionOrNe$inboundSchema = z.object({
1572
+ ne: z.union([z.string(), z.number(), z.boolean()]),
1573
+ });
1574
+ /** @internal */
1575
+ exports.CreateChatCompletionOrNe$outboundSchema = z.object({
1576
+ ne: z.union([z.string(), z.number(), z.boolean()]),
1577
+ });
1578
+ function createChatCompletionOrNeToJSON(createChatCompletionOrNe) {
1579
+ return JSON.stringify(exports.CreateChatCompletionOrNe$outboundSchema.parse(createChatCompletionOrNe));
1580
+ }
1581
+ function createChatCompletionOrNeFromJSON(jsonString) {
1582
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrNe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrNe' from JSON`);
1583
+ }
1584
+ /** @internal */
1585
+ exports.CreateChatCompletionOrRouterEq$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1586
+ /** @internal */
1587
+ exports.CreateChatCompletionOrRouterEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1588
+ function createChatCompletionOrRouterEqToJSON(createChatCompletionOrRouterEq) {
1589
+ return JSON.stringify(exports.CreateChatCompletionOrRouterEq$outboundSchema.parse(createChatCompletionOrRouterEq));
1590
+ }
1591
+ function createChatCompletionOrRouterEqFromJSON(jsonString) {
1592
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrRouterEq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrRouterEq' from JSON`);
1593
+ }
1594
+ /** @internal */
1595
+ exports.CreateChatCompletionOrEq$inboundSchema = z.object({
1596
+ eq: z.union([z.string(), z.number(), z.boolean()]),
1597
+ });
1598
+ /** @internal */
1599
+ exports.CreateChatCompletionOrEq$outboundSchema = z.object({
1600
+ eq: z.union([z.string(), z.number(), z.boolean()]),
1601
+ });
1602
+ function createChatCompletionOrEqToJSON(createChatCompletionOrEq) {
1603
+ return JSON.stringify(exports.CreateChatCompletionOrEq$outboundSchema.parse(createChatCompletionOrEq));
1604
+ }
1605
+ function createChatCompletionOrEqFromJSON(jsonString) {
1606
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionOrEq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionOrEq' from JSON`);
1607
+ }
1608
+ /** @internal */
1609
+ exports.CreateChatCompletionFilterByRouterOr$inboundSchema = z.union([
1610
+ z.lazy(() => exports.CreateChatCompletionOrEq$inboundSchema),
1611
+ z.lazy(() => exports.CreateChatCompletionOrNe$inboundSchema),
1612
+ z.lazy(() => exports.CreateChatCompletionOrGt$inboundSchema),
1613
+ z.lazy(() => exports.CreateChatCompletionOrGte$inboundSchema),
1614
+ z.lazy(() => exports.CreateChatCompletionOrLt$inboundSchema),
1615
+ z.lazy(() => exports.CreateChatCompletionOrLte$inboundSchema),
1616
+ z.lazy(() => exports.CreateChatCompletionOrIn$inboundSchema),
1617
+ z.lazy(() => exports.CreateChatCompletionOrNin$inboundSchema),
1618
+ z.lazy(() => exports.CreateChatCompletionOrExists$inboundSchema),
1619
+ ]);
1620
+ /** @internal */
1621
+ exports.CreateChatCompletionFilterByRouterOr$outboundSchema = z.union([
1622
+ z.lazy(() => exports.CreateChatCompletionOrEq$outboundSchema),
1623
+ z.lazy(() => exports.CreateChatCompletionOrNe$outboundSchema),
1624
+ z.lazy(() => exports.CreateChatCompletionOrGt$outboundSchema),
1625
+ z.lazy(() => exports.CreateChatCompletionOrGte$outboundSchema),
1626
+ z.lazy(() => exports.CreateChatCompletionOrLt$outboundSchema),
1627
+ z.lazy(() => exports.CreateChatCompletionOrLte$outboundSchema),
1628
+ z.lazy(() => exports.CreateChatCompletionOrIn$outboundSchema),
1629
+ z.lazy(() => exports.CreateChatCompletionOrNin$outboundSchema),
1630
+ z.lazy(() => exports.CreateChatCompletionOrExists$outboundSchema),
1631
+ ]);
1632
+ function createChatCompletionFilterByRouterOrToJSON(createChatCompletionFilterByRouterOr) {
1633
+ return JSON.stringify(exports.CreateChatCompletionFilterByRouterOr$outboundSchema.parse(createChatCompletionFilterByRouterOr));
1634
+ }
1635
+ function createChatCompletionFilterByRouterOrFromJSON(jsonString) {
1636
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterByRouterOr$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterByRouterOr' from JSON`);
1637
+ }
1638
+ /** @internal */
1639
+ exports.CreateChatCompletionFilterByOr$inboundSchema = z.object({
1640
+ or: z.array(z.record(z.union([
1641
+ z.lazy(() => exports.CreateChatCompletionOrEq$inboundSchema),
1642
+ z.lazy(() => exports.CreateChatCompletionOrNe$inboundSchema),
1643
+ z.lazy(() => exports.CreateChatCompletionOrGt$inboundSchema),
1644
+ z.lazy(() => exports.CreateChatCompletionOrGte$inboundSchema),
1645
+ z.lazy(() => exports.CreateChatCompletionOrLt$inboundSchema),
1646
+ z.lazy(() => exports.CreateChatCompletionOrLte$inboundSchema),
1647
+ z.lazy(() => exports.CreateChatCompletionOrIn$inboundSchema),
1648
+ z.lazy(() => exports.CreateChatCompletionOrNin$inboundSchema),
1649
+ z.lazy(() => exports.CreateChatCompletionOrExists$inboundSchema),
1650
+ ]))),
1651
+ });
1652
+ /** @internal */
1653
+ exports.CreateChatCompletionFilterByOr$outboundSchema = z.object({
1654
+ or: z.array(z.record(z.union([
1655
+ z.lazy(() => exports.CreateChatCompletionOrEq$outboundSchema),
1656
+ z.lazy(() => exports.CreateChatCompletionOrNe$outboundSchema),
1657
+ z.lazy(() => exports.CreateChatCompletionOrGt$outboundSchema),
1658
+ z.lazy(() => exports.CreateChatCompletionOrGte$outboundSchema),
1659
+ z.lazy(() => exports.CreateChatCompletionOrLt$outboundSchema),
1660
+ z.lazy(() => exports.CreateChatCompletionOrLte$outboundSchema),
1661
+ z.lazy(() => exports.CreateChatCompletionOrIn$outboundSchema),
1662
+ z.lazy(() => exports.CreateChatCompletionOrNin$outboundSchema),
1663
+ z.lazy(() => exports.CreateChatCompletionOrExists$outboundSchema),
1664
+ ]))),
1665
+ });
1666
+ function createChatCompletionFilterByOrToJSON(createChatCompletionFilterByOr) {
1667
+ return JSON.stringify(exports.CreateChatCompletionFilterByOr$outboundSchema.parse(createChatCompletionFilterByOr));
1668
+ }
1669
+ function createChatCompletionFilterByOrFromJSON(jsonString) {
1670
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterByOr$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterByOr' from JSON`);
1671
+ }
1672
+ /** @internal */
1673
+ exports.CreateChatCompletionAndExists$inboundSchema = z.object({
1674
+ exists: z.boolean(),
1675
+ });
1676
+ /** @internal */
1677
+ exports.CreateChatCompletionAndExists$outboundSchema = z.object({
1678
+ exists: z.boolean(),
1679
+ });
1680
+ function createChatCompletionAndExistsToJSON(createChatCompletionAndExists) {
1681
+ return JSON.stringify(exports.CreateChatCompletionAndExists$outboundSchema.parse(createChatCompletionAndExists));
1682
+ }
1683
+ function createChatCompletionAndExistsFromJSON(jsonString) {
1684
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndExists$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndExists' from JSON`);
1685
+ }
1686
+ /** @internal */
1687
+ exports.CreateChatCompletionAndRouterNin$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1688
+ /** @internal */
1689
+ exports.CreateChatCompletionAndRouterNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1690
+ function createChatCompletionAndRouterNinToJSON(createChatCompletionAndRouterNin) {
1691
+ return JSON.stringify(exports.CreateChatCompletionAndRouterNin$outboundSchema.parse(createChatCompletionAndRouterNin));
1692
+ }
1693
+ function createChatCompletionAndRouterNinFromJSON(jsonString) {
1694
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndRouterNin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndRouterNin' from JSON`);
1695
+ }
1696
+ /** @internal */
1697
+ exports.CreateChatCompletionAndNin$inboundSchema = z.object({
1698
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1699
+ });
1700
+ /** @internal */
1701
+ exports.CreateChatCompletionAndNin$outboundSchema = z.object({
1702
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1703
+ });
1704
+ function createChatCompletionAndNinToJSON(createChatCompletionAndNin) {
1705
+ return JSON.stringify(exports.CreateChatCompletionAndNin$outboundSchema.parse(createChatCompletionAndNin));
1706
+ }
1707
+ function createChatCompletionAndNinFromJSON(jsonString) {
1708
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndNin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndNin' from JSON`);
1709
+ }
1710
+ /** @internal */
1711
+ exports.CreateChatCompletionAndRouterIn$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1712
+ /** @internal */
1713
+ exports.CreateChatCompletionAndRouterIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1714
+ function createChatCompletionAndRouterInToJSON(createChatCompletionAndRouterIn) {
1715
+ return JSON.stringify(exports.CreateChatCompletionAndRouterIn$outboundSchema.parse(createChatCompletionAndRouterIn));
1716
+ }
1717
+ function createChatCompletionAndRouterInFromJSON(jsonString) {
1718
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndRouterIn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndRouterIn' from JSON`);
1719
+ }
1720
+ /** @internal */
1721
+ exports.CreateChatCompletionAndIn$inboundSchema = z.object({
1722
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1723
+ });
1724
+ /** @internal */
1725
+ exports.CreateChatCompletionAndIn$outboundSchema = z.object({
1726
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1727
+ });
1728
+ function createChatCompletionAndInToJSON(createChatCompletionAndIn) {
1729
+ return JSON.stringify(exports.CreateChatCompletionAndIn$outboundSchema.parse(createChatCompletionAndIn));
1730
+ }
1731
+ function createChatCompletionAndInFromJSON(jsonString) {
1732
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndIn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndIn' from JSON`);
1733
+ }
1734
+ /** @internal */
1735
+ exports.CreateChatCompletionAndLte$inboundSchema = z.object({
1736
+ lte: z.number(),
1737
+ });
1738
+ /** @internal */
1739
+ exports.CreateChatCompletionAndLte$outboundSchema = z.object({
1740
+ lte: z.number(),
1741
+ });
1742
+ function createChatCompletionAndLteToJSON(createChatCompletionAndLte) {
1743
+ return JSON.stringify(exports.CreateChatCompletionAndLte$outboundSchema.parse(createChatCompletionAndLte));
1744
+ }
1745
+ function createChatCompletionAndLteFromJSON(jsonString) {
1746
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndLte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndLte' from JSON`);
1747
+ }
1748
+ /** @internal */
1749
+ exports.CreateChatCompletionAndLt$inboundSchema = z.object({
1750
+ lt: z.number(),
1751
+ });
1752
+ /** @internal */
1753
+ exports.CreateChatCompletionAndLt$outboundSchema = z.object({
1754
+ lt: z.number(),
1755
+ });
1756
+ function createChatCompletionAndLtToJSON(createChatCompletionAndLt) {
1757
+ return JSON.stringify(exports.CreateChatCompletionAndLt$outboundSchema.parse(createChatCompletionAndLt));
1758
+ }
1759
+ function createChatCompletionAndLtFromJSON(jsonString) {
1760
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndLt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndLt' from JSON`);
1761
+ }
1762
+ /** @internal */
1763
+ exports.CreateChatCompletionAndGte$inboundSchema = z.object({
1764
+ gte: z.number(),
1765
+ });
1766
+ /** @internal */
1767
+ exports.CreateChatCompletionAndGte$outboundSchema = z.object({
1768
+ gte: z.number(),
1769
+ });
1770
+ function createChatCompletionAndGteToJSON(createChatCompletionAndGte) {
1771
+ return JSON.stringify(exports.CreateChatCompletionAndGte$outboundSchema.parse(createChatCompletionAndGte));
1772
+ }
1773
+ function createChatCompletionAndGteFromJSON(jsonString) {
1774
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndGte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndGte' from JSON`);
1775
+ }
1776
+ /** @internal */
1777
+ exports.CreateChatCompletionAndGt$inboundSchema = z.object({
1778
+ gt: z.number(),
1779
+ });
1780
+ /** @internal */
1781
+ exports.CreateChatCompletionAndGt$outboundSchema = z.object({
1782
+ gt: z.number(),
1783
+ });
1784
+ function createChatCompletionAndGtToJSON(createChatCompletionAndGt) {
1785
+ return JSON.stringify(exports.CreateChatCompletionAndGt$outboundSchema.parse(createChatCompletionAndGt));
1786
+ }
1787
+ function createChatCompletionAndGtFromJSON(jsonString) {
1788
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndGt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndGt' from JSON`);
1789
+ }
1790
+ /** @internal */
1791
+ exports.CreateChatCompletionAndRouterNe$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1792
+ /** @internal */
1793
+ exports.CreateChatCompletionAndRouterNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1794
+ function createChatCompletionAndRouterNeToJSON(createChatCompletionAndRouterNe) {
1795
+ return JSON.stringify(exports.CreateChatCompletionAndRouterNe$outboundSchema.parse(createChatCompletionAndRouterNe));
1796
+ }
1797
+ function createChatCompletionAndRouterNeFromJSON(jsonString) {
1798
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndRouterNe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndRouterNe' from JSON`);
1799
+ }
1800
+ /** @internal */
1801
+ exports.CreateChatCompletionAndNe$inboundSchema = z.object({
1802
+ ne: z.union([z.string(), z.number(), z.boolean()]),
1803
+ });
1804
+ /** @internal */
1805
+ exports.CreateChatCompletionAndNe$outboundSchema = z.object({
1806
+ ne: z.union([z.string(), z.number(), z.boolean()]),
1807
+ });
1808
+ function createChatCompletionAndNeToJSON(createChatCompletionAndNe) {
1809
+ return JSON.stringify(exports.CreateChatCompletionAndNe$outboundSchema.parse(createChatCompletionAndNe));
1810
+ }
1811
+ function createChatCompletionAndNeFromJSON(jsonString) {
1812
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndNe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndNe' from JSON`);
1813
+ }
1814
+ /** @internal */
1815
+ exports.CreateChatCompletionAndRouterEq$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1816
+ /** @internal */
1817
+ exports.CreateChatCompletionAndRouterEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1818
+ function createChatCompletionAndRouterEqToJSON(createChatCompletionAndRouterEq) {
1819
+ return JSON.stringify(exports.CreateChatCompletionAndRouterEq$outboundSchema.parse(createChatCompletionAndRouterEq));
1820
+ }
1821
+ function createChatCompletionAndRouterEqFromJSON(jsonString) {
1822
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndRouterEq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndRouterEq' from JSON`);
1823
+ }
1824
+ /** @internal */
1825
+ exports.CreateChatCompletionAndEq$inboundSchema = z.object({
1826
+ eq: z.union([z.string(), z.number(), z.boolean()]),
1827
+ });
1828
+ /** @internal */
1829
+ exports.CreateChatCompletionAndEq$outboundSchema = z.object({
1830
+ eq: z.union([z.string(), z.number(), z.boolean()]),
1831
+ });
1832
+ function createChatCompletionAndEqToJSON(createChatCompletionAndEq) {
1833
+ return JSON.stringify(exports.CreateChatCompletionAndEq$outboundSchema.parse(createChatCompletionAndEq));
1834
+ }
1835
+ function createChatCompletionAndEqFromJSON(jsonString) {
1836
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAndEq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAndEq' from JSON`);
1837
+ }
1838
+ /** @internal */
1839
+ exports.CreateChatCompletionFilterByRouterAnd$inboundSchema = z.union([
1840
+ z.lazy(() => exports.CreateChatCompletionAndEq$inboundSchema),
1841
+ z.lazy(() => exports.CreateChatCompletionAndNe$inboundSchema),
1842
+ z.lazy(() => exports.CreateChatCompletionAndGt$inboundSchema),
1843
+ z.lazy(() => exports.CreateChatCompletionAndGte$inboundSchema),
1844
+ z.lazy(() => exports.CreateChatCompletionAndLt$inboundSchema),
1845
+ z.lazy(() => exports.CreateChatCompletionAndLte$inboundSchema),
1846
+ z.lazy(() => exports.CreateChatCompletionAndIn$inboundSchema),
1847
+ z.lazy(() => exports.CreateChatCompletionAndNin$inboundSchema),
1848
+ z.lazy(() => exports.CreateChatCompletionAndExists$inboundSchema),
1849
+ ]);
1850
+ /** @internal */
1851
+ exports.CreateChatCompletionFilterByRouterAnd$outboundSchema = z.union([
1852
+ z.lazy(() => exports.CreateChatCompletionAndEq$outboundSchema),
1853
+ z.lazy(() => exports.CreateChatCompletionAndNe$outboundSchema),
1854
+ z.lazy(() => exports.CreateChatCompletionAndGt$outboundSchema),
1855
+ z.lazy(() => exports.CreateChatCompletionAndGte$outboundSchema),
1856
+ z.lazy(() => exports.CreateChatCompletionAndLt$outboundSchema),
1857
+ z.lazy(() => exports.CreateChatCompletionAndLte$outboundSchema),
1858
+ z.lazy(() => exports.CreateChatCompletionAndIn$outboundSchema),
1859
+ z.lazy(() => exports.CreateChatCompletionAndNin$outboundSchema),
1860
+ z.lazy(() => exports.CreateChatCompletionAndExists$outboundSchema),
1861
+ ]);
1862
+ function createChatCompletionFilterByRouterAndToJSON(createChatCompletionFilterByRouterAnd) {
1863
+ return JSON.stringify(exports.CreateChatCompletionFilterByRouterAnd$outboundSchema.parse(createChatCompletionFilterByRouterAnd));
1864
+ }
1865
+ function createChatCompletionFilterByRouterAndFromJSON(jsonString) {
1866
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterByRouterAnd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterByRouterAnd' from JSON`);
1867
+ }
1868
+ /** @internal */
1869
+ exports.CreateChatCompletionFilterByAnd$inboundSchema = z.object({
1870
+ and: z.array(z.record(z.union([
1871
+ z.lazy(() => exports.CreateChatCompletionAndEq$inboundSchema),
1872
+ z.lazy(() => exports.CreateChatCompletionAndNe$inboundSchema),
1873
+ z.lazy(() => exports.CreateChatCompletionAndGt$inboundSchema),
1874
+ z.lazy(() => exports.CreateChatCompletionAndGte$inboundSchema),
1875
+ z.lazy(() => exports.CreateChatCompletionAndLt$inboundSchema),
1876
+ z.lazy(() => exports.CreateChatCompletionAndLte$inboundSchema),
1877
+ z.lazy(() => exports.CreateChatCompletionAndIn$inboundSchema),
1878
+ z.lazy(() => exports.CreateChatCompletionAndNin$inboundSchema),
1879
+ z.lazy(() => exports.CreateChatCompletionAndExists$inboundSchema),
1880
+ ]))),
1881
+ });
1882
+ /** @internal */
1883
+ exports.CreateChatCompletionFilterByAnd$outboundSchema = z.object({
1884
+ and: z.array(z.record(z.union([
1885
+ z.lazy(() => exports.CreateChatCompletionAndEq$outboundSchema),
1886
+ z.lazy(() => exports.CreateChatCompletionAndNe$outboundSchema),
1887
+ z.lazy(() => exports.CreateChatCompletionAndGt$outboundSchema),
1888
+ z.lazy(() => exports.CreateChatCompletionAndGte$outboundSchema),
1889
+ z.lazy(() => exports.CreateChatCompletionAndLt$outboundSchema),
1890
+ z.lazy(() => exports.CreateChatCompletionAndLte$outboundSchema),
1891
+ z.lazy(() => exports.CreateChatCompletionAndIn$outboundSchema),
1892
+ z.lazy(() => exports.CreateChatCompletionAndNin$outboundSchema),
1893
+ z.lazy(() => exports.CreateChatCompletionAndExists$outboundSchema),
1894
+ ]))),
1895
+ });
1896
+ function createChatCompletionFilterByAndToJSON(createChatCompletionFilterByAnd) {
1897
+ return JSON.stringify(exports.CreateChatCompletionFilterByAnd$outboundSchema.parse(createChatCompletionFilterByAnd));
1898
+ }
1899
+ function createChatCompletionFilterByAndFromJSON(jsonString) {
1900
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterByAnd$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterByAnd' from JSON`);
1901
+ }
1902
+ /** @internal */
1903
+ exports.CreateChatCompletion1Exists$inboundSchema = z.object({
1904
+ exists: z.boolean(),
1905
+ });
1906
+ /** @internal */
1907
+ exports.CreateChatCompletion1Exists$outboundSchema = z.object({
1908
+ exists: z.boolean(),
1909
+ });
1910
+ function createChatCompletion1ExistsToJSON(createChatCompletion1Exists) {
1911
+ return JSON.stringify(exports.CreateChatCompletion1Exists$outboundSchema.parse(createChatCompletion1Exists));
1912
+ }
1913
+ function createChatCompletion1ExistsFromJSON(jsonString) {
1914
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Exists$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Exists' from JSON`);
1915
+ }
1916
+ /** @internal */
1917
+ exports.CreateChatCompletion1RouterNin$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1918
+ /** @internal */
1919
+ exports.CreateChatCompletion1RouterNin$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1920
+ function createChatCompletion1RouterNinToJSON(createChatCompletion1RouterNin) {
1921
+ return JSON.stringify(exports.CreateChatCompletion1RouterNin$outboundSchema.parse(createChatCompletion1RouterNin));
1922
+ }
1923
+ function createChatCompletion1RouterNinFromJSON(jsonString) {
1924
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1RouterNin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1RouterNin' from JSON`);
1925
+ }
1926
+ /** @internal */
1927
+ exports.CreateChatCompletion1Nin$inboundSchema = z.object({
1928
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1929
+ });
1930
+ /** @internal */
1931
+ exports.CreateChatCompletion1Nin$outboundSchema = z.object({
1932
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
1933
+ });
1934
+ function createChatCompletion1NinToJSON(createChatCompletion1Nin) {
1935
+ return JSON.stringify(exports.CreateChatCompletion1Nin$outboundSchema.parse(createChatCompletion1Nin));
1936
+ }
1937
+ function createChatCompletion1NinFromJSON(jsonString) {
1938
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Nin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Nin' from JSON`);
1939
+ }
1940
+ /** @internal */
1941
+ exports.CreateChatCompletion1RouterIn$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1942
+ /** @internal */
1943
+ exports.CreateChatCompletion1RouterIn$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
1944
+ function createChatCompletion1RouterInToJSON(createChatCompletion1RouterIn) {
1945
+ return JSON.stringify(exports.CreateChatCompletion1RouterIn$outboundSchema.parse(createChatCompletion1RouterIn));
1946
+ }
1947
+ function createChatCompletion1RouterInFromJSON(jsonString) {
1948
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1RouterIn$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1RouterIn' from JSON`);
1949
+ }
1950
+ /** @internal */
1951
+ exports.CreateChatCompletion1In$inboundSchema = z.object({
1952
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1953
+ });
1954
+ /** @internal */
1955
+ exports.CreateChatCompletion1In$outboundSchema = z.object({
1956
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
1957
+ });
1958
+ function createChatCompletion1InToJSON(createChatCompletion1In) {
1959
+ return JSON.stringify(exports.CreateChatCompletion1In$outboundSchema.parse(createChatCompletion1In));
1960
+ }
1961
+ function createChatCompletion1InFromJSON(jsonString) {
1962
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1In$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1In' from JSON`);
1963
+ }
1964
+ /** @internal */
1965
+ exports.CreateChatCompletion1Lte$inboundSchema = z.object({
1966
+ lte: z.number(),
1967
+ });
1968
+ /** @internal */
1969
+ exports.CreateChatCompletion1Lte$outboundSchema = z.object({
1970
+ lte: z.number(),
1971
+ });
1972
+ function createChatCompletion1LteToJSON(createChatCompletion1Lte) {
1973
+ return JSON.stringify(exports.CreateChatCompletion1Lte$outboundSchema.parse(createChatCompletion1Lte));
1974
+ }
1975
+ function createChatCompletion1LteFromJSON(jsonString) {
1976
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Lte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Lte' from JSON`);
1977
+ }
1978
+ /** @internal */
1979
+ exports.CreateChatCompletion1Lt$inboundSchema = z.object({
1980
+ lt: z.number(),
1981
+ });
1982
+ /** @internal */
1983
+ exports.CreateChatCompletion1Lt$outboundSchema = z.object({
1984
+ lt: z.number(),
1985
+ });
1986
+ function createChatCompletion1LtToJSON(createChatCompletion1Lt) {
1987
+ return JSON.stringify(exports.CreateChatCompletion1Lt$outboundSchema.parse(createChatCompletion1Lt));
1988
+ }
1989
+ function createChatCompletion1LtFromJSON(jsonString) {
1990
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Lt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Lt' from JSON`);
1991
+ }
1992
+ /** @internal */
1993
+ exports.CreateChatCompletion1Gte$inboundSchema = z.object({
1994
+ gte: z.number(),
1995
+ });
1996
+ /** @internal */
1997
+ exports.CreateChatCompletion1Gte$outboundSchema = z.object({
1998
+ gte: z.number(),
1999
+ });
2000
+ function createChatCompletion1GteToJSON(createChatCompletion1Gte) {
2001
+ return JSON.stringify(exports.CreateChatCompletion1Gte$outboundSchema.parse(createChatCompletion1Gte));
2002
+ }
2003
+ function createChatCompletion1GteFromJSON(jsonString) {
2004
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Gte$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Gte' from JSON`);
2005
+ }
2006
+ /** @internal */
2007
+ exports.CreateChatCompletion1Gt$inboundSchema = z.object({
2008
+ gt: z.number(),
2009
+ });
2010
+ /** @internal */
2011
+ exports.CreateChatCompletion1Gt$outboundSchema = z.object({
2012
+ gt: z.number(),
2013
+ });
2014
+ function createChatCompletion1GtToJSON(createChatCompletion1Gt) {
2015
+ return JSON.stringify(exports.CreateChatCompletion1Gt$outboundSchema.parse(createChatCompletion1Gt));
2016
+ }
2017
+ function createChatCompletion1GtFromJSON(jsonString) {
2018
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Gt$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Gt' from JSON`);
2019
+ }
2020
+ /** @internal */
2021
+ exports.CreateChatCompletion1RouterNe$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
2022
+ /** @internal */
2023
+ exports.CreateChatCompletion1RouterNe$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
2024
+ function createChatCompletion1RouterNeToJSON(createChatCompletion1RouterNe) {
2025
+ return JSON.stringify(exports.CreateChatCompletion1RouterNe$outboundSchema.parse(createChatCompletion1RouterNe));
2026
+ }
2027
+ function createChatCompletion1RouterNeFromJSON(jsonString) {
2028
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1RouterNe$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1RouterNe' from JSON`);
2029
+ }
2030
+ /** @internal */
2031
+ exports.CreateChatCompletion1Ne$inboundSchema = z.object({
2032
+ ne: z.union([z.string(), z.number(), z.boolean()]),
2033
+ });
2034
+ /** @internal */
2035
+ exports.CreateChatCompletion1Ne$outboundSchema = z.object({
2036
+ ne: z.union([z.string(), z.number(), z.boolean()]),
2037
+ });
2038
+ function createChatCompletion1NeToJSON(createChatCompletion1Ne) {
2039
+ return JSON.stringify(exports.CreateChatCompletion1Ne$outboundSchema.parse(createChatCompletion1Ne));
2040
+ }
2041
+ function createChatCompletion1NeFromJSON(jsonString) {
2042
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Ne$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Ne' from JSON`);
2043
+ }
2044
+ /** @internal */
2045
+ exports.CreateChatCompletion1RouterEq$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
2046
+ /** @internal */
2047
+ exports.CreateChatCompletion1RouterEq$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
2048
+ function createChatCompletion1RouterEqToJSON(createChatCompletion1RouterEq) {
2049
+ return JSON.stringify(exports.CreateChatCompletion1RouterEq$outboundSchema.parse(createChatCompletion1RouterEq));
2050
+ }
2051
+ function createChatCompletion1RouterEqFromJSON(jsonString) {
2052
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1RouterEq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1RouterEq' from JSON`);
2053
+ }
2054
+ /** @internal */
2055
+ exports.CreateChatCompletion1Eq$inboundSchema = z.object({
2056
+ eq: z.union([z.string(), z.number(), z.boolean()]),
2057
+ });
2058
+ /** @internal */
2059
+ exports.CreateChatCompletion1Eq$outboundSchema = z.object({
2060
+ eq: z.union([z.string(), z.number(), z.boolean()]),
2061
+ });
2062
+ function createChatCompletion1EqToJSON(createChatCompletion1Eq) {
2063
+ return JSON.stringify(exports.CreateChatCompletion1Eq$outboundSchema.parse(createChatCompletion1Eq));
2064
+ }
2065
+ function createChatCompletion1EqFromJSON(jsonString) {
2066
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletion1Eq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletion1Eq' from JSON`);
2067
+ }
2068
+ /** @internal */
2069
+ exports.CreateChatCompletionFilterBy1$inboundSchema = z.union([
2070
+ z.lazy(() => exports.CreateChatCompletion1Eq$inboundSchema),
2071
+ z.lazy(() => exports.CreateChatCompletion1Ne$inboundSchema),
2072
+ z.lazy(() => exports.CreateChatCompletion1Gt$inboundSchema),
2073
+ z.lazy(() => exports.CreateChatCompletion1Gte$inboundSchema),
2074
+ z.lazy(() => exports.CreateChatCompletion1Lt$inboundSchema),
2075
+ z.lazy(() => exports.CreateChatCompletion1Lte$inboundSchema),
2076
+ z.lazy(() => exports.CreateChatCompletion1In$inboundSchema),
2077
+ z.lazy(() => exports.CreateChatCompletion1Nin$inboundSchema),
2078
+ z.lazy(() => exports.CreateChatCompletion1Exists$inboundSchema),
2079
+ ]);
2080
+ /** @internal */
2081
+ exports.CreateChatCompletionFilterBy1$outboundSchema = z.union([
2082
+ z.lazy(() => exports.CreateChatCompletion1Eq$outboundSchema),
2083
+ z.lazy(() => exports.CreateChatCompletion1Ne$outboundSchema),
2084
+ z.lazy(() => exports.CreateChatCompletion1Gt$outboundSchema),
2085
+ z.lazy(() => exports.CreateChatCompletion1Gte$outboundSchema),
2086
+ z.lazy(() => exports.CreateChatCompletion1Lt$outboundSchema),
2087
+ z.lazy(() => exports.CreateChatCompletion1Lte$outboundSchema),
2088
+ z.lazy(() => exports.CreateChatCompletion1In$outboundSchema),
2089
+ z.lazy(() => exports.CreateChatCompletion1Nin$outboundSchema),
2090
+ z.lazy(() => exports.CreateChatCompletion1Exists$outboundSchema),
2091
+ ]);
2092
+ function createChatCompletionFilterBy1ToJSON(createChatCompletionFilterBy1) {
2093
+ return JSON.stringify(exports.CreateChatCompletionFilterBy1$outboundSchema.parse(createChatCompletionFilterBy1));
2094
+ }
2095
+ function createChatCompletionFilterBy1FromJSON(jsonString) {
2096
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterBy1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterBy1' from JSON`);
2097
+ }
2098
+ /** @internal */
2099
+ exports.CreateChatCompletionFilterBy$inboundSchema = z.union([
2100
+ z.lazy(() => exports.CreateChatCompletionFilterByAnd$inboundSchema),
2101
+ z.lazy(() => exports.CreateChatCompletionFilterByOr$inboundSchema),
2102
+ z.record(z.union([
2103
+ z.lazy(() => exports.CreateChatCompletion1Eq$inboundSchema),
2104
+ z.lazy(() => exports.CreateChatCompletion1Ne$inboundSchema),
2105
+ z.lazy(() => exports.CreateChatCompletion1Gt$inboundSchema),
2106
+ z.lazy(() => exports.CreateChatCompletion1Gte$inboundSchema),
2107
+ z.lazy(() => exports.CreateChatCompletion1Lt$inboundSchema),
2108
+ z.lazy(() => exports.CreateChatCompletion1Lte$inboundSchema),
2109
+ z.lazy(() => exports.CreateChatCompletion1In$inboundSchema),
2110
+ z.lazy(() => exports.CreateChatCompletion1Nin$inboundSchema),
2111
+ z.lazy(() => exports.CreateChatCompletion1Exists$inboundSchema),
2112
+ ])),
2113
+ ]);
2114
+ /** @internal */
2115
+ exports.CreateChatCompletionFilterBy$outboundSchema = z.union([
2116
+ z.lazy(() => exports.CreateChatCompletionFilterByAnd$outboundSchema),
2117
+ z.lazy(() => exports.CreateChatCompletionFilterByOr$outboundSchema),
2118
+ z.record(z.union([
2119
+ z.lazy(() => exports.CreateChatCompletion1Eq$outboundSchema),
2120
+ z.lazy(() => exports.CreateChatCompletion1Ne$outboundSchema),
2121
+ z.lazy(() => exports.CreateChatCompletion1Gt$outboundSchema),
2122
+ z.lazy(() => exports.CreateChatCompletion1Gte$outboundSchema),
2123
+ z.lazy(() => exports.CreateChatCompletion1Lt$outboundSchema),
2124
+ z.lazy(() => exports.CreateChatCompletion1Lte$outboundSchema),
2125
+ z.lazy(() => exports.CreateChatCompletion1In$outboundSchema),
2126
+ z.lazy(() => exports.CreateChatCompletion1Nin$outboundSchema),
2127
+ z.lazy(() => exports.CreateChatCompletion1Exists$outboundSchema),
2128
+ ])),
2129
+ ]);
2130
+ function createChatCompletionFilterByToJSON(createChatCompletionFilterBy) {
2131
+ return JSON.stringify(exports.CreateChatCompletionFilterBy$outboundSchema.parse(createChatCompletionFilterBy));
2132
+ }
2133
+ function createChatCompletionFilterByFromJSON(jsonString) {
2134
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionFilterBy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionFilterBy' from JSON`);
2135
+ }
2136
+ /** @internal */
2137
+ exports.CreateChatCompletionSearchOptions$inboundSchema = z.object({
2138
+ include_vectors: z.boolean().optional(),
2139
+ include_metadata: z.boolean().optional(),
2140
+ include_scores: z.boolean().optional(),
2141
+ }).transform((v) => {
2142
+ return (0, primitives_js_1.remap)(v, {
2143
+ "include_vectors": "includeVectors",
2144
+ "include_metadata": "includeMetadata",
2145
+ "include_scores": "includeScores",
2146
+ });
2147
+ });
2148
+ /** @internal */
2149
+ exports.CreateChatCompletionSearchOptions$outboundSchema = z.object({
2150
+ includeVectors: z.boolean().optional(),
2151
+ includeMetadata: z.boolean().optional(),
2152
+ includeScores: z.boolean().optional(),
2153
+ }).transform((v) => {
2154
+ return (0, primitives_js_1.remap)(v, {
2155
+ includeVectors: "include_vectors",
2156
+ includeMetadata: "include_metadata",
2157
+ includeScores: "include_scores",
2158
+ });
2159
+ });
2160
+ function createChatCompletionSearchOptionsToJSON(createChatCompletionSearchOptions) {
2161
+ return JSON.stringify(exports.CreateChatCompletionSearchOptions$outboundSchema.parse(createChatCompletionSearchOptions));
2162
+ }
2163
+ function createChatCompletionSearchOptionsFromJSON(jsonString) {
2164
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionSearchOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionSearchOptions' from JSON`);
2165
+ }
2166
+ /** @internal */
2167
+ exports.CreateChatCompletionRerankConfig$inboundSchema = z.object({
2168
+ model: z.string(),
2169
+ threshold: z.number().default(0),
2170
+ top_k: z.number().int().default(10),
2171
+ }).transform((v) => {
2172
+ return (0, primitives_js_1.remap)(v, {
2173
+ "top_k": "topK",
2174
+ });
2175
+ });
2176
+ /** @internal */
2177
+ exports.CreateChatCompletionRerankConfig$outboundSchema = z.object({
2178
+ model: z.string(),
2179
+ threshold: z.number().default(0),
2180
+ topK: z.number().int().default(10),
2181
+ }).transform((v) => {
2182
+ return (0, primitives_js_1.remap)(v, {
2183
+ topK: "top_k",
2184
+ });
2185
+ });
2186
+ function createChatCompletionRerankConfigToJSON(createChatCompletionRerankConfig) {
2187
+ return JSON.stringify(exports.CreateChatCompletionRerankConfig$outboundSchema.parse(createChatCompletionRerankConfig));
2188
+ }
2189
+ function createChatCompletionRerankConfigFromJSON(jsonString) {
2190
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRerankConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRerankConfig' from JSON`);
2191
+ }
2192
+ /** @internal */
2193
+ exports.CreateChatCompletionAgenticRagConfig$inboundSchema = z.object({
2194
+ model: z.string(),
2195
+ });
2196
+ /** @internal */
2197
+ exports.CreateChatCompletionAgenticRagConfig$outboundSchema = z.object({
2198
+ model: z.string(),
2199
+ });
2200
+ function createChatCompletionAgenticRagConfigToJSON(createChatCompletionAgenticRagConfig) {
2201
+ return JSON.stringify(exports.CreateChatCompletionAgenticRagConfig$outboundSchema.parse(createChatCompletionAgenticRagConfig));
2202
+ }
2203
+ function createChatCompletionAgenticRagConfigFromJSON(jsonString) {
2204
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionAgenticRagConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionAgenticRagConfig' from JSON`);
2205
+ }
2206
+ /** @internal */
2207
+ exports.CreateChatCompletionKnowledgeBases$inboundSchema = z.object({
2208
+ top_k: z.number().int().optional(),
2209
+ threshold: z.number().optional(),
2210
+ search_type: exports.CreateChatCompletionSearchType$inboundSchema.default("hybrid_search"),
2211
+ filter_by: z.union([
2212
+ z.lazy(() => exports.CreateChatCompletionFilterByAnd$inboundSchema),
2213
+ z.lazy(() => exports.CreateChatCompletionFilterByOr$inboundSchema),
2214
+ z.record(z.union([
2215
+ z.lazy(() => exports.CreateChatCompletion1Eq$inboundSchema),
2216
+ z.lazy(() => exports.CreateChatCompletion1Ne$inboundSchema),
2217
+ z.lazy(() => exports.CreateChatCompletion1Gt$inboundSchema),
2218
+ z.lazy(() => exports.CreateChatCompletion1Gte$inboundSchema),
2219
+ z.lazy(() => exports.CreateChatCompletion1Lt$inboundSchema),
2220
+ z.lazy(() => exports.CreateChatCompletion1Lte$inboundSchema),
2221
+ z.lazy(() => exports.CreateChatCompletion1In$inboundSchema),
2222
+ z.lazy(() => exports.CreateChatCompletion1Nin$inboundSchema),
2223
+ z.lazy(() => exports.CreateChatCompletion1Exists$inboundSchema),
2224
+ ])),
2225
+ ]).optional(),
2226
+ search_options: z.lazy(() => exports.CreateChatCompletionSearchOptions$inboundSchema)
2227
+ .optional(),
2228
+ rerank_config: z.lazy(() => exports.CreateChatCompletionRerankConfig$inboundSchema)
2229
+ .optional(),
2230
+ agentic_rag_config: z.lazy(() => exports.CreateChatCompletionAgenticRagConfig$inboundSchema).optional(),
2231
+ knowledge_id: z.string(),
2232
+ query: z.string().optional(),
2233
+ }).transform((v) => {
2234
+ return (0, primitives_js_1.remap)(v, {
2235
+ "top_k": "topK",
2236
+ "search_type": "searchType",
2237
+ "filter_by": "filterBy",
2238
+ "search_options": "searchOptions",
2239
+ "rerank_config": "rerankConfig",
2240
+ "agentic_rag_config": "agenticRagConfig",
2241
+ "knowledge_id": "knowledgeId",
2242
+ });
2243
+ });
2244
+ /** @internal */
2245
+ exports.CreateChatCompletionKnowledgeBases$outboundSchema = z.object({
2246
+ topK: z.number().int().optional(),
2247
+ threshold: z.number().optional(),
2248
+ searchType: exports.CreateChatCompletionSearchType$outboundSchema.default("hybrid_search"),
2249
+ filterBy: z.union([
2250
+ z.lazy(() => exports.CreateChatCompletionFilterByAnd$outboundSchema),
2251
+ z.lazy(() => exports.CreateChatCompletionFilterByOr$outboundSchema),
2252
+ z.record(z.union([
2253
+ z.lazy(() => exports.CreateChatCompletion1Eq$outboundSchema),
2254
+ z.lazy(() => exports.CreateChatCompletion1Ne$outboundSchema),
2255
+ z.lazy(() => exports.CreateChatCompletion1Gt$outboundSchema),
2256
+ z.lazy(() => exports.CreateChatCompletion1Gte$outboundSchema),
2257
+ z.lazy(() => exports.CreateChatCompletion1Lt$outboundSchema),
2258
+ z.lazy(() => exports.CreateChatCompletion1Lte$outboundSchema),
2259
+ z.lazy(() => exports.CreateChatCompletion1In$outboundSchema),
2260
+ z.lazy(() => exports.CreateChatCompletion1Nin$outboundSchema),
2261
+ z.lazy(() => exports.CreateChatCompletion1Exists$outboundSchema),
2262
+ ])),
2263
+ ]).optional(),
2264
+ searchOptions: z.lazy(() => exports.CreateChatCompletionSearchOptions$outboundSchema)
2265
+ .optional(),
2266
+ rerankConfig: z.lazy(() => exports.CreateChatCompletionRerankConfig$outboundSchema)
2267
+ .optional(),
2268
+ agenticRagConfig: z.lazy(() => exports.CreateChatCompletionAgenticRagConfig$outboundSchema).optional(),
2269
+ knowledgeId: z.string(),
2270
+ query: z.string().optional(),
2271
+ }).transform((v) => {
2272
+ return (0, primitives_js_1.remap)(v, {
2273
+ topK: "top_k",
2274
+ searchType: "search_type",
2275
+ filterBy: "filter_by",
2276
+ searchOptions: "search_options",
2277
+ rerankConfig: "rerank_config",
2278
+ agenticRagConfig: "agentic_rag_config",
2279
+ knowledgeId: "knowledge_id",
2280
+ });
2281
+ });
2282
+ function createChatCompletionKnowledgeBasesToJSON(createChatCompletionKnowledgeBases) {
2283
+ return JSON.stringify(exports.CreateChatCompletionKnowledgeBases$outboundSchema.parse(createChatCompletionKnowledgeBases));
2284
+ }
2285
+ function createChatCompletionKnowledgeBasesFromJSON(jsonString) {
2286
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionKnowledgeBases$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionKnowledgeBases' from JSON`);
2287
+ }
2288
+ /** @internal */
2289
+ exports.LoadBalancerType$inboundSchema = z.nativeEnum(exports.LoadBalancerType);
2290
+ /** @internal */
2291
+ exports.LoadBalancerType$outboundSchema = exports.LoadBalancerType$inboundSchema;
2292
+ /** @internal */
2293
+ exports.LoadBalancer1$inboundSchema = z.object({
2294
+ type: exports.LoadBalancerType$inboundSchema,
2295
+ model: z.string(),
2296
+ weight: z.number().default(0.5),
2297
+ });
2298
+ /** @internal */
2299
+ exports.LoadBalancer1$outboundSchema = z.object({
2300
+ type: exports.LoadBalancerType$outboundSchema,
2301
+ model: z.string(),
2302
+ weight: z.number().default(0.5),
2303
+ });
2304
+ function loadBalancer1ToJSON(loadBalancer1) {
2305
+ return JSON.stringify(exports.LoadBalancer1$outboundSchema.parse(loadBalancer1));
2306
+ }
2307
+ function loadBalancer1FromJSON(jsonString) {
2308
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LoadBalancer1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LoadBalancer1' from JSON`);
2309
+ }
2310
+ /** @internal */
2311
+ exports.LoadBalancer$inboundSchema = z.lazy(() => exports.LoadBalancer1$inboundSchema);
2312
+ /** @internal */
2313
+ exports.LoadBalancer$outboundSchema = z.lazy(() => exports.LoadBalancer1$outboundSchema);
2314
+ function loadBalancerToJSON(loadBalancer) {
2315
+ return JSON.stringify(exports.LoadBalancer$outboundSchema.parse(loadBalancer));
2316
+ }
2317
+ function loadBalancerFromJSON(jsonString) {
2318
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.LoadBalancer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LoadBalancer' from JSON`);
2319
+ }
2320
+ /** @internal */
2321
+ exports.Timeout$inboundSchema = z.object({
2322
+ call_timeout: z.number(),
2323
+ }).transform((v) => {
2324
+ return (0, primitives_js_1.remap)(v, {
2325
+ "call_timeout": "callTimeout",
2326
+ });
2327
+ });
2328
+ /** @internal */
2329
+ exports.Timeout$outboundSchema = z.object({
2330
+ callTimeout: z.number(),
2331
+ }).transform((v) => {
2332
+ return (0, primitives_js_1.remap)(v, {
2333
+ callTimeout: "call_timeout",
2334
+ });
2335
+ });
2336
+ function timeoutToJSON(timeout) {
2337
+ return JSON.stringify(exports.Timeout$outboundSchema.parse(timeout));
2338
+ }
2339
+ function timeoutFromJSON(jsonString) {
2340
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Timeout$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Timeout' from JSON`);
2341
+ }
2342
+ /** @internal */
2343
+ exports.Orq$inboundSchema = z
2344
+ .object({
2345
+ name: z.string().optional(),
2346
+ retry: z.lazy(() => exports.CreateChatCompletionRetry$inboundSchema).optional(),
2347
+ fallbacks: z.array(z.lazy(() => exports.Fallbacks$inboundSchema)).optional(),
2348
+ prompt: z.lazy(() => exports.Prompt$inboundSchema).optional(),
2349
+ contact: components.PublicContact$inboundSchema.optional(),
2350
+ thread: z.lazy(() => exports.CreateChatCompletionThread$inboundSchema).optional(),
2351
+ inputs: z.union([
2352
+ z.record(z.any()),
2353
+ z.array(z.lazy(() => exports.Inputs2$inboundSchema)),
2354
+ ]).optional(),
2355
+ cache: z.lazy(() => exports.Cache$inboundSchema).optional(),
2356
+ knowledge_bases: z.array(z.lazy(() => exports.CreateChatCompletionKnowledgeBases$inboundSchema)).optional(),
2357
+ load_balancer: z.array(z.lazy(() => exports.LoadBalancer1$inboundSchema))
2358
+ .optional(),
2359
+ timeout: z.lazy(() => exports.Timeout$inboundSchema).optional(),
2360
+ }).transform((v) => {
2361
+ return (0, primitives_js_1.remap)(v, {
2362
+ "knowledge_bases": "knowledgeBases",
2363
+ "load_balancer": "loadBalancer",
2364
+ });
2365
+ });
2366
+ /** @internal */
2367
+ exports.Orq$outboundSchema = z
2368
+ .object({
2369
+ name: z.string().optional(),
2370
+ retry: z.lazy(() => exports.CreateChatCompletionRetry$outboundSchema).optional(),
2371
+ fallbacks: z.array(z.lazy(() => exports.Fallbacks$outboundSchema)).optional(),
2372
+ prompt: z.lazy(() => exports.Prompt$outboundSchema).optional(),
2373
+ contact: components.PublicContact$outboundSchema.optional(),
2374
+ thread: z.lazy(() => exports.CreateChatCompletionThread$outboundSchema).optional(),
2375
+ inputs: z.union([
2376
+ z.record(z.any()),
2377
+ z.array(z.lazy(() => exports.Inputs2$outboundSchema)),
2378
+ ]).optional(),
2379
+ cache: z.lazy(() => exports.Cache$outboundSchema).optional(),
2380
+ knowledgeBases: z.array(z.lazy(() => exports.CreateChatCompletionKnowledgeBases$outboundSchema)).optional(),
2381
+ loadBalancer: z.array(z.lazy(() => exports.LoadBalancer1$outboundSchema))
2382
+ .optional(),
2383
+ timeout: z.lazy(() => exports.Timeout$outboundSchema).optional(),
2384
+ }).transform((v) => {
2385
+ return (0, primitives_js_1.remap)(v, {
2386
+ knowledgeBases: "knowledge_bases",
2387
+ loadBalancer: "load_balancer",
2388
+ });
2389
+ });
2390
+ function orqToJSON(orq) {
2391
+ return JSON.stringify(exports.Orq$outboundSchema.parse(orq));
2392
+ }
2393
+ function orqFromJSON(jsonString) {
2394
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Orq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Orq' from JSON`);
2395
+ }
2396
+ /** @internal */
2397
+ exports.CreateChatCompletionRequestBody$inboundSchema = z.object({
2398
+ messages: z.array(z.union([
2399
+ z.lazy(() => exports.CreateChatCompletionMessagesSystemMessage$inboundSchema),
2400
+ z.lazy(() => exports.CreateChatCompletionMessagesDeveloperMessage$inboundSchema),
2401
+ z.lazy(() => exports.CreateChatCompletionMessagesUserMessage$inboundSchema),
2402
+ z.lazy(() => exports.CreateChatCompletionMessagesAssistantMessage$inboundSchema),
2403
+ z.lazy(() => exports.CreateChatCompletionMessagesToolMessage$inboundSchema),
2404
+ ])),
2405
+ model: z.string(),
2406
+ metadata: z.record(z.string()).optional(),
2407
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionAudio$inboundSchema))
2408
+ .optional(),
2409
+ frequency_penalty: z.nullable(z.number()).optional(),
2410
+ max_tokens: z.nullable(z.number().int()).optional(),
2411
+ max_completion_tokens: z.nullable(z.number().int()).optional(),
2412
+ logprobs: z.nullable(z.boolean()).optional(),
2413
+ top_logprobs: z.nullable(z.number().int()).optional(),
2414
+ n: z.nullable(z.number().int()).optional(),
2415
+ presence_penalty: z.nullable(z.number()).optional(),
2416
+ response_format: z.union([
2417
+ z.lazy(() => exports.CreateChatCompletionResponseFormatText$inboundSchema),
2418
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONObject$inboundSchema),
2419
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONSchema$inboundSchema),
2420
+ ]).optional(),
2421
+ reasoning_effort: exports.CreateChatCompletionReasoningEffort$inboundSchema
2422
+ .optional(),
2423
+ verbosity: z.string().optional(),
2424
+ seed: z.nullable(z.number()).optional(),
2425
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
2426
+ stream_options: z.nullable(z.lazy(() => exports.CreateChatCompletionStreamOptions$inboundSchema)).optional(),
2427
+ thinking: z.union([
2428
+ components.ThinkingConfigDisabledSchema$inboundSchema,
2429
+ components.ThinkingConfigEnabledSchema$inboundSchema,
2430
+ ]).optional(),
2431
+ temperature: z.nullable(z.number()).optional(),
2432
+ top_p: z.nullable(z.number()).optional(),
2433
+ top_k: z.nullable(z.number()).optional(),
2434
+ tools: z.array(z.lazy(() => exports.CreateChatCompletionTools$inboundSchema))
2435
+ .optional(),
2436
+ tool_choice: z.union([
2437
+ z.lazy(() => exports.CreateChatCompletionToolChoice2$inboundSchema),
2438
+ exports.CreateChatCompletionToolChoice1$inboundSchema,
2439
+ ]).optional(),
2440
+ parallel_tool_calls: z.boolean().optional(),
2441
+ modalities: z.nullable(z.array(exports.CreateChatCompletionModalities$inboundSchema))
2442
+ .optional(),
2443
+ guardrails: z.array(z.lazy(() => exports.CreateChatCompletionGuardrails$inboundSchema)).optional(),
2444
+ orq: z.lazy(() => exports.Orq$inboundSchema).optional(),
2445
+ stream: z.boolean().default(false),
2446
+ }).transform((v) => {
2447
+ return (0, primitives_js_1.remap)(v, {
2448
+ "frequency_penalty": "frequencyPenalty",
2449
+ "max_tokens": "maxTokens",
2450
+ "max_completion_tokens": "maxCompletionTokens",
2451
+ "top_logprobs": "topLogprobs",
2452
+ "presence_penalty": "presencePenalty",
2453
+ "response_format": "responseFormat",
2454
+ "reasoning_effort": "reasoningEffort",
2455
+ "stream_options": "streamOptions",
2456
+ "top_p": "topP",
2457
+ "top_k": "topK",
2458
+ "tool_choice": "toolChoice",
2459
+ "parallel_tool_calls": "parallelToolCalls",
2460
+ });
2461
+ });
2462
+ /** @internal */
2463
+ exports.CreateChatCompletionRequestBody$outboundSchema = z.object({
2464
+ messages: z.array(z.union([
2465
+ z.lazy(() => exports.CreateChatCompletionMessagesSystemMessage$outboundSchema),
2466
+ z.lazy(() => exports.CreateChatCompletionMessagesDeveloperMessage$outboundSchema),
2467
+ z.lazy(() => exports.CreateChatCompletionMessagesUserMessage$outboundSchema),
2468
+ z.lazy(() => exports.CreateChatCompletionMessagesAssistantMessage$outboundSchema),
2469
+ z.lazy(() => exports.CreateChatCompletionMessagesToolMessage$outboundSchema),
2470
+ ])),
2471
+ model: z.string(),
2472
+ metadata: z.record(z.string()).optional(),
2473
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionAudio$outboundSchema))
2474
+ .optional(),
2475
+ frequencyPenalty: z.nullable(z.number()).optional(),
2476
+ maxTokens: z.nullable(z.number().int()).optional(),
2477
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
2478
+ logprobs: z.nullable(z.boolean()).optional(),
2479
+ topLogprobs: z.nullable(z.number().int()).optional(),
2480
+ n: z.nullable(z.number().int()).optional(),
2481
+ presencePenalty: z.nullable(z.number()).optional(),
2482
+ responseFormat: z.union([
2483
+ z.lazy(() => exports.CreateChatCompletionResponseFormatText$outboundSchema),
2484
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONObject$outboundSchema),
2485
+ z.lazy(() => exports.CreateChatCompletionResponseFormatJSONSchema$outboundSchema),
2486
+ ]).optional(),
2487
+ reasoningEffort: exports.CreateChatCompletionReasoningEffort$outboundSchema
2488
+ .optional(),
2489
+ verbosity: z.string().optional(),
2490
+ seed: z.nullable(z.number()).optional(),
2491
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
2492
+ streamOptions: z.nullable(z.lazy(() => exports.CreateChatCompletionStreamOptions$outboundSchema)).optional(),
2493
+ thinking: z.union([
2494
+ components.ThinkingConfigDisabledSchema$outboundSchema,
2495
+ components.ThinkingConfigEnabledSchema$outboundSchema,
2496
+ ]).optional(),
2497
+ temperature: z.nullable(z.number()).optional(),
2498
+ topP: z.nullable(z.number()).optional(),
2499
+ topK: z.nullable(z.number()).optional(),
2500
+ tools: z.array(z.lazy(() => exports.CreateChatCompletionTools$outboundSchema))
2501
+ .optional(),
2502
+ toolChoice: z.union([
2503
+ z.lazy(() => exports.CreateChatCompletionToolChoice2$outboundSchema),
2504
+ exports.CreateChatCompletionToolChoice1$outboundSchema,
2505
+ ]).optional(),
2506
+ parallelToolCalls: z.boolean().optional(),
2507
+ modalities: z.nullable(z.array(exports.CreateChatCompletionModalities$outboundSchema))
2508
+ .optional(),
2509
+ guardrails: z.array(z.lazy(() => exports.CreateChatCompletionGuardrails$outboundSchema)).optional(),
2510
+ orq: z.lazy(() => exports.Orq$outboundSchema).optional(),
2511
+ stream: z.boolean().default(false),
2512
+ }).transform((v) => {
2513
+ return (0, primitives_js_1.remap)(v, {
2514
+ frequencyPenalty: "frequency_penalty",
2515
+ maxTokens: "max_tokens",
2516
+ maxCompletionTokens: "max_completion_tokens",
2517
+ topLogprobs: "top_logprobs",
2518
+ presencePenalty: "presence_penalty",
2519
+ responseFormat: "response_format",
2520
+ reasoningEffort: "reasoning_effort",
2521
+ streamOptions: "stream_options",
2522
+ topP: "top_p",
2523
+ topK: "top_k",
2524
+ toolChoice: "tool_choice",
2525
+ parallelToolCalls: "parallel_tool_calls",
2526
+ });
2527
+ });
2528
+ function createChatCompletionRequestBodyToJSON(createChatCompletionRequestBody) {
2529
+ return JSON.stringify(exports.CreateChatCompletionRequestBody$outboundSchema.parse(createChatCompletionRequestBody));
2530
+ }
2531
+ function createChatCompletionRequestBodyFromJSON(jsonString) {
2532
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRequestBody' from JSON`);
2533
+ }
2534
+ /** @internal */
2535
+ exports.CreateChatCompletionFinishReason$inboundSchema = z.nativeEnum(exports.CreateChatCompletionFinishReason);
2536
+ /** @internal */
2537
+ exports.CreateChatCompletionFinishReason$outboundSchema = exports.CreateChatCompletionFinishReason$inboundSchema;
2538
+ /** @internal */
2539
+ exports.CreateChatCompletionRouterTopLogprobs$inboundSchema = z.object({
2540
+ token: z.string(),
2541
+ logprob: z.number(),
2542
+ bytes: z.nullable(z.array(z.number())),
2543
+ });
2544
+ /** @internal */
2545
+ exports.CreateChatCompletionRouterTopLogprobs$outboundSchema = z.object({
2546
+ token: z.string(),
2547
+ logprob: z.number(),
2548
+ bytes: z.nullable(z.array(z.number())),
2549
+ });
2550
+ function createChatCompletionRouterTopLogprobsToJSON(createChatCompletionRouterTopLogprobs) {
2551
+ return JSON.stringify(exports.CreateChatCompletionRouterTopLogprobs$outboundSchema.parse(createChatCompletionRouterTopLogprobs));
2552
+ }
2553
+ function createChatCompletionRouterTopLogprobsFromJSON(jsonString) {
2554
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterTopLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterTopLogprobs' from JSON`);
2555
+ }
2556
+ /** @internal */
2557
+ exports.CreateChatCompletionRouterContent$inboundSchema = z.object({
2558
+ token: z.string(),
2559
+ logprob: z.number(),
2560
+ bytes: z.nullable(z.array(z.number())),
2561
+ top_logprobs: z.array(z.lazy(() => exports.CreateChatCompletionRouterTopLogprobs$inboundSchema)),
2562
+ }).transform((v) => {
2563
+ return (0, primitives_js_1.remap)(v, {
2564
+ "top_logprobs": "topLogprobs",
2565
+ });
2566
+ });
2567
+ /** @internal */
2568
+ exports.CreateChatCompletionRouterContent$outboundSchema = z.object({
2569
+ token: z.string(),
2570
+ logprob: z.number(),
2571
+ bytes: z.nullable(z.array(z.number())),
2572
+ topLogprobs: z.array(z.lazy(() => exports.CreateChatCompletionRouterTopLogprobs$outboundSchema)),
2573
+ }).transform((v) => {
2574
+ return (0, primitives_js_1.remap)(v, {
2575
+ topLogprobs: "top_logprobs",
2576
+ });
2577
+ });
2578
+ function createChatCompletionRouterContentToJSON(createChatCompletionRouterContent) {
2579
+ return JSON.stringify(exports.CreateChatCompletionRouterContent$outboundSchema.parse(createChatCompletionRouterContent));
2580
+ }
2581
+ function createChatCompletionRouterContentFromJSON(jsonString) {
2582
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterContent' from JSON`);
2583
+ }
2584
+ /** @internal */
2585
+ exports.CreateChatCompletionRouterResponseTopLogprobs$inboundSchema = z.object({
2586
+ token: z.string(),
2587
+ logprob: z.number(),
2588
+ bytes: z.nullable(z.array(z.number())),
2589
+ });
2590
+ /** @internal */
2591
+ exports.CreateChatCompletionRouterResponseTopLogprobs$outboundSchema = z.object({
2592
+ token: z.string(),
2593
+ logprob: z.number(),
2594
+ bytes: z.nullable(z.array(z.number())),
2595
+ });
2596
+ function createChatCompletionRouterResponseTopLogprobsToJSON(createChatCompletionRouterResponseTopLogprobs) {
2597
+ return JSON.stringify(exports.CreateChatCompletionRouterResponseTopLogprobs$outboundSchema.parse(createChatCompletionRouterResponseTopLogprobs));
2598
+ }
2599
+ function createChatCompletionRouterResponseTopLogprobsFromJSON(jsonString) {
2600
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterResponseTopLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterResponseTopLogprobs' from JSON`);
2601
+ }
2602
+ /** @internal */
2603
+ exports.CreateChatCompletionRefusal$inboundSchema = z.object({
2604
+ token: z.string(),
2605
+ logprob: z.number(),
2606
+ bytes: z.nullable(z.array(z.number())),
2607
+ top_logprobs: z.array(z.lazy(() => exports.CreateChatCompletionRouterResponseTopLogprobs$inboundSchema)),
2608
+ }).transform((v) => {
2609
+ return (0, primitives_js_1.remap)(v, {
2610
+ "top_logprobs": "topLogprobs",
2611
+ });
2612
+ });
2613
+ /** @internal */
2614
+ exports.CreateChatCompletionRefusal$outboundSchema = z.object({
2615
+ token: z.string(),
2616
+ logprob: z.number(),
2617
+ bytes: z.nullable(z.array(z.number())),
2618
+ topLogprobs: z.array(z.lazy(() => exports.CreateChatCompletionRouterResponseTopLogprobs$outboundSchema)),
2619
+ }).transform((v) => {
2620
+ return (0, primitives_js_1.remap)(v, {
2621
+ topLogprobs: "top_logprobs",
2622
+ });
2623
+ });
2624
+ function createChatCompletionRefusalToJSON(createChatCompletionRefusal) {
2625
+ return JSON.stringify(exports.CreateChatCompletionRefusal$outboundSchema.parse(createChatCompletionRefusal));
2626
+ }
2627
+ function createChatCompletionRefusalFromJSON(jsonString) {
2628
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRefusal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRefusal' from JSON`);
2629
+ }
2630
+ /** @internal */
2631
+ exports.CreateChatCompletionLogprobs$inboundSchema = z.object({
2632
+ content: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionRouterContent$inboundSchema))),
2633
+ refusal: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionRefusal$inboundSchema))),
2634
+ });
2635
+ /** @internal */
2636
+ exports.CreateChatCompletionLogprobs$outboundSchema = z.object({
2637
+ content: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionRouterContent$outboundSchema))),
2638
+ refusal: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionRefusal$outboundSchema))),
2639
+ });
2640
+ function createChatCompletionLogprobsToJSON(createChatCompletionLogprobs) {
2641
+ return JSON.stringify(exports.CreateChatCompletionLogprobs$outboundSchema.parse(createChatCompletionLogprobs));
2642
+ }
2643
+ function createChatCompletionLogprobsFromJSON(jsonString) {
2644
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionLogprobs' from JSON`);
2645
+ }
2646
+ /** @internal */
2647
+ exports.CreateChatCompletionRouterResponse200Type$inboundSchema = z
2648
+ .nativeEnum(exports.CreateChatCompletionRouterResponse200Type);
2649
+ /** @internal */
2650
+ exports.CreateChatCompletionRouterResponse200Type$outboundSchema = exports.CreateChatCompletionRouterResponse200Type$inboundSchema;
2651
+ /** @internal */
2652
+ exports.CreateChatCompletionRouterResponseFunction$inboundSchema = z.object({
2653
+ name: z.string().optional(),
2654
+ arguments: z.string().optional(),
2655
+ });
2656
+ /** @internal */
2657
+ exports.CreateChatCompletionRouterResponseFunction$outboundSchema = z.object({
2658
+ name: z.string().optional(),
2659
+ arguments: z.string().optional(),
2660
+ });
2661
+ function createChatCompletionRouterResponseFunctionToJSON(createChatCompletionRouterResponseFunction) {
2662
+ return JSON.stringify(exports.CreateChatCompletionRouterResponseFunction$outboundSchema.parse(createChatCompletionRouterResponseFunction));
2663
+ }
2664
+ function createChatCompletionRouterResponseFunctionFromJSON(jsonString) {
2665
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterResponseFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterResponseFunction' from JSON`);
2666
+ }
2667
+ /** @internal */
2668
+ exports.CreateChatCompletionRouterToolCalls$inboundSchema = z.object({
2669
+ index: z.number().optional(),
2670
+ id: z.string().optional(),
2671
+ type: exports.CreateChatCompletionRouterResponse200Type$inboundSchema.optional(),
2672
+ function: z.lazy(() => exports.CreateChatCompletionRouterResponseFunction$inboundSchema).optional(),
2673
+ thought_signature: z.string().optional(),
2674
+ }).transform((v) => {
2675
+ return (0, primitives_js_1.remap)(v, {
2676
+ "thought_signature": "thoughtSignature",
2677
+ });
2678
+ });
2679
+ /** @internal */
2680
+ exports.CreateChatCompletionRouterToolCalls$outboundSchema = z.object({
2681
+ index: z.number().optional(),
2682
+ id: z.string().optional(),
2683
+ type: exports.CreateChatCompletionRouterResponse200Type$outboundSchema.optional(),
2684
+ function: z.lazy(() => exports.CreateChatCompletionRouterResponseFunction$outboundSchema).optional(),
2685
+ thoughtSignature: z.string().optional(),
2686
+ }).transform((v) => {
2687
+ return (0, primitives_js_1.remap)(v, {
2688
+ thoughtSignature: "thought_signature",
2689
+ });
2690
+ });
2691
+ function createChatCompletionRouterToolCallsToJSON(createChatCompletionRouterToolCalls) {
2692
+ return JSON.stringify(exports.CreateChatCompletionRouterToolCalls$outboundSchema.parse(createChatCompletionRouterToolCalls));
2693
+ }
2694
+ function createChatCompletionRouterToolCallsFromJSON(jsonString) {
2695
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterToolCalls$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterToolCalls' from JSON`);
2696
+ }
2697
+ /** @internal */
2698
+ exports.CreateChatCompletionRouterRole$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRouterRole);
2699
+ /** @internal */
2700
+ exports.CreateChatCompletionRouterRole$outboundSchema = exports.CreateChatCompletionRouterRole$inboundSchema;
2701
+ /** @internal */
2702
+ exports.CreateChatCompletionRouterResponseAudio$inboundSchema = z.object({
2703
+ id: z.string().optional(),
2704
+ transcript: z.string().optional(),
2705
+ data: z.string().optional(),
2706
+ expires_at: z.number().int().optional(),
2707
+ }).transform((v) => {
2708
+ return (0, primitives_js_1.remap)(v, {
2709
+ "expires_at": "expiresAt",
2710
+ });
2711
+ });
2712
+ /** @internal */
2713
+ exports.CreateChatCompletionRouterResponseAudio$outboundSchema = z.object({
2714
+ id: z.string().optional(),
2715
+ transcript: z.string().optional(),
2716
+ data: z.string().optional(),
2717
+ expiresAt: z.number().int().optional(),
2718
+ }).transform((v) => {
2719
+ return (0, primitives_js_1.remap)(v, {
2720
+ expiresAt: "expires_at",
2721
+ });
2722
+ });
2723
+ function createChatCompletionRouterResponseAudioToJSON(createChatCompletionRouterResponseAudio) {
2724
+ return JSON.stringify(exports.CreateChatCompletionRouterResponseAudio$outboundSchema.parse(createChatCompletionRouterResponseAudio));
2725
+ }
2726
+ function createChatCompletionRouterResponseAudioFromJSON(jsonString) {
2727
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterResponseAudio$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterResponseAudio' from JSON`);
2728
+ }
2729
+ /** @internal */
2730
+ exports.Delta$inboundSchema = z
2731
+ .object({
2732
+ content: z.nullable(z.string()).optional(),
2733
+ refusal: z.nullable(z.string()).optional(),
2734
+ tool_calls: z.array(z.lazy(() => exports.CreateChatCompletionRouterToolCalls$inboundSchema)).optional(),
2735
+ role: exports.CreateChatCompletionRouterRole$inboundSchema.optional(),
2736
+ reasoning: z.string().optional(),
2737
+ reasoning_signature: z.string().optional(),
2738
+ redacted_reasoning: z.string().optional(),
2739
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterResponseAudio$inboundSchema)).optional(),
2740
+ }).transform((v) => {
2741
+ return (0, primitives_js_1.remap)(v, {
2742
+ "tool_calls": "toolCalls",
2743
+ "reasoning_signature": "reasoningSignature",
2744
+ "redacted_reasoning": "redactedReasoning",
2745
+ });
2746
+ });
2747
+ /** @internal */
2748
+ exports.Delta$outboundSchema = z.object({
2749
+ content: z.nullable(z.string()).optional(),
2750
+ refusal: z.nullable(z.string()).optional(),
2751
+ toolCalls: z.array(z.lazy(() => exports.CreateChatCompletionRouterToolCalls$outboundSchema)).optional(),
2752
+ role: exports.CreateChatCompletionRouterRole$outboundSchema.optional(),
2753
+ reasoning: z.string().optional(),
2754
+ reasoningSignature: z.string().optional(),
2755
+ redactedReasoning: z.string().optional(),
2756
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterResponseAudio$outboundSchema)).optional(),
2757
+ }).transform((v) => {
2758
+ return (0, primitives_js_1.remap)(v, {
2759
+ toolCalls: "tool_calls",
2760
+ reasoningSignature: "reasoning_signature",
2761
+ redactedReasoning: "redacted_reasoning",
2762
+ });
2763
+ });
2764
+ function deltaToJSON(delta) {
2765
+ return JSON.stringify(exports.Delta$outboundSchema.parse(delta));
2766
+ }
2767
+ function deltaFromJSON(jsonString) {
2768
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Delta$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Delta' from JSON`);
2769
+ }
2770
+ /** @internal */
2771
+ exports.CreateChatCompletionRouterChoices$inboundSchema = z.object({
2772
+ finish_reason: z.nullable(exports.CreateChatCompletionFinishReason$inboundSchema),
2773
+ index: z.number().default(0),
2774
+ logprobs: z.nullable(z.lazy(() => exports.CreateChatCompletionLogprobs$inboundSchema))
2775
+ .optional(),
2776
+ delta: z.lazy(() => exports.Delta$inboundSchema),
2777
+ }).transform((v) => {
2778
+ return (0, primitives_js_1.remap)(v, {
2779
+ "finish_reason": "finishReason",
2780
+ });
2781
+ });
2782
+ /** @internal */
2783
+ exports.CreateChatCompletionRouterChoices$outboundSchema = z.object({
2784
+ finishReason: z.nullable(exports.CreateChatCompletionFinishReason$outboundSchema),
2785
+ index: z.number().default(0),
2786
+ logprobs: z.nullable(z.lazy(() => exports.CreateChatCompletionLogprobs$outboundSchema)).optional(),
2787
+ delta: z.lazy(() => exports.Delta$outboundSchema),
2788
+ }).transform((v) => {
2789
+ return (0, primitives_js_1.remap)(v, {
2790
+ finishReason: "finish_reason",
2791
+ });
2792
+ });
2793
+ function createChatCompletionRouterChoicesToJSON(createChatCompletionRouterChoices) {
2794
+ return JSON.stringify(exports.CreateChatCompletionRouterChoices$outboundSchema.parse(createChatCompletionRouterChoices));
2795
+ }
2796
+ function createChatCompletionRouterChoicesFromJSON(jsonString) {
2797
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterChoices$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterChoices' from JSON`);
2798
+ }
2799
+ /** @internal */
2800
+ exports.CreateChatCompletionPromptTokensDetails$inboundSchema = z.object({
2801
+ cached_tokens: z.nullable(z.number().int()).optional(),
2802
+ cache_creation_tokens: z.nullable(z.number().int()).optional(),
2803
+ audio_tokens: z.nullable(z.number().int()).optional(),
2804
+ }).transform((v) => {
2805
+ return (0, primitives_js_1.remap)(v, {
2806
+ "cached_tokens": "cachedTokens",
2807
+ "cache_creation_tokens": "cacheCreationTokens",
2808
+ "audio_tokens": "audioTokens",
2809
+ });
2810
+ });
2811
+ /** @internal */
2812
+ exports.CreateChatCompletionPromptTokensDetails$outboundSchema = z.object({
2813
+ cachedTokens: z.nullable(z.number().int()).optional(),
2814
+ cacheCreationTokens: z.nullable(z.number().int()).optional(),
2815
+ audioTokens: z.nullable(z.number().int()).optional(),
2816
+ }).transform((v) => {
2817
+ return (0, primitives_js_1.remap)(v, {
2818
+ cachedTokens: "cached_tokens",
2819
+ cacheCreationTokens: "cache_creation_tokens",
2820
+ audioTokens: "audio_tokens",
2821
+ });
2822
+ });
2823
+ function createChatCompletionPromptTokensDetailsToJSON(createChatCompletionPromptTokensDetails) {
2824
+ return JSON.stringify(exports.CreateChatCompletionPromptTokensDetails$outboundSchema.parse(createChatCompletionPromptTokensDetails));
2825
+ }
2826
+ function createChatCompletionPromptTokensDetailsFromJSON(jsonString) {
2827
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionPromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionPromptTokensDetails' from JSON`);
2828
+ }
2829
+ /** @internal */
2830
+ exports.CreateChatCompletionCompletionTokensDetails$inboundSchema = z.object({
2831
+ reasoning_tokens: z.nullable(z.number()).optional(),
2832
+ accepted_prediction_tokens: z.nullable(z.number()).optional(),
2833
+ rejected_prediction_tokens: z.nullable(z.number()).optional(),
2834
+ audio_tokens: z.nullable(z.number().int()).optional(),
2835
+ }).transform((v) => {
2836
+ return (0, primitives_js_1.remap)(v, {
2837
+ "reasoning_tokens": "reasoningTokens",
2838
+ "accepted_prediction_tokens": "acceptedPredictionTokens",
2839
+ "rejected_prediction_tokens": "rejectedPredictionTokens",
2840
+ "audio_tokens": "audioTokens",
2841
+ });
2842
+ });
2843
+ /** @internal */
2844
+ exports.CreateChatCompletionCompletionTokensDetails$outboundSchema = z.object({
2845
+ reasoningTokens: z.nullable(z.number()).optional(),
2846
+ acceptedPredictionTokens: z.nullable(z.number()).optional(),
2847
+ rejectedPredictionTokens: z.nullable(z.number()).optional(),
2848
+ audioTokens: z.nullable(z.number().int()).optional(),
2849
+ }).transform((v) => {
2850
+ return (0, primitives_js_1.remap)(v, {
2851
+ reasoningTokens: "reasoning_tokens",
2852
+ acceptedPredictionTokens: "accepted_prediction_tokens",
2853
+ rejectedPredictionTokens: "rejected_prediction_tokens",
2854
+ audioTokens: "audio_tokens",
2855
+ });
2856
+ });
2857
+ function createChatCompletionCompletionTokensDetailsToJSON(createChatCompletionCompletionTokensDetails) {
2858
+ return JSON.stringify(exports.CreateChatCompletionCompletionTokensDetails$outboundSchema.parse(createChatCompletionCompletionTokensDetails));
2859
+ }
2860
+ function createChatCompletionCompletionTokensDetailsFromJSON(jsonString) {
2861
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionCompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionCompletionTokensDetails' from JSON`);
2862
+ }
2863
+ /** @internal */
2864
+ exports.CreateChatCompletionRouterUsage$inboundSchema = z.object({
2865
+ completion_tokens: z.number().optional(),
2866
+ prompt_tokens: z.number().optional(),
2867
+ total_tokens: z.number().optional(),
2868
+ prompt_tokens_details: z.nullable(z.lazy(() => exports.CreateChatCompletionPromptTokensDetails$inboundSchema)).optional(),
2869
+ completion_tokens_details: z.nullable(z.lazy(() => exports.CreateChatCompletionCompletionTokensDetails$inboundSchema)).optional(),
2870
+ }).transform((v) => {
2871
+ return (0, primitives_js_1.remap)(v, {
2872
+ "completion_tokens": "completionTokens",
2873
+ "prompt_tokens": "promptTokens",
2874
+ "total_tokens": "totalTokens",
2875
+ "prompt_tokens_details": "promptTokensDetails",
2876
+ "completion_tokens_details": "completionTokensDetails",
2877
+ });
2878
+ });
2879
+ /** @internal */
2880
+ exports.CreateChatCompletionRouterUsage$outboundSchema = z.object({
2881
+ completionTokens: z.number().optional(),
2882
+ promptTokens: z.number().optional(),
2883
+ totalTokens: z.number().optional(),
2884
+ promptTokensDetails: z.nullable(z.lazy(() => exports.CreateChatCompletionPromptTokensDetails$outboundSchema)).optional(),
2885
+ completionTokensDetails: z.nullable(z.lazy(() => exports.CreateChatCompletionCompletionTokensDetails$outboundSchema)).optional(),
2886
+ }).transform((v) => {
2887
+ return (0, primitives_js_1.remap)(v, {
2888
+ completionTokens: "completion_tokens",
2889
+ promptTokens: "prompt_tokens",
2890
+ totalTokens: "total_tokens",
2891
+ promptTokensDetails: "prompt_tokens_details",
2892
+ completionTokensDetails: "completion_tokens_details",
2893
+ });
2894
+ });
2895
+ function createChatCompletionRouterUsageToJSON(createChatCompletionRouterUsage) {
2896
+ return JSON.stringify(exports.CreateChatCompletionRouterUsage$outboundSchema.parse(createChatCompletionRouterUsage));
2897
+ }
2898
+ function createChatCompletionRouterUsageFromJSON(jsonString) {
2899
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterUsage' from JSON`);
2900
+ }
2901
+ /** @internal */
2902
+ exports.CreateChatCompletionRouterObject$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRouterObject);
2903
+ /** @internal */
2904
+ exports.CreateChatCompletionRouterObject$outboundSchema = exports.CreateChatCompletionRouterObject$inboundSchema;
2905
+ /** @internal */
2906
+ exports.CreateChatCompletionData$inboundSchema = z.object({
2907
+ id: z.string(),
2908
+ choices: z.array(z.lazy(() => exports.CreateChatCompletionRouterChoices$inboundSchema)),
2909
+ created: z.number(),
2910
+ model: z.string(),
2911
+ system_fingerprint: z.nullable(z.string()).optional(),
2912
+ usage: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterUsage$inboundSchema))
2913
+ .optional(),
2914
+ object: exports.CreateChatCompletionRouterObject$inboundSchema,
2915
+ }).transform((v) => {
2916
+ return (0, primitives_js_1.remap)(v, {
2917
+ "system_fingerprint": "systemFingerprint",
2918
+ });
2919
+ });
2920
+ /** @internal */
2921
+ exports.CreateChatCompletionData$outboundSchema = z.object({
2922
+ id: z.string(),
2923
+ choices: z.array(z.lazy(() => exports.CreateChatCompletionRouterChoices$outboundSchema)),
2924
+ created: z.number(),
2925
+ model: z.string(),
2926
+ systemFingerprint: z.nullable(z.string()).optional(),
2927
+ usage: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterUsage$outboundSchema)).optional(),
2928
+ object: exports.CreateChatCompletionRouterObject$outboundSchema,
2929
+ }).transform((v) => {
2930
+ return (0, primitives_js_1.remap)(v, {
2931
+ systemFingerprint: "system_fingerprint",
2932
+ });
2933
+ });
2934
+ function createChatCompletionDataToJSON(createChatCompletionData) {
2935
+ return JSON.stringify(exports.CreateChatCompletionData$outboundSchema.parse(createChatCompletionData));
2936
+ }
2937
+ function createChatCompletionDataFromJSON(jsonString) {
2938
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionData' from JSON`);
2939
+ }
2940
+ /** @internal */
2941
+ exports.CreateChatCompletionRouterResponseBody$inboundSchema = z.object({
2942
+ data: z.string().optional().transform((v, ctx) => {
2943
+ if (v === undefined)
2944
+ return undefined;
2945
+ try {
2946
+ return JSON.parse(v);
2947
+ }
2948
+ catch (err) {
2949
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
2950
+ return z.NEVER;
2951
+ }
2952
+ }).pipe(z.lazy(() => exports.CreateChatCompletionData$inboundSchema).optional()),
2953
+ });
2954
+ /** @internal */
2955
+ exports.CreateChatCompletionRouterResponseBody$outboundSchema = z.object({
2956
+ data: z.lazy(() => exports.CreateChatCompletionData$outboundSchema).optional(),
2957
+ });
2958
+ function createChatCompletionRouterResponseBodyToJSON(createChatCompletionRouterResponseBody) {
2959
+ return JSON.stringify(exports.CreateChatCompletionRouterResponseBody$outboundSchema.parse(createChatCompletionRouterResponseBody));
2960
+ }
2961
+ function createChatCompletionRouterResponseBodyFromJSON(jsonString) {
2962
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterResponseBody' from JSON`);
2963
+ }
2964
+ /** @internal */
2965
+ exports.FinishReason$inboundSchema = z.nativeEnum(exports.FinishReason);
2966
+ /** @internal */
2967
+ exports.FinishReason$outboundSchema = exports.FinishReason$inboundSchema;
2968
+ /** @internal */
2969
+ exports.CreateChatCompletionRouterResponseType$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRouterResponseType);
2970
+ /** @internal */
2971
+ exports.CreateChatCompletionRouterResponseType$outboundSchema = exports.CreateChatCompletionRouterResponseType$inboundSchema;
2972
+ /** @internal */
2973
+ exports.CreateChatCompletionRouterFunction$inboundSchema = z.object({
2974
+ name: z.string().optional(),
2975
+ arguments: z.string().optional(),
2976
+ });
2977
+ /** @internal */
2978
+ exports.CreateChatCompletionRouterFunction$outboundSchema = z.object({
2979
+ name: z.string().optional(),
2980
+ arguments: z.string().optional(),
2981
+ });
2982
+ function createChatCompletionRouterFunctionToJSON(createChatCompletionRouterFunction) {
2983
+ return JSON.stringify(exports.CreateChatCompletionRouterFunction$outboundSchema.parse(createChatCompletionRouterFunction));
2984
+ }
2985
+ function createChatCompletionRouterFunctionFromJSON(jsonString) {
2986
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterFunction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterFunction' from JSON`);
2987
+ }
2988
+ /** @internal */
2989
+ exports.CreateChatCompletionToolCalls$inboundSchema = z.object({
2990
+ index: z.number().optional(),
2991
+ id: z.string().optional(),
2992
+ type: exports.CreateChatCompletionRouterResponseType$inboundSchema.optional(),
2993
+ function: z.lazy(() => exports.CreateChatCompletionRouterFunction$inboundSchema)
2994
+ .optional(),
2995
+ thought_signature: z.string().optional(),
2996
+ }).transform((v) => {
2997
+ return (0, primitives_js_1.remap)(v, {
2998
+ "thought_signature": "thoughtSignature",
2999
+ });
3000
+ });
3001
+ /** @internal */
3002
+ exports.CreateChatCompletionToolCalls$outboundSchema = z.object({
3003
+ index: z.number().optional(),
3004
+ id: z.string().optional(),
3005
+ type: exports.CreateChatCompletionRouterResponseType$outboundSchema.optional(),
3006
+ function: z.lazy(() => exports.CreateChatCompletionRouterFunction$outboundSchema)
3007
+ .optional(),
3008
+ thoughtSignature: z.string().optional(),
3009
+ }).transform((v) => {
3010
+ return (0, primitives_js_1.remap)(v, {
3011
+ thoughtSignature: "thought_signature",
3012
+ });
3013
+ });
3014
+ function createChatCompletionToolCallsToJSON(createChatCompletionToolCalls) {
3015
+ return JSON.stringify(exports.CreateChatCompletionToolCalls$outboundSchema.parse(createChatCompletionToolCalls));
3016
+ }
3017
+ function createChatCompletionToolCallsFromJSON(jsonString) {
3018
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionToolCalls$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionToolCalls' from JSON`);
3019
+ }
3020
+ /** @internal */
3021
+ exports.CreateChatCompletionRole$inboundSchema = z.nativeEnum(exports.CreateChatCompletionRole);
3022
+ /** @internal */
3023
+ exports.CreateChatCompletionRole$outboundSchema = exports.CreateChatCompletionRole$inboundSchema;
3024
+ /** @internal */
3025
+ exports.CreateChatCompletionRouterAudio$inboundSchema = z.object({
3026
+ id: z.string(),
3027
+ expires_at: z.number().int(),
3028
+ data: z.string(),
3029
+ transcript: z.string(),
3030
+ }).transform((v) => {
3031
+ return (0, primitives_js_1.remap)(v, {
3032
+ "expires_at": "expiresAt",
3033
+ });
3034
+ });
3035
+ /** @internal */
3036
+ exports.CreateChatCompletionRouterAudio$outboundSchema = z.object({
3037
+ id: z.string(),
3038
+ expiresAt: z.number().int(),
3039
+ data: z.string(),
3040
+ transcript: z.string(),
3041
+ }).transform((v) => {
3042
+ return (0, primitives_js_1.remap)(v, {
3043
+ expiresAt: "expires_at",
3044
+ });
3045
+ });
3046
+ function createChatCompletionRouterAudioToJSON(createChatCompletionRouterAudio) {
3047
+ return JSON.stringify(exports.CreateChatCompletionRouterAudio$outboundSchema.parse(createChatCompletionRouterAudio));
3048
+ }
3049
+ function createChatCompletionRouterAudioFromJSON(jsonString) {
3050
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionRouterAudio$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionRouterAudio' from JSON`);
3051
+ }
3052
+ /** @internal */
3053
+ exports.CreateChatCompletionMessage$inboundSchema = z.object({
3054
+ content: z.nullable(z.string()).optional(),
3055
+ refusal: z.nullable(z.string()).optional(),
3056
+ tool_calls: z.array(z.lazy(() => exports.CreateChatCompletionToolCalls$inboundSchema))
3057
+ .optional(),
3058
+ role: exports.CreateChatCompletionRole$inboundSchema.optional(),
3059
+ reasoning: z.nullable(z.string()).optional(),
3060
+ reasoning_signature: z.nullable(z.string()).optional(),
3061
+ redacted_reasoning: z.string().optional(),
3062
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterAudio$inboundSchema))
3063
+ .optional(),
3064
+ }).transform((v) => {
3065
+ return (0, primitives_js_1.remap)(v, {
3066
+ "tool_calls": "toolCalls",
3067
+ "reasoning_signature": "reasoningSignature",
3068
+ "redacted_reasoning": "redactedReasoning",
3069
+ });
3070
+ });
3071
+ /** @internal */
3072
+ exports.CreateChatCompletionMessage$outboundSchema = z.object({
3073
+ content: z.nullable(z.string()).optional(),
3074
+ refusal: z.nullable(z.string()).optional(),
3075
+ toolCalls: z.array(z.lazy(() => exports.CreateChatCompletionToolCalls$outboundSchema))
3076
+ .optional(),
3077
+ role: exports.CreateChatCompletionRole$outboundSchema.optional(),
3078
+ reasoning: z.nullable(z.string()).optional(),
3079
+ reasoningSignature: z.nullable(z.string()).optional(),
3080
+ redactedReasoning: z.string().optional(),
3081
+ audio: z.nullable(z.lazy(() => exports.CreateChatCompletionRouterAudio$outboundSchema)).optional(),
3082
+ }).transform((v) => {
3083
+ return (0, primitives_js_1.remap)(v, {
3084
+ toolCalls: "tool_calls",
3085
+ reasoningSignature: "reasoning_signature",
3086
+ redactedReasoning: "redacted_reasoning",
3087
+ });
3088
+ });
3089
+ function createChatCompletionMessageToJSON(createChatCompletionMessage) {
3090
+ return JSON.stringify(exports.CreateChatCompletionMessage$outboundSchema.parse(createChatCompletionMessage));
3091
+ }
3092
+ function createChatCompletionMessageFromJSON(jsonString) {
3093
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionMessage' from JSON`);
3094
+ }
3095
+ /** @internal */
3096
+ exports.TopLogprobs$inboundSchema = z.object({
3097
+ token: z.string(),
3098
+ logprob: z.number(),
3099
+ bytes: z.nullable(z.array(z.number())),
3100
+ });
3101
+ /** @internal */
3102
+ exports.TopLogprobs$outboundSchema = z.object({
3103
+ token: z.string(),
3104
+ logprob: z.number(),
3105
+ bytes: z.nullable(z.array(z.number())),
3106
+ });
3107
+ function topLogprobsToJSON(topLogprobs) {
3108
+ return JSON.stringify(exports.TopLogprobs$outboundSchema.parse(topLogprobs));
3109
+ }
3110
+ function topLogprobsFromJSON(jsonString) {
3111
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TopLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TopLogprobs' from JSON`);
3112
+ }
3113
+ /** @internal */
3114
+ exports.CreateChatCompletionContent$inboundSchema = z.object({
3115
+ token: z.string(),
3116
+ logprob: z.number(),
3117
+ bytes: z.nullable(z.array(z.number())),
3118
+ top_logprobs: z.array(z.lazy(() => exports.TopLogprobs$inboundSchema)),
3119
+ }).transform((v) => {
3120
+ return (0, primitives_js_1.remap)(v, {
3121
+ "top_logprobs": "topLogprobs",
3122
+ });
3123
+ });
3124
+ /** @internal */
3125
+ exports.CreateChatCompletionContent$outboundSchema = z.object({
3126
+ token: z.string(),
3127
+ logprob: z.number(),
3128
+ bytes: z.nullable(z.array(z.number())),
3129
+ topLogprobs: z.array(z.lazy(() => exports.TopLogprobs$outboundSchema)),
3130
+ }).transform((v) => {
3131
+ return (0, primitives_js_1.remap)(v, {
3132
+ topLogprobs: "top_logprobs",
3133
+ });
3134
+ });
3135
+ function createChatCompletionContentToJSON(createChatCompletionContent) {
3136
+ return JSON.stringify(exports.CreateChatCompletionContent$outboundSchema.parse(createChatCompletionContent));
3137
+ }
3138
+ function createChatCompletionContentFromJSON(jsonString) {
3139
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionContent' from JSON`);
3140
+ }
3141
+ /** @internal */
3142
+ exports.CreateChatCompletionTopLogprobs$inboundSchema = z.object({
3143
+ token: z.string(),
3144
+ logprob: z.number(),
3145
+ bytes: z.nullable(z.array(z.number())),
3146
+ });
3147
+ /** @internal */
3148
+ exports.CreateChatCompletionTopLogprobs$outboundSchema = z.object({
3149
+ token: z.string(),
3150
+ logprob: z.number(),
3151
+ bytes: z.nullable(z.array(z.number())),
3152
+ });
3153
+ function createChatCompletionTopLogprobsToJSON(createChatCompletionTopLogprobs) {
3154
+ return JSON.stringify(exports.CreateChatCompletionTopLogprobs$outboundSchema.parse(createChatCompletionTopLogprobs));
3155
+ }
3156
+ function createChatCompletionTopLogprobsFromJSON(jsonString) {
3157
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionTopLogprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionTopLogprobs' from JSON`);
3158
+ }
3159
+ /** @internal */
3160
+ exports.Refusal$inboundSchema = z.object({
3161
+ token: z.string(),
3162
+ logprob: z.number(),
3163
+ bytes: z.nullable(z.array(z.number())),
3164
+ top_logprobs: z.array(z.lazy(() => exports.CreateChatCompletionTopLogprobs$inboundSchema)),
3165
+ }).transform((v) => {
3166
+ return (0, primitives_js_1.remap)(v, {
3167
+ "top_logprobs": "topLogprobs",
3168
+ });
3169
+ });
3170
+ /** @internal */
3171
+ exports.Refusal$outboundSchema = z.object({
3172
+ token: z.string(),
3173
+ logprob: z.number(),
3174
+ bytes: z.nullable(z.array(z.number())),
3175
+ topLogprobs: z.array(z.lazy(() => exports.CreateChatCompletionTopLogprobs$outboundSchema)),
3176
+ }).transform((v) => {
3177
+ return (0, primitives_js_1.remap)(v, {
3178
+ topLogprobs: "top_logprobs",
3179
+ });
3180
+ });
3181
+ function refusalToJSON(refusal) {
3182
+ return JSON.stringify(exports.Refusal$outboundSchema.parse(refusal));
3183
+ }
3184
+ function refusalFromJSON(jsonString) {
3185
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Refusal$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Refusal' from JSON`);
3186
+ }
3187
+ /** @internal */
3188
+ exports.Logprobs$inboundSchema = z.object({
3189
+ content: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionContent$inboundSchema))),
3190
+ refusal: z.nullable(z.array(z.lazy(() => exports.Refusal$inboundSchema))),
3191
+ });
3192
+ /** @internal */
3193
+ exports.Logprobs$outboundSchema = z.object({
3194
+ content: z.nullable(z.array(z.lazy(() => exports.CreateChatCompletionContent$outboundSchema))),
3195
+ refusal: z.nullable(z.array(z.lazy(() => exports.Refusal$outboundSchema))),
3196
+ });
3197
+ function logprobsToJSON(logprobs) {
3198
+ return JSON.stringify(exports.Logprobs$outboundSchema.parse(logprobs));
3199
+ }
3200
+ function logprobsFromJSON(jsonString) {
3201
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Logprobs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Logprobs' from JSON`);
3202
+ }
3203
+ /** @internal */
3204
+ exports.CreateChatCompletionChoices$inboundSchema = z.object({
3205
+ finish_reason: z.nullable(exports.FinishReason$inboundSchema),
3206
+ index: z.number().default(0),
3207
+ message: z.lazy(() => exports.CreateChatCompletionMessage$inboundSchema),
3208
+ logprobs: z.nullable(z.lazy(() => exports.Logprobs$inboundSchema)).optional(),
3209
+ }).transform((v) => {
3210
+ return (0, primitives_js_1.remap)(v, {
3211
+ "finish_reason": "finishReason",
3212
+ });
3213
+ });
3214
+ /** @internal */
3215
+ exports.CreateChatCompletionChoices$outboundSchema = z.object({
3216
+ finishReason: z.nullable(exports.FinishReason$outboundSchema),
3217
+ index: z.number().default(0),
3218
+ message: z.lazy(() => exports.CreateChatCompletionMessage$outboundSchema),
3219
+ logprobs: z.nullable(z.lazy(() => exports.Logprobs$outboundSchema)).optional(),
3220
+ }).transform((v) => {
3221
+ return (0, primitives_js_1.remap)(v, {
3222
+ finishReason: "finish_reason",
3223
+ });
3224
+ });
3225
+ function createChatCompletionChoicesToJSON(createChatCompletionChoices) {
3226
+ return JSON.stringify(exports.CreateChatCompletionChoices$outboundSchema.parse(createChatCompletionChoices));
3227
+ }
3228
+ function createChatCompletionChoicesFromJSON(jsonString) {
3229
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionChoices$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionChoices' from JSON`);
3230
+ }
3231
+ /** @internal */
3232
+ exports.PromptTokensDetails$inboundSchema = z.object({
3233
+ cached_tokens: z.nullable(z.number().int()).optional(),
3234
+ cache_creation_tokens: z.nullable(z.number().int()).optional(),
3235
+ audio_tokens: z.nullable(z.number().int()).optional(),
3236
+ }).transform((v) => {
3237
+ return (0, primitives_js_1.remap)(v, {
3238
+ "cached_tokens": "cachedTokens",
3239
+ "cache_creation_tokens": "cacheCreationTokens",
3240
+ "audio_tokens": "audioTokens",
3241
+ });
3242
+ });
3243
+ /** @internal */
3244
+ exports.PromptTokensDetails$outboundSchema = z.object({
3245
+ cachedTokens: z.nullable(z.number().int()).optional(),
3246
+ cacheCreationTokens: z.nullable(z.number().int()).optional(),
3247
+ audioTokens: z.nullable(z.number().int()).optional(),
3248
+ }).transform((v) => {
3249
+ return (0, primitives_js_1.remap)(v, {
3250
+ cachedTokens: "cached_tokens",
3251
+ cacheCreationTokens: "cache_creation_tokens",
3252
+ audioTokens: "audio_tokens",
3253
+ });
3254
+ });
3255
+ function promptTokensDetailsToJSON(promptTokensDetails) {
3256
+ return JSON.stringify(exports.PromptTokensDetails$outboundSchema.parse(promptTokensDetails));
3257
+ }
3258
+ function promptTokensDetailsFromJSON(jsonString) {
3259
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.PromptTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptTokensDetails' from JSON`);
3260
+ }
3261
+ /** @internal */
3262
+ exports.CompletionTokensDetails$inboundSchema = z.object({
3263
+ reasoning_tokens: z.nullable(z.number()).optional(),
3264
+ accepted_prediction_tokens: z.nullable(z.number()).optional(),
3265
+ rejected_prediction_tokens: z.nullable(z.number()).optional(),
3266
+ audio_tokens: z.nullable(z.number().int()).optional(),
3267
+ }).transform((v) => {
3268
+ return (0, primitives_js_1.remap)(v, {
3269
+ "reasoning_tokens": "reasoningTokens",
3270
+ "accepted_prediction_tokens": "acceptedPredictionTokens",
3271
+ "rejected_prediction_tokens": "rejectedPredictionTokens",
3272
+ "audio_tokens": "audioTokens",
3273
+ });
3274
+ });
3275
+ /** @internal */
3276
+ exports.CompletionTokensDetails$outboundSchema = z.object({
3277
+ reasoningTokens: z.nullable(z.number()).optional(),
3278
+ acceptedPredictionTokens: z.nullable(z.number()).optional(),
3279
+ rejectedPredictionTokens: z.nullable(z.number()).optional(),
3280
+ audioTokens: z.nullable(z.number().int()).optional(),
3281
+ }).transform((v) => {
3282
+ return (0, primitives_js_1.remap)(v, {
3283
+ reasoningTokens: "reasoning_tokens",
3284
+ acceptedPredictionTokens: "accepted_prediction_tokens",
3285
+ rejectedPredictionTokens: "rejected_prediction_tokens",
3286
+ audioTokens: "audio_tokens",
3287
+ });
3288
+ });
3289
+ function completionTokensDetailsToJSON(completionTokensDetails) {
3290
+ return JSON.stringify(exports.CompletionTokensDetails$outboundSchema.parse(completionTokensDetails));
3291
+ }
3292
+ function completionTokensDetailsFromJSON(jsonString) {
3293
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CompletionTokensDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionTokensDetails' from JSON`);
3294
+ }
3295
+ /** @internal */
3296
+ exports.CreateChatCompletionUsage$inboundSchema = z.object({
3297
+ completion_tokens: z.number().optional(),
3298
+ prompt_tokens: z.number().optional(),
3299
+ total_tokens: z.number().optional(),
3300
+ prompt_tokens_details: z.nullable(z.lazy(() => exports.PromptTokensDetails$inboundSchema)).optional(),
3301
+ completion_tokens_details: z.nullable(z.lazy(() => exports.CompletionTokensDetails$inboundSchema)).optional(),
3302
+ }).transform((v) => {
3303
+ return (0, primitives_js_1.remap)(v, {
3304
+ "completion_tokens": "completionTokens",
3305
+ "prompt_tokens": "promptTokens",
3306
+ "total_tokens": "totalTokens",
3307
+ "prompt_tokens_details": "promptTokensDetails",
3308
+ "completion_tokens_details": "completionTokensDetails",
3309
+ });
3310
+ });
3311
+ /** @internal */
3312
+ exports.CreateChatCompletionUsage$outboundSchema = z.object({
3313
+ completionTokens: z.number().optional(),
3314
+ promptTokens: z.number().optional(),
3315
+ totalTokens: z.number().optional(),
3316
+ promptTokensDetails: z.nullable(z.lazy(() => exports.PromptTokensDetails$outboundSchema)).optional(),
3317
+ completionTokensDetails: z.nullable(z.lazy(() => exports.CompletionTokensDetails$outboundSchema)).optional(),
3318
+ }).transform((v) => {
3319
+ return (0, primitives_js_1.remap)(v, {
3320
+ completionTokens: "completion_tokens",
3321
+ promptTokens: "prompt_tokens",
3322
+ totalTokens: "total_tokens",
3323
+ promptTokensDetails: "prompt_tokens_details",
3324
+ completionTokensDetails: "completion_tokens_details",
3325
+ });
3326
+ });
3327
+ function createChatCompletionUsageToJSON(createChatCompletionUsage) {
3328
+ return JSON.stringify(exports.CreateChatCompletionUsage$outboundSchema.parse(createChatCompletionUsage));
3329
+ }
3330
+ function createChatCompletionUsageFromJSON(jsonString) {
3331
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionUsage' from JSON`);
3332
+ }
3333
+ /** @internal */
3334
+ exports.CreateChatCompletionObject$inboundSchema = z.nativeEnum(exports.CreateChatCompletionObject);
3335
+ /** @internal */
3336
+ exports.CreateChatCompletionObject$outboundSchema = exports.CreateChatCompletionObject$inboundSchema;
3337
+ /** @internal */
3338
+ exports.CreateChatCompletionResponseBody$inboundSchema = z.object({
3339
+ id: z.string(),
3340
+ choices: z.array(z.lazy(() => exports.CreateChatCompletionChoices$inboundSchema)),
3341
+ created: z.number(),
3342
+ model: z.string(),
3343
+ system_fingerprint: z.nullable(z.string()).optional(),
3344
+ usage: z.nullable(z.lazy(() => exports.CreateChatCompletionUsage$inboundSchema))
3345
+ .optional(),
3346
+ object: exports.CreateChatCompletionObject$inboundSchema,
3347
+ }).transform((v) => {
3348
+ return (0, primitives_js_1.remap)(v, {
3349
+ "system_fingerprint": "systemFingerprint",
3350
+ });
3351
+ });
3352
+ /** @internal */
3353
+ exports.CreateChatCompletionResponseBody$outboundSchema = z.object({
3354
+ id: z.string(),
3355
+ choices: z.array(z.lazy(() => exports.CreateChatCompletionChoices$outboundSchema)),
3356
+ created: z.number(),
3357
+ model: z.string(),
3358
+ systemFingerprint: z.nullable(z.string()).optional(),
3359
+ usage: z.nullable(z.lazy(() => exports.CreateChatCompletionUsage$outboundSchema))
3360
+ .optional(),
3361
+ object: exports.CreateChatCompletionObject$outboundSchema,
3362
+ }).transform((v) => {
3363
+ return (0, primitives_js_1.remap)(v, {
3364
+ systemFingerprint: "system_fingerprint",
3365
+ });
3366
+ });
3367
+ function createChatCompletionResponseBodyToJSON(createChatCompletionResponseBody) {
3368
+ return JSON.stringify(exports.CreateChatCompletionResponseBody$outboundSchema.parse(createChatCompletionResponseBody));
3369
+ }
3370
+ function createChatCompletionResponseBodyFromJSON(jsonString) {
3371
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponseBody' from JSON`);
3372
+ }
3373
+ /** @internal */
3374
+ exports.CreateChatCompletionResponse$inboundSchema = z.union([
3375
+ z.lazy(() => exports.CreateChatCompletionResponseBody$inboundSchema),
3376
+ z.instanceof((ReadableStream))
3377
+ .transform(stream => {
3378
+ return new event_streams_js_1.EventStream(stream, rawEvent => {
3379
+ if (rawEvent.data === "[DONE]")
3380
+ return { done: true };
3381
+ return {
3382
+ value: z.lazy(() => exports.CreateChatCompletionRouterResponseBody$inboundSchema).parse(rawEvent),
3383
+ };
3384
+ });
3385
+ }),
3386
+ ]);
3387
+ /** @internal */
3388
+ exports.CreateChatCompletionResponse$outboundSchema = z.union([
3389
+ z.lazy(() => exports.CreateChatCompletionResponseBody$outboundSchema),
3390
+ z.never(),
3391
+ ]);
3392
+ function createChatCompletionResponseToJSON(createChatCompletionResponse) {
3393
+ return JSON.stringify(exports.CreateChatCompletionResponse$outboundSchema.parse(createChatCompletionResponse));
3394
+ }
3395
+ function createChatCompletionResponseFromJSON(jsonString) {
3396
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateChatCompletionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateChatCompletionResponse' from JSON`);
3397
+ }
3398
+ //# sourceMappingURL=createchatcompletion.js.map