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
|
@@ -10,8 +10,11 @@ export declare namespace Deployments {
|
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
11
|
}
|
|
12
12
|
interface RequestOptions {
|
|
13
|
+
/** The maximum time to wait for a response in seconds. */
|
|
13
14
|
timeoutInSeconds?: number;
|
|
15
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
14
16
|
maxRetries?: number;
|
|
17
|
+
/** A hook to abort the request. */
|
|
15
18
|
abortSignal?: AbortSignal;
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -23,7 +26,7 @@ export declare class Deployments {
|
|
|
23
26
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
27
|
*
|
|
25
28
|
* @example
|
|
26
|
-
* await
|
|
29
|
+
* await client.deployments.list()
|
|
27
30
|
*/
|
|
28
31
|
list(request?: Vellum.DeploymentsListRequest, requestOptions?: Deployments.RequestOptions): Promise<Vellum.PaginatedSlimDeploymentReadList>;
|
|
29
32
|
/**
|
|
@@ -33,7 +36,7 @@ export declare class Deployments {
|
|
|
33
36
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
37
|
*
|
|
35
38
|
* @example
|
|
36
|
-
* await
|
|
39
|
+
* await client.deployments.retrieve("id")
|
|
37
40
|
*/
|
|
38
41
|
retrieve(id: string, requestOptions?: Deployments.RequestOptions): Promise<Vellum.DeploymentRead>;
|
|
39
42
|
/**
|
|
@@ -44,7 +47,7 @@ export declare class Deployments {
|
|
|
44
47
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
48
|
*
|
|
46
49
|
* @example
|
|
47
|
-
* await
|
|
50
|
+
* await client.deployments.retrieveDeploymentReleaseTag("id", "name")
|
|
48
51
|
*/
|
|
49
52
|
retrieveDeploymentReleaseTag(id: string, name: string, requestOptions?: Deployments.RequestOptions): Promise<Vellum.DeploymentReleaseTagRead>;
|
|
50
53
|
/**
|
|
@@ -56,7 +59,7 @@ export declare class Deployments {
|
|
|
56
59
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
60
|
*
|
|
58
61
|
* @example
|
|
59
|
-
* await
|
|
62
|
+
* await client.deployments.updateDeploymentReleaseTag("id", "name")
|
|
60
63
|
*/
|
|
61
64
|
updateDeploymentReleaseTag(id: string, name: string, request?: Vellum.PatchedDeploymentReleaseTagUpdateRequest, requestOptions?: Deployments.RequestOptions): Promise<Vellum.DeploymentReleaseTagRead>;
|
|
62
65
|
/**
|
|
@@ -69,7 +72,7 @@ export declare class Deployments {
|
|
|
69
72
|
* @throws {@link Vellum.InternalServerError}
|
|
70
73
|
*
|
|
71
74
|
* @example
|
|
72
|
-
* await
|
|
75
|
+
* await client.deployments.retrieveProviderPayload({
|
|
73
76
|
* inputs: []
|
|
74
77
|
* })
|
|
75
78
|
*/
|
|
@@ -54,7 +54,7 @@ class Deployments {
|
|
|
54
54
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
|
-
* await
|
|
57
|
+
* await client.deployments.list()
|
|
58
58
|
*/
|
|
59
59
|
list(request = {}, requestOptions) {
|
|
60
60
|
var _a;
|
|
@@ -77,15 +77,16 @@ class Deployments {
|
|
|
77
77
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
78
78
|
.default, "v1/deployments"),
|
|
79
79
|
method: "GET",
|
|
80
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
80
|
+
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())),
|
|
81
81
|
contentType: "application/json",
|
|
82
82
|
queryParameters: _queryParams,
|
|
83
|
+
requestType: "json",
|
|
83
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
84
85
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
85
86
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
87
|
});
|
|
87
88
|
if (_response.ok) {
|
|
88
|
-
return
|
|
89
|
+
return serializers.PaginatedSlimDeploymentReadList.parseOrThrow(_response.body, {
|
|
89
90
|
unrecognizedObjectKeys: "passthrough",
|
|
90
91
|
allowUnrecognizedUnionMembers: true,
|
|
91
92
|
allowUnrecognizedEnumValues: true,
|
|
@@ -120,7 +121,7 @@ class Deployments {
|
|
|
120
121
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
122
|
*
|
|
122
123
|
* @example
|
|
123
|
-
* await
|
|
124
|
+
* await client.deployments.retrieve("id")
|
|
124
125
|
*/
|
|
125
126
|
retrieve(id, requestOptions) {
|
|
126
127
|
var _a;
|
|
@@ -129,14 +130,15 @@ class Deployments {
|
|
|
129
130
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
130
131
|
.default, `v1/deployments/${encodeURIComponent(id)}`),
|
|
131
132
|
method: "GET",
|
|
132
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
133
|
+
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())),
|
|
133
134
|
contentType: "application/json",
|
|
135
|
+
requestType: "json",
|
|
134
136
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
135
137
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
136
138
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
137
139
|
});
|
|
138
140
|
if (_response.ok) {
|
|
139
|
-
return
|
|
141
|
+
return serializers.DeploymentRead.parseOrThrow(_response.body, {
|
|
140
142
|
unrecognizedObjectKeys: "passthrough",
|
|
141
143
|
allowUnrecognizedUnionMembers: true,
|
|
142
144
|
allowUnrecognizedEnumValues: true,
|
|
@@ -172,7 +174,7 @@ class Deployments {
|
|
|
172
174
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
175
|
*
|
|
174
176
|
* @example
|
|
175
|
-
* await
|
|
177
|
+
* await client.deployments.retrieveDeploymentReleaseTag("id", "name")
|
|
176
178
|
*/
|
|
177
179
|
retrieveDeploymentReleaseTag(id, name, requestOptions) {
|
|
178
180
|
var _a;
|
|
@@ -181,14 +183,15 @@ class Deployments {
|
|
|
181
183
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
182
184
|
.default, `v1/deployments/${encodeURIComponent(id)}/release-tags/${encodeURIComponent(name)}`),
|
|
183
185
|
method: "GET",
|
|
184
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
186
|
+
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())),
|
|
185
187
|
contentType: "application/json",
|
|
188
|
+
requestType: "json",
|
|
186
189
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
187
190
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
188
191
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
189
192
|
});
|
|
190
193
|
if (_response.ok) {
|
|
191
|
-
return
|
|
194
|
+
return serializers.DeploymentReleaseTagRead.parseOrThrow(_response.body, {
|
|
192
195
|
unrecognizedObjectKeys: "passthrough",
|
|
193
196
|
allowUnrecognizedUnionMembers: true,
|
|
194
197
|
allowUnrecognizedEnumValues: true,
|
|
@@ -225,7 +228,7 @@ class Deployments {
|
|
|
225
228
|
* @param {Deployments.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
229
|
*
|
|
227
230
|
* @example
|
|
228
|
-
* await
|
|
231
|
+
* await client.deployments.updateDeploymentReleaseTag("id", "name")
|
|
229
232
|
*/
|
|
230
233
|
updateDeploymentReleaseTag(id, name, request = {}, requestOptions) {
|
|
231
234
|
var _a;
|
|
@@ -234,9 +237,10 @@ class Deployments {
|
|
|
234
237
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
235
238
|
.default, `v1/deployments/${encodeURIComponent(id)}/release-tags/${encodeURIComponent(name)}`),
|
|
236
239
|
method: "PATCH",
|
|
237
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
240
|
+
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())),
|
|
238
241
|
contentType: "application/json",
|
|
239
|
-
|
|
242
|
+
requestType: "json",
|
|
243
|
+
body: serializers.PatchedDeploymentReleaseTagUpdateRequest.jsonOrThrow(request, {
|
|
240
244
|
unrecognizedObjectKeys: "strip",
|
|
241
245
|
}),
|
|
242
246
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -244,7 +248,7 @@ class Deployments {
|
|
|
244
248
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
245
249
|
});
|
|
246
250
|
if (_response.ok) {
|
|
247
|
-
return
|
|
251
|
+
return serializers.DeploymentReleaseTagRead.parseOrThrow(_response.body, {
|
|
248
252
|
unrecognizedObjectKeys: "passthrough",
|
|
249
253
|
allowUnrecognizedUnionMembers: true,
|
|
250
254
|
allowUnrecognizedEnumValues: true,
|
|
@@ -282,7 +286,7 @@ class Deployments {
|
|
|
282
286
|
* @throws {@link Vellum.InternalServerError}
|
|
283
287
|
*
|
|
284
288
|
* @example
|
|
285
|
-
* await
|
|
289
|
+
* await client.deployments.retrieveProviderPayload({
|
|
286
290
|
* inputs: []
|
|
287
291
|
* })
|
|
288
292
|
*/
|
|
@@ -293,9 +297,10 @@ class Deployments {
|
|
|
293
297
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
294
298
|
.default, "v1/deployments/provider-payload"),
|
|
295
299
|
method: "POST",
|
|
296
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
300
|
+
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())),
|
|
297
301
|
contentType: "application/json",
|
|
298
|
-
|
|
302
|
+
requestType: "json",
|
|
303
|
+
body: serializers.DeploymentProviderPayloadRequest.jsonOrThrow(request, {
|
|
299
304
|
unrecognizedObjectKeys: "strip",
|
|
300
305
|
}),
|
|
301
306
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -303,7 +308,7 @@ class Deployments {
|
|
|
303
308
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
304
309
|
});
|
|
305
310
|
if (_response.ok) {
|
|
306
|
-
return
|
|
311
|
+
return serializers.DeploymentProviderPayloadResponse.parseOrThrow(_response.body, {
|
|
307
312
|
unrecognizedObjectKeys: "passthrough",
|
|
308
313
|
allowUnrecognizedUnionMembers: true,
|
|
309
314
|
allowUnrecognizedEnumValues: true,
|
|
@@ -10,8 +10,11 @@ export declare namespace DocumentIndexes {
|
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
11
|
}
|
|
12
12
|
interface RequestOptions {
|
|
13
|
+
/** The maximum time to wait for a response in seconds. */
|
|
13
14
|
timeoutInSeconds?: number;
|
|
15
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
14
16
|
maxRetries?: number;
|
|
17
|
+
/** A hook to abort the request. */
|
|
15
18
|
abortSignal?: AbortSignal;
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -25,7 +28,7 @@ export declare class DocumentIndexes {
|
|
|
25
28
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
29
|
*
|
|
27
30
|
* @example
|
|
28
|
-
* await
|
|
31
|
+
* await client.documentIndexes.list()
|
|
29
32
|
*/
|
|
30
33
|
list(request?: Vellum.DocumentIndexesListRequest, requestOptions?: DocumentIndexes.RequestOptions): Promise<Vellum.PaginatedDocumentIndexReadList>;
|
|
31
34
|
/**
|
|
@@ -35,7 +38,7 @@ export declare class DocumentIndexes {
|
|
|
35
38
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
39
|
*
|
|
37
40
|
* @example
|
|
38
|
-
* await
|
|
41
|
+
* await client.documentIndexes.create({
|
|
39
42
|
* label: "string",
|
|
40
43
|
* name: "string",
|
|
41
44
|
* status: Vellum.EntityStatus.Active,
|
|
@@ -59,7 +62,7 @@ export declare class DocumentIndexes {
|
|
|
59
62
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
63
|
*
|
|
61
64
|
* @example
|
|
62
|
-
* await
|
|
65
|
+
* await client.documentIndexes.retrieve("string")
|
|
63
66
|
*/
|
|
64
67
|
retrieve(id: string, requestOptions?: DocumentIndexes.RequestOptions): Promise<Vellum.DocumentIndexRead>;
|
|
65
68
|
/**
|
|
@@ -70,7 +73,7 @@ export declare class DocumentIndexes {
|
|
|
70
73
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
74
|
*
|
|
72
75
|
* @example
|
|
73
|
-
* await
|
|
76
|
+
* await client.documentIndexes.update("string", {
|
|
74
77
|
* label: "string",
|
|
75
78
|
* status: Vellum.EntityStatus.Active,
|
|
76
79
|
* environment: Vellum.EnvironmentEnum.Development
|
|
@@ -84,7 +87,7 @@ export declare class DocumentIndexes {
|
|
|
84
87
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
88
|
*
|
|
86
89
|
* @example
|
|
87
|
-
* await
|
|
90
|
+
* await client.documentIndexes.destroy("id")
|
|
88
91
|
*/
|
|
89
92
|
destroy(id: string, requestOptions?: DocumentIndexes.RequestOptions): Promise<void>;
|
|
90
93
|
/**
|
|
@@ -95,13 +98,24 @@ export declare class DocumentIndexes {
|
|
|
95
98
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
99
|
*
|
|
97
100
|
* @example
|
|
98
|
-
* await
|
|
101
|
+
* await client.documentIndexes.partialUpdate("string", {
|
|
99
102
|
* label: "string",
|
|
100
103
|
* status: Vellum.EntityStatus.Active,
|
|
101
104
|
* environment: Vellum.EnvironmentEnum.Development
|
|
102
105
|
* })
|
|
103
106
|
*/
|
|
104
107
|
partialUpdate(id: string, request?: Vellum.PatchedDocumentIndexUpdateRequest, requestOptions?: DocumentIndexes.RequestOptions): Promise<Vellum.DocumentIndexRead>;
|
|
108
|
+
/**
|
|
109
|
+
* Adds a previously uploaded Document to the specified Document Index.
|
|
110
|
+
*
|
|
111
|
+
* @param {string} documentId - Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
|
|
112
|
+
* @param {string} id - Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
|
|
113
|
+
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.documentIndexes.addDocument("document_id", "id")
|
|
117
|
+
*/
|
|
118
|
+
addDocument(documentId: string, id: string, requestOptions?: DocumentIndexes.RequestOptions): Promise<void>;
|
|
105
119
|
/**
|
|
106
120
|
* Removes a Document from a Document Index without deleting the Document itself.
|
|
107
121
|
*
|
|
@@ -110,7 +124,7 @@ export declare class DocumentIndexes {
|
|
|
110
124
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
111
125
|
*
|
|
112
126
|
* @example
|
|
113
|
-
* await
|
|
127
|
+
* await client.documentIndexes.removeDocument("document_id", "id")
|
|
114
128
|
*/
|
|
115
129
|
removeDocument(documentId: string, id: string, requestOptions?: DocumentIndexes.RequestOptions): Promise<void>;
|
|
116
130
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -55,7 +55,7 @@ class DocumentIndexes {
|
|
|
55
55
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
|
-
* await
|
|
58
|
+
* await client.documentIndexes.list()
|
|
59
59
|
*/
|
|
60
60
|
list(request = {}, requestOptions) {
|
|
61
61
|
var _a;
|
|
@@ -81,15 +81,16 @@ class DocumentIndexes {
|
|
|
81
81
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
82
82
|
.default, "v1/document-indexes"),
|
|
83
83
|
method: "GET",
|
|
84
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
84
|
+
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())),
|
|
85
85
|
contentType: "application/json",
|
|
86
86
|
queryParameters: _queryParams,
|
|
87
|
+
requestType: "json",
|
|
87
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
88
89
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
91
|
});
|
|
91
92
|
if (_response.ok) {
|
|
92
|
-
return
|
|
93
|
+
return serializers.PaginatedDocumentIndexReadList.parseOrThrow(_response.body, {
|
|
93
94
|
unrecognizedObjectKeys: "passthrough",
|
|
94
95
|
allowUnrecognizedUnionMembers: true,
|
|
95
96
|
allowUnrecognizedEnumValues: true,
|
|
@@ -124,7 +125,7 @@ class DocumentIndexes {
|
|
|
124
125
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
125
126
|
*
|
|
126
127
|
* @example
|
|
127
|
-
* await
|
|
128
|
+
* await client.documentIndexes.create({
|
|
128
129
|
* label: "string",
|
|
129
130
|
* name: "string",
|
|
130
131
|
* status: Vellum.EntityStatus.Active,
|
|
@@ -147,17 +148,16 @@ class DocumentIndexes {
|
|
|
147
148
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
148
149
|
.default, "v1/document-indexes"),
|
|
149
150
|
method: "POST",
|
|
150
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
151
|
+
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())),
|
|
151
152
|
contentType: "application/json",
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}),
|
|
153
|
+
requestType: "json",
|
|
154
|
+
body: serializers.DocumentIndexCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
155
155
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
156
156
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
157
157
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
158
158
|
});
|
|
159
159
|
if (_response.ok) {
|
|
160
|
-
return
|
|
160
|
+
return serializers.DocumentIndexRead.parseOrThrow(_response.body, {
|
|
161
161
|
unrecognizedObjectKeys: "passthrough",
|
|
162
162
|
allowUnrecognizedUnionMembers: true,
|
|
163
163
|
allowUnrecognizedEnumValues: true,
|
|
@@ -192,7 +192,7 @@ class DocumentIndexes {
|
|
|
192
192
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
193
193
|
*
|
|
194
194
|
* @example
|
|
195
|
-
* await
|
|
195
|
+
* await client.documentIndexes.retrieve("string")
|
|
196
196
|
*/
|
|
197
197
|
retrieve(id, requestOptions) {
|
|
198
198
|
var _a;
|
|
@@ -201,14 +201,15 @@ class DocumentIndexes {
|
|
|
201
201
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
202
202
|
.default, `v1/document-indexes/${encodeURIComponent(id)}`),
|
|
203
203
|
method: "GET",
|
|
204
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
204
|
+
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())),
|
|
205
205
|
contentType: "application/json",
|
|
206
|
+
requestType: "json",
|
|
206
207
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
207
208
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
208
209
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
209
210
|
});
|
|
210
211
|
if (_response.ok) {
|
|
211
|
-
return
|
|
212
|
+
return serializers.DocumentIndexRead.parseOrThrow(_response.body, {
|
|
212
213
|
unrecognizedObjectKeys: "passthrough",
|
|
213
214
|
allowUnrecognizedUnionMembers: true,
|
|
214
215
|
allowUnrecognizedEnumValues: true,
|
|
@@ -244,7 +245,7 @@ class DocumentIndexes {
|
|
|
244
245
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
245
246
|
*
|
|
246
247
|
* @example
|
|
247
|
-
* await
|
|
248
|
+
* await client.documentIndexes.update("string", {
|
|
248
249
|
* label: "string",
|
|
249
250
|
* status: Vellum.EntityStatus.Active,
|
|
250
251
|
* environment: Vellum.EnvironmentEnum.Development
|
|
@@ -257,17 +258,16 @@ class DocumentIndexes {
|
|
|
257
258
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
258
259
|
.default, `v1/document-indexes/${encodeURIComponent(id)}`),
|
|
259
260
|
method: "PUT",
|
|
260
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
261
|
+
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())),
|
|
261
262
|
contentType: "application/json",
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}),
|
|
263
|
+
requestType: "json",
|
|
264
|
+
body: serializers.DocumentIndexUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
265
265
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
266
266
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
267
267
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
268
268
|
});
|
|
269
269
|
if (_response.ok) {
|
|
270
|
-
return
|
|
270
|
+
return serializers.DocumentIndexRead.parseOrThrow(_response.body, {
|
|
271
271
|
unrecognizedObjectKeys: "passthrough",
|
|
272
272
|
allowUnrecognizedUnionMembers: true,
|
|
273
273
|
allowUnrecognizedEnumValues: true,
|
|
@@ -302,7 +302,7 @@ class DocumentIndexes {
|
|
|
302
302
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
303
303
|
*
|
|
304
304
|
* @example
|
|
305
|
-
* await
|
|
305
|
+
* await client.documentIndexes.destroy("id")
|
|
306
306
|
*/
|
|
307
307
|
destroy(id, requestOptions) {
|
|
308
308
|
var _a;
|
|
@@ -311,8 +311,9 @@ class DocumentIndexes {
|
|
|
311
311
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
312
312
|
.default, `v1/document-indexes/${encodeURIComponent(id)}`),
|
|
313
313
|
method: "DELETE",
|
|
314
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
314
|
+
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())),
|
|
315
315
|
contentType: "application/json",
|
|
316
|
+
requestType: "json",
|
|
316
317
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
317
318
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
318
319
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -349,7 +350,7 @@ class DocumentIndexes {
|
|
|
349
350
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
350
351
|
*
|
|
351
352
|
* @example
|
|
352
|
-
* await
|
|
353
|
+
* await client.documentIndexes.partialUpdate("string", {
|
|
353
354
|
* label: "string",
|
|
354
355
|
* status: Vellum.EntityStatus.Active,
|
|
355
356
|
* environment: Vellum.EnvironmentEnum.Development
|
|
@@ -362,9 +363,10 @@ class DocumentIndexes {
|
|
|
362
363
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
363
364
|
.default, `v1/document-indexes/${encodeURIComponent(id)}`),
|
|
364
365
|
method: "PATCH",
|
|
365
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
366
|
+
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())),
|
|
366
367
|
contentType: "application/json",
|
|
367
|
-
|
|
368
|
+
requestType: "json",
|
|
369
|
+
body: serializers.PatchedDocumentIndexUpdateRequest.jsonOrThrow(request, {
|
|
368
370
|
unrecognizedObjectKeys: "strip",
|
|
369
371
|
}),
|
|
370
372
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -372,7 +374,7 @@ class DocumentIndexes {
|
|
|
372
374
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
373
375
|
});
|
|
374
376
|
if (_response.ok) {
|
|
375
|
-
return
|
|
377
|
+
return serializers.DocumentIndexRead.parseOrThrow(_response.body, {
|
|
376
378
|
unrecognizedObjectKeys: "passthrough",
|
|
377
379
|
allowUnrecognizedUnionMembers: true,
|
|
378
380
|
allowUnrecognizedEnumValues: true,
|
|
@@ -400,6 +402,54 @@ class DocumentIndexes {
|
|
|
400
402
|
}
|
|
401
403
|
});
|
|
402
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Adds a previously uploaded Document to the specified Document Index.
|
|
407
|
+
*
|
|
408
|
+
* @param {string} documentId - Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to add.
|
|
409
|
+
* @param {string} id - Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index to which you'd like to add the Document.
|
|
410
|
+
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* await client.documentIndexes.addDocument("document_id", "id")
|
|
414
|
+
*/
|
|
415
|
+
addDocument(documentId, id, requestOptions) {
|
|
416
|
+
var _a;
|
|
417
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
418
|
+
const _response = yield core.fetcher({
|
|
419
|
+
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
420
|
+
.default, `v1/document-indexes/${encodeURIComponent(id)}/documents/${encodeURIComponent(documentId)}`),
|
|
421
|
+
method: "POST",
|
|
422
|
+
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())),
|
|
423
|
+
contentType: "application/json",
|
|
424
|
+
requestType: "json",
|
|
425
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
426
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
427
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
428
|
+
});
|
|
429
|
+
if (_response.ok) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
if (_response.error.reason === "status-code") {
|
|
433
|
+
throw new errors.VellumError({
|
|
434
|
+
statusCode: _response.error.statusCode,
|
|
435
|
+
body: _response.error.body,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
switch (_response.error.reason) {
|
|
439
|
+
case "non-json":
|
|
440
|
+
throw new errors.VellumError({
|
|
441
|
+
statusCode: _response.error.statusCode,
|
|
442
|
+
body: _response.error.rawBody,
|
|
443
|
+
});
|
|
444
|
+
case "timeout":
|
|
445
|
+
throw new errors.VellumTimeoutError();
|
|
446
|
+
case "unknown":
|
|
447
|
+
throw new errors.VellumError({
|
|
448
|
+
message: _response.error.errorMessage,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
}
|
|
403
453
|
/**
|
|
404
454
|
* Removes a Document from a Document Index without deleting the Document itself.
|
|
405
455
|
*
|
|
@@ -408,7 +458,7 @@ class DocumentIndexes {
|
|
|
408
458
|
* @param {DocumentIndexes.RequestOptions} requestOptions - Request-specific configuration.
|
|
409
459
|
*
|
|
410
460
|
* @example
|
|
411
|
-
* await
|
|
461
|
+
* await client.documentIndexes.removeDocument("document_id", "id")
|
|
412
462
|
*/
|
|
413
463
|
removeDocument(documentId, id, requestOptions) {
|
|
414
464
|
var _a;
|
|
@@ -417,8 +467,9 @@ class DocumentIndexes {
|
|
|
417
467
|
url: (0, url_join_1.default)(((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.VellumEnvironment.Production)
|
|
418
468
|
.default, `v1/document-indexes/${encodeURIComponent(id)}/documents/${encodeURIComponent(documentId)}`),
|
|
419
469
|
method: "DELETE",
|
|
420
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "vellum-ai", "X-Fern-SDK-Version": "0.6.
|
|
470
|
+
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())),
|
|
421
471
|
contentType: "application/json",
|
|
472
|
+
requestType: "json",
|
|
422
473
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
423
474
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
424
475
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,14 +6,18 @@ import * as environments from "../../../../environments";
|
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
7
|
import * as Vellum from "../../../index";
|
|
8
8
|
import * as fs from "fs";
|
|
9
|
+
import { Blob } from "buffer";
|
|
9
10
|
export declare namespace Documents {
|
|
10
11
|
interface Options {
|
|
11
12
|
environment?: core.Supplier<environments.VellumEnvironment | environments.VellumEnvironmentUrls>;
|
|
12
13
|
apiKey: core.Supplier<string>;
|
|
13
14
|
}
|
|
14
15
|
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
15
17
|
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
16
19
|
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
17
21
|
abortSignal?: AbortSignal;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -27,7 +31,7 @@ export declare class Documents {
|
|
|
27
31
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
32
|
*
|
|
29
33
|
* @example
|
|
30
|
-
* await
|
|
34
|
+
* await client.documents.list()
|
|
31
35
|
*/
|
|
32
36
|
list(request?: Vellum.DocumentsListRequest, requestOptions?: Documents.RequestOptions): Promise<Vellum.PaginatedSlimDocumentList>;
|
|
33
37
|
/**
|
|
@@ -37,7 +41,7 @@ export declare class Documents {
|
|
|
37
41
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
42
|
*
|
|
39
43
|
* @example
|
|
40
|
-
* await
|
|
44
|
+
* await client.documents.retrieve("id")
|
|
41
45
|
*/
|
|
42
46
|
retrieve(id: string, requestOptions?: Documents.RequestOptions): Promise<Vellum.DocumentRead>;
|
|
43
47
|
/**
|
|
@@ -47,7 +51,7 @@ export declare class Documents {
|
|
|
47
51
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
52
|
*
|
|
49
53
|
* @example
|
|
50
|
-
* await
|
|
54
|
+
* await client.documents.destroy("id")
|
|
51
55
|
*/
|
|
52
56
|
destroy(id: string, requestOptions?: Documents.RequestOptions): Promise<void>;
|
|
53
57
|
/**
|
|
@@ -58,7 +62,7 @@ export declare class Documents {
|
|
|
58
62
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
63
|
*
|
|
60
64
|
* @example
|
|
61
|
-
* await
|
|
65
|
+
* await client.documents.partialUpdate("id")
|
|
62
66
|
*/
|
|
63
67
|
partialUpdate(id: string, request?: Vellum.PatchedDocumentUpdateRequest, requestOptions?: Documents.RequestOptions): Promise<Vellum.DocumentRead>;
|
|
64
68
|
/**
|
|
@@ -74,7 +78,7 @@ export declare class Documents {
|
|
|
74
78
|
* - `keywords: list[str] | None` - Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches.
|
|
75
79
|
* - `metadata: dict[str, Any]` - A stringified JSON object containing any metadata associated with the document that you'd like to filter upon later.
|
|
76
80
|
*
|
|
77
|
-
* @param {File | fs.ReadStream} contents
|
|
81
|
+
* @param {File | fs.ReadStream | Blob} contents
|
|
78
82
|
* @param {Vellum.UploadDocumentBodyRequest} request
|
|
79
83
|
* @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
84
|
*
|
|
@@ -83,11 +87,11 @@ export declare class Documents {
|
|
|
83
87
|
* @throws {@link Vellum.InternalServerError}
|
|
84
88
|
*
|
|
85
89
|
* @example
|
|
86
|
-
* await
|
|
90
|
+
* await client.documents.upload(fs.createReadStream("/path/to/your/file"), {
|
|
87
91
|
* label: "label"
|
|
88
92
|
* })
|
|
89
93
|
*/
|
|
90
|
-
upload(contents: File | fs.ReadStream, request: Vellum.UploadDocumentBodyRequest, requestOptions?: Documents.RequestOptions): Promise<Vellum.UploadDocumentResponse>;
|
|
94
|
+
upload(contents: File | fs.ReadStream | Blob, request: Vellum.UploadDocumentBodyRequest, requestOptions?: Documents.RequestOptions): Promise<Vellum.UploadDocumentResponse>;
|
|
91
95
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
92
96
|
X_API_KEY: string;
|
|
93
97
|
}>;
|