vellum-ai 0.0.9 → 0.0.11

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 (227) hide show
  1. package/Client.d.ts +39 -0
  2. package/Client.js +107 -12
  3. package/api/client/requests/index.d.ts +0 -1
  4. package/api/errors/BadRequestError.d.ts +7 -0
  5. package/api/errors/BadRequestError.js +41 -0
  6. package/api/errors/InternalServerError.d.ts +7 -0
  7. package/api/errors/InternalServerError.js +41 -0
  8. package/api/errors/NotFoundError.d.ts +7 -0
  9. package/api/errors/NotFoundError.js +41 -0
  10. package/api/errors/index.d.ts +3 -0
  11. package/api/errors/index.js +19 -0
  12. package/api/index.d.ts +1 -0
  13. package/api/index.js +1 -0
  14. package/api/resources/documents/client/Client.d.ts +17 -0
  15. package/api/resources/documents/client/Client.js +31 -4
  16. package/api/resources/documents/client/requests/DocumentsListRequest.d.ts +12 -0
  17. package/api/resources/index.d.ts +2 -0
  18. package/api/resources/index.js +3 -1
  19. package/api/resources/modelVersions/client/Client.d.ts +7 -0
  20. package/api/resources/modelVersions/client/Client.js +7 -0
  21. package/api/resources/sandboxes/client/Client.d.ts +11 -0
  22. package/api/resources/sandboxes/client/Client.js +11 -0
  23. package/api/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +1 -1
  24. package/api/resources/testSuites/client/Client.d.ts +28 -0
  25. package/api/resources/testSuites/client/Client.js +92 -0
  26. package/api/resources/testSuites/client/index.d.ts +1 -0
  27. package/api/resources/testSuites/client/index.js +17 -0
  28. package/api/resources/testSuites/client/requests/TestSuiteTestCaseRequest.d.ts +14 -0
  29. package/api/resources/testSuites/client/requests/index.d.ts +1 -0
  30. package/api/resources/testSuites/client/requests/index.js +2 -0
  31. package/api/resources/testSuites/index.d.ts +1 -0
  32. package/api/resources/testSuites/index.js +17 -0
  33. package/api/types/EvaluationParams.d.ts +7 -0
  34. package/api/types/EvaluationParamsRequest.d.ts +7 -0
  35. package/api/{client/requests → types}/GenerateBodyRequest.d.ts +1 -1
  36. package/api/types/GenerateStreamResponse.d.ts +7 -0
  37. package/api/types/GenerateStreamResult.d.ts +9 -0
  38. package/api/types/GenerateStreamResultData.d.ts +8 -0
  39. package/api/types/GenerateStreamResultData.js +5 -0
  40. package/api/types/ProcessingFailureReasonEnum.d.ts +7 -0
  41. package/api/types/ProcessingFailureReasonEnum.js +9 -0
  42. package/api/types/SandboxMetricInputParams.d.ts +2 -1
  43. package/api/types/SandboxMetricInputParamsRequest.d.ts +2 -1
  44. package/api/types/SandboxScenario.d.ts +1 -1
  45. package/{dist/api/types/SandboxInput.d.ts → api/types/ScenarioInput.d.ts} +1 -1
  46. package/api/types/ScenarioInput.js +5 -0
  47. package/api/types/{SandboxInputRequest.d.ts → ScenarioInputRequest.d.ts} +1 -1
  48. package/api/types/ScenarioInputRequest.js +5 -0
  49. package/api/types/SlimDocument.d.ts +3 -1
  50. package/api/types/TestSuiteTestCase.d.ts +14 -0
  51. package/api/types/TestSuiteTestCase.js +5 -0
  52. package/api/types/index.d.ts +10 -2
  53. package/api/types/index.js +10 -2
  54. package/core/callback-queue/CallbackQueue.d.ts +6 -0
  55. package/core/callback-queue/CallbackQueue.js +20 -0
  56. package/core/callback-queue/index.d.ts +1 -0
  57. package/core/callback-queue/index.js +5 -0
  58. package/core/index.d.ts +2 -0
  59. package/core/index.js +2 -0
  60. package/core/streaming-fetcher/StreamingFetcher.d.ts +22 -0
  61. package/core/streaming-fetcher/StreamingFetcher.js +64 -0
  62. package/core/streaming-fetcher/index.d.ts +1 -0
  63. package/core/streaming-fetcher/index.js +5 -0
  64. package/dist/Client.d.ts +39 -0
  65. package/dist/Client.js +107 -12
  66. package/dist/api/client/requests/index.d.ts +0 -1
  67. package/dist/api/errors/BadRequestError.d.ts +7 -0
  68. package/dist/api/errors/BadRequestError.js +41 -0
  69. package/dist/api/errors/InternalServerError.d.ts +7 -0
  70. package/dist/api/errors/InternalServerError.js +41 -0
  71. package/dist/api/errors/NotFoundError.d.ts +7 -0
  72. package/dist/api/errors/NotFoundError.js +41 -0
  73. package/dist/api/errors/index.d.ts +3 -0
  74. package/dist/api/errors/index.js +19 -0
  75. package/dist/api/index.d.ts +1 -0
  76. package/dist/api/index.js +1 -0
  77. package/dist/api/resources/documents/client/Client.d.ts +17 -0
  78. package/dist/api/resources/documents/client/Client.js +31 -4
  79. package/dist/api/resources/documents/client/requests/DocumentsListRequest.d.ts +12 -0
  80. package/dist/api/resources/index.d.ts +2 -0
  81. package/dist/api/resources/index.js +3 -1
  82. package/dist/api/resources/modelVersions/client/Client.d.ts +7 -0
  83. package/dist/api/resources/modelVersions/client/Client.js +7 -0
  84. package/dist/api/resources/sandboxes/client/Client.d.ts +11 -0
  85. package/dist/api/resources/sandboxes/client/Client.js +11 -0
  86. package/dist/api/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +1 -1
  87. package/dist/api/resources/testSuites/client/Client.d.ts +28 -0
  88. package/dist/api/resources/testSuites/client/Client.js +92 -0
  89. package/dist/api/resources/testSuites/client/index.d.ts +1 -0
  90. package/dist/api/resources/testSuites/client/index.js +17 -0
  91. package/dist/api/resources/testSuites/client/requests/TestSuiteTestCaseRequest.d.ts +14 -0
  92. package/dist/api/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +5 -0
  93. package/dist/api/resources/testSuites/client/requests/index.d.ts +1 -0
  94. package/dist/api/resources/testSuites/client/requests/index.js +2 -0
  95. package/dist/api/resources/testSuites/index.d.ts +1 -0
  96. package/dist/api/resources/testSuites/index.js +17 -0
  97. package/dist/api/types/EvaluationParams.d.ts +7 -0
  98. package/dist/api/types/EvaluationParams.js +5 -0
  99. package/dist/api/types/EvaluationParamsRequest.d.ts +7 -0
  100. package/dist/api/types/EvaluationParamsRequest.js +5 -0
  101. package/dist/api/{client/requests → types}/GenerateBodyRequest.d.ts +1 -1
  102. package/dist/api/types/GenerateBodyRequest.js +5 -0
  103. package/dist/api/types/GenerateStreamResponse.d.ts +7 -0
  104. package/dist/api/types/GenerateStreamResponse.js +5 -0
  105. package/dist/api/types/GenerateStreamResult.d.ts +9 -0
  106. package/dist/api/types/GenerateStreamResult.js +5 -0
  107. package/dist/api/types/GenerateStreamResultData.d.ts +8 -0
  108. package/dist/api/types/GenerateStreamResultData.js +5 -0
  109. package/dist/api/types/ProcessingFailureReasonEnum.d.ts +7 -0
  110. package/dist/api/types/ProcessingFailureReasonEnum.js +9 -0
  111. package/dist/api/types/SandboxMetricInputParams.d.ts +2 -1
  112. package/dist/api/types/SandboxMetricInputParamsRequest.d.ts +2 -1
  113. package/dist/api/types/SandboxScenario.d.ts +1 -1
  114. package/{api/types/SandboxInput.d.ts → dist/api/types/ScenarioInput.d.ts} +1 -1
  115. package/dist/api/types/ScenarioInput.js +5 -0
  116. package/dist/api/types/{SandboxInputRequest.d.ts → ScenarioInputRequest.d.ts} +1 -1
  117. package/dist/api/types/ScenarioInputRequest.js +5 -0
  118. package/dist/api/types/SlimDocument.d.ts +3 -1
  119. package/dist/api/types/TestSuiteTestCase.d.ts +14 -0
  120. package/dist/api/types/TestSuiteTestCase.js +5 -0
  121. package/dist/api/types/index.d.ts +10 -2
  122. package/dist/api/types/index.js +10 -2
  123. package/dist/core/callback-queue/CallbackQueue.d.ts +6 -0
  124. package/dist/core/callback-queue/CallbackQueue.js +20 -0
  125. package/dist/core/callback-queue/index.d.ts +1 -0
  126. package/dist/core/callback-queue/index.js +5 -0
  127. package/dist/core/index.d.ts +2 -0
  128. package/dist/core/index.js +2 -0
  129. package/dist/core/streaming-fetcher/StreamingFetcher.d.ts +22 -0
  130. package/dist/core/streaming-fetcher/StreamingFetcher.js +64 -0
  131. package/dist/core/streaming-fetcher/index.d.ts +1 -0
  132. package/dist/core/streaming-fetcher/index.js +5 -0
  133. package/dist/serialization/client/requests/index.d.ts +0 -1
  134. package/dist/serialization/client/requests/index.js +1 -3
  135. package/dist/serialization/resources/index.d.ts +2 -0
  136. package/dist/serialization/resources/index.js +3 -1
  137. package/dist/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +1 -1
  138. package/dist/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +1 -1
  139. package/dist/serialization/resources/testSuites/client/index.d.ts +1 -0
  140. package/dist/serialization/resources/testSuites/client/index.js +17 -0
  141. package/dist/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.d.ts +15 -0
  142. package/dist/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +36 -0
  143. package/dist/serialization/resources/testSuites/client/requests/index.d.ts +1 -0
  144. package/dist/serialization/resources/testSuites/client/requests/index.js +5 -0
  145. package/dist/serialization/resources/testSuites/index.d.ts +1 -0
  146. package/dist/serialization/resources/testSuites/index.js +17 -0
  147. package/dist/serialization/types/EvaluationParams.d.ts +12 -0
  148. package/dist/serialization/types/EvaluationParams.js +33 -0
  149. package/dist/serialization/types/EvaluationParamsRequest.d.ts +12 -0
  150. package/dist/serialization/types/EvaluationParamsRequest.js +33 -0
  151. package/{serialization/client/requests → dist/serialization/types}/GenerateBodyRequest.d.ts +4 -4
  152. package/{serialization/client/requests → dist/serialization/types}/GenerateBodyRequest.js +3 -3
  153. package/dist/serialization/types/GenerateStreamResponse.d.ts +12 -0
  154. package/dist/serialization/types/GenerateStreamResponse.js +33 -0
  155. package/dist/serialization/types/GenerateStreamResult.d.ts +14 -0
  156. package/dist/serialization/types/GenerateStreamResult.js +35 -0
  157. package/dist/serialization/types/GenerateStreamResultData.d.ts +13 -0
  158. package/dist/serialization/types/GenerateStreamResultData.js +34 -0
  159. package/dist/serialization/types/ProcessingFailureReasonEnum.d.ts +10 -0
  160. package/dist/serialization/types/ProcessingFailureReasonEnum.js +31 -0
  161. package/dist/serialization/types/SandboxMetricInputParams.d.ts +1 -1
  162. package/dist/serialization/types/SandboxMetricInputParams.js +1 -1
  163. package/dist/serialization/types/SandboxMetricInputParamsRequest.d.ts +1 -1
  164. package/dist/serialization/types/SandboxMetricInputParamsRequest.js +1 -1
  165. package/dist/serialization/types/SandboxScenario.d.ts +1 -1
  166. package/dist/serialization/types/SandboxScenario.js +1 -1
  167. package/{serialization/types/SandboxInput.d.ts → dist/serialization/types/ScenarioInput.d.ts} +2 -2
  168. package/{serialization/types/SandboxInput.js → dist/serialization/types/ScenarioInput.js} +2 -2
  169. package/dist/serialization/types/{SandboxInputRequest.d.ts → ScenarioInputRequest.d.ts} +2 -2
  170. package/dist/serialization/types/{SandboxInputRequest.js → ScenarioInputRequest.js} +2 -2
  171. package/dist/serialization/types/SlimDocument.d.ts +1 -0
  172. package/dist/serialization/types/SlimDocument.js +1 -0
  173. package/dist/serialization/types/TestSuiteTestCase.d.ts +15 -0
  174. package/dist/serialization/types/TestSuiteTestCase.js +36 -0
  175. package/dist/serialization/types/index.d.ts +10 -2
  176. package/dist/serialization/types/index.js +10 -2
  177. package/package.json +1 -1
  178. package/serialization/client/requests/index.d.ts +0 -1
  179. package/serialization/client/requests/index.js +1 -3
  180. package/serialization/resources/index.d.ts +2 -0
  181. package/serialization/resources/index.js +3 -1
  182. package/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +1 -1
  183. package/serialization/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.js +1 -1
  184. package/serialization/resources/testSuites/client/index.d.ts +1 -0
  185. package/serialization/resources/testSuites/client/index.js +17 -0
  186. package/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.d.ts +15 -0
  187. package/serialization/resources/testSuites/client/requests/TestSuiteTestCaseRequest.js +36 -0
  188. package/serialization/resources/testSuites/client/requests/index.d.ts +1 -0
  189. package/serialization/resources/testSuites/client/requests/index.js +5 -0
  190. package/serialization/resources/testSuites/index.d.ts +1 -0
  191. package/serialization/resources/testSuites/index.js +17 -0
  192. package/serialization/types/EvaluationParams.d.ts +12 -0
  193. package/serialization/types/EvaluationParams.js +33 -0
  194. package/serialization/types/EvaluationParamsRequest.d.ts +12 -0
  195. package/serialization/types/EvaluationParamsRequest.js +33 -0
  196. package/{dist/serialization/client/requests → serialization/types}/GenerateBodyRequest.d.ts +4 -4
  197. package/{dist/serialization/client/requests → serialization/types}/GenerateBodyRequest.js +3 -3
  198. package/serialization/types/GenerateStreamResponse.d.ts +12 -0
  199. package/serialization/types/GenerateStreamResponse.js +33 -0
  200. package/serialization/types/GenerateStreamResult.d.ts +14 -0
  201. package/serialization/types/GenerateStreamResult.js +35 -0
  202. package/serialization/types/GenerateStreamResultData.d.ts +13 -0
  203. package/serialization/types/GenerateStreamResultData.js +34 -0
  204. package/serialization/types/ProcessingFailureReasonEnum.d.ts +10 -0
  205. package/serialization/types/ProcessingFailureReasonEnum.js +31 -0
  206. package/serialization/types/SandboxMetricInputParams.d.ts +1 -1
  207. package/serialization/types/SandboxMetricInputParams.js +1 -1
  208. package/serialization/types/SandboxMetricInputParamsRequest.d.ts +1 -1
  209. package/serialization/types/SandboxMetricInputParamsRequest.js +1 -1
  210. package/serialization/types/SandboxScenario.d.ts +1 -1
  211. package/serialization/types/SandboxScenario.js +1 -1
  212. package/{dist/serialization/types/SandboxInput.d.ts → serialization/types/ScenarioInput.d.ts} +2 -2
  213. package/{dist/serialization/types/SandboxInput.js → serialization/types/ScenarioInput.js} +2 -2
  214. package/serialization/types/{SandboxInputRequest.d.ts → ScenarioInputRequest.d.ts} +2 -2
  215. package/serialization/types/{SandboxInputRequest.js → ScenarioInputRequest.js} +2 -2
  216. package/serialization/types/SlimDocument.d.ts +1 -0
  217. package/serialization/types/SlimDocument.js +1 -0
  218. package/serialization/types/TestSuiteTestCase.d.ts +15 -0
  219. package/serialization/types/TestSuiteTestCase.js +36 -0
  220. package/serialization/types/index.d.ts +10 -2
  221. package/serialization/types/index.js +10 -2
  222. /package/api/{client/requests/GenerateBodyRequest.js → resources/testSuites/client/requests/TestSuiteTestCaseRequest.js} +0 -0
  223. /package/api/types/{SandboxInput.js → EvaluationParams.js} +0 -0
  224. /package/api/types/{SandboxInputRequest.js → EvaluationParamsRequest.js} +0 -0
  225. /package/{dist/api/client/requests → api/types}/GenerateBodyRequest.js +0 -0
  226. /package/{dist/api/types/SandboxInput.js → api/types/GenerateStreamResponse.js} +0 -0
  227. /package/{dist/api/types/SandboxInputRequest.js → api/types/GenerateStreamResult.js} +0 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as Vellum from "../../..";
7
+ export declare namespace TestSuites {
8
+ interface Options {
9
+ environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
10
+ apiKey: core.Supplier<string>;
11
+ }
12
+ }
13
+ export declare class TestSuites {
14
+ protected readonly options: TestSuites.Options;
15
+ constructor(options: TestSuites.Options);
16
+ /**
17
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
18
+ *
19
+ * Upserts a new test case for a test suite, keying off of the optionally provided test case id.
20
+ *
21
+ * If an id is provided and has a match, the test case will be updated. If no id is provided or no match
22
+ * is found, a new test case will be appended to the end.
23
+ *
24
+ * Note that a full replacement of the test case is performed, so any fields not provided will be removed
25
+ * or overwritten with default values.
26
+ */
27
+ upsertTestSuiteTestCase(id: string, request: Vellum.TestSuiteTestCaseRequest): Promise<Vellum.TestSuiteTestCase>;
28
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
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 (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.TestSuites = void 0;
33
+ const environments = __importStar(require("../../../../environments"));
34
+ const core = __importStar(require("../../../../core"));
35
+ const url_join_1 = __importDefault(require("url-join"));
36
+ const serializers = __importStar(require("../../../../serialization"));
37
+ const errors = __importStar(require("../../../../errors"));
38
+ class TestSuites {
39
+ options;
40
+ constructor(options) {
41
+ this.options = options;
42
+ }
43
+ /**
44
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
45
+ *
46
+ * Upserts a new test case for a test suite, keying off of the optionally provided test case id.
47
+ *
48
+ * If an id is provided and has a match, the test case will be updated. If no id is provided or no match
49
+ * is found, a new test case will be appended to the end.
50
+ *
51
+ * Note that a full replacement of the test case is performed, so any fields not provided will be removed
52
+ * or overwritten with default values.
53
+ */
54
+ async upsertTestSuiteTestCase(id, request) {
55
+ const _response = await core.fetcher({
56
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/test-suites/${id}/test-cases`),
57
+ method: "POST",
58
+ headers: {
59
+ X_API_KEY: await core.Supplier.get(this.options.apiKey),
60
+ },
61
+ contentType: "application/json",
62
+ body: await serializers.TestSuiteTestCaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
63
+ });
64
+ if (_response.ok) {
65
+ return await serializers.TestSuiteTestCase.parseOrThrow(_response.body, {
66
+ unrecognizedObjectKeys: "passthrough",
67
+ allowUnrecognizedUnionMembers: true,
68
+ allowUnrecognizedEnumValues: true,
69
+ });
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,
82
+ });
83
+ case "timeout":
84
+ throw new errors.VellumTimeoutError();
85
+ case "unknown":
86
+ throw new errors.VellumError({
87
+ message: _response.error.errorMessage,
88
+ });
89
+ }
90
+ }
91
+ }
92
+ exports.TestSuites = TestSuites;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "../../../..";
5
+ export interface TestSuiteTestCaseRequest {
6
+ /** The id of the test case to update. If none is provided, an id will be generated and a new test case will be appended. */
7
+ testCaseId?: string;
8
+ /** A human-friendly label for the test case. */
9
+ label?: string;
10
+ /** Key/value pairs for each input variable that the Test Suite expects. */
11
+ inputValues: Record<string, unknown>;
12
+ /** Parameters to use when evaluating the test case, specific to the test suite's evaluation metric. */
13
+ evaluationParams: Vellum.EvaluationParamsRequest;
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { TestSuiteTestCaseRequest } from "./TestSuiteTestCaseRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EvaluationParams {
5
+ /** The target value to compare the LLM output against. Typically what you expect or desire the LLM output to be. */
6
+ target?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EvaluationParamsRequest {
5
+ /** The target value to compare the LLM output against. Typically what you expect or desire the LLM output to be. */
6
+ target?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Vellum from "../..";
4
+ import * as Vellum from "..";
5
5
  export interface GenerateBodyRequest {
6
6
  /** The ID of the deployment. Must provide either this or deployment_name. */
7
7
  deploymentId?: string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface GenerateStreamResponse {
6
+ delta: Vellum.GenerateStreamResult;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface GenerateStreamResult {
6
+ requestIndex: number;
7
+ data?: Vellum.GenerateStreamResultData;
8
+ error?: Vellum.GenerateResultError;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface GenerateStreamResultData {
6
+ completionIndex: number;
7
+ completion: Vellum.EnrichedNormalizedCompletion;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type ProcessingFailureReasonEnum = "EXCEEDED_CHARACTER_LIMIT";
5
+ export declare const ProcessingFailureReasonEnum: {
6
+ readonly ExceededCharacterLimit: "EXCEEDED_CHARACTER_LIMIT";
7
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ProcessingFailureReasonEnum = void 0;
7
+ exports.ProcessingFailureReasonEnum = {
8
+ ExceededCharacterLimit: "EXCEEDED_CHARACTER_LIMIT",
9
+ };
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Vellum from "..";
4
5
  export interface SandboxMetricInputParams {
5
- params?: Record<string, unknown>;
6
+ params?: Vellum.EvaluationParams;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Vellum from "..";
4
5
  export interface SandboxMetricInputParamsRequest {
5
- params?: Record<string, unknown>;
6
+ params?: Vellum.EvaluationParamsRequest;
6
7
  }
@@ -5,7 +5,7 @@ import * as Vellum from "..";
5
5
  export interface SandboxScenario {
6
6
  label?: string;
7
7
  /** The inputs for the scenario */
8
- inputs: Vellum.SandboxInput[];
8
+ inputs: Vellum.ScenarioInput[];
9
9
  /** The id of the scenario */
10
10
  id: string;
11
11
  metricInputParams: Vellum.SandboxMetricInputParams;
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Vellum from "..";
5
- export interface SandboxInput {
5
+ export interface ScenarioInput {
6
6
  key: string;
7
7
  type?: Vellum.TypeEnum;
8
8
  value?: string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Vellum from "..";
5
- export interface SandboxInputRequest {
5
+ export interface ScenarioInputRequest {
6
6
  key: string;
7
7
  type?: Vellum.TypeEnum;
8
8
  value?: string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,8 +11,10 @@ export interface SlimDocument {
11
11
  lastUploadedAt: string;
12
12
  /** Human-friendly name for this document. */
13
13
  label: string;
14
- /** The current processing state of the document */
14
+ /** An enum value representing where this document is along its processing lifecycle. Note that this is different than its indexing lifecycle. */
15
15
  processingState?: Vellum.ProcessingStateEnum;
16
+ /** An enum value representing why the document could not be processed. Is null unless processing_state is FAILED. */
17
+ processingFailureReason?: Vellum.ProcessingFailureReasonEnum;
16
18
  /** The document's current status. */
17
19
  status?: Vellum.SlimDocumentStatusEnum;
18
20
  /** A list of keywords associated with this document. Originally provided when uploading the document. */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface TestSuiteTestCase {
6
+ /** The id of the test case to update. If none is provided, an id will be generated and a new test case will be appended. */
7
+ testCaseId?: string;
8
+ /** A human-friendly label for the test case. */
9
+ label?: string;
10
+ /** Key/value pairs for each input variable that the Test Suite expects. */
11
+ inputValues: Record<string, unknown>;
12
+ /** Parameters to use when evaluating the test case, specific to the test suite's evaluation metric. */
13
+ evaluationParams: Vellum.EvaluationParams;
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ export * from "./GenerateBodyRequest";
1
2
  export * from "./BlockTypeEnum";
2
3
  export * from "./ChatMessage";
3
4
  export * from "./ChatMessageRequest";
@@ -5,6 +6,8 @@ export * from "./ChatMessageRole";
5
6
  export * from "./Document";
6
7
  export * from "./DocumentDocumentToDocumentIndex";
7
8
  export * from "./EnrichedNormalizedCompletion";
9
+ export * from "./EvaluationParams";
10
+ export * from "./EvaluationParamsRequest";
8
11
  export * from "./FinishReasonEnum";
9
12
  export * from "./GenerateErrorResponse";
10
13
  export * from "./GenerateOptionsRequest";
@@ -13,6 +16,9 @@ export * from "./GenerateResponse";
13
16
  export * from "./GenerateResult";
14
17
  export * from "./GenerateResultData";
15
18
  export * from "./GenerateResultError";
19
+ export * from "./GenerateStreamResponse";
20
+ export * from "./GenerateStreamResult";
21
+ export * from "./GenerateStreamResultData";
16
22
  export * from "./IndexingStateEnum";
17
23
  export * from "./LogprobsEnum";
18
24
  export * from "./ModelTypeEnum";
@@ -25,16 +31,17 @@ export * from "./ModelVersionSandboxSnapshot";
25
31
  export * from "./NormalizedLogProbs";
26
32
  export * from "./NormalizedTokenLogProbs";
27
33
  export * from "./PaginatedSlimDocumentList";
34
+ export * from "./ProcessingFailureReasonEnum";
28
35
  export * from "./ProcessingStateEnum";
29
36
  export * from "./PromptTemplateBlock";
30
37
  export * from "./PromptTemplateBlockData";
31
38
  export * from "./PromptTemplateBlockProperties";
32
39
  export * from "./ProviderEnum";
33
- export * from "./SandboxInput";
34
- export * from "./SandboxInputRequest";
35
40
  export * from "./SandboxMetricInputParams";
36
41
  export * from "./SandboxMetricInputParamsRequest";
37
42
  export * from "./SandboxScenario";
43
+ export * from "./ScenarioInput";
44
+ export * from "./ScenarioInputRequest";
38
45
  export * from "./SearchErrorResponse";
39
46
  export * from "./SearchFiltersRequest";
40
47
  export * from "./SearchRequestOptionsRequest";
@@ -46,6 +53,7 @@ export * from "./SlimDocument";
46
53
  export * from "./SlimDocumentStatusEnum";
47
54
  export * from "./SubmitCompletionActualRequest";
48
55
  export * from "./SubmitCompletionActualsErrorResponse";
56
+ export * from "./TestSuiteTestCase";
49
57
  export * from "./TypeEnum";
50
58
  export * from "./UploadDocumentErrorResponse";
51
59
  export * from "./UploadDocumentResponse";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./GenerateBodyRequest"), exports);
17
18
  __exportStar(require("./BlockTypeEnum"), exports);
18
19
  __exportStar(require("./ChatMessage"), exports);
19
20
  __exportStar(require("./ChatMessageRequest"), exports);
@@ -21,6 +22,8 @@ __exportStar(require("./ChatMessageRole"), exports);
21
22
  __exportStar(require("./Document"), exports);
22
23
  __exportStar(require("./DocumentDocumentToDocumentIndex"), exports);
23
24
  __exportStar(require("./EnrichedNormalizedCompletion"), exports);
25
+ __exportStar(require("./EvaluationParams"), exports);
26
+ __exportStar(require("./EvaluationParamsRequest"), exports);
24
27
  __exportStar(require("./FinishReasonEnum"), exports);
25
28
  __exportStar(require("./GenerateErrorResponse"), exports);
26
29
  __exportStar(require("./GenerateOptionsRequest"), exports);
@@ -29,6 +32,9 @@ __exportStar(require("./GenerateResponse"), exports);
29
32
  __exportStar(require("./GenerateResult"), exports);
30
33
  __exportStar(require("./GenerateResultData"), exports);
31
34
  __exportStar(require("./GenerateResultError"), exports);
35
+ __exportStar(require("./GenerateStreamResponse"), exports);
36
+ __exportStar(require("./GenerateStreamResult"), exports);
37
+ __exportStar(require("./GenerateStreamResultData"), exports);
32
38
  __exportStar(require("./IndexingStateEnum"), exports);
33
39
  __exportStar(require("./LogprobsEnum"), exports);
34
40
  __exportStar(require("./ModelTypeEnum"), exports);
@@ -41,16 +47,17 @@ __exportStar(require("./ModelVersionSandboxSnapshot"), exports);
41
47
  __exportStar(require("./NormalizedLogProbs"), exports);
42
48
  __exportStar(require("./NormalizedTokenLogProbs"), exports);
43
49
  __exportStar(require("./PaginatedSlimDocumentList"), exports);
50
+ __exportStar(require("./ProcessingFailureReasonEnum"), exports);
44
51
  __exportStar(require("./ProcessingStateEnum"), exports);
45
52
  __exportStar(require("./PromptTemplateBlock"), exports);
46
53
  __exportStar(require("./PromptTemplateBlockData"), exports);
47
54
  __exportStar(require("./PromptTemplateBlockProperties"), exports);
48
55
  __exportStar(require("./ProviderEnum"), exports);
49
- __exportStar(require("./SandboxInput"), exports);
50
- __exportStar(require("./SandboxInputRequest"), exports);
51
56
  __exportStar(require("./SandboxMetricInputParams"), exports);
52
57
  __exportStar(require("./SandboxMetricInputParamsRequest"), exports);
53
58
  __exportStar(require("./SandboxScenario"), exports);
59
+ __exportStar(require("./ScenarioInput"), exports);
60
+ __exportStar(require("./ScenarioInputRequest"), exports);
54
61
  __exportStar(require("./SearchErrorResponse"), exports);
55
62
  __exportStar(require("./SearchFiltersRequest"), exports);
56
63
  __exportStar(require("./SearchRequestOptionsRequest"), exports);
@@ -62,6 +69,7 @@ __exportStar(require("./SlimDocument"), exports);
62
69
  __exportStar(require("./SlimDocumentStatusEnum"), exports);
63
70
  __exportStar(require("./SubmitCompletionActualRequest"), exports);
64
71
  __exportStar(require("./SubmitCompletionActualsErrorResponse"), exports);
72
+ __exportStar(require("./TestSuiteTestCase"), exports);
65
73
  __exportStar(require("./TypeEnum"), exports);
66
74
  __exportStar(require("./UploadDocumentErrorResponse"), exports);
67
75
  __exportStar(require("./UploadDocumentResponse"), exports);
@@ -0,0 +1,6 @@
1
+ export declare class CallbackQueue {
2
+ private queue;
3
+ wrap<Args extends any[]>(callback: (...args: Args) => void | Promise<void>): (...args: Args) => void;
4
+ wrap(callback: undefined): undefined;
5
+ toPromise(): Promise<void>;
6
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallbackQueue = void 0;
4
+ class CallbackQueue {
5
+ queue = Promise.resolve();
6
+ wrap(callback) {
7
+ if (callback == null) {
8
+ return undefined;
9
+ }
10
+ return (...args) => {
11
+ this.queue = this.queue.then(() => {
12
+ return callback(...args);
13
+ });
14
+ };
15
+ }
16
+ toPromise() {
17
+ return this.queue;
18
+ }
19
+ }
20
+ exports.CallbackQueue = CallbackQueue;
@@ -0,0 +1 @@
1
+ export { CallbackQueue } from "./CallbackQueue";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallbackQueue = void 0;
4
+ var CallbackQueue_1 = require("./CallbackQueue");
5
+ Object.defineProperty(exports, "CallbackQueue", { enumerable: true, get: function () { return CallbackQueue_1.CallbackQueue; } });
@@ -1,3 +1,5 @@
1
1
  export * as serialization from "./schemas";
2
2
  export * from "./fetcher";
3
+ export * from "./streaming-fetcher";
4
+ export * from "./callback-queue";
3
5
  export * from "./form-data-utils";
@@ -29,4 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.serialization = void 0;
30
30
  exports.serialization = __importStar(require("./schemas"));
31
31
  __exportStar(require("./fetcher"), exports);
32
+ __exportStar(require("./streaming-fetcher"), exports);
33
+ __exportStar(require("./callback-queue"), exports);
32
34
  __exportStar(require("./form-data-utils"), exports);
@@ -0,0 +1,22 @@
1
+ import URLSearchParams from "@ungap/url-search-params";
2
+ import { AxiosAdapter } from "axios";
3
+ export declare type StreamingFetchFunction = (args: StreamingFetcher.Args) => Promise<void>;
4
+ export declare namespace StreamingFetcher {
5
+ interface Args {
6
+ url: string;
7
+ method: string;
8
+ headers?: Record<string, string | undefined>;
9
+ queryParameters?: URLSearchParams;
10
+ body?: unknown;
11
+ timeoutMs?: number;
12
+ withCredentials?: boolean;
13
+ adapter?: AxiosAdapter;
14
+ onData: (data: unknown) => void;
15
+ onError?: (err: unknown) => void;
16
+ onFinish?: () => void;
17
+ abortController?: AbortController;
18
+ responseChunkPrefix?: string;
19
+ terminator?: string;
20
+ }
21
+ }
22
+ export declare const streamingFetcher: StreamingFetchFunction;