vellum-ai 0.0.44 → 0.1.0

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 (349) hide show
  1. package/Client.d.ts +23 -26
  2. package/Client.js +288 -242
  3. package/api/resources/deployments/client/Client.d.ts +8 -4
  4. package/api/resources/deployments/client/Client.js +52 -34
  5. package/api/resources/documentIndexes/client/Client.d.ts +9 -5
  6. package/api/resources/documentIndexes/client/Client.js +97 -69
  7. package/api/resources/documents/client/Client.d.ts +14 -10
  8. package/api/resources/documents/client/Client.js +222 -176
  9. package/api/resources/modelVersions/client/Client.d.ts +9 -5
  10. package/api/resources/modelVersions/client/Client.js +96 -68
  11. package/api/resources/registeredPrompts/client/Client.d.ts +11 -7
  12. package/api/resources/registeredPrompts/client/Client.js +72 -53
  13. package/api/resources/sandboxes/client/Client.d.ts +9 -5
  14. package/api/resources/sandboxes/client/Client.js +92 -65
  15. package/api/resources/testSuites/client/Client.d.ts +9 -5
  16. package/api/resources/testSuites/client/Client.js +90 -63
  17. package/core/fetcher/Fetcher.d.ts +5 -3
  18. package/core/fetcher/Fetcher.js +104 -62
  19. package/core/fetcher/Supplier.js +11 -2
  20. package/core/fetcher/index.d.ts +3 -2
  21. package/core/form-data-utils/getFormDataContentLength.d.ts +1 -1
  22. package/core/form-data-utils/getFormDataContentLength.js +20 -9
  23. package/core/index.d.ts +1 -2
  24. package/core/index.js +4 -5
  25. package/core/schemas/Schema.d.ts +19 -0
  26. package/core/schemas/Schema.js +1 -0
  27. package/core/schemas/builders/date/date.js +22 -14
  28. package/core/schemas/builders/enum/enum.js +17 -7
  29. package/core/schemas/builders/lazy/index.d.ts +2 -1
  30. package/core/schemas/builders/lazy/lazy.js +21 -13
  31. package/core/schemas/builders/lazy/lazyObject.js +11 -11
  32. package/core/schemas/builders/list/list.js +53 -38
  33. package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  34. package/core/schemas/builders/literals/booleanLiteral.js +29 -0
  35. package/core/schemas/builders/literals/index.d.ts +1 -0
  36. package/core/schemas/builders/literals/index.js +3 -1
  37. package/core/schemas/builders/literals/stringLiteral.js +4 -3
  38. package/core/schemas/builders/object/index.d.ts +5 -2
  39. package/core/schemas/builders/object/index.js +3 -1
  40. package/core/schemas/builders/object/object.js +150 -129
  41. package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  42. package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  43. package/core/schemas/builders/object-like/getObjectLikeUtils.js +19 -18
  44. package/core/schemas/builders/object-like/index.d.ts +1 -1
  45. package/core/schemas/builders/primitives/boolean.js +4 -3
  46. package/core/schemas/builders/primitives/number.js +4 -3
  47. package/core/schemas/builders/primitives/string.js +4 -3
  48. package/core/schemas/builders/record/index.d.ts +1 -1
  49. package/core/schemas/builders/record/record.js +82 -67
  50. package/core/schemas/builders/schema-utils/JsonError.js +0 -1
  51. package/core/schemas/builders/schema-utils/ParseError.js +0 -1
  52. package/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
  53. package/core/schemas/builders/schema-utils/index.d.ts +2 -1
  54. package/core/schemas/builders/set/set.js +21 -12
  55. package/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
  56. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +38 -24
  57. package/core/schemas/builders/union/index.d.ts +3 -2
  58. package/core/schemas/builders/union/union.js +95 -74
  59. package/core/schemas/index.d.ts +1 -1
  60. package/core/schemas/utils/createIdentitySchemaCreator.js +2 -4
  61. package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  62. package/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
  63. package/core/schemas/utils/isPlainObject.d.ts +0 -1
  64. package/core/schemas/utils/isPlainObject.js +1 -2
  65. package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  66. package/core/schemas/utils/maybeSkipValidation.js +37 -0
  67. package/core/streaming-fetcher/Stream.d.ts +14 -0
  68. package/core/streaming-fetcher/Stream.js +75 -0
  69. package/core/streaming-fetcher/StreamingFetcher.d.ts +10 -8
  70. package/core/streaming-fetcher/StreamingFetcher.js +38 -44
  71. package/core/streaming-fetcher/getHeader.d.ts +2 -0
  72. package/core/streaming-fetcher/getHeader.js +12 -0
  73. package/core/streaming-fetcher/index.d.ts +4 -1
  74. package/core/streaming-fetcher/index.js +5 -1
  75. package/dist/Client.d.ts +23 -26
  76. package/dist/Client.js +288 -242
  77. package/dist/api/resources/deployments/client/Client.d.ts +8 -4
  78. package/dist/api/resources/deployments/client/Client.js +52 -34
  79. package/dist/api/resources/documentIndexes/client/Client.d.ts +9 -5
  80. package/dist/api/resources/documentIndexes/client/Client.js +97 -69
  81. package/dist/api/resources/documents/client/Client.d.ts +14 -10
  82. package/dist/api/resources/documents/client/Client.js +222 -176
  83. package/dist/api/resources/modelVersions/client/Client.d.ts +9 -5
  84. package/dist/api/resources/modelVersions/client/Client.js +96 -68
  85. package/dist/api/resources/registeredPrompts/client/Client.d.ts +11 -7
  86. package/dist/api/resources/registeredPrompts/client/Client.js +72 -53
  87. package/dist/api/resources/sandboxes/client/Client.d.ts +9 -5
  88. package/dist/api/resources/sandboxes/client/Client.js +92 -65
  89. package/dist/api/resources/testSuites/client/Client.d.ts +9 -5
  90. package/dist/api/resources/testSuites/client/Client.js +90 -63
  91. package/dist/core/fetcher/Fetcher.d.ts +5 -3
  92. package/dist/core/fetcher/Fetcher.js +104 -62
  93. package/dist/core/fetcher/Supplier.js +11 -2
  94. package/dist/core/fetcher/index.d.ts +3 -2
  95. package/dist/core/form-data-utils/getFormDataContentLength.d.ts +1 -1
  96. package/dist/core/form-data-utils/getFormDataContentLength.js +20 -9
  97. package/dist/core/index.d.ts +1 -2
  98. package/dist/core/index.js +4 -5
  99. package/dist/core/schemas/Schema.d.ts +19 -0
  100. package/dist/core/schemas/Schema.js +1 -0
  101. package/dist/core/schemas/builders/date/date.js +22 -14
  102. package/dist/core/schemas/builders/enum/enum.js +17 -7
  103. package/dist/core/schemas/builders/lazy/index.d.ts +2 -1
  104. package/dist/core/schemas/builders/lazy/lazy.js +21 -13
  105. package/dist/core/schemas/builders/lazy/lazyObject.js +11 -11
  106. package/dist/core/schemas/builders/list/list.js +53 -38
  107. package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
  108. package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -0
  109. package/dist/core/schemas/builders/literals/index.d.ts +1 -0
  110. package/dist/core/schemas/builders/literals/index.js +3 -1
  111. package/dist/core/schemas/builders/literals/stringLiteral.js +4 -3
  112. package/dist/core/schemas/builders/object/index.d.ts +5 -2
  113. package/dist/core/schemas/builders/object/index.js +3 -1
  114. package/dist/core/schemas/builders/object/object.js +150 -129
  115. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
  116. package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
  117. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +19 -18
  118. package/dist/core/schemas/builders/object-like/index.d.ts +1 -1
  119. package/dist/core/schemas/builders/primitives/boolean.js +4 -3
  120. package/dist/core/schemas/builders/primitives/number.js +4 -3
  121. package/dist/core/schemas/builders/primitives/string.js +4 -3
  122. package/dist/core/schemas/builders/record/index.d.ts +1 -1
  123. package/dist/core/schemas/builders/record/record.js +82 -67
  124. package/dist/core/schemas/builders/schema-utils/JsonError.js +0 -1
  125. package/dist/core/schemas/builders/schema-utils/ParseError.js +0 -1
  126. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +23 -20
  127. package/dist/core/schemas/builders/schema-utils/index.d.ts +2 -1
  128. package/dist/core/schemas/builders/set/set.js +21 -12
  129. package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +1 -1
  130. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +38 -24
  131. package/dist/core/schemas/builders/union/index.d.ts +3 -2
  132. package/dist/core/schemas/builders/union/union.js +95 -74
  133. package/dist/core/schemas/index.d.ts +1 -1
  134. package/dist/core/schemas/utils/createIdentitySchemaCreator.js +2 -4
  135. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
  136. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
  137. package/dist/core/schemas/utils/isPlainObject.d.ts +0 -1
  138. package/dist/core/schemas/utils/isPlainObject.js +1 -2
  139. package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
  140. package/dist/core/schemas/utils/maybeSkipValidation.js +37 -0
  141. package/dist/core/streaming-fetcher/Stream.d.ts +14 -0
  142. package/dist/core/streaming-fetcher/Stream.js +75 -0
  143. package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +10 -8
  144. package/dist/core/streaming-fetcher/StreamingFetcher.js +38 -44
  145. package/dist/core/streaming-fetcher/getHeader.d.ts +2 -0
  146. package/dist/core/streaming-fetcher/getHeader.js +12 -0
  147. package/dist/core/streaming-fetcher/index.d.ts +4 -1
  148. package/dist/core/streaming-fetcher/index.js +5 -1
  149. package/dist/errors/VellumError.js +14 -3
  150. package/dist/serialization/client/requests/ExecuteWorkflowStreamRequest.js +11 -2
  151. package/dist/serialization/client/requests/GenerateBodyRequest.js +11 -2
  152. package/dist/serialization/client/requests/GenerateStreamBodyRequest.js +11 -2
  153. package/dist/serialization/client/requests/SearchRequestBodyRequest.js +10 -1
  154. package/dist/serialization/client/requests/SubmitCompletionActualsRequest.js +10 -1
  155. package/dist/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +10 -1
  156. package/dist/serialization/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.js +11 -2
  157. package/dist/serialization/resources/documents/client/requests/PatchedDocumentUpdateRequest.js +10 -1
  158. package/dist/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.js +12 -3
  159. package/dist/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +11 -2
  160. package/dist/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +10 -1
  161. package/dist/serialization/types/ApiNodeResult.js +10 -1
  162. package/dist/serialization/types/ChatMessage.js +10 -1
  163. package/dist/serialization/types/ChatMessageRequest.js +10 -1
  164. package/dist/serialization/types/ConditionalNodeResult.js +10 -1
  165. package/dist/serialization/types/DeploymentRead.js +12 -3
  166. package/dist/serialization/types/DocumentDocumentToDocumentIndex.js +10 -1
  167. package/dist/serialization/types/DocumentIndexRead.js +11 -2
  168. package/dist/serialization/types/DocumentRead.js +12 -3
  169. package/dist/serialization/types/EnrichedNormalizedCompletion.js +12 -3
  170. package/dist/serialization/types/GenerateOptionsRequest.js +10 -1
  171. package/dist/serialization/types/GenerateRequest.js +10 -1
  172. package/dist/serialization/types/GenerateResponse.js +10 -1
  173. package/dist/serialization/types/GenerateResult.js +11 -2
  174. package/dist/serialization/types/GenerateResultData.js +10 -1
  175. package/dist/serialization/types/GenerateStreamResponse.js +10 -1
  176. package/dist/serialization/types/GenerateStreamResult.js +11 -2
  177. package/dist/serialization/types/GenerateStreamResultData.js +10 -1
  178. package/dist/serialization/types/MetadataFilterConfigRequest.js +12 -3
  179. package/dist/serialization/types/MetadataFilterRuleRequest.js +12 -3
  180. package/dist/serialization/types/ModelVersionBuildConfig.js +10 -1
  181. package/dist/serialization/types/ModelVersionCompilePromptResponse.js +10 -1
  182. package/dist/serialization/types/ModelVersionExecConfig.js +12 -3
  183. package/dist/serialization/types/ModelVersionRead.js +13 -4
  184. package/dist/serialization/types/NodeInputCompiledChatHistoryValue.js +10 -1
  185. package/dist/serialization/types/NodeInputCompiledErrorValue.js +10 -1
  186. package/dist/serialization/types/NodeInputCompiledSearchResultsValue.js +10 -1
  187. package/dist/serialization/types/NodeInputVariableCompiledValue.js +15 -6
  188. package/dist/serialization/types/NormalizedLogProbs.js +10 -1
  189. package/dist/serialization/types/PaginatedSlimDocumentList.js +10 -1
  190. package/dist/serialization/types/PromptNodeResult.js +10 -1
  191. package/dist/serialization/types/PromptTemplateBlock.js +11 -2
  192. package/dist/serialization/types/PromptTemplateBlockData.js +10 -1
  193. package/dist/serialization/types/PromptTemplateBlockDataRequest.js +10 -1
  194. package/dist/serialization/types/PromptTemplateBlockProperties.js +12 -3
  195. package/dist/serialization/types/PromptTemplateBlockPropertiesRequest.js +12 -3
  196. package/dist/serialization/types/PromptTemplateBlockRequest.js +11 -2
  197. package/dist/serialization/types/RegisterPromptPromptInfoRequest.js +11 -2
  198. package/dist/serialization/types/RegisterPromptResponse.js +14 -5
  199. package/dist/serialization/types/RegisteredPromptInputVariableRequest.js +10 -1
  200. package/dist/serialization/types/SandboxMetricInputParams.js +10 -1
  201. package/dist/serialization/types/SandboxMetricInputParamsRequest.js +10 -1
  202. package/dist/serialization/types/SandboxScenario.js +11 -2
  203. package/dist/serialization/types/ScenarioInput.js +11 -2
  204. package/dist/serialization/types/ScenarioInputRequest.js +11 -2
  205. package/dist/serialization/types/SearchFiltersRequest.js +10 -1
  206. package/dist/serialization/types/SearchNodeResult.js +10 -1
  207. package/dist/serialization/types/SearchNodeResultData.js +10 -1
  208. package/dist/serialization/types/SearchRequestOptionsRequest.js +12 -3
  209. package/dist/serialization/types/SearchResponse.js +10 -1
  210. package/dist/serialization/types/SearchResult.js +10 -1
  211. package/dist/serialization/types/SlimDocument.js +13 -4
  212. package/dist/serialization/types/SubmitWorkflowExecutionActualRequest.js +12 -3
  213. package/dist/serialization/types/TemplatingNodeChatHistoryResult.js +10 -1
  214. package/dist/serialization/types/TemplatingNodeErrorResult.js +10 -1
  215. package/dist/serialization/types/TemplatingNodeResult.js +10 -1
  216. package/dist/serialization/types/TemplatingNodeResultData.js +10 -1
  217. package/dist/serialization/types/TemplatingNodeResultOutput.js +15 -6
  218. package/dist/serialization/types/TemplatingNodeSearchResultsResult.js +10 -1
  219. package/dist/serialization/types/TerminalNodeChatHistoryResult.js +10 -1
  220. package/dist/serialization/types/TerminalNodeErrorResult.js +10 -1
  221. package/dist/serialization/types/TerminalNodeResult.js +10 -1
  222. package/dist/serialization/types/TerminalNodeResultData.js +10 -1
  223. package/dist/serialization/types/TerminalNodeResultOutput.js +15 -6
  224. package/dist/serialization/types/TerminalNodeSearchResultsResult.js +10 -1
  225. package/dist/serialization/types/TestSuiteTestCase.js +10 -1
  226. package/dist/serialization/types/VellumError.js +10 -1
  227. package/dist/serialization/types/VellumVariable.js +10 -1
  228. package/dist/serialization/types/WorkflowEventError.js +10 -1
  229. package/dist/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +10 -1
  230. package/dist/serialization/types/WorkflowExecutionNodeResultEvent.js +10 -1
  231. package/dist/serialization/types/WorkflowExecutionWorkflowResultEvent.js +10 -1
  232. package/dist/serialization/types/WorkflowNodeResultData.js +15 -6
  233. package/dist/serialization/types/WorkflowNodeResultEvent.js +13 -4
  234. package/dist/serialization/types/WorkflowRequestChatHistoryInputRequest.js +10 -1
  235. package/dist/serialization/types/WorkflowRequestInputRequest.js +12 -3
  236. package/dist/serialization/types/WorkflowResultEvent.js +12 -3
  237. package/dist/serialization/types/WorkflowResultEventOutputData.js +15 -6
  238. package/dist/serialization/types/WorkflowResultEventOutputDataChatHistory.js +11 -2
  239. package/dist/serialization/types/WorkflowResultEventOutputDataError.js +11 -2
  240. package/dist/serialization/types/WorkflowResultEventOutputDataJson.js +10 -1
  241. package/dist/serialization/types/WorkflowResultEventOutputDataNumber.js +10 -1
  242. package/dist/serialization/types/WorkflowResultEventOutputDataSearchResults.js +11 -2
  243. package/dist/serialization/types/WorkflowResultEventOutputDataString.js +10 -1
  244. package/dist/serialization/types/WorkflowStreamEvent.js +11 -2
  245. package/errors/VellumError.js +14 -3
  246. package/package.json +4 -3
  247. package/serialization/client/requests/ExecuteWorkflowStreamRequest.js +11 -2
  248. package/serialization/client/requests/GenerateBodyRequest.js +11 -2
  249. package/serialization/client/requests/GenerateStreamBodyRequest.js +11 -2
  250. package/serialization/client/requests/SearchRequestBodyRequest.js +10 -1
  251. package/serialization/client/requests/SubmitCompletionActualsRequest.js +10 -1
  252. package/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +10 -1
  253. package/serialization/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.js +11 -2
  254. package/serialization/resources/documents/client/requests/PatchedDocumentUpdateRequest.js +10 -1
  255. package/serialization/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.js +12 -3
  256. package/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +11 -2
  257. package/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +10 -1
  258. package/serialization/types/ApiNodeResult.js +10 -1
  259. package/serialization/types/ChatMessage.js +10 -1
  260. package/serialization/types/ChatMessageRequest.js +10 -1
  261. package/serialization/types/ConditionalNodeResult.js +10 -1
  262. package/serialization/types/DeploymentRead.js +12 -3
  263. package/serialization/types/DocumentDocumentToDocumentIndex.js +10 -1
  264. package/serialization/types/DocumentIndexRead.js +11 -2
  265. package/serialization/types/DocumentRead.js +12 -3
  266. package/serialization/types/EnrichedNormalizedCompletion.js +12 -3
  267. package/serialization/types/GenerateOptionsRequest.js +10 -1
  268. package/serialization/types/GenerateRequest.js +10 -1
  269. package/serialization/types/GenerateResponse.js +10 -1
  270. package/serialization/types/GenerateResult.js +11 -2
  271. package/serialization/types/GenerateResultData.js +10 -1
  272. package/serialization/types/GenerateStreamResponse.js +10 -1
  273. package/serialization/types/GenerateStreamResult.js +11 -2
  274. package/serialization/types/GenerateStreamResultData.js +10 -1
  275. package/serialization/types/MetadataFilterConfigRequest.js +12 -3
  276. package/serialization/types/MetadataFilterRuleRequest.js +12 -3
  277. package/serialization/types/ModelVersionBuildConfig.js +10 -1
  278. package/serialization/types/ModelVersionCompilePromptResponse.js +10 -1
  279. package/serialization/types/ModelVersionExecConfig.js +12 -3
  280. package/serialization/types/ModelVersionRead.js +13 -4
  281. package/serialization/types/NodeInputCompiledChatHistoryValue.js +10 -1
  282. package/serialization/types/NodeInputCompiledErrorValue.js +10 -1
  283. package/serialization/types/NodeInputCompiledSearchResultsValue.js +10 -1
  284. package/serialization/types/NodeInputVariableCompiledValue.js +15 -6
  285. package/serialization/types/NormalizedLogProbs.js +10 -1
  286. package/serialization/types/PaginatedSlimDocumentList.js +10 -1
  287. package/serialization/types/PromptNodeResult.js +10 -1
  288. package/serialization/types/PromptTemplateBlock.js +11 -2
  289. package/serialization/types/PromptTemplateBlockData.js +10 -1
  290. package/serialization/types/PromptTemplateBlockDataRequest.js +10 -1
  291. package/serialization/types/PromptTemplateBlockProperties.js +12 -3
  292. package/serialization/types/PromptTemplateBlockPropertiesRequest.js +12 -3
  293. package/serialization/types/PromptTemplateBlockRequest.js +11 -2
  294. package/serialization/types/RegisterPromptPromptInfoRequest.js +11 -2
  295. package/serialization/types/RegisterPromptResponse.js +14 -5
  296. package/serialization/types/RegisteredPromptInputVariableRequest.js +10 -1
  297. package/serialization/types/SandboxMetricInputParams.js +10 -1
  298. package/serialization/types/SandboxMetricInputParamsRequest.js +10 -1
  299. package/serialization/types/SandboxScenario.js +11 -2
  300. package/serialization/types/ScenarioInput.js +11 -2
  301. package/serialization/types/ScenarioInputRequest.js +11 -2
  302. package/serialization/types/SearchFiltersRequest.js +10 -1
  303. package/serialization/types/SearchNodeResult.js +10 -1
  304. package/serialization/types/SearchNodeResultData.js +10 -1
  305. package/serialization/types/SearchRequestOptionsRequest.js +12 -3
  306. package/serialization/types/SearchResponse.js +10 -1
  307. package/serialization/types/SearchResult.js +10 -1
  308. package/serialization/types/SlimDocument.js +13 -4
  309. package/serialization/types/SubmitWorkflowExecutionActualRequest.js +12 -3
  310. package/serialization/types/TemplatingNodeChatHistoryResult.js +10 -1
  311. package/serialization/types/TemplatingNodeErrorResult.js +10 -1
  312. package/serialization/types/TemplatingNodeResult.js +10 -1
  313. package/serialization/types/TemplatingNodeResultData.js +10 -1
  314. package/serialization/types/TemplatingNodeResultOutput.js +15 -6
  315. package/serialization/types/TemplatingNodeSearchResultsResult.js +10 -1
  316. package/serialization/types/TerminalNodeChatHistoryResult.js +10 -1
  317. package/serialization/types/TerminalNodeErrorResult.js +10 -1
  318. package/serialization/types/TerminalNodeResult.js +10 -1
  319. package/serialization/types/TerminalNodeResultData.js +10 -1
  320. package/serialization/types/TerminalNodeResultOutput.js +15 -6
  321. package/serialization/types/TerminalNodeSearchResultsResult.js +10 -1
  322. package/serialization/types/TestSuiteTestCase.js +10 -1
  323. package/serialization/types/VellumError.js +10 -1
  324. package/serialization/types/VellumVariable.js +10 -1
  325. package/serialization/types/WorkflowEventError.js +10 -1
  326. package/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +10 -1
  327. package/serialization/types/WorkflowExecutionNodeResultEvent.js +10 -1
  328. package/serialization/types/WorkflowExecutionWorkflowResultEvent.js +10 -1
  329. package/serialization/types/WorkflowNodeResultData.js +15 -6
  330. package/serialization/types/WorkflowNodeResultEvent.js +13 -4
  331. package/serialization/types/WorkflowRequestChatHistoryInputRequest.js +10 -1
  332. package/serialization/types/WorkflowRequestInputRequest.js +12 -3
  333. package/serialization/types/WorkflowResultEvent.js +12 -3
  334. package/serialization/types/WorkflowResultEventOutputData.js +15 -6
  335. package/serialization/types/WorkflowResultEventOutputDataChatHistory.js +11 -2
  336. package/serialization/types/WorkflowResultEventOutputDataError.js +11 -2
  337. package/serialization/types/WorkflowResultEventOutputDataJson.js +10 -1
  338. package/serialization/types/WorkflowResultEventOutputDataNumber.js +10 -1
  339. package/serialization/types/WorkflowResultEventOutputDataSearchResults.js +11 -2
  340. package/serialization/types/WorkflowResultEventOutputDataString.js +10 -1
  341. package/serialization/types/WorkflowStreamEvent.js +11 -2
  342. package/core/callback-queue/CallbackQueue.d.ts +0 -6
  343. package/core/callback-queue/CallbackQueue.js +0 -20
  344. package/core/callback-queue/index.d.ts +0 -1
  345. package/core/callback-queue/index.js +0 -5
  346. package/dist/core/callback-queue/CallbackQueue.d.ts +0 -6
  347. package/dist/core/callback-queue/CallbackQueue.js +0 -20
  348. package/dist/core/callback-queue/index.d.ts +0 -1
  349. package/dist/core/callback-queue/index.js +0 -5
@@ -25,6 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
28
37
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
38
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
39
  };
@@ -36,90 +45,109 @@ const url_join_1 = __importDefault(require("url-join"));
36
45
  const serializers = __importStar(require("../../../../serialization"));
37
46
  const errors = __importStar(require("../../../../errors"));
38
47
  class ModelVersions {
39
- options;
40
- constructor(options) {
41
- this.options = options;
48
+ constructor(_options) {
49
+ this._options = _options;
42
50
  }
43
51
  /**
44
52
  * Used to retrieve a model version given its ID.
45
53
  */
46
- async retrieve(id) {
47
- const _response = await core.fetcher({
48
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/model-versions/${id}`),
49
- method: "GET",
50
- headers: {
51
- X_API_KEY: await core.Supplier.get(this.options.apiKey),
52
- },
53
- contentType: "application/json",
54
- });
55
- if (_response.ok) {
56
- return await serializers.ModelVersionRead.parseOrThrow(_response.body, {
57
- unrecognizedObjectKeys: "passthrough",
58
- allowUnrecognizedUnionMembers: true,
59
- allowUnrecognizedEnumValues: true,
54
+ retrieve(id, requestOptions) {
55
+ var _a;
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const _response = yield core.fetcher({
58
+ url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
59
+ .default, `v1/model-versions/${id}`),
60
+ method: "GET",
61
+ headers: {
62
+ X_API_KEY: yield core.Supplier.get(this._options.apiKey),
63
+ "X-Fern-Language": "JavaScript",
64
+ "X-Fern-SDK-Name": "vellum-ai",
65
+ "X-Fern-SDK-Version": "v0.1.0",
66
+ },
67
+ contentType: "application/json",
68
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
69
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
60
70
  });
61
- }
62
- if (_response.error.reason === "status-code") {
63
- throw new errors.VellumError({
64
- statusCode: _response.error.statusCode,
65
- body: _response.error.body,
66
- });
67
- }
68
- switch (_response.error.reason) {
69
- case "non-json":
70
- throw new errors.VellumError({
71
- statusCode: _response.error.statusCode,
72
- body: _response.error.rawBody,
71
+ if (_response.ok) {
72
+ return yield serializers.ModelVersionRead.parseOrThrow(_response.body, {
73
+ unrecognizedObjectKeys: "passthrough",
74
+ allowUnrecognizedUnionMembers: true,
75
+ allowUnrecognizedEnumValues: true,
76
+ breadcrumbsPrefix: ["response"],
73
77
  });
74
- case "timeout":
75
- throw new errors.VellumTimeoutError();
76
- case "unknown":
78
+ }
79
+ if (_response.error.reason === "status-code") {
77
80
  throw new errors.VellumError({
78
- message: _response.error.errorMessage,
81
+ statusCode: _response.error.statusCode,
82
+ body: _response.error.body,
79
83
  });
80
- }
84
+ }
85
+ switch (_response.error.reason) {
86
+ case "non-json":
87
+ throw new errors.VellumError({
88
+ statusCode: _response.error.statusCode,
89
+ body: _response.error.rawBody,
90
+ });
91
+ case "timeout":
92
+ throw new errors.VellumTimeoutError();
93
+ case "unknown":
94
+ throw new errors.VellumError({
95
+ message: _response.error.errorMessage,
96
+ });
97
+ }
98
+ });
81
99
  }
82
100
  /**
83
101
  * Compiles the prompt backing the model version using the provided input values.
84
102
  */
85
- async modelVersionCompilePrompt(id, request) {
86
- const _response = await core.fetcher({
87
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/model-versions/${id}/compile-prompt`),
88
- method: "POST",
89
- headers: {
90
- X_API_KEY: await core.Supplier.get(this.options.apiKey),
91
- },
92
- contentType: "application/json",
93
- body: await serializers.ModelVersionCompilePromptRequestRequest.jsonOrThrow(request, {
94
- unrecognizedObjectKeys: "strip",
95
- }),
96
- });
97
- if (_response.ok) {
98
- return await serializers.ModelVersionCompilePromptResponse.parseOrThrow(_response.body, {
99
- unrecognizedObjectKeys: "passthrough",
100
- allowUnrecognizedUnionMembers: true,
101
- allowUnrecognizedEnumValues: true,
102
- });
103
- }
104
- if (_response.error.reason === "status-code") {
105
- throw new errors.VellumError({
106
- statusCode: _response.error.statusCode,
107
- body: _response.error.body,
103
+ modelVersionCompilePrompt(id, request, requestOptions) {
104
+ var _a;
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ const _response = yield core.fetcher({
107
+ url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
108
+ .default, `v1/model-versions/${id}/compile-prompt`),
109
+ method: "POST",
110
+ headers: {
111
+ X_API_KEY: yield core.Supplier.get(this._options.apiKey),
112
+ "X-Fern-Language": "JavaScript",
113
+ "X-Fern-SDK-Name": "vellum-ai",
114
+ "X-Fern-SDK-Version": "v0.1.0",
115
+ },
116
+ contentType: "application/json",
117
+ body: yield serializers.ModelVersionCompilePromptRequestRequest.jsonOrThrow(request, {
118
+ unrecognizedObjectKeys: "strip",
119
+ }),
120
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
121
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
108
122
  });
109
- }
110
- switch (_response.error.reason) {
111
- case "non-json":
112
- throw new errors.VellumError({
113
- statusCode: _response.error.statusCode,
114
- body: _response.error.rawBody,
123
+ if (_response.ok) {
124
+ return yield serializers.ModelVersionCompilePromptResponse.parseOrThrow(_response.body, {
125
+ unrecognizedObjectKeys: "passthrough",
126
+ allowUnrecognizedUnionMembers: true,
127
+ allowUnrecognizedEnumValues: true,
128
+ breadcrumbsPrefix: ["response"],
115
129
  });
116
- case "timeout":
117
- throw new errors.VellumTimeoutError();
118
- case "unknown":
130
+ }
131
+ if (_response.error.reason === "status-code") {
119
132
  throw new errors.VellumError({
120
- message: _response.error.errorMessage,
133
+ statusCode: _response.error.statusCode,
134
+ body: _response.error.body,
121
135
  });
122
- }
136
+ }
137
+ switch (_response.error.reason) {
138
+ case "non-json":
139
+ throw new errors.VellumError({
140
+ statusCode: _response.error.statusCode,
141
+ body: _response.error.rawBody,
142
+ });
143
+ case "timeout":
144
+ throw new errors.VellumTimeoutError();
145
+ case "unknown":
146
+ throw new errors.VellumError({
147
+ message: _response.error.errorMessage,
148
+ });
149
+ }
150
+ });
123
151
  }
124
152
  }
125
153
  exports.ModelVersions = ModelVersions;
@@ -6,21 +6,25 @@ import * as core from "../../../../core";
6
6
  import * as Vellum from "../../..";
7
7
  export declare namespace RegisteredPrompts {
8
8
  interface Options {
9
- environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
9
+ environment?: core.Supplier<environments.VellumEnvironment | environments.VellumEnvironmentUrls>;
10
10
  apiKey: core.Supplier<string>;
11
11
  }
12
+ interface RequestOptions {
13
+ timeoutInSeconds?: number;
14
+ maxRetries?: number;
15
+ }
12
16
  }
13
17
  export declare class RegisteredPrompts {
14
- protected readonly options: RegisteredPrompts.Options;
15
- constructor(options: RegisteredPrompts.Options);
18
+ protected readonly _options: RegisteredPrompts.Options;
19
+ constructor(_options: RegisteredPrompts.Options);
16
20
  /**
17
21
  * Registers a prompt within Vellum and creates associated Vellum entities. Intended to be used by integration
18
22
  * partners, not directly by Vellum users.
19
23
  *
20
24
  * Under the hood, this endpoint creates a new sandbox, a new model version, and a new deployment.
21
- * @throws {Vellum.BadRequestError}
22
- * @throws {Vellum.NotFoundError}
23
- * @throws {Vellum.ConflictError}
25
+ * @throws {@link Vellum.BadRequestError}
26
+ * @throws {@link Vellum.NotFoundError}
27
+ * @throws {@link Vellum.ConflictError}
24
28
  */
25
- registerPrompt(request: Vellum.RegisterPromptRequestRequest): Promise<Vellum.RegisterPromptResponse>;
29
+ registerPrompt(request: Vellum.RegisterPromptRequestRequest, requestOptions?: RegisteredPrompts.RequestOptions): Promise<Vellum.RegisterPromptResponse>;
26
30
  }
@@ -25,6 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
28
37
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
38
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
39
  };
@@ -33,74 +42,84 @@ exports.RegisteredPrompts = void 0;
33
42
  const environments = __importStar(require("../../../../environments"));
34
43
  const core = __importStar(require("../../../../core"));
35
44
  const Vellum = __importStar(require("../../.."));
36
- const url_join_1 = __importDefault(require("url-join"));
37
45
  const serializers = __importStar(require("../../../../serialization"));
46
+ const url_join_1 = __importDefault(require("url-join"));
38
47
  const errors = __importStar(require("../../../../errors"));
39
48
  class RegisteredPrompts {
40
- options;
41
- constructor(options) {
42
- this.options = options;
49
+ constructor(_options) {
50
+ this._options = _options;
43
51
  }
44
52
  /**
45
53
  * Registers a prompt within Vellum and creates associated Vellum entities. Intended to be used by integration
46
54
  * partners, not directly by Vellum users.
47
55
  *
48
56
  * Under the hood, this endpoint creates a new sandbox, a new model version, and a new deployment.
49
- * @throws {Vellum.BadRequestError}
50
- * @throws {Vellum.NotFoundError}
51
- * @throws {Vellum.ConflictError}
57
+ * @throws {@link Vellum.BadRequestError}
58
+ * @throws {@link Vellum.NotFoundError}
59
+ * @throws {@link Vellum.ConflictError}
52
60
  */
53
- async registerPrompt(request) {
54
- const _response = await core.fetcher({
55
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, "v1/registered-prompts/register"),
56
- method: "POST",
57
- headers: {
58
- X_API_KEY: await core.Supplier.get(this.options.apiKey),
59
- },
60
- contentType: "application/json",
61
- body: await serializers.RegisterPromptRequestRequest.jsonOrThrow(request, {
62
- unrecognizedObjectKeys: "strip",
63
- }),
64
- });
65
- if (_response.ok) {
66
- return await serializers.RegisterPromptResponse.parseOrThrow(_response.body, {
67
- unrecognizedObjectKeys: "passthrough",
68
- allowUnrecognizedUnionMembers: true,
69
- allowUnrecognizedEnumValues: true,
61
+ registerPrompt(request, requestOptions) {
62
+ var _a;
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const _response = yield core.fetcher({
65
+ url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
66
+ .default, "v1/registered-prompts/register"),
67
+ method: "POST",
68
+ headers: {
69
+ X_API_KEY: yield core.Supplier.get(this._options.apiKey),
70
+ "X-Fern-Language": "JavaScript",
71
+ "X-Fern-SDK-Name": "vellum-ai",
72
+ "X-Fern-SDK-Version": "v0.1.0",
73
+ },
74
+ contentType: "application/json",
75
+ body: yield serializers.RegisterPromptRequestRequest.jsonOrThrow(request, {
76
+ unrecognizedObjectKeys: "strip",
77
+ }),
78
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
79
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
70
80
  });
71
- }
72
- if (_response.error.reason === "status-code") {
73
- switch (_response.error.statusCode) {
74
- case 400:
75
- throw new Vellum.BadRequestError(_response.error.body);
76
- case 404:
77
- throw new Vellum.NotFoundError(_response.error.body);
78
- case 409:
79
- throw new Vellum.ConflictError(await serializers.RegisterPromptErrorResponse.parseOrThrow(_response.error.body, {
80
- unrecognizedObjectKeys: "passthrough",
81
- allowUnrecognizedUnionMembers: true,
82
- allowUnrecognizedEnumValues: true,
83
- }));
84
- default:
81
+ if (_response.ok) {
82
+ return yield serializers.RegisterPromptResponse.parseOrThrow(_response.body, {
83
+ unrecognizedObjectKeys: "passthrough",
84
+ allowUnrecognizedUnionMembers: true,
85
+ allowUnrecognizedEnumValues: true,
86
+ breadcrumbsPrefix: ["response"],
87
+ });
88
+ }
89
+ if (_response.error.reason === "status-code") {
90
+ switch (_response.error.statusCode) {
91
+ case 400:
92
+ throw new Vellum.BadRequestError(_response.error.body);
93
+ case 404:
94
+ throw new Vellum.NotFoundError(_response.error.body);
95
+ case 409:
96
+ throw new Vellum.ConflictError(yield serializers.RegisterPromptErrorResponse.parseOrThrow(_response.error.body, {
97
+ unrecognizedObjectKeys: "passthrough",
98
+ allowUnrecognizedUnionMembers: true,
99
+ allowUnrecognizedEnumValues: true,
100
+ breadcrumbsPrefix: ["response"],
101
+ }));
102
+ default:
103
+ throw new errors.VellumError({
104
+ statusCode: _response.error.statusCode,
105
+ body: _response.error.body,
106
+ });
107
+ }
108
+ }
109
+ switch (_response.error.reason) {
110
+ case "non-json":
85
111
  throw new errors.VellumError({
86
112
  statusCode: _response.error.statusCode,
87
- body: _response.error.body,
113
+ body: _response.error.rawBody,
114
+ });
115
+ case "timeout":
116
+ throw new errors.VellumTimeoutError();
117
+ case "unknown":
118
+ throw new errors.VellumError({
119
+ message: _response.error.errorMessage,
88
120
  });
89
121
  }
90
- }
91
- switch (_response.error.reason) {
92
- case "non-json":
93
- throw new errors.VellumError({
94
- statusCode: _response.error.statusCode,
95
- body: _response.error.rawBody,
96
- });
97
- case "timeout":
98
- throw new errors.VellumTimeoutError();
99
- case "unknown":
100
- throw new errors.VellumError({
101
- message: _response.error.errorMessage,
102
- });
103
- }
122
+ });
104
123
  }
105
124
  }
106
125
  exports.RegisteredPrompts = RegisteredPrompts;
@@ -6,13 +6,17 @@ import * as core from "../../../../core";
6
6
  import * as Vellum from "../../..";
7
7
  export declare namespace Sandboxes {
8
8
  interface Options {
9
- environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
9
+ environment?: core.Supplier<environments.VellumEnvironment | environments.VellumEnvironmentUrls>;
10
10
  apiKey: core.Supplier<string>;
11
11
  }
12
+ interface RequestOptions {
13
+ timeoutInSeconds?: number;
14
+ maxRetries?: number;
15
+ }
12
16
  }
13
17
  export declare class Sandboxes {
14
- protected readonly options: Sandboxes.Options;
15
- constructor(options: Sandboxes.Options);
18
+ protected readonly _options: Sandboxes.Options;
19
+ constructor(_options: Sandboxes.Options);
16
20
  /**
17
21
  * Upserts a new scenario for a sandbox, keying off of the optionally provided scenario id.
18
22
  *
@@ -22,9 +26,9 @@ export declare class Sandboxes {
22
26
  * Note that a full replacement of the scenario is performed, so any fields not provided will be removed
23
27
  * or overwritten with default values.
24
28
  */
25
- upsertSandboxScenario(id: string, request: Vellum.UpsertSandboxScenarioRequestRequest): Promise<Vellum.SandboxScenario>;
29
+ upsertSandboxScenario(id: string, request: Vellum.UpsertSandboxScenarioRequestRequest, requestOptions?: Sandboxes.RequestOptions): Promise<Vellum.SandboxScenario>;
26
30
  /**
27
31
  * Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
28
32
  */
29
- deleteSandboxScenario(id: string, scenarioId: string): Promise<void>;
33
+ deleteSandboxScenario(id: string, scenarioId: string, requestOptions?: Sandboxes.RequestOptions): Promise<void>;
30
34
  }
@@ -25,6 +25,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
28
37
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
38
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
39
  };
@@ -32,13 +41,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
32
41
  exports.Sandboxes = void 0;
33
42
  const environments = __importStar(require("../../../../environments"));
34
43
  const core = __importStar(require("../../../../core"));
35
- const url_join_1 = __importDefault(require("url-join"));
36
44
  const serializers = __importStar(require("../../../../serialization"));
45
+ const url_join_1 = __importDefault(require("url-join"));
37
46
  const errors = __importStar(require("../../../../errors"));
38
47
  class Sandboxes {
39
- options;
40
- constructor(options) {
41
- this.options = options;
48
+ constructor(_options) {
49
+ this._options = _options;
42
50
  }
43
51
  /**
44
52
  * Upserts a new scenario for a sandbox, keying off of the optionally provided scenario id.
@@ -49,79 +57,98 @@ class Sandboxes {
49
57
  * Note that a full replacement of the scenario is performed, so any fields not provided will be removed
50
58
  * or overwritten with default values.
51
59
  */
52
- async upsertSandboxScenario(id, request) {
53
- const _response = await core.fetcher({
54
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/sandboxes/${id}/scenarios`),
55
- method: "POST",
56
- headers: {
57
- X_API_KEY: await core.Supplier.get(this.options.apiKey),
58
- },
59
- contentType: "application/json",
60
- body: await serializers.UpsertSandboxScenarioRequestRequest.jsonOrThrow(request, {
61
- unrecognizedObjectKeys: "strip",
62
- }),
63
- });
64
- if (_response.ok) {
65
- return await serializers.SandboxScenario.parseOrThrow(_response.body, {
66
- unrecognizedObjectKeys: "passthrough",
67
- allowUnrecognizedUnionMembers: true,
68
- allowUnrecognizedEnumValues: true,
60
+ upsertSandboxScenario(id, request, requestOptions) {
61
+ var _a;
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const _response = yield core.fetcher({
64
+ url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
65
+ .default, `v1/sandboxes/${id}/scenarios`),
66
+ method: "POST",
67
+ headers: {
68
+ X_API_KEY: yield core.Supplier.get(this._options.apiKey),
69
+ "X-Fern-Language": "JavaScript",
70
+ "X-Fern-SDK-Name": "vellum-ai",
71
+ "X-Fern-SDK-Version": "v0.1.0",
72
+ },
73
+ contentType: "application/json",
74
+ body: yield serializers.UpsertSandboxScenarioRequestRequest.jsonOrThrow(request, {
75
+ unrecognizedObjectKeys: "strip",
76
+ }),
77
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
78
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
69
79
  });
70
- }
71
- if (_response.error.reason === "status-code") {
72
- throw new errors.VellumError({
73
- statusCode: _response.error.statusCode,
74
- body: _response.error.body,
75
- });
76
- }
77
- switch (_response.error.reason) {
78
- case "non-json":
79
- throw new errors.VellumError({
80
- statusCode: _response.error.statusCode,
81
- body: _response.error.rawBody,
80
+ if (_response.ok) {
81
+ return yield serializers.SandboxScenario.parseOrThrow(_response.body, {
82
+ unrecognizedObjectKeys: "passthrough",
83
+ allowUnrecognizedUnionMembers: true,
84
+ allowUnrecognizedEnumValues: true,
85
+ breadcrumbsPrefix: ["response"],
82
86
  });
83
- case "timeout":
84
- throw new errors.VellumTimeoutError();
85
- case "unknown":
87
+ }
88
+ if (_response.error.reason === "status-code") {
86
89
  throw new errors.VellumError({
87
- message: _response.error.errorMessage,
90
+ statusCode: _response.error.statusCode,
91
+ body: _response.error.body,
88
92
  });
89
- }
93
+ }
94
+ switch (_response.error.reason) {
95
+ case "non-json":
96
+ throw new errors.VellumError({
97
+ statusCode: _response.error.statusCode,
98
+ body: _response.error.rawBody,
99
+ });
100
+ case "timeout":
101
+ throw new errors.VellumTimeoutError();
102
+ case "unknown":
103
+ throw new errors.VellumError({
104
+ message: _response.error.errorMessage,
105
+ });
106
+ }
107
+ });
90
108
  }
91
109
  /**
92
110
  * Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
93
111
  */
94
- async deleteSandboxScenario(id, scenarioId) {
95
- const _response = await core.fetcher({
96
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/sandboxes/${id}/scenarios/${scenarioId}`),
97
- method: "DELETE",
98
- headers: {
99
- X_API_KEY: await core.Supplier.get(this.options.apiKey),
100
- },
101
- contentType: "application/json",
102
- });
103
- if (_response.ok) {
104
- return;
105
- }
106
- if (_response.error.reason === "status-code") {
107
- throw new errors.VellumError({
108
- statusCode: _response.error.statusCode,
109
- body: _response.error.body,
112
+ deleteSandboxScenario(id, scenarioId, requestOptions) {
113
+ var _a;
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const _response = yield core.fetcher({
116
+ url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
117
+ .default, `v1/sandboxes/${id}/scenarios/${scenarioId}`),
118
+ method: "DELETE",
119
+ headers: {
120
+ X_API_KEY: yield core.Supplier.get(this._options.apiKey),
121
+ "X-Fern-Language": "JavaScript",
122
+ "X-Fern-SDK-Name": "vellum-ai",
123
+ "X-Fern-SDK-Version": "v0.1.0",
124
+ },
125
+ contentType: "application/json",
126
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
127
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
110
128
  });
111
- }
112
- switch (_response.error.reason) {
113
- case "non-json":
129
+ if (_response.ok) {
130
+ return;
131
+ }
132
+ if (_response.error.reason === "status-code") {
114
133
  throw new errors.VellumError({
115
134
  statusCode: _response.error.statusCode,
116
- body: _response.error.rawBody,
135
+ body: _response.error.body,
117
136
  });
118
- case "timeout":
119
- throw new errors.VellumTimeoutError();
120
- case "unknown":
121
- throw new errors.VellumError({
122
- message: _response.error.errorMessage,
123
- });
124
- }
137
+ }
138
+ switch (_response.error.reason) {
139
+ case "non-json":
140
+ throw new errors.VellumError({
141
+ statusCode: _response.error.statusCode,
142
+ body: _response.error.rawBody,
143
+ });
144
+ case "timeout":
145
+ throw new errors.VellumTimeoutError();
146
+ case "unknown":
147
+ throw new errors.VellumError({
148
+ message: _response.error.errorMessage,
149
+ });
150
+ }
151
+ });
125
152
  }
126
153
  }
127
154
  exports.Sandboxes = Sandboxes;
@@ -6,13 +6,17 @@ import * as core from "../../../../core";
6
6
  import * as Vellum from "../../..";
7
7
  export declare namespace TestSuites {
8
8
  interface Options {
9
- environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
9
+ environment?: core.Supplier<environments.VellumEnvironment | environments.VellumEnvironmentUrls>;
10
10
  apiKey: core.Supplier<string>;
11
11
  }
12
+ interface RequestOptions {
13
+ timeoutInSeconds?: number;
14
+ maxRetries?: number;
15
+ }
12
16
  }
13
17
  export declare class TestSuites {
14
- protected readonly options: TestSuites.Options;
15
- constructor(options: TestSuites.Options);
18
+ protected readonly _options: TestSuites.Options;
19
+ constructor(_options: TestSuites.Options);
16
20
  /**
17
21
  * Upserts a new test case for a test suite, keying off of the optionally provided test case id.
18
22
  *
@@ -22,10 +26,10 @@ export declare class TestSuites {
22
26
  * Note that a full replacement of the test case is performed, so any fields not provided will be removed
23
27
  * or overwritten with default values.
24
28
  */
25
- upsertTestSuiteTestCase(id: string, request: Vellum.TestSuiteTestCaseRequest): Promise<Vellum.TestSuiteTestCase>;
29
+ upsertTestSuiteTestCase(id: string, request: Vellum.TestSuiteTestCaseRequest, requestOptions?: TestSuites.RequestOptions): Promise<Vellum.TestSuiteTestCase>;
26
30
  /**
27
31
  * Deletes an existing test case for a test suite, keying off of the test case id.
28
32
  *
29
33
  */
30
- deleteTestSuiteTestCase(id: string, testCaseId: string): Promise<void>;
34
+ deleteTestSuiteTestCase(id: string, testCaseId: string, requestOptions?: TestSuites.RequestOptions): Promise<void>;
31
35
  }