vellum-ai 0.6.8 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +9 -6
- package/Client.js +40 -37
- package/api/client/requests/ExecutePromptRequest.d.ts +7 -5
- package/api/client/requests/ExecutePromptStreamRequest.d.ts +7 -5
- package/api/resources/deployments/client/Client.d.ts +8 -5
- package/api/resources/deployments/client/Client.js +22 -17
- package/api/resources/documentIndexes/client/Client.d.ts +21 -7
- package/api/resources/documentIndexes/client/Client.js +77 -26
- package/api/resources/documents/client/Client.d.ts +11 -7
- package/api/resources/documents/client/Client.js +25 -22
- package/api/resources/folderEntities/client/Client.d.ts +4 -1
- package/api/resources/folderEntities/client/Client.js +4 -3
- package/api/resources/sandboxes/client/Client.d.ts +7 -4
- package/api/resources/sandboxes/client/Client.js +14 -13
- package/api/resources/testSuiteRuns/client/Client.d.ts +6 -3
- package/api/resources/testSuiteRuns/client/Client.js +13 -10
- package/api/resources/testSuites/client/Client.d.ts +6 -3
- package/api/resources/testSuites/client/Client.js +16 -14
- package/api/resources/testSuites/client/requests/index.d.ts +0 -1
- package/api/resources/workflowDeployments/client/Client.d.ts +7 -4
- package/api/resources/workflowDeployments/client/Client.js +17 -13
- package/api/resources/workflowSandboxes/client/Client.d.ts +4 -1
- package/api/resources/workflowSandboxes/client/Client.js +5 -6
- package/api/types/IterationStateEnum.d.ts +12 -0
- package/api/types/IterationStateEnum.js +10 -0
- package/api/types/MapNodeResultData.d.ts +2 -0
- package/api/types/MergeNodeResult.d.ts +2 -0
- package/api/types/MergeNodeResultData.d.ts +6 -0
- package/api/types/PromptNodeResultData.d.ts +1 -0
- package/api/types/TestSuiteRunExecutionArrayOutput.d.ts +12 -0
- package/api/types/TestSuiteRunExecutionOutput.d.ts +4 -1
- package/api/types/TestSuiteRunMetricNumberOutput.d.ts +1 -1
- package/api/types/TestSuiteRunMetricStringOutput.d.ts +1 -1
- package/api/types/TestSuiteTestCaseBulkOperationRequest.d.ts +4 -1
- package/api/types/TestSuiteTestCaseRejectedBulkResult.d.ts +1 -1
- package/api/types/TestSuiteTestCaseUpsertBulkOperationRequest.d.ts +12 -0
- package/api/types/TestSuiteTestCaseUpsertBulkOperationRequest.js +5 -0
- package/api/types/UpsertEnum.d.ts +4 -0
- package/api/types/UpsertEnum.js +5 -0
- package/api/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.d.ts +2 -9
- package/api/types/UpsertTestSuiteTestCaseRequest.js +5 -0
- package/api/types/index.d.ts +6 -0
- package/api/types/index.js +6 -0
- package/core/fetcher/Fetcher.d.ts +2 -0
- package/core/fetcher/Fetcher.js +19 -185
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +55 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +40 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +10 -21
- package/core/form-data-utils/FormDataWrapper.js +82 -49
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -6
- package/dist/Client.js +40 -37
- package/dist/api/client/requests/ExecutePromptRequest.d.ts +7 -5
- package/dist/api/client/requests/ExecutePromptStreamRequest.d.ts +7 -5
- package/dist/api/resources/deployments/client/Client.d.ts +8 -5
- package/dist/api/resources/deployments/client/Client.js +22 -17
- package/dist/api/resources/documentIndexes/client/Client.d.ts +21 -7
- package/dist/api/resources/documentIndexes/client/Client.js +77 -26
- package/dist/api/resources/documents/client/Client.d.ts +11 -7
- package/dist/api/resources/documents/client/Client.js +25 -22
- package/dist/api/resources/folderEntities/client/Client.d.ts +4 -1
- package/dist/api/resources/folderEntities/client/Client.js +4 -3
- package/dist/api/resources/sandboxes/client/Client.d.ts +7 -4
- package/dist/api/resources/sandboxes/client/Client.js +14 -13
- package/dist/api/resources/testSuiteRuns/client/Client.d.ts +6 -3
- package/dist/api/resources/testSuiteRuns/client/Client.js +13 -10
- package/dist/api/resources/testSuites/client/Client.d.ts +6 -3
- package/dist/api/resources/testSuites/client/Client.js +16 -14
- package/dist/api/resources/testSuites/client/requests/index.d.ts +0 -1
- package/dist/api/resources/workflowDeployments/client/Client.d.ts +7 -4
- package/dist/api/resources/workflowDeployments/client/Client.js +17 -13
- package/dist/api/resources/workflowSandboxes/client/Client.d.ts +4 -1
- package/dist/api/resources/workflowSandboxes/client/Client.js +5 -6
- package/dist/api/types/IterationStateEnum.d.ts +12 -0
- package/dist/api/types/IterationStateEnum.js +10 -0
- package/dist/api/types/MapNodeResultData.d.ts +2 -0
- package/dist/api/types/MergeNodeResult.d.ts +2 -0
- package/dist/api/types/MergeNodeResultData.d.ts +6 -0
- package/dist/api/types/MergeNodeResultData.js +5 -0
- package/dist/api/types/PromptNodeResultData.d.ts +1 -0
- package/dist/api/types/TestSuiteRunExecutionArrayOutput.d.ts +12 -0
- package/dist/api/types/TestSuiteRunExecutionArrayOutput.js +5 -0
- package/dist/api/types/TestSuiteRunExecutionOutput.d.ts +4 -1
- package/dist/api/types/TestSuiteRunMetricNumberOutput.d.ts +1 -1
- package/dist/api/types/TestSuiteRunMetricStringOutput.d.ts +1 -1
- package/dist/api/types/TestSuiteTestCaseBulkOperationRequest.d.ts +4 -1
- package/dist/api/types/TestSuiteTestCaseRejectedBulkResult.d.ts +1 -1
- package/dist/api/types/TestSuiteTestCaseUpsertBulkOperationRequest.d.ts +12 -0
- package/dist/api/types/TestSuiteTestCaseUpsertBulkOperationRequest.js +5 -0
- package/dist/api/types/UpsertEnum.d.ts +4 -0
- package/dist/api/types/UpsertEnum.js +5 -0
- package/dist/api/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.d.ts +2 -9
- package/dist/api/types/UpsertTestSuiteTestCaseRequest.js +5 -0
- package/dist/api/types/index.d.ts +6 -0
- package/dist/api/types/index.js +6 -0
- package/dist/core/fetcher/Fetcher.d.ts +2 -0
- package/dist/core/fetcher/Fetcher.js +19 -185
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +55 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +40 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +10 -21
- package/dist/core/form-data-utils/FormDataWrapper.js +82 -49
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/index.d.ts +0 -1
- package/dist/serialization/resources/index.js +0 -1
- package/dist/serialization/resources/testSuites/client/index.d.ts +0 -1
- package/dist/serialization/resources/testSuites/client/index.js +0 -4
- package/dist/serialization/types/IterationStateEnum.d.ts +10 -0
- package/dist/serialization/types/IterationStateEnum.js +31 -0
- package/dist/serialization/types/MapNodeResultData.d.ts +2 -0
- package/dist/serialization/types/MapNodeResultData.js +2 -0
- package/dist/serialization/types/MergeNodeResult.d.ts +2 -0
- package/dist/serialization/types/MergeNodeResult.js +4 -1
- package/dist/serialization/types/MergeNodeResultData.d.ts +12 -0
- package/dist/serialization/types/MergeNodeResultData.js +33 -0
- package/dist/serialization/types/MetadataFilterConfigRequest.js +2 -10
- package/dist/serialization/types/MetadataFilterRuleRequest.js +2 -10
- package/dist/serialization/types/PromptNodeResultData.d.ts +1 -0
- package/dist/serialization/types/PromptNodeResultData.js +1 -0
- package/dist/serialization/types/TestSuiteRunExecutionArrayOutput.d.ts +15 -0
- package/dist/serialization/types/TestSuiteRunExecutionArrayOutput.js +36 -0
- package/dist/serialization/types/TestSuiteRunExecutionOutput.d.ts +5 -1
- package/dist/serialization/types/TestSuiteRunExecutionOutput.js +2 -0
- package/dist/serialization/types/TestSuiteRunMetricNumberOutput.d.ts +1 -1
- package/dist/serialization/types/TestSuiteRunMetricNumberOutput.js +1 -1
- package/dist/serialization/types/TestSuiteRunMetricStringOutput.d.ts +1 -1
- package/dist/serialization/types/TestSuiteRunMetricStringOutput.js +1 -1
- package/dist/serialization/types/TestSuiteTestCaseBulkOperationRequest.d.ts +5 -1
- package/dist/serialization/types/TestSuiteTestCaseBulkOperationRequest.js +2 -0
- package/dist/serialization/types/TestSuiteTestCaseRejectedBulkResult.d.ts +1 -1
- package/dist/serialization/types/TestSuiteTestCaseRejectedBulkResult.js +1 -1
- package/dist/serialization/types/TestSuiteTestCaseUpsertBulkOperationRequest.d.ts +14 -0
- package/dist/serialization/types/TestSuiteTestCaseUpsertBulkOperationRequest.js +35 -0
- package/dist/serialization/types/UpsertEnum.d.ts +10 -0
- package/dist/serialization/types/UpsertEnum.js +31 -0
- package/dist/serialization/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.d.ts +5 -5
- package/dist/serialization/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.js +3 -3
- package/dist/serialization/types/index.d.ts +6 -0
- package/dist/serialization/types/index.js +6 -0
- package/package.json +6 -1
- package/reference.md +2418 -0
- package/serialization/resources/index.d.ts +0 -1
- package/serialization/resources/index.js +0 -1
- package/serialization/resources/testSuites/client/index.d.ts +0 -1
- package/serialization/resources/testSuites/client/index.js +0 -4
- package/serialization/types/IterationStateEnum.d.ts +10 -0
- package/serialization/types/IterationStateEnum.js +31 -0
- package/serialization/types/MapNodeResultData.d.ts +2 -0
- package/serialization/types/MapNodeResultData.js +2 -0
- package/serialization/types/MergeNodeResult.d.ts +2 -0
- package/serialization/types/MergeNodeResult.js +4 -1
- package/serialization/types/MergeNodeResultData.d.ts +12 -0
- package/serialization/types/MergeNodeResultData.js +33 -0
- package/serialization/types/MetadataFilterConfigRequest.js +2 -10
- package/serialization/types/MetadataFilterRuleRequest.js +2 -10
- package/serialization/types/PromptNodeResultData.d.ts +1 -0
- package/serialization/types/PromptNodeResultData.js +1 -0
- package/serialization/types/TestSuiteRunExecutionArrayOutput.d.ts +15 -0
- package/serialization/types/TestSuiteRunExecutionArrayOutput.js +36 -0
- package/serialization/types/TestSuiteRunExecutionOutput.d.ts +5 -1
- package/serialization/types/TestSuiteRunExecutionOutput.js +2 -0
- package/serialization/types/TestSuiteRunMetricNumberOutput.d.ts +1 -1
- package/serialization/types/TestSuiteRunMetricNumberOutput.js +1 -1
- package/serialization/types/TestSuiteRunMetricStringOutput.d.ts +1 -1
- package/serialization/types/TestSuiteRunMetricStringOutput.js +1 -1
- package/serialization/types/TestSuiteTestCaseBulkOperationRequest.d.ts +5 -1
- package/serialization/types/TestSuiteTestCaseBulkOperationRequest.js +2 -0
- package/serialization/types/TestSuiteTestCaseRejectedBulkResult.d.ts +1 -1
- package/serialization/types/TestSuiteTestCaseRejectedBulkResult.js +1 -1
- package/serialization/types/TestSuiteTestCaseUpsertBulkOperationRequest.d.ts +14 -0
- package/serialization/types/TestSuiteTestCaseUpsertBulkOperationRequest.js +35 -0
- package/serialization/types/UpsertEnum.d.ts +10 -0
- package/serialization/types/UpsertEnum.js +31 -0
- package/serialization/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.d.ts +5 -5
- package/serialization/{resources/testSuites/client/requests → types}/UpsertTestSuiteTestCaseRequest.js +3 -3
- package/serialization/types/index.d.ts +6 -0
- package/serialization/types/index.js +6 -0
- package/dist/serialization/resources/testSuites/client/requests/index.d.ts +0 -1
- package/dist/serialization/resources/testSuites/client/requests/index.js +0 -5
- package/serialization/resources/testSuites/client/requests/index.d.ts +0 -1
- package/serialization/resources/testSuites/client/requests/index.js +0 -5
- /package/api/{resources/testSuites/client/requests/UpsertTestSuiteTestCaseRequest.js → types/MergeNodeResultData.js} +0 -0
- /package/{dist/api/resources/testSuites/client/requests/UpsertTestSuiteTestCaseRequest.js → api/types/TestSuiteRunExecutionArrayOutput.js} +0 -0
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.undiscriminatedUnion = void 0;
|
|
13
4
|
const Schema_1 = require("../../Schema");
|
|
@@ -15,37 +6,35 @@ const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
|
15
6
|
const schema_utils_1 = require("../schema-utils");
|
|
16
7
|
function undiscriminatedUnion(schemas) {
|
|
17
8
|
const baseSchema = {
|
|
18
|
-
parse: (raw, opts) =>
|
|
9
|
+
parse: (raw, opts) => {
|
|
19
10
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.parse(raw, opts), schemas, opts);
|
|
20
|
-
}
|
|
21
|
-
json: (parsed, opts) =>
|
|
11
|
+
},
|
|
12
|
+
json: (parsed, opts) => {
|
|
22
13
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.json(parsed, opts), schemas, opts);
|
|
23
|
-
}
|
|
14
|
+
},
|
|
24
15
|
getType: () => Schema_1.SchemaType.UNDISCRIMINATED_UNION,
|
|
25
16
|
};
|
|
26
17
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
27
18
|
}
|
|
28
19
|
exports.undiscriminatedUnion = undiscriminatedUnion;
|
|
29
20
|
function validateAndTransformUndiscriminatedUnion(transform, schemas, opts) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
}
|
|
21
|
+
const errors = [];
|
|
22
|
+
for (const [index, schema] of schemas.entries()) {
|
|
23
|
+
const transformed = transform(schema, Object.assign(Object.assign({}, opts), { skipValidation: false }));
|
|
24
|
+
if (transformed.ok) {
|
|
25
|
+
return transformed;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
for (const error of transformed.errors) {
|
|
29
|
+
errors.push({
|
|
30
|
+
path: error.path,
|
|
31
|
+
message: `[Variant ${index}] ${error.message}`,
|
|
32
|
+
});
|
|
44
33
|
}
|
|
45
34
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
errors,
|
|
39
|
+
};
|
|
51
40
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
3
|
var t = {};
|
|
13
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -36,7 +27,7 @@ function union(discriminant, union) {
|
|
|
36
27
|
: discriminant.parsedDiscriminant;
|
|
37
28
|
const discriminantValueSchema = (0, enum_1.enum_)((0, keys_1.keys)(union));
|
|
38
29
|
const baseSchema = {
|
|
39
|
-
parse: (raw, opts) =>
|
|
30
|
+
parse: (raw, opts) => {
|
|
40
31
|
return transformAndValidateUnion({
|
|
41
32
|
value: raw,
|
|
42
33
|
discriminant: rawDiscriminant,
|
|
@@ -53,8 +44,8 @@ function union(discriminant, union) {
|
|
|
53
44
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts),
|
|
54
45
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
55
46
|
});
|
|
56
|
-
}
|
|
57
|
-
json: (parsed, opts) =>
|
|
47
|
+
},
|
|
48
|
+
json: (parsed, opts) => {
|
|
58
49
|
return transformAndValidateUnion({
|
|
59
50
|
value: parsed,
|
|
60
51
|
discriminant: parsedDiscriminant,
|
|
@@ -71,71 +62,69 @@ function union(discriminant, union) {
|
|
|
71
62
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts),
|
|
72
63
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
73
64
|
});
|
|
74
|
-
}
|
|
65
|
+
},
|
|
75
66
|
getType: () => Schema_1.SchemaType.UNION,
|
|
76
67
|
};
|
|
77
68
|
return Object.assign(Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema));
|
|
78
69
|
}
|
|
79
70
|
exports.union = union;
|
|
80
71
|
function transformAndValidateUnion({ value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnrecognizedUnionMembers = false, transformAdditionalProperties, breadcrumbsPrefix = [], }) {
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
if (!(0, isPlainObject_1.isPlainObject)(value)) {
|
|
73
|
+
return {
|
|
74
|
+
ok: false,
|
|
75
|
+
errors: [
|
|
76
|
+
{
|
|
77
|
+
path: breadcrumbsPrefix,
|
|
78
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const _a = value, _b = discriminant, discriminantValue = _a[_b], additionalProperties = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
84
|
+
if (discriminantValue == null) {
|
|
85
|
+
return {
|
|
86
|
+
ok: false,
|
|
87
|
+
errors: [
|
|
88
|
+
{
|
|
89
|
+
path: breadcrumbsPrefix,
|
|
90
|
+
message: `Missing discriminant ("${discriminant}")`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue);
|
|
96
|
+
if (!transformedDiscriminantValue.ok) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
errors: transformedDiscriminantValue.errors,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
|
|
103
|
+
if (additionalPropertiesSchema == null) {
|
|
104
|
+
if (allowUnrecognizedUnionMembers) {
|
|
83
105
|
return {
|
|
84
|
-
ok:
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
path: breadcrumbsPrefix,
|
|
88
|
-
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
89
|
-
},
|
|
90
|
-
],
|
|
106
|
+
ok: true,
|
|
107
|
+
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
91
108
|
};
|
|
92
109
|
}
|
|
93
|
-
|
|
94
|
-
if (discriminantValue == null) {
|
|
110
|
+
else {
|
|
95
111
|
return {
|
|
96
112
|
ok: false,
|
|
97
113
|
errors: [
|
|
98
114
|
{
|
|
99
|
-
path: breadcrumbsPrefix,
|
|
100
|
-
message:
|
|
115
|
+
path: [...breadcrumbsPrefix, discriminant],
|
|
116
|
+
message: "Unexpected discriminant value",
|
|
101
117
|
},
|
|
102
118
|
],
|
|
103
119
|
};
|
|
104
120
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (allowUnrecognizedUnionMembers) {
|
|
115
|
-
return {
|
|
116
|
-
ok: true,
|
|
117
|
-
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
return {
|
|
122
|
-
ok: false,
|
|
123
|
-
errors: [
|
|
124
|
-
{
|
|
125
|
-
path: [...breadcrumbsPrefix, discriminant],
|
|
126
|
-
message: "Unexpected discriminant value",
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
const transformedAdditionalProperties = yield transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
133
|
-
if (!transformedAdditionalProperties.ok) {
|
|
134
|
-
return transformedAdditionalProperties;
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
ok: true,
|
|
138
|
-
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
139
|
-
};
|
|
140
|
-
});
|
|
121
|
+
}
|
|
122
|
+
const transformedAdditionalProperties = transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
123
|
+
if (!transformedAdditionalProperties.ok) {
|
|
124
|
+
return transformedAdditionalProperties;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
ok: true,
|
|
128
|
+
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
129
|
+
};
|
|
141
130
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.maybeSkipValidation = void 0;
|
|
13
4
|
function maybeSkipValidation(schema) {
|
|
@@ -15,8 +6,8 @@ function maybeSkipValidation(schema) {
|
|
|
15
6
|
}
|
|
16
7
|
exports.maybeSkipValidation = maybeSkipValidation;
|
|
17
8
|
function transformAndMaybeSkipValidation(transform) {
|
|
18
|
-
return (value, opts) =>
|
|
19
|
-
const transformed =
|
|
9
|
+
return (value, opts) => {
|
|
10
|
+
const transformed = transform(value, opts);
|
|
20
11
|
const { skipValidation = false } = opts !== null && opts !== void 0 ? opts : {};
|
|
21
12
|
if (!transformed.ok && skipValidation) {
|
|
22
13
|
// eslint-disable-next-line no-console
|
|
@@ -33,5 +24,5 @@ function transformAndMaybeSkipValidation(transform) {
|
|
|
33
24
|
else {
|
|
34
25
|
return transformed;
|
|
35
26
|
}
|
|
36
|
-
}
|
|
27
|
+
};
|
|
37
28
|
}
|
package/dist/Client.d.ts
CHANGED
|
@@ -19,8 +19,11 @@ export declare namespace VellumClient {
|
|
|
19
19
|
apiKey: core.Supplier<string>;
|
|
20
20
|
}
|
|
21
21
|
interface RequestOptions {
|
|
22
|
+
/** The maximum time to wait for a response in seconds. */
|
|
22
23
|
timeoutInSeconds?: number;
|
|
24
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
23
25
|
maxRetries?: number;
|
|
26
|
+
/** A hook to abort the request. */
|
|
24
27
|
abortSignal?: AbortSignal;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
@@ -39,7 +42,7 @@ export declare class VellumClient {
|
|
|
39
42
|
* @throws {@link Vellum.InternalServerError}
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
|
-
* await
|
|
45
|
+
* await client.executePrompt({
|
|
43
46
|
* inputs: [{
|
|
44
47
|
* type: "STRING",
|
|
45
48
|
* name: "string",
|
|
@@ -94,7 +97,7 @@ export declare class VellumClient {
|
|
|
94
97
|
* @throws {@link Vellum.InternalServerError}
|
|
95
98
|
*
|
|
96
99
|
* @example
|
|
97
|
-
* await
|
|
100
|
+
* await client.executeWorkflow({
|
|
98
101
|
* inputs: [{
|
|
99
102
|
* type: "STRING",
|
|
100
103
|
* name: "string",
|
|
@@ -126,7 +129,7 @@ export declare class VellumClient {
|
|
|
126
129
|
* @throws {@link Vellum.InternalServerError}
|
|
127
130
|
*
|
|
128
131
|
* @example
|
|
129
|
-
* await
|
|
132
|
+
* await client.generate({
|
|
130
133
|
* requests: [{
|
|
131
134
|
* inputValues: {}
|
|
132
135
|
* }]
|
|
@@ -151,7 +154,7 @@ export declare class VellumClient {
|
|
|
151
154
|
* @throws {@link Vellum.InternalServerError}
|
|
152
155
|
*
|
|
153
156
|
* @example
|
|
154
|
-
* await
|
|
157
|
+
* await client.search({
|
|
155
158
|
* query: "query"
|
|
156
159
|
* })
|
|
157
160
|
*/
|
|
@@ -167,7 +170,7 @@ export declare class VellumClient {
|
|
|
167
170
|
* @throws {@link Vellum.InternalServerError}
|
|
168
171
|
*
|
|
169
172
|
* @example
|
|
170
|
-
* await
|
|
173
|
+
* await client.submitCompletionActuals({
|
|
171
174
|
* actuals: [{}]
|
|
172
175
|
* })
|
|
173
176
|
*/
|
|
@@ -181,7 +184,7 @@ export declare class VellumClient {
|
|
|
181
184
|
* @param {VellumClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
185
|
*
|
|
183
186
|
* @example
|
|
184
|
-
* await
|
|
187
|
+
* await client.submitWorkflowExecutionActuals({
|
|
185
188
|
* actuals: []
|
|
186
189
|
* })
|
|
187
190
|
*/
|
package/dist/Client.js
CHANGED
|
@@ -70,7 +70,7 @@ class VellumClient {
|
|
|
70
70
|
* @throws {@link Vellum.InternalServerError}
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
|
-
* await
|
|
73
|
+
* await client.executePrompt({
|
|
74
74
|
* inputs: [{
|
|
75
75
|
* type: "STRING",
|
|
76
76
|
* name: "string",
|
|
@@ -116,15 +116,16 @@ class VellumClient {
|
|
|
116
116
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
117
117
|
.predict, "v1/execute-prompt"),
|
|
118
118
|
method: "POST",
|
|
119
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
119
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
120
120
|
contentType: "application/json",
|
|
121
|
-
|
|
121
|
+
requestType: "json",
|
|
122
|
+
body: serializers.ExecutePromptRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
122
123
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
123
124
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
124
125
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
125
126
|
});
|
|
126
127
|
if (_response.ok) {
|
|
127
|
-
return
|
|
128
|
+
return serializers.ExecutePromptResponse.parseOrThrow(_response.body, {
|
|
128
129
|
unrecognizedObjectKeys: "passthrough",
|
|
129
130
|
allowUnrecognizedUnionMembers: true,
|
|
130
131
|
allowUnrecognizedEnumValues: true,
|
|
@@ -173,11 +174,10 @@ class VellumClient {
|
|
|
173
174
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
174
175
|
.predict, "v1/execute-prompt-stream"),
|
|
175
176
|
method: "POST",
|
|
176
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
177
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
177
178
|
contentType: "application/json",
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}),
|
|
179
|
+
requestType: "json",
|
|
180
|
+
body: serializers.ExecutePromptStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
181
181
|
responseType: "streaming",
|
|
182
182
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
183
183
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -187,7 +187,7 @@ class VellumClient {
|
|
|
187
187
|
return new core.Stream({
|
|
188
188
|
stream: _response.body,
|
|
189
189
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
190
|
-
return
|
|
190
|
+
return serializers.ExecutePromptEvent.parseOrThrow(data, {
|
|
191
191
|
unrecognizedObjectKeys: "passthrough",
|
|
192
192
|
allowUnrecognizedUnionMembers: true,
|
|
193
193
|
allowUnrecognizedEnumValues: true,
|
|
@@ -244,7 +244,7 @@ class VellumClient {
|
|
|
244
244
|
* @throws {@link Vellum.InternalServerError}
|
|
245
245
|
*
|
|
246
246
|
* @example
|
|
247
|
-
* await
|
|
247
|
+
* await client.executeWorkflow({
|
|
248
248
|
* inputs: [{
|
|
249
249
|
* type: "STRING",
|
|
250
250
|
* name: "string",
|
|
@@ -263,15 +263,16 @@ class VellumClient {
|
|
|
263
263
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
264
264
|
.predict, "v1/execute-workflow"),
|
|
265
265
|
method: "POST",
|
|
266
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
266
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
267
267
|
contentType: "application/json",
|
|
268
|
-
|
|
268
|
+
requestType: "json",
|
|
269
|
+
body: serializers.ExecuteWorkflowRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
269
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
270
271
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
271
272
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
272
273
|
});
|
|
273
274
|
if (_response.ok) {
|
|
274
|
-
return
|
|
275
|
+
return serializers.ExecuteWorkflowResponse.parseOrThrow(_response.body, {
|
|
275
276
|
unrecognizedObjectKeys: "passthrough",
|
|
276
277
|
allowUnrecognizedUnionMembers: true,
|
|
277
278
|
allowUnrecognizedEnumValues: true,
|
|
@@ -318,11 +319,10 @@ class VellumClient {
|
|
|
318
319
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
319
320
|
.predict, "v1/execute-workflow-stream"),
|
|
320
321
|
method: "POST",
|
|
321
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
322
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
322
323
|
contentType: "application/json",
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}),
|
|
324
|
+
requestType: "json",
|
|
325
|
+
body: serializers.ExecuteWorkflowStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
326
326
|
responseType: "streaming",
|
|
327
327
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
328
328
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -332,7 +332,7 @@ class VellumClient {
|
|
|
332
332
|
return new core.Stream({
|
|
333
333
|
stream: _response.body,
|
|
334
334
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
335
|
-
return
|
|
335
|
+
return serializers.WorkflowStreamEvent.parseOrThrow(data, {
|
|
336
336
|
unrecognizedObjectKeys: "passthrough",
|
|
337
337
|
allowUnrecognizedUnionMembers: true,
|
|
338
338
|
allowUnrecognizedEnumValues: true,
|
|
@@ -391,7 +391,7 @@ class VellumClient {
|
|
|
391
391
|
* @throws {@link Vellum.InternalServerError}
|
|
392
392
|
*
|
|
393
393
|
* @example
|
|
394
|
-
* await
|
|
394
|
+
* await client.generate({
|
|
395
395
|
* requests: [{
|
|
396
396
|
* inputValues: {}
|
|
397
397
|
* }]
|
|
@@ -404,15 +404,16 @@ class VellumClient {
|
|
|
404
404
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
405
405
|
.predict, "v1/generate"),
|
|
406
406
|
method: "POST",
|
|
407
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
407
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
408
408
|
contentType: "application/json",
|
|
409
|
-
|
|
409
|
+
requestType: "json",
|
|
410
|
+
body: serializers.GenerateBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
410
411
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
411
412
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
412
413
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
413
414
|
});
|
|
414
415
|
if (_response.ok) {
|
|
415
|
-
return
|
|
416
|
+
return serializers.GenerateResponse.parseOrThrow(_response.body, {
|
|
416
417
|
unrecognizedObjectKeys: "passthrough",
|
|
417
418
|
allowUnrecognizedUnionMembers: true,
|
|
418
419
|
allowUnrecognizedEnumValues: true,
|
|
@@ -464,9 +465,10 @@ class VellumClient {
|
|
|
464
465
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
465
466
|
.predict, "v1/generate-stream"),
|
|
466
467
|
method: "POST",
|
|
467
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
468
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
468
469
|
contentType: "application/json",
|
|
469
|
-
|
|
470
|
+
requestType: "json",
|
|
471
|
+
body: serializers.GenerateStreamBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
470
472
|
responseType: "streaming",
|
|
471
473
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
472
474
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -476,7 +478,7 @@ class VellumClient {
|
|
|
476
478
|
return new core.Stream({
|
|
477
479
|
stream: _response.body,
|
|
478
480
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
479
|
-
return
|
|
481
|
+
return serializers.GenerateStreamResponse.parseOrThrow(data, {
|
|
480
482
|
unrecognizedObjectKeys: "passthrough",
|
|
481
483
|
allowUnrecognizedUnionMembers: true,
|
|
482
484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -533,7 +535,7 @@ class VellumClient {
|
|
|
533
535
|
* @throws {@link Vellum.InternalServerError}
|
|
534
536
|
*
|
|
535
537
|
* @example
|
|
536
|
-
* await
|
|
538
|
+
* await client.search({
|
|
537
539
|
* query: "query"
|
|
538
540
|
* })
|
|
539
541
|
*/
|
|
@@ -544,15 +546,16 @@ class VellumClient {
|
|
|
544
546
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
545
547
|
.predict, "v1/search"),
|
|
546
548
|
method: "POST",
|
|
547
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
549
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
548
550
|
contentType: "application/json",
|
|
549
|
-
|
|
551
|
+
requestType: "json",
|
|
552
|
+
body: serializers.SearchRequestBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
550
553
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
551
554
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
552
555
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
553
556
|
});
|
|
554
557
|
if (_response.ok) {
|
|
555
|
-
return
|
|
558
|
+
return serializers.SearchResponse.parseOrThrow(_response.body, {
|
|
556
559
|
unrecognizedObjectKeys: "passthrough",
|
|
557
560
|
allowUnrecognizedUnionMembers: true,
|
|
558
561
|
allowUnrecognizedEnumValues: true,
|
|
@@ -600,7 +603,7 @@ class VellumClient {
|
|
|
600
603
|
* @throws {@link Vellum.InternalServerError}
|
|
601
604
|
*
|
|
602
605
|
* @example
|
|
603
|
-
* await
|
|
606
|
+
* await client.submitCompletionActuals({
|
|
604
607
|
* actuals: [{}]
|
|
605
608
|
* })
|
|
606
609
|
*/
|
|
@@ -611,11 +614,10 @@ class VellumClient {
|
|
|
611
614
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
612
615
|
.predict, "v1/submit-completion-actuals"),
|
|
613
616
|
method: "POST",
|
|
614
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
617
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
615
618
|
contentType: "application/json",
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}),
|
|
619
|
+
requestType: "json",
|
|
620
|
+
body: serializers.SubmitCompletionActualsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
619
621
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
620
622
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
621
623
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -662,7 +664,7 @@ class VellumClient {
|
|
|
662
664
|
* @param {VellumClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
663
665
|
*
|
|
664
666
|
* @example
|
|
665
|
-
* await
|
|
667
|
+
* await client.submitWorkflowExecutionActuals({
|
|
666
668
|
* actuals: []
|
|
667
669
|
* })
|
|
668
670
|
*/
|
|
@@ -673,9 +675,10 @@ class VellumClient {
|
|
|
673
675
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
674
676
|
.predict, "v1/submit-workflow-execution-actuals"),
|
|
675
677
|
method: "POST",
|
|
676
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
678
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
677
679
|
contentType: "application/json",
|
|
678
|
-
|
|
680
|
+
requestType: "json",
|
|
681
|
+
body: serializers.SubmitWorkflowExecutionActualsRequest.jsonOrThrow(request, {
|
|
679
682
|
unrecognizedObjectKeys: "strip",
|
|
680
683
|
}),
|
|
681
684
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -44,20 +44,22 @@ import * as Vellum from "../../index";
|
|
|
44
44
|
* }
|
|
45
45
|
*/
|
|
46
46
|
export interface ExecutePromptRequest {
|
|
47
|
-
/**
|
|
47
|
+
/** A list consisting of the Prompt Deployment's input variables and their values. */
|
|
48
48
|
inputs: Vellum.PromptDeploymentInputRequest[];
|
|
49
49
|
/** The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name. */
|
|
50
50
|
promptDeploymentId?: string;
|
|
51
|
-
/** The name of the Prompt Deployment. Must provide either this or prompt_deployment_id. */
|
|
51
|
+
/** The unique name of the Prompt Deployment. Must provide either this or prompt_deployment_id. */
|
|
52
52
|
promptDeploymentName?: string;
|
|
53
53
|
/** Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment */
|
|
54
54
|
releaseTag?: string;
|
|
55
|
-
/**
|
|
55
|
+
/** Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment. */
|
|
56
56
|
externalId?: string;
|
|
57
|
-
/**
|
|
57
|
+
/** An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response. */
|
|
58
58
|
expandMeta?: Vellum.PromptDeploymentExpandMetaRequestRequest;
|
|
59
|
+
/** Overrides for the raw API request sent to the model host. Combined with `expand_raw`, it can be used to access new features from models. */
|
|
59
60
|
rawOverrides?: Vellum.RawPromptExecutionOverridesRequest;
|
|
60
|
-
/**
|
|
61
|
+
/** A list of keys whose values you'd like to directly return from the JSON response of the model provider. Useful if you need lower-level info returned by model providers that Vellum would otherwise omit. Corresponding key/value pairs will be returned under the `raw` key of the API response. */
|
|
61
62
|
expandRaw?: string[];
|
|
63
|
+
/** Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis. */
|
|
62
64
|
metadata?: Record<string, unknown>;
|
|
63
65
|
}
|
|
@@ -44,20 +44,22 @@ import * as Vellum from "../../index";
|
|
|
44
44
|
* }
|
|
45
45
|
*/
|
|
46
46
|
export interface ExecutePromptStreamRequest {
|
|
47
|
-
/**
|
|
47
|
+
/** A list consisting of the Prompt Deployment's input variables and their values. */
|
|
48
48
|
inputs: Vellum.PromptDeploymentInputRequest[];
|
|
49
49
|
/** The ID of the Prompt Deployment. Must provide either this or prompt_deployment_name. */
|
|
50
50
|
promptDeploymentId?: string;
|
|
51
|
-
/** The name of the Prompt Deployment. Must provide either this or prompt_deployment_id. */
|
|
51
|
+
/** The unique name of the Prompt Deployment. Must provide either this or prompt_deployment_id. */
|
|
52
52
|
promptDeploymentName?: string;
|
|
53
53
|
/** Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment */
|
|
54
54
|
releaseTag?: string;
|
|
55
|
-
/**
|
|
55
|
+
/** Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment. */
|
|
56
56
|
externalId?: string;
|
|
57
|
-
/**
|
|
57
|
+
/** An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response. */
|
|
58
58
|
expandMeta?: Vellum.PromptDeploymentExpandMetaRequestRequest;
|
|
59
|
+
/** Overrides for the raw API request sent to the model host. Combined with `expand_raw`, it can be used to access new features from models. */
|
|
59
60
|
rawOverrides?: Vellum.RawPromptExecutionOverridesRequest;
|
|
60
|
-
/**
|
|
61
|
+
/** A list of keys whose values you'd like to directly return from the JSON response of the model provider. Useful if you need lower-level info returned by model providers that Vellum would otherwise omit. Corresponding key/value pairs will be returned under the `raw` key of the API response. */
|
|
61
62
|
expandRaw?: string[];
|
|
63
|
+
/** Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis. */
|
|
62
64
|
metadata?: Record<string, unknown>;
|
|
63
65
|
}
|