vellum-ai 0.3.4 → 0.3.6
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 +5 -22
- package/Client.js +32 -31
- package/api/client/requests/GenerateBodyRequest.d.ts +3 -4
- package/api/client/requests/SearchRequestBodyRequest.d.ts +1 -11
- package/api/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/api/resources/deployments/client/Client.d.ts +1 -1
- package/api/resources/deployments/client/Client.js +10 -4
- package/api/resources/deployments/client/requests/DeploymentsListRequest.d.ts +1 -3
- package/api/resources/documentIndexes/client/Client.d.ts +1 -3
- package/api/resources/documentIndexes/client/Client.js +7 -5
- package/api/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.d.ts +0 -2
- package/api/resources/documents/client/Client.d.ts +1 -3
- package/api/resources/documents/client/Client.js +13 -7
- package/api/resources/documents/client/requests/PatchedDocumentUpdateRequest.d.ts +1 -3
- package/api/resources/modelVersions/client/Client.d.ts +1 -1
- package/api/resources/modelVersions/client/Client.js +4 -2
- package/api/resources/registeredPrompts/client/Client.d.ts +11 -6
- package/api/resources/registeredPrompts/client/Client.js +14 -7
- package/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +11 -6
- package/api/resources/sandboxes/client/Client.d.ts +4 -2
- package/api/resources/sandboxes/client/Client.js +10 -4
- package/api/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +2 -0
- package/api/resources/testSuites/client/Client.d.ts +2 -2
- package/api/resources/testSuites/client/Client.js +8 -4
- package/api/resources/workflowDeployments/client/Client.js +3 -1
- package/api/resources/workflowDeployments/client/requests/WorkflowDeploymentsListRequest.d.ts +1 -3
- package/core/fetcher/Fetcher.js +8 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +8 -0
- package/core/runtime/runtime.js +82 -0
- package/core/streaming-fetcher/Stream.d.ts +4 -0
- package/core/streaming-fetcher/Stream.js +63 -5
- package/dist/Client.d.ts +5 -22
- package/dist/Client.js +32 -31
- package/dist/api/client/requests/GenerateBodyRequest.d.ts +3 -4
- package/dist/api/client/requests/SearchRequestBodyRequest.d.ts +1 -11
- package/dist/api/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/dist/api/resources/deployments/client/Client.d.ts +1 -1
- package/dist/api/resources/deployments/client/Client.js +10 -4
- package/dist/api/resources/deployments/client/requests/DeploymentsListRequest.d.ts +1 -3
- package/dist/api/resources/documentIndexes/client/Client.d.ts +1 -3
- package/dist/api/resources/documentIndexes/client/Client.js +7 -5
- package/dist/api/resources/documentIndexes/client/requests/DocumentIndexCreateRequest.d.ts +0 -2
- package/dist/api/resources/documents/client/Client.d.ts +1 -3
- package/dist/api/resources/documents/client/Client.js +13 -7
- package/dist/api/resources/documents/client/requests/PatchedDocumentUpdateRequest.d.ts +1 -3
- package/dist/api/resources/modelVersions/client/Client.d.ts +1 -1
- package/dist/api/resources/modelVersions/client/Client.js +4 -2
- package/dist/api/resources/registeredPrompts/client/Client.d.ts +11 -6
- package/dist/api/resources/registeredPrompts/client/Client.js +14 -7
- package/dist/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts +11 -6
- package/dist/api/resources/sandboxes/client/Client.d.ts +4 -2
- package/dist/api/resources/sandboxes/client/Client.js +10 -4
- package/dist/api/resources/sandboxes/client/requests/UpsertSandboxScenarioRequestRequest.d.ts +2 -0
- package/dist/api/resources/testSuites/client/Client.d.ts +2 -2
- package/dist/api/resources/testSuites/client/Client.js +8 -4
- package/dist/api/resources/workflowDeployments/client/Client.js +3 -1
- package/dist/api/resources/workflowDeployments/client/requests/WorkflowDeploymentsListRequest.d.ts +1 -3
- package/dist/core/fetcher/Fetcher.js +8 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +8 -0
- package/dist/core/runtime/runtime.js +82 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +4 -0
- package/dist/core/streaming-fetcher/Stream.js +63 -5
- package/jest.config.js +5 -0
- package/package.json +6 -2
- package/tests/client.test.ts +11 -0
|
@@ -22,7 +22,7 @@ export declare class Deployments {
|
|
|
22
22
|
* Used to retrieve a deployment given its ID or name.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
|
-
* await vellum.deployments.retrieve("
|
|
25
|
+
* await vellum.deployments.retrieve("id")
|
|
26
26
|
*/
|
|
27
27
|
retrieve(id: string, requestOptions?: Deployments.RequestOptions): Promise<Vellum.DeploymentRead>;
|
|
28
28
|
retrieveProviderPayload(request: Vellum.DeploymentProviderPayloadRequest, requestOptions?: Deployments.RequestOptions): Promise<Vellum.DeploymentProviderPayloadResponse>;
|
|
@@ -73,7 +73,9 @@ class Deployments {
|
|
|
73
73
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
74
74
|
"X-Fern-Language": "JavaScript",
|
|
75
75
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
76
|
-
"X-Fern-SDK-Version": "0.3.
|
|
76
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
77
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
78
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
77
79
|
},
|
|
78
80
|
contentType: "application/json",
|
|
79
81
|
queryParameters: _queryParams,
|
|
@@ -113,7 +115,7 @@ class Deployments {
|
|
|
113
115
|
* Used to retrieve a deployment given its ID or name.
|
|
114
116
|
*
|
|
115
117
|
* @example
|
|
116
|
-
* await vellum.deployments.retrieve("
|
|
118
|
+
* await vellum.deployments.retrieve("id")
|
|
117
119
|
*/
|
|
118
120
|
retrieve(id, requestOptions) {
|
|
119
121
|
var _a;
|
|
@@ -126,7 +128,9 @@ class Deployments {
|
|
|
126
128
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
127
129
|
"X-Fern-Language": "JavaScript",
|
|
128
130
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
129
|
-
"X-Fern-SDK-Version": "0.3.
|
|
131
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
132
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
133
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
130
134
|
},
|
|
131
135
|
contentType: "application/json",
|
|
132
136
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -172,7 +176,9 @@ class Deployments {
|
|
|
172
176
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
173
177
|
"X-Fern-Language": "JavaScript",
|
|
174
178
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
175
|
-
"X-Fern-SDK-Version": "0.3.
|
|
179
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
180
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
181
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
176
182
|
},
|
|
177
183
|
contentType: "application/json",
|
|
178
184
|
body: yield serializers.DeploymentProviderPayloadRequest.jsonOrThrow(request, {
|
|
@@ -24,8 +24,6 @@ export declare class DocumentIndexes {
|
|
|
24
24
|
* await vellum.documentIndexes.create({
|
|
25
25
|
* label: "My Document Index",
|
|
26
26
|
* name: "my-document-index",
|
|
27
|
-
* status: Vellum.EntityStatus.Active,
|
|
28
|
-
* environment: Vellum.EnvironmentEnum.Development,
|
|
29
27
|
* indexingConfig: {
|
|
30
28
|
* "chunking": {
|
|
31
29
|
* "chunker_name": "sentence-chunker",
|
|
@@ -50,7 +48,7 @@ export declare class DocumentIndexes {
|
|
|
50
48
|
* Used to retrieve a Document Index given its ID or name.
|
|
51
49
|
*
|
|
52
50
|
* @example
|
|
53
|
-
* await vellum.documentIndexes.retrieve("
|
|
51
|
+
* await vellum.documentIndexes.retrieve("id")
|
|
54
52
|
*/
|
|
55
53
|
retrieve(id: string, requestOptions?: DocumentIndexes.RequestOptions): Promise<Vellum.DocumentIndexRead>;
|
|
56
54
|
}
|
|
@@ -55,8 +55,6 @@ class DocumentIndexes {
|
|
|
55
55
|
* await vellum.documentIndexes.create({
|
|
56
56
|
* label: "My Document Index",
|
|
57
57
|
* name: "my-document-index",
|
|
58
|
-
* status: Vellum.EntityStatus.Active,
|
|
59
|
-
* environment: Vellum.EnvironmentEnum.Development,
|
|
60
58
|
* indexingConfig: {
|
|
61
59
|
* "chunking": {
|
|
62
60
|
* "chunker_name": "sentence-chunker",
|
|
@@ -87,7 +85,9 @@ class DocumentIndexes {
|
|
|
87
85
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
88
86
|
"X-Fern-Language": "JavaScript",
|
|
89
87
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
90
|
-
"X-Fern-SDK-Version": "0.3.
|
|
88
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
89
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
90
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
91
91
|
},
|
|
92
92
|
contentType: "application/json",
|
|
93
93
|
body: yield serializers.DocumentIndexCreateRequest.jsonOrThrow(request, {
|
|
@@ -129,7 +129,7 @@ class DocumentIndexes {
|
|
|
129
129
|
* Used to retrieve a Document Index given its ID or name.
|
|
130
130
|
*
|
|
131
131
|
* @example
|
|
132
|
-
* await vellum.documentIndexes.retrieve("
|
|
132
|
+
* await vellum.documentIndexes.retrieve("id")
|
|
133
133
|
*/
|
|
134
134
|
retrieve(id, requestOptions) {
|
|
135
135
|
var _a;
|
|
@@ -142,7 +142,9 @@ class DocumentIndexes {
|
|
|
142
142
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
143
143
|
"X-Fern-Language": "JavaScript",
|
|
144
144
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
145
|
-
"X-Fern-SDK-Version": "0.3.
|
|
145
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
146
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
147
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
146
148
|
},
|
|
147
149
|
contentType: "application/json",
|
|
148
150
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -7,8 +7,6 @@ import * as Vellum from "../../../..";
|
|
|
7
7
|
* {
|
|
8
8
|
* label: "My Document Index",
|
|
9
9
|
* name: "my-document-index",
|
|
10
|
-
* status: Vellum.EntityStatus.Active,
|
|
11
|
-
* environment: Vellum.EnvironmentEnum.Development,
|
|
12
10
|
* indexingConfig: {
|
|
13
11
|
* "chunking": {
|
|
14
12
|
* "chunker_name": "sentence-chunker",
|
|
@@ -31,9 +31,7 @@ export declare class Documents {
|
|
|
31
31
|
* Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
|
-
* await vellum.documents.partialUpdate("
|
|
35
|
-
* status: "ACTIVE"
|
|
36
|
-
* })
|
|
34
|
+
* await vellum.documents.partialUpdate("id", {})
|
|
37
35
|
*/
|
|
38
36
|
partialUpdate(id: string, request?: Vellum.PatchedDocumentUpdateRequest, requestOptions?: Documents.RequestOptions): Promise<Vellum.DocumentRead>;
|
|
39
37
|
/**
|
|
@@ -81,7 +81,9 @@ class Documents {
|
|
|
81
81
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
82
82
|
"X-Fern-Language": "JavaScript",
|
|
83
83
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
84
|
-
"X-Fern-SDK-Version": "0.3.
|
|
84
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
85
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
86
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
85
87
|
},
|
|
86
88
|
contentType: "application/json",
|
|
87
89
|
queryParameters: _queryParams,
|
|
@@ -128,7 +130,9 @@ class Documents {
|
|
|
128
130
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
129
131
|
"X-Fern-Language": "JavaScript",
|
|
130
132
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
131
|
-
"X-Fern-SDK-Version": "0.3.
|
|
133
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
134
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
135
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
132
136
|
},
|
|
133
137
|
contentType: "application/json",
|
|
134
138
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -162,9 +166,7 @@ class Documents {
|
|
|
162
166
|
* Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
|
|
163
167
|
*
|
|
164
168
|
* @example
|
|
165
|
-
* await vellum.documents.partialUpdate("
|
|
166
|
-
* status: "ACTIVE"
|
|
167
|
-
* })
|
|
169
|
+
* await vellum.documents.partialUpdate("id", {})
|
|
168
170
|
*/
|
|
169
171
|
partialUpdate(id, request = {}, requestOptions) {
|
|
170
172
|
var _a;
|
|
@@ -177,7 +179,9 @@ class Documents {
|
|
|
177
179
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
178
180
|
"X-Fern-Language": "JavaScript",
|
|
179
181
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
180
|
-
"X-Fern-SDK-Version": "0.3.
|
|
182
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
183
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
184
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
181
185
|
},
|
|
182
186
|
contentType: "application/json",
|
|
183
187
|
body: yield serializers.PatchedDocumentUpdateRequest.jsonOrThrow(request, {
|
|
@@ -261,7 +265,9 @@ class Documents {
|
|
|
261
265
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
262
266
|
"X-Fern-Language": "JavaScript",
|
|
263
267
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
264
|
-
"X-Fern-SDK-Version": "0.3.
|
|
268
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
269
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
270
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
265
271
|
},
|
|
266
272
|
contentType: "multipart/form-data; boundary=" + _request.getBoundary(),
|
|
267
273
|
body: _request,
|
|
@@ -21,7 +21,7 @@ export declare class ModelVersions {
|
|
|
21
21
|
* Deprecated. Use the `deployments/provider-payload` endpoint to fetch information that we send to Model providers.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
|
-
* await vellum.modelVersions.retrieve("
|
|
24
|
+
* await vellum.modelVersions.retrieve("id")
|
|
25
25
|
*/
|
|
26
26
|
retrieve(id: string, requestOptions?: ModelVersions.RequestOptions): Promise<Vellum.ModelVersionRead>;
|
|
27
27
|
}
|
|
@@ -52,7 +52,7 @@ class ModelVersions {
|
|
|
52
52
|
* Deprecated. Use the `deployments/provider-payload` endpoint to fetch information that we send to Model providers.
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
|
-
* await vellum.modelVersions.retrieve("
|
|
55
|
+
* await vellum.modelVersions.retrieve("id")
|
|
56
56
|
*/
|
|
57
57
|
retrieve(id, requestOptions) {
|
|
58
58
|
var _a;
|
|
@@ -65,7 +65,9 @@ class ModelVersions {
|
|
|
65
65
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
66
66
|
"X-Fern-Language": "JavaScript",
|
|
67
67
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
68
|
-
"X-Fern-SDK-Version": "0.3.
|
|
68
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
69
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
70
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
71
|
},
|
|
70
72
|
contentType: "application/json",
|
|
71
73
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -28,17 +28,22 @@ export declare class RegisteredPrompts {
|
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* await vellum.registeredPrompts.registerPrompt({
|
|
31
|
-
* label: "
|
|
32
|
-
* name: "
|
|
31
|
+
* label: "label",
|
|
32
|
+
* name: "name",
|
|
33
33
|
* prompt: {
|
|
34
34
|
* promptBlockData: {
|
|
35
35
|
* version: 1,
|
|
36
|
-
* blocks: [
|
|
36
|
+
* blocks: [{
|
|
37
|
+
* id: "id",
|
|
38
|
+
* blockType: Vellum.BlockTypeEnum.ChatMessage,
|
|
39
|
+
* properties: {}
|
|
40
|
+
* }]
|
|
37
41
|
* },
|
|
38
|
-
* inputVariables: [
|
|
42
|
+
* inputVariables: [{
|
|
43
|
+
* key: "key"
|
|
44
|
+
* }]
|
|
39
45
|
* },
|
|
40
|
-
*
|
|
41
|
-
* model: "string",
|
|
46
|
+
* model: "model",
|
|
42
47
|
* parameters: {
|
|
43
48
|
* temperature: 1.1,
|
|
44
49
|
* maxTokens: 1,
|
|
@@ -60,17 +60,22 @@ class RegisteredPrompts {
|
|
|
60
60
|
*
|
|
61
61
|
* @example
|
|
62
62
|
* await vellum.registeredPrompts.registerPrompt({
|
|
63
|
-
* label: "
|
|
64
|
-
* name: "
|
|
63
|
+
* label: "label",
|
|
64
|
+
* name: "name",
|
|
65
65
|
* prompt: {
|
|
66
66
|
* promptBlockData: {
|
|
67
67
|
* version: 1,
|
|
68
|
-
* blocks: [
|
|
68
|
+
* blocks: [{
|
|
69
|
+
* id: "id",
|
|
70
|
+
* blockType: Vellum.BlockTypeEnum.ChatMessage,
|
|
71
|
+
* properties: {}
|
|
72
|
+
* }]
|
|
69
73
|
* },
|
|
70
|
-
* inputVariables: [
|
|
74
|
+
* inputVariables: [{
|
|
75
|
+
* key: "key"
|
|
76
|
+
* }]
|
|
71
77
|
* },
|
|
72
|
-
*
|
|
73
|
-
* model: "string",
|
|
78
|
+
* model: "model",
|
|
74
79
|
* parameters: {
|
|
75
80
|
* temperature: 1.1,
|
|
76
81
|
* maxTokens: 1,
|
|
@@ -91,7 +96,9 @@ class RegisteredPrompts {
|
|
|
91
96
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
92
97
|
"X-Fern-Language": "JavaScript",
|
|
93
98
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
94
|
-
"X-Fern-SDK-Version": "0.3.
|
|
99
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
100
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
101
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
95
102
|
},
|
|
96
103
|
contentType: "application/json",
|
|
97
104
|
body: yield serializers.RegisterPromptRequestRequest.jsonOrThrow(request, {
|
package/dist/api/resources/registeredPrompts/client/requests/RegisterPromptRequestRequest.d.ts
CHANGED
|
@@ -5,17 +5,22 @@ import * as Vellum from "../../../..";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* label: "
|
|
9
|
-
* name: "
|
|
8
|
+
* label: "label",
|
|
9
|
+
* name: "name",
|
|
10
10
|
* prompt: {
|
|
11
11
|
* promptBlockData: {
|
|
12
12
|
* version: 1,
|
|
13
|
-
* blocks: [
|
|
13
|
+
* blocks: [{
|
|
14
|
+
* id: "id",
|
|
15
|
+
* blockType: Vellum.BlockTypeEnum.ChatMessage,
|
|
16
|
+
* properties: {}
|
|
17
|
+
* }]
|
|
14
18
|
* },
|
|
15
|
-
* inputVariables: [
|
|
19
|
+
* inputVariables: [{
|
|
20
|
+
* key: "key"
|
|
21
|
+
* }]
|
|
16
22
|
* },
|
|
17
|
-
*
|
|
18
|
-
* model: "string",
|
|
23
|
+
* model: "model",
|
|
19
24
|
* parameters: {
|
|
20
25
|
* temperature: 1.1,
|
|
21
26
|
* maxTokens: 1,
|
|
@@ -27,7 +27,7 @@ export declare class Sandboxes {
|
|
|
27
27
|
* or overwritten with default values.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
|
-
* await vellum.sandboxes.upsertSandboxScenario("
|
|
30
|
+
* await vellum.sandboxes.upsertSandboxScenario("id", {
|
|
31
31
|
* label: "Scenario 1",
|
|
32
32
|
* inputs: [{
|
|
33
33
|
* key: "var_1",
|
|
@@ -37,6 +37,8 @@ export declare class Sandboxes {
|
|
|
37
37
|
* key: "var_2",
|
|
38
38
|
* type: Vellum.ScenarioInputTypeEnum.Text,
|
|
39
39
|
* value: "Why hello, there!"
|
|
40
|
+
* }, {
|
|
41
|
+
* key: "key"
|
|
40
42
|
* }]
|
|
41
43
|
* })
|
|
42
44
|
*/
|
|
@@ -45,7 +47,7 @@ export declare class Sandboxes {
|
|
|
45
47
|
* Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
|
|
46
48
|
*
|
|
47
49
|
* @example
|
|
48
|
-
* await vellum.sandboxes.deleteSandboxScenario("
|
|
50
|
+
* await vellum.sandboxes.deleteSandboxScenario("id", "scenario_id")
|
|
49
51
|
*/
|
|
50
52
|
deleteSandboxScenario(id: string, scenarioId: string, requestOptions?: Sandboxes.RequestOptions): Promise<void>;
|
|
51
53
|
}
|
|
@@ -58,7 +58,7 @@ class Sandboxes {
|
|
|
58
58
|
* or overwritten with default values.
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
|
-
* await vellum.sandboxes.upsertSandboxScenario("
|
|
61
|
+
* await vellum.sandboxes.upsertSandboxScenario("id", {
|
|
62
62
|
* label: "Scenario 1",
|
|
63
63
|
* inputs: [{
|
|
64
64
|
* key: "var_1",
|
|
@@ -68,6 +68,8 @@ class Sandboxes {
|
|
|
68
68
|
* key: "var_2",
|
|
69
69
|
* type: Vellum.ScenarioInputTypeEnum.Text,
|
|
70
70
|
* value: "Why hello, there!"
|
|
71
|
+
* }, {
|
|
72
|
+
* key: "key"
|
|
71
73
|
* }]
|
|
72
74
|
* })
|
|
73
75
|
*/
|
|
@@ -82,7 +84,9 @@ class Sandboxes {
|
|
|
82
84
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
83
85
|
"X-Fern-Language": "JavaScript",
|
|
84
86
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
85
|
-
"X-Fern-SDK-Version": "0.3.
|
|
87
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
88
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
89
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
90
|
},
|
|
87
91
|
contentType: "application/json",
|
|
88
92
|
body: yield serializers.UpsertSandboxScenarioRequestRequest.jsonOrThrow(request, {
|
|
@@ -124,7 +128,7 @@ class Sandboxes {
|
|
|
124
128
|
* Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
|
|
125
129
|
*
|
|
126
130
|
* @example
|
|
127
|
-
* await vellum.sandboxes.deleteSandboxScenario("
|
|
131
|
+
* await vellum.sandboxes.deleteSandboxScenario("id", "scenario_id")
|
|
128
132
|
*/
|
|
129
133
|
deleteSandboxScenario(id, scenarioId, requestOptions) {
|
|
130
134
|
var _a;
|
|
@@ -137,7 +141,9 @@ class Sandboxes {
|
|
|
137
141
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
138
142
|
"X-Fern-Language": "JavaScript",
|
|
139
143
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
140
|
-
"X-Fern-SDK-Version": "0.3.
|
|
144
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
145
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
146
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
141
147
|
},
|
|
142
148
|
contentType: "application/json",
|
|
143
149
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -27,7 +27,7 @@ export declare class TestSuites {
|
|
|
27
27
|
* or overwritten with default values.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
|
-
* await vellum.testSuites.upsertTestSuiteTestCase("
|
|
30
|
+
* await vellum.testSuites.upsertTestSuiteTestCase("id", {
|
|
31
31
|
* inputValues: [],
|
|
32
32
|
* evaluationValues: []
|
|
33
33
|
* })
|
|
@@ -37,7 +37,7 @@ export declare class TestSuites {
|
|
|
37
37
|
* Deletes an existing test case for a test suite, keying off of the test case id.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
|
-
* await vellum.testSuites.deleteTestSuiteTestCase("
|
|
40
|
+
* await vellum.testSuites.deleteTestSuiteTestCase("id", "test_case_id")
|
|
41
41
|
*/
|
|
42
42
|
deleteTestSuiteTestCase(id: string, testCaseId: string, requestOptions?: TestSuites.RequestOptions): Promise<void>;
|
|
43
43
|
}
|
|
@@ -58,7 +58,7 @@ class TestSuites {
|
|
|
58
58
|
* or overwritten with default values.
|
|
59
59
|
*
|
|
60
60
|
* @example
|
|
61
|
-
* await vellum.testSuites.upsertTestSuiteTestCase("
|
|
61
|
+
* await vellum.testSuites.upsertTestSuiteTestCase("id", {
|
|
62
62
|
* inputValues: [],
|
|
63
63
|
* evaluationValues: []
|
|
64
64
|
* })
|
|
@@ -74,7 +74,9 @@ class TestSuites {
|
|
|
74
74
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
75
75
|
"X-Fern-Language": "JavaScript",
|
|
76
76
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
77
|
-
"X-Fern-SDK-Version": "0.3.
|
|
77
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
78
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
79
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
78
80
|
},
|
|
79
81
|
contentType: "application/json",
|
|
80
82
|
body: yield serializers.UpsertTestSuiteTestCaseRequest.jsonOrThrow(request, {
|
|
@@ -116,7 +118,7 @@ class TestSuites {
|
|
|
116
118
|
* Deletes an existing test case for a test suite, keying off of the test case id.
|
|
117
119
|
*
|
|
118
120
|
* @example
|
|
119
|
-
* await vellum.testSuites.deleteTestSuiteTestCase("
|
|
121
|
+
* await vellum.testSuites.deleteTestSuiteTestCase("id", "test_case_id")
|
|
120
122
|
*/
|
|
121
123
|
deleteTestSuiteTestCase(id, testCaseId, requestOptions) {
|
|
122
124
|
var _a;
|
|
@@ -129,7 +131,9 @@ class TestSuites {
|
|
|
129
131
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
130
132
|
"X-Fern-Language": "JavaScript",
|
|
131
133
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
132
|
-
"X-Fern-SDK-Version": "0.3.
|
|
134
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
135
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
136
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
133
137
|
},
|
|
134
138
|
contentType: "application/json",
|
|
135
139
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : undefined,
|
|
@@ -73,7 +73,9 @@ class WorkflowDeployments {
|
|
|
73
73
|
X_API_KEY: yield core.Supplier.get(this._options.apiKey),
|
|
74
74
|
"X-Fern-Language": "JavaScript",
|
|
75
75
|
"X-Fern-SDK-Name": "vellum-ai",
|
|
76
|
-
"X-Fern-SDK-Version": "0.3.
|
|
76
|
+
"X-Fern-SDK-Version": "0.3.6",
|
|
77
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
78
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
77
79
|
},
|
|
78
80
|
contentType: "application/json",
|
|
79
81
|
queryParameters: _queryParams,
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.fetcher = void 0;
|
|
16
16
|
const form_data_1 = __importDefault(require("form-data"));
|
|
17
17
|
const qs_1 = __importDefault(require("qs"));
|
|
18
|
+
const runtime_1 = require("../runtime");
|
|
18
19
|
const INITIAL_RETRY_DELAY = 1;
|
|
19
20
|
const MAX_RETRY_DELAY = 60;
|
|
20
21
|
const DEFAULT_MAX_RETRIES = 2;
|
|
@@ -40,10 +41,16 @@ function fetcherImpl(args) {
|
|
|
40
41
|
// @ts-expect-error
|
|
41
42
|
body = args.body;
|
|
42
43
|
}
|
|
44
|
+
else if (args.body instanceof Uint8Array) {
|
|
45
|
+
body = args.body;
|
|
46
|
+
}
|
|
43
47
|
else {
|
|
44
48
|
body = JSON.stringify(args.body);
|
|
45
49
|
}
|
|
46
|
-
|
|
50
|
+
// In Node.js environments, the SDK always uses`node-fetch`.
|
|
51
|
+
// If not in Node.js the SDK uses global fetch if available,
|
|
52
|
+
// and falls back to node-fetch.
|
|
53
|
+
const fetchFn = runtime_1.RUNTIME.type === "node" ? require("node-fetch") : typeof fetch == "function" ? fetch : require("node-fetch");
|
|
47
54
|
const makeRequest = () => __awaiter(this, void 0, void 0, function* () {
|
|
48
55
|
const controller = new AbortController();
|
|
49
56
|
let abortId = undefined;
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -28,5 +28,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.serialization = void 0;
|
|
30
30
|
__exportStar(require("./fetcher"), exports);
|
|
31
|
+
__exportStar(require("./runtime"), exports);
|
|
31
32
|
__exportStar(require("./streaming-fetcher"), exports);
|
|
32
33
|
exports.serialization = __importStar(require("./schemas"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RUNTIME } from "./runtime";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A constant that indicates which environment and version the SDK is running in.
|
|
3
|
+
*/
|
|
4
|
+
export declare const RUNTIME: Runtime;
|
|
5
|
+
export interface Runtime {
|
|
6
|
+
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown";
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|