vellum-ai 0.0.11 → 0.0.13
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 -1
- package/Client.js +19 -9
- package/api/{types → client/requests}/GenerateBodyRequest.d.ts +1 -1
- package/api/client/requests/GenerateStreamBodyRequest.d.ts +14 -0
- package/api/client/requests/index.d.ts +2 -0
- package/api/resources/deployments/client/Client.d.ts +24 -0
- package/api/resources/deployments/client/Client.js +87 -0
- package/api/resources/deployments/client/index.d.ts +1 -0
- package/api/resources/deployments/client/index.js +2 -0
- package/api/resources/deployments/index.d.ts +1 -0
- package/api/resources/deployments/index.js +17 -0
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +2 -1
- package/api/types/DeploymentRead.d.ts +20 -0
- package/api/types/DeploymentRead.js +5 -0
- package/api/types/DeploymentReadStatusEnum.d.ts +9 -0
- package/api/types/DeploymentReadStatusEnum.js +11 -0
- package/api/types/EnvironmentEnum.d.ts +9 -0
- package/api/types/EnvironmentEnum.js +11 -0
- package/api/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/api/types/PromptTemplateBlockProperties.d.ts +1 -0
- package/api/types/index.d.ts +3 -1
- package/api/types/index.js +3 -1
- package/dist/Client.d.ts +9 -1
- package/dist/Client.js +19 -9
- package/dist/api/{types → client/requests}/GenerateBodyRequest.d.ts +1 -1
- package/dist/api/client/requests/GenerateBodyRequest.js +5 -0
- package/dist/api/client/requests/GenerateStreamBodyRequest.d.ts +14 -0
- package/dist/api/client/requests/GenerateStreamBodyRequest.js +5 -0
- package/dist/api/client/requests/index.d.ts +2 -0
- package/dist/api/resources/deployments/client/Client.d.ts +24 -0
- package/dist/api/resources/deployments/client/Client.js +87 -0
- package/dist/api/resources/deployments/client/index.d.ts +1 -0
- package/dist/api/resources/deployments/client/index.js +2 -0
- package/dist/api/resources/deployments/index.d.ts +1 -0
- package/dist/api/resources/deployments/index.js +17 -0
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +2 -1
- package/dist/api/types/DeploymentRead.d.ts +20 -0
- package/dist/api/types/DeploymentRead.js +5 -0
- package/dist/api/types/DeploymentReadStatusEnum.d.ts +9 -0
- package/dist/api/types/DeploymentReadStatusEnum.js +11 -0
- package/dist/api/types/EnvironmentEnum.d.ts +9 -0
- package/dist/api/types/EnvironmentEnum.js +11 -0
- package/dist/api/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/dist/api/types/PromptTemplateBlockProperties.d.ts +1 -0
- package/dist/api/types/index.d.ts +3 -1
- package/dist/api/types/index.js +3 -1
- package/dist/serialization/{types → client/requests}/GenerateBodyRequest.d.ts +4 -4
- package/dist/serialization/{types → client/requests}/GenerateBodyRequest.js +3 -3
- package/dist/serialization/client/requests/GenerateStreamBodyRequest.d.ts +15 -0
- package/dist/serialization/client/requests/GenerateStreamBodyRequest.js +36 -0
- package/dist/serialization/client/requests/index.d.ts +2 -0
- package/dist/serialization/client/requests/index.js +5 -1
- package/dist/serialization/types/DeploymentRead.d.ts +20 -0
- package/dist/serialization/types/DeploymentRead.js +41 -0
- package/dist/serialization/types/DeploymentReadStatusEnum.d.ts +10 -0
- package/dist/serialization/types/DeploymentReadStatusEnum.js +31 -0
- package/dist/serialization/types/EnvironmentEnum.d.ts +10 -0
- package/dist/serialization/types/EnvironmentEnum.js +31 -0
- package/dist/serialization/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/dist/serialization/types/ModelVersionSandboxSnapshot.js +1 -1
- package/dist/serialization/types/PromptTemplateBlockProperties.d.ts +1 -0
- package/dist/serialization/types/PromptTemplateBlockProperties.js +1 -0
- package/dist/serialization/types/index.d.ts +3 -1
- package/dist/serialization/types/index.js +3 -1
- package/package.json +1 -1
- package/serialization/{types → client/requests}/GenerateBodyRequest.d.ts +4 -4
- package/serialization/{types → client/requests}/GenerateBodyRequest.js +3 -3
- package/serialization/client/requests/GenerateStreamBodyRequest.d.ts +15 -0
- package/serialization/client/requests/GenerateStreamBodyRequest.js +36 -0
- package/serialization/client/requests/index.d.ts +2 -0
- package/serialization/client/requests/index.js +5 -1
- package/serialization/types/DeploymentRead.d.ts +20 -0
- package/serialization/types/DeploymentRead.js +41 -0
- package/serialization/types/DeploymentReadStatusEnum.d.ts +10 -0
- package/serialization/types/DeploymentReadStatusEnum.js +31 -0
- package/serialization/types/EnvironmentEnum.d.ts +10 -0
- package/serialization/types/EnvironmentEnum.js +31 -0
- package/serialization/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/serialization/types/ModelVersionSandboxSnapshot.js +1 -1
- package/serialization/types/PromptTemplateBlockProperties.d.ts +1 -0
- package/serialization/types/PromptTemplateBlockProperties.js +1 -0
- package/serialization/types/index.d.ts +3 -1
- package/serialization/types/index.js +3 -1
- /package/api/{types → client/requests}/GenerateBodyRequest.js +0 -0
- /package/{dist/api/types/GenerateBodyRequest.js → api/client/requests/GenerateStreamBodyRequest.js} +0 -0
package/Client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
6
|
import * as Vellum from "./api";
|
|
7
|
+
import { Deployments } from "./api/resources/deployments/client/Client";
|
|
7
8
|
import { Documents } from "./api/resources/documents/client/Client";
|
|
8
9
|
import { ModelVersions } from "./api/resources/modelVersions/client/Client";
|
|
9
10
|
import { Sandboxes } from "./api/resources/sandboxes/client/Client";
|
|
@@ -29,11 +30,16 @@ export declare class VellumClient {
|
|
|
29
30
|
*/
|
|
30
31
|
generate(request: Vellum.GenerateBodyRequest): Promise<Vellum.GenerateResponse>;
|
|
31
32
|
/**
|
|
33
|
+
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
34
|
+
*
|
|
35
|
+
* Generate a stream of completions using a previously defined deployment.
|
|
36
|
+
*
|
|
37
|
+
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
32
38
|
* @throws {Vellum.BadRequestError}
|
|
33
39
|
* @throws {Vellum.NotFoundError}
|
|
34
40
|
* @throws {Vellum.InternalServerError}
|
|
35
41
|
*/
|
|
36
|
-
generateStream(request: Vellum.
|
|
42
|
+
generateStream(request: Vellum.GenerateStreamBodyRequest, cb: (data: Vellum.GenerateStreamResponse) => void, opts?: Pick<core.StreamingFetcher.Args, "onError" | "onFinish" | "abortController" | "timeoutMs">): Promise<void>;
|
|
37
43
|
/**
|
|
38
44
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
39
45
|
*
|
|
@@ -56,6 +62,8 @@ export declare class VellumClient {
|
|
|
56
62
|
* @throws {Vellum.InternalServerError}
|
|
57
63
|
*/
|
|
58
64
|
submitCompletionActuals(request: Vellum.SubmitCompletionActualsRequest): Promise<void>;
|
|
65
|
+
protected _deployments: Deployments | undefined;
|
|
66
|
+
get deployments(): Deployments;
|
|
59
67
|
protected _documents: Documents | undefined;
|
|
60
68
|
get documents(): Documents;
|
|
61
69
|
protected _modelVersions: ModelVersions | undefined;
|
package/Client.js
CHANGED
|
@@ -36,10 +36,11 @@ const Vellum = __importStar(require("./api"));
|
|
|
36
36
|
const url_join_1 = __importDefault(require("url-join"));
|
|
37
37
|
const serializers = __importStar(require("./serialization"));
|
|
38
38
|
const errors = __importStar(require("./errors"));
|
|
39
|
-
const Client_1 = require("./api/resources/
|
|
40
|
-
const Client_2 = require("./api/resources/
|
|
41
|
-
const Client_3 = require("./api/resources/
|
|
42
|
-
const Client_4 = require("./api/resources/
|
|
39
|
+
const Client_1 = require("./api/resources/deployments/client/Client");
|
|
40
|
+
const Client_2 = require("./api/resources/documents/client/Client");
|
|
41
|
+
const Client_3 = require("./api/resources/modelVersions/client/Client");
|
|
42
|
+
const Client_4 = require("./api/resources/sandboxes/client/Client");
|
|
43
|
+
const Client_5 = require("./api/resources/testSuites/client/Client");
|
|
43
44
|
class VellumClient {
|
|
44
45
|
options;
|
|
45
46
|
constructor(options) {
|
|
@@ -102,6 +103,11 @@ class VellumClient {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
106
|
+
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
107
|
+
*
|
|
108
|
+
* Generate a stream of completions using a previously defined deployment.
|
|
109
|
+
*
|
|
110
|
+
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
105
111
|
* @throws {Vellum.BadRequestError}
|
|
106
112
|
* @throws {Vellum.NotFoundError}
|
|
107
113
|
* @throws {Vellum.InternalServerError}
|
|
@@ -114,7 +120,7 @@ class VellumClient {
|
|
|
114
120
|
headers: {
|
|
115
121
|
X_API_KEY: await core.Supplier.get(this.options.apiKey),
|
|
116
122
|
},
|
|
117
|
-
body: await serializers.
|
|
123
|
+
body: await serializers.GenerateStreamBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
118
124
|
onData: _queue.wrap(async (data) => {
|
|
119
125
|
const parsed = await serializers.GenerateStreamResponse.parse(data, {
|
|
120
126
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -243,21 +249,25 @@ class VellumClient {
|
|
|
243
249
|
});
|
|
244
250
|
}
|
|
245
251
|
}
|
|
252
|
+
_deployments;
|
|
253
|
+
get deployments() {
|
|
254
|
+
return (this._deployments ??= new Client_1.Deployments(this.options));
|
|
255
|
+
}
|
|
246
256
|
_documents;
|
|
247
257
|
get documents() {
|
|
248
|
-
return (this._documents ??= new
|
|
258
|
+
return (this._documents ??= new Client_2.Documents(this.options));
|
|
249
259
|
}
|
|
250
260
|
_modelVersions;
|
|
251
261
|
get modelVersions() {
|
|
252
|
-
return (this._modelVersions ??= new
|
|
262
|
+
return (this._modelVersions ??= new Client_3.ModelVersions(this.options));
|
|
253
263
|
}
|
|
254
264
|
_sandboxes;
|
|
255
265
|
get sandboxes() {
|
|
256
|
-
return (this._sandboxes ??= new
|
|
266
|
+
return (this._sandboxes ??= new Client_4.Sandboxes(this.options));
|
|
257
267
|
}
|
|
258
268
|
_testSuites;
|
|
259
269
|
get testSuites() {
|
|
260
|
-
return (this._testSuites ??= new
|
|
270
|
+
return (this._testSuites ??= new Client_5.TestSuites(this.options));
|
|
261
271
|
}
|
|
262
272
|
}
|
|
263
273
|
exports.VellumClient = VellumClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Vellum from "
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface GenerateBodyRequest {
|
|
6
6
|
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
7
|
deploymentId?: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
|
+
export interface GenerateStreamBodyRequest {
|
|
6
|
+
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
|
+
deploymentId?: string;
|
|
8
|
+
/** The name of the deployment. Must provide either this or deployment_id. */
|
|
9
|
+
deploymentName?: string;
|
|
10
|
+
/** The generation requests to make. Supplying multiple will perform a bulk request to the LLM provided when possible. */
|
|
11
|
+
requests: Vellum.GenerateRequest[];
|
|
12
|
+
/** Additional configuration that can be used to control what's included in the response. */
|
|
13
|
+
options?: Vellum.GenerateOptionsRequest;
|
|
14
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { GenerateBodyRequest } from "./GenerateBodyRequest";
|
|
2
|
+
export { GenerateStreamBodyRequest } from "./GenerateStreamBodyRequest";
|
|
1
3
|
export { SearchRequestBodyRequest } from "./SearchRequestBodyRequest";
|
|
2
4
|
export { SubmitCompletionActualsRequest } from "./SubmitCompletionActualsRequest";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Vellum from "../../..";
|
|
7
|
+
export declare namespace Deployments {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare class Deployments {
|
|
14
|
+
protected readonly options: Deployments.Options;
|
|
15
|
+
constructor(options: Deployments.Options);
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
|
|
19
|
+
*
|
|
20
|
+
* Used to retrieve a deployment given its ID or name.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
retrieve(id: string): Promise<Vellum.DeploymentRead>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.Deployments = void 0;
|
|
33
|
+
const environments = __importStar(require("../../../../environments"));
|
|
34
|
+
const core = __importStar(require("../../../../core"));
|
|
35
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
36
|
+
const serializers = __importStar(require("../../../../serialization"));
|
|
37
|
+
const errors = __importStar(require("../../../../errors"));
|
|
38
|
+
class Deployments {
|
|
39
|
+
options;
|
|
40
|
+
constructor(options) {
|
|
41
|
+
this.options = options;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
|
|
46
|
+
*
|
|
47
|
+
* Used to retrieve a deployment given its ID or name.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
async retrieve(id) {
|
|
51
|
+
const _response = await core.fetcher({
|
|
52
|
+
url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, `v1/deployments/${id}`),
|
|
53
|
+
method: "GET",
|
|
54
|
+
headers: {
|
|
55
|
+
X_API_KEY: await core.Supplier.get(this.options.apiKey),
|
|
56
|
+
},
|
|
57
|
+
contentType: "application/json",
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return await serializers.DeploymentRead.parseOrThrow(_response.body, {
|
|
61
|
+
unrecognizedObjectKeys: "passthrough",
|
|
62
|
+
allowUnrecognizedUnionMembers: true,
|
|
63
|
+
allowUnrecognizedEnumValues: true,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (_response.error.reason === "status-code") {
|
|
67
|
+
throw new errors.VellumError({
|
|
68
|
+
statusCode: _response.error.statusCode,
|
|
69
|
+
body: _response.error.body,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
switch (_response.error.reason) {
|
|
73
|
+
case "non-json":
|
|
74
|
+
throw new errors.VellumError({
|
|
75
|
+
statusCode: _response.error.statusCode,
|
|
76
|
+
body: _response.error.rawBody,
|
|
77
|
+
});
|
|
78
|
+
case "timeout":
|
|
79
|
+
throw new errors.VellumTimeoutError();
|
|
80
|
+
case "unknown":
|
|
81
|
+
throw new errors.VellumError({
|
|
82
|
+
message: _response.error.errorMessage,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.Deployments = Deployments;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
package/api/resources/index.d.ts
CHANGED
package/api/resources/index.js
CHANGED
|
@@ -26,7 +26,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.testSuites = exports.sandboxes = exports.modelVersions = exports.documents = void 0;
|
|
29
|
+
exports.testSuites = exports.sandboxes = exports.modelVersions = exports.documents = exports.deployments = void 0;
|
|
30
|
+
exports.deployments = __importStar(require("./deployments"));
|
|
30
31
|
exports.documents = __importStar(require("./documents"));
|
|
31
32
|
exports.modelVersions = __importStar(require("./modelVersions"));
|
|
32
33
|
exports.sandboxes = __importStar(require("./sandboxes"));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Vellum from "..";
|
|
5
|
+
export interface DeploymentRead {
|
|
6
|
+
id: string;
|
|
7
|
+
created: string;
|
|
8
|
+
/** A human-readable label for the deployment */
|
|
9
|
+
label: string;
|
|
10
|
+
/** A name that uniquely identifies this deployment within its workspace */
|
|
11
|
+
name: string;
|
|
12
|
+
/** The current status of the deployment */
|
|
13
|
+
status?: Vellum.DeploymentReadStatusEnum;
|
|
14
|
+
/** The environment this deployment is used in */
|
|
15
|
+
environment?: Vellum.EnvironmentEnum;
|
|
16
|
+
/** The type of model this deployment serves */
|
|
17
|
+
modelType: Vellum.ModelTypeEnum;
|
|
18
|
+
activeModelVersionIds: string[];
|
|
19
|
+
lastDeployedOn: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type DeploymentReadStatusEnum = "ACTIVE" | "INACTIVE" | "ARCHIVED";
|
|
5
|
+
export declare const DeploymentReadStatusEnum: {
|
|
6
|
+
readonly Active: "ACTIVE";
|
|
7
|
+
readonly Inactive: "INACTIVE";
|
|
8
|
+
readonly Archived: "ARCHIVED";
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DeploymentReadStatusEnum = void 0;
|
|
7
|
+
exports.DeploymentReadStatusEnum = {
|
|
8
|
+
Active: "ACTIVE",
|
|
9
|
+
Inactive: "INACTIVE",
|
|
10
|
+
Archived: "ARCHIVED",
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type EnvironmentEnum = "DEVELOPMENT" | "STAGING" | "PRODUCTION";
|
|
5
|
+
export declare const EnvironmentEnum: {
|
|
6
|
+
readonly Development: "DEVELOPMENT";
|
|
7
|
+
readonly Staging: "STAGING";
|
|
8
|
+
readonly Production: "PRODUCTION";
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EnvironmentEnum = void 0;
|
|
7
|
+
exports.EnvironmentEnum = {
|
|
8
|
+
Development: "DEVELOPMENT",
|
|
9
|
+
Staging: "STAGING",
|
|
10
|
+
Production: "PRODUCTION",
|
|
11
|
+
};
|
|
@@ -5,7 +5,7 @@ export interface ModelVersionSandboxSnapshot {
|
|
|
5
5
|
/** The ID of the sandbox snapshot. */
|
|
6
6
|
id: string;
|
|
7
7
|
/** The index of the prompt in the sandbox snapshot. */
|
|
8
|
-
promptIndex
|
|
8
|
+
promptIndex?: number;
|
|
9
9
|
/** The id of the prompt in the sandbox snapshot. */
|
|
10
10
|
promptId?: string;
|
|
11
11
|
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export * from "./GenerateBodyRequest";
|
|
2
1
|
export * from "./BlockTypeEnum";
|
|
3
2
|
export * from "./ChatMessage";
|
|
4
3
|
export * from "./ChatMessageRequest";
|
|
5
4
|
export * from "./ChatMessageRole";
|
|
5
|
+
export * from "./DeploymentRead";
|
|
6
|
+
export * from "./DeploymentReadStatusEnum";
|
|
6
7
|
export * from "./Document";
|
|
7
8
|
export * from "./DocumentDocumentToDocumentIndex";
|
|
8
9
|
export * from "./EnrichedNormalizedCompletion";
|
|
10
|
+
export * from "./EnvironmentEnum";
|
|
9
11
|
export * from "./EvaluationParams";
|
|
10
12
|
export * from "./EvaluationParamsRequest";
|
|
11
13
|
export * from "./FinishReasonEnum";
|
package/api/types/index.js
CHANGED
|
@@ -14,14 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./GenerateBodyRequest"), exports);
|
|
18
17
|
__exportStar(require("./BlockTypeEnum"), exports);
|
|
19
18
|
__exportStar(require("./ChatMessage"), exports);
|
|
20
19
|
__exportStar(require("./ChatMessageRequest"), exports);
|
|
21
20
|
__exportStar(require("./ChatMessageRole"), exports);
|
|
21
|
+
__exportStar(require("./DeploymentRead"), exports);
|
|
22
|
+
__exportStar(require("./DeploymentReadStatusEnum"), exports);
|
|
22
23
|
__exportStar(require("./Document"), exports);
|
|
23
24
|
__exportStar(require("./DocumentDocumentToDocumentIndex"), exports);
|
|
24
25
|
__exportStar(require("./EnrichedNormalizedCompletion"), exports);
|
|
26
|
+
__exportStar(require("./EnvironmentEnum"), exports);
|
|
25
27
|
__exportStar(require("./EvaluationParams"), exports);
|
|
26
28
|
__exportStar(require("./EvaluationParamsRequest"), exports);
|
|
27
29
|
__exportStar(require("./FinishReasonEnum"), exports);
|
package/dist/Client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
6
|
import * as Vellum from "./api";
|
|
7
|
+
import { Deployments } from "./api/resources/deployments/client/Client";
|
|
7
8
|
import { Documents } from "./api/resources/documents/client/Client";
|
|
8
9
|
import { ModelVersions } from "./api/resources/modelVersions/client/Client";
|
|
9
10
|
import { Sandboxes } from "./api/resources/sandboxes/client/Client";
|
|
@@ -29,11 +30,16 @@ export declare class VellumClient {
|
|
|
29
30
|
*/
|
|
30
31
|
generate(request: Vellum.GenerateBodyRequest): Promise<Vellum.GenerateResponse>;
|
|
31
32
|
/**
|
|
33
|
+
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
34
|
+
*
|
|
35
|
+
* Generate a stream of completions using a previously defined deployment.
|
|
36
|
+
*
|
|
37
|
+
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
32
38
|
* @throws {Vellum.BadRequestError}
|
|
33
39
|
* @throws {Vellum.NotFoundError}
|
|
34
40
|
* @throws {Vellum.InternalServerError}
|
|
35
41
|
*/
|
|
36
|
-
generateStream(request: Vellum.
|
|
42
|
+
generateStream(request: Vellum.GenerateStreamBodyRequest, cb: (data: Vellum.GenerateStreamResponse) => void, opts?: Pick<core.StreamingFetcher.Args, "onError" | "onFinish" | "abortController" | "timeoutMs">): Promise<void>;
|
|
37
43
|
/**
|
|
38
44
|
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
39
45
|
*
|
|
@@ -56,6 +62,8 @@ export declare class VellumClient {
|
|
|
56
62
|
* @throws {Vellum.InternalServerError}
|
|
57
63
|
*/
|
|
58
64
|
submitCompletionActuals(request: Vellum.SubmitCompletionActualsRequest): Promise<void>;
|
|
65
|
+
protected _deployments: Deployments | undefined;
|
|
66
|
+
get deployments(): Deployments;
|
|
59
67
|
protected _documents: Documents | undefined;
|
|
60
68
|
get documents(): Documents;
|
|
61
69
|
protected _modelVersions: ModelVersions | undefined;
|
package/dist/Client.js
CHANGED
|
@@ -36,10 +36,11 @@ const Vellum = __importStar(require("./api"));
|
|
|
36
36
|
const url_join_1 = __importDefault(require("url-join"));
|
|
37
37
|
const serializers = __importStar(require("./serialization"));
|
|
38
38
|
const errors = __importStar(require("./errors"));
|
|
39
|
-
const Client_1 = require("./api/resources/
|
|
40
|
-
const Client_2 = require("./api/resources/
|
|
41
|
-
const Client_3 = require("./api/resources/
|
|
42
|
-
const Client_4 = require("./api/resources/
|
|
39
|
+
const Client_1 = require("./api/resources/deployments/client/Client");
|
|
40
|
+
const Client_2 = require("./api/resources/documents/client/Client");
|
|
41
|
+
const Client_3 = require("./api/resources/modelVersions/client/Client");
|
|
42
|
+
const Client_4 = require("./api/resources/sandboxes/client/Client");
|
|
43
|
+
const Client_5 = require("./api/resources/testSuites/client/Client");
|
|
43
44
|
class VellumClient {
|
|
44
45
|
options;
|
|
45
46
|
constructor(options) {
|
|
@@ -102,6 +103,11 @@ class VellumClient {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
/**
|
|
106
|
+
* <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
|
|
107
|
+
*
|
|
108
|
+
* Generate a stream of completions using a previously defined deployment.
|
|
109
|
+
*
|
|
110
|
+
* **Note:** Uses a base url of `https://predict.vellum.ai`.
|
|
105
111
|
* @throws {Vellum.BadRequestError}
|
|
106
112
|
* @throws {Vellum.NotFoundError}
|
|
107
113
|
* @throws {Vellum.InternalServerError}
|
|
@@ -114,7 +120,7 @@ class VellumClient {
|
|
|
114
120
|
headers: {
|
|
115
121
|
X_API_KEY: await core.Supplier.get(this.options.apiKey),
|
|
116
122
|
},
|
|
117
|
-
body: await serializers.
|
|
123
|
+
body: await serializers.GenerateStreamBodyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
118
124
|
onData: _queue.wrap(async (data) => {
|
|
119
125
|
const parsed = await serializers.GenerateStreamResponse.parse(data, {
|
|
120
126
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -243,21 +249,25 @@ class VellumClient {
|
|
|
243
249
|
});
|
|
244
250
|
}
|
|
245
251
|
}
|
|
252
|
+
_deployments;
|
|
253
|
+
get deployments() {
|
|
254
|
+
return (this._deployments ??= new Client_1.Deployments(this.options));
|
|
255
|
+
}
|
|
246
256
|
_documents;
|
|
247
257
|
get documents() {
|
|
248
|
-
return (this._documents ??= new
|
|
258
|
+
return (this._documents ??= new Client_2.Documents(this.options));
|
|
249
259
|
}
|
|
250
260
|
_modelVersions;
|
|
251
261
|
get modelVersions() {
|
|
252
|
-
return (this._modelVersions ??= new
|
|
262
|
+
return (this._modelVersions ??= new Client_3.ModelVersions(this.options));
|
|
253
263
|
}
|
|
254
264
|
_sandboxes;
|
|
255
265
|
get sandboxes() {
|
|
256
|
-
return (this._sandboxes ??= new
|
|
266
|
+
return (this._sandboxes ??= new Client_4.Sandboxes(this.options));
|
|
257
267
|
}
|
|
258
268
|
_testSuites;
|
|
259
269
|
get testSuites() {
|
|
260
|
-
return (this._testSuites ??= new
|
|
270
|
+
return (this._testSuites ??= new Client_5.TestSuites(this.options));
|
|
261
271
|
}
|
|
262
272
|
}
|
|
263
273
|
exports.VellumClient = VellumClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Vellum from "
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface GenerateBodyRequest {
|
|
6
6
|
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
7
|
deploymentId?: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
|
+
export interface GenerateStreamBodyRequest {
|
|
6
|
+
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
|
+
deploymentId?: string;
|
|
8
|
+
/** The name of the deployment. Must provide either this or deployment_id. */
|
|
9
|
+
deploymentName?: string;
|
|
10
|
+
/** The generation requests to make. Supplying multiple will perform a bulk request to the LLM provided when possible. */
|
|
11
|
+
requests: Vellum.GenerateRequest[];
|
|
12
|
+
/** Additional configuration that can be used to control what's included in the response. */
|
|
13
|
+
options?: Vellum.GenerateOptionsRequest;
|
|
14
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { GenerateBodyRequest } from "./GenerateBodyRequest";
|
|
2
|
+
export { GenerateStreamBodyRequest } from "./GenerateStreamBodyRequest";
|
|
1
3
|
export { SearchRequestBodyRequest } from "./SearchRequestBodyRequest";
|
|
2
4
|
export { SubmitCompletionActualsRequest } from "./SubmitCompletionActualsRequest";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Vellum from "../../..";
|
|
7
|
+
export declare namespace Deployments {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
|
|
10
|
+
apiKey: core.Supplier<string>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare class Deployments {
|
|
14
|
+
protected readonly options: Deployments.Options;
|
|
15
|
+
constructor(options: Deployments.Options);
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
|
|
19
|
+
*
|
|
20
|
+
* Used to retrieve a deployment given its ID or name.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
retrieve(id: string): Promise<Vellum.DeploymentRead>;
|
|
24
|
+
}
|