vellum-ai 0.0.3 → 0.0.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 +1 -1
- package/README.md +5 -2
- package/api/client/requests/GenerateBodyRequest.d.ts +1 -1
- package/api/client/requests/SearchRequestBodyRequest.d.ts +1 -1
- package/api/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/api/resources/documents/client/Client.d.ts +1 -1
- package/api/resources/documents/client/Client.js +11 -5
- package/api/resources/documents/client/requests/UploadDocumentBodyRequest.d.ts +3 -3
- package/api/resources/modelVersions/client/Client.d.ts +1 -1
- package/api/types/ChatMessageRequest.d.ts +8 -0
- package/api/types/ChatMessageRequest.js +5 -0
- package/api/types/{ChatRoleEnum.d.ts → ChatMessageRole.d.ts} +2 -2
- package/api/types/{ChatRoleEnum.js → ChatMessageRole.js} +2 -2
- package/api/types/DocumentDocumentToDocumentIndex.d.ts +1 -1
- package/api/types/EnrichedNormalizedCompletion.d.ts +2 -2
- package/api/types/GenerateOptionsRequest.d.ts +1 -1
- package/api/types/GenerateRequest.d.ts +3 -0
- package/api/types/GenerateResponse.d.ts +1 -1
- package/api/types/GenerateResult.d.ts +1 -1
- package/api/types/GenerateResultData.d.ts +1 -1
- package/api/types/ModelVersionBuildConfig.d.ts +1 -1
- package/api/types/ModelVersionExecConfigParameters.d.ts +1 -1
- package/api/types/ModelVersionExecConfigRead.d.ts +1 -1
- package/api/types/ModelVersionRead.d.ts +1 -1
- package/api/types/NormalizedLogProbs.d.ts +2 -2
- package/api/types/NormalizedTokenLogProbs.d.ts +2 -2
- package/api/types/PaginatedSlimDocumentList.d.ts +1 -1
- package/api/types/PromptTemplateBlock.d.ts +1 -1
- package/api/types/PromptTemplateBlockData.d.ts +1 -1
- package/api/types/PromptTemplateBlockProperties.d.ts +2 -2
- package/api/types/SearchRequestOptionsRequest.d.ts +1 -1
- package/api/types/SearchResponse.d.ts +1 -1
- package/api/types/SearchResult.d.ts +1 -1
- package/api/types/SlimDocument.d.ts +1 -1
- package/api/types/index.d.ts +2 -1
- package/api/types/index.js +2 -1
- package/core/fetcher/Fetcher.js +1 -1
- package/dist/Client.d.ts +1 -1
- package/dist/api/client/requests/GenerateBodyRequest.d.ts +1 -1
- package/dist/api/client/requests/SearchRequestBodyRequest.d.ts +1 -1
- package/dist/api/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/dist/api/resources/documents/client/Client.d.ts +1 -1
- package/dist/api/resources/documents/client/Client.js +11 -5
- package/dist/api/resources/documents/client/requests/UploadDocumentBodyRequest.d.ts +3 -3
- package/dist/api/resources/modelVersions/client/Client.d.ts +1 -1
- package/dist/api/types/ChatMessageRequest.d.ts +8 -0
- package/dist/api/types/ChatMessageRequest.js +5 -0
- package/dist/api/types/{ChatRoleEnum.d.ts → ChatMessageRole.d.ts} +2 -2
- package/dist/api/types/{ChatRoleEnum.js → ChatMessageRole.js} +2 -2
- package/dist/api/types/DocumentDocumentToDocumentIndex.d.ts +1 -1
- package/dist/api/types/EnrichedNormalizedCompletion.d.ts +2 -2
- package/dist/api/types/GenerateOptionsRequest.d.ts +1 -1
- package/dist/api/types/GenerateRequest.d.ts +3 -0
- package/dist/api/types/GenerateResponse.d.ts +1 -1
- package/dist/api/types/GenerateResult.d.ts +1 -1
- package/dist/api/types/GenerateResultData.d.ts +1 -1
- package/dist/api/types/ModelVersionBuildConfig.d.ts +1 -1
- package/dist/api/types/ModelVersionExecConfigParameters.d.ts +1 -1
- package/dist/api/types/ModelVersionExecConfigRead.d.ts +1 -1
- package/dist/api/types/ModelVersionRead.d.ts +1 -1
- package/dist/api/types/NormalizedLogProbs.d.ts +2 -2
- package/dist/api/types/NormalizedTokenLogProbs.d.ts +2 -2
- package/dist/api/types/PaginatedSlimDocumentList.d.ts +1 -1
- package/dist/api/types/PromptTemplateBlock.d.ts +1 -1
- package/dist/api/types/PromptTemplateBlockData.d.ts +1 -1
- package/dist/api/types/PromptTemplateBlockProperties.d.ts +2 -2
- package/dist/api/types/SearchRequestOptionsRequest.d.ts +1 -1
- package/dist/api/types/SearchResponse.d.ts +1 -1
- package/dist/api/types/SearchResult.d.ts +1 -1
- package/dist/api/types/SlimDocument.d.ts +1 -1
- package/dist/api/types/index.d.ts +2 -1
- package/dist/api/types/index.js +2 -1
- package/dist/core/fetcher/Fetcher.js +1 -1
- package/dist/serialization/client/requests/GenerateBodyRequest.d.ts +1 -1
- package/dist/serialization/client/requests/SearchRequestBodyRequest.d.ts +1 -1
- package/dist/serialization/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/dist/serialization/types/BlockTypeEnum.d.ts +1 -1
- package/dist/serialization/types/ChatMessageRequest.d.ts +13 -0
- package/dist/serialization/types/ChatMessageRequest.js +34 -0
- package/dist/serialization/types/ChatMessageRole.d.ts +10 -0
- package/dist/serialization/types/{ChatRoleEnum.js → ChatMessageRole.js} +2 -2
- package/dist/serialization/types/Document.d.ts +1 -1
- package/dist/serialization/types/DocumentDocumentToDocumentIndex.d.ts +1 -1
- package/dist/serialization/types/EnrichedNormalizedCompletion.d.ts +2 -2
- package/dist/serialization/types/EnrichedNormalizedCompletion.js +1 -1
- package/dist/serialization/types/FinishReasonEnum.d.ts +1 -1
- package/dist/serialization/types/GenerateErrorResponse.d.ts +1 -1
- package/dist/serialization/types/GenerateOptionsRequest.d.ts +1 -1
- package/dist/serialization/types/GenerateRequest.d.ts +2 -1
- package/dist/serialization/types/GenerateRequest.js +3 -0
- package/dist/serialization/types/GenerateResponse.d.ts +1 -1
- package/dist/serialization/types/GenerateResult.d.ts +1 -1
- package/dist/serialization/types/GenerateResultData.d.ts +1 -1
- package/dist/serialization/types/GenerateResultError.d.ts +1 -1
- package/dist/serialization/types/IndexingStateEnum.d.ts +1 -1
- package/dist/serialization/types/LogprobsEnum.d.ts +1 -1
- package/dist/serialization/types/ModelTypeEnum.d.ts +1 -1
- package/dist/serialization/types/ModelVersionBuildConfig.d.ts +1 -1
- package/dist/serialization/types/ModelVersionExecConfigParameters.d.ts +2 -2
- package/dist/serialization/types/ModelVersionExecConfigParameters.js +1 -1
- package/dist/serialization/types/ModelVersionExecConfigRead.d.ts +1 -1
- package/dist/serialization/types/ModelVersionRead.d.ts +1 -1
- package/dist/serialization/types/ModelVersionReadStatusEnum.d.ts +1 -1
- package/dist/serialization/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/dist/serialization/types/NormalizedLogProbs.d.ts +2 -2
- package/dist/serialization/types/NormalizedLogProbs.js +1 -1
- package/dist/serialization/types/NormalizedTokenLogProbs.d.ts +3 -3
- package/dist/serialization/types/NormalizedTokenLogProbs.js +2 -2
- package/dist/serialization/types/PaginatedSlimDocumentList.d.ts +1 -1
- package/dist/serialization/types/ProcessingStateEnum.d.ts +1 -1
- package/dist/serialization/types/PromptTemplateBlock.d.ts +1 -1
- package/dist/serialization/types/PromptTemplateBlockData.d.ts +1 -1
- package/dist/serialization/types/PromptTemplateBlockProperties.d.ts +2 -2
- package/dist/serialization/types/PromptTemplateBlockProperties.js +1 -1
- package/dist/serialization/types/ProviderEnum.d.ts +1 -1
- package/dist/serialization/types/SearchErrorResponse.d.ts +1 -1
- package/dist/serialization/types/SearchFiltersRequest.d.ts +1 -1
- package/dist/serialization/types/SearchRequestOptionsRequest.d.ts +1 -1
- package/dist/serialization/types/SearchResponse.d.ts +1 -1
- package/dist/serialization/types/SearchResult.d.ts +1 -1
- package/dist/serialization/types/SearchResultMergingRequest.d.ts +1 -1
- package/dist/serialization/types/SearchWeightsRequest.d.ts +1 -1
- package/dist/serialization/types/SlimDocument.d.ts +1 -1
- package/dist/serialization/types/SlimDocumentStatusEnum.d.ts +1 -1
- package/dist/serialization/types/SubmitCompletionActualRequest.d.ts +1 -1
- package/dist/serialization/types/SubmitCompletionActualsErrorResponse.d.ts +1 -1
- package/dist/serialization/types/UploadDocumentErrorResponse.d.ts +1 -1
- package/dist/serialization/types/UploadDocumentResponse.d.ts +1 -1
- package/dist/serialization/types/index.d.ts +2 -1
- package/dist/serialization/types/index.js +2 -1
- package/package.json +2 -3
- package/serialization/client/requests/GenerateBodyRequest.d.ts +1 -1
- package/serialization/client/requests/SearchRequestBodyRequest.d.ts +1 -1
- package/serialization/client/requests/SubmitCompletionActualsRequest.d.ts +1 -1
- package/serialization/types/BlockTypeEnum.d.ts +1 -1
- package/serialization/types/ChatMessageRequest.d.ts +13 -0
- package/serialization/types/ChatMessageRequest.js +34 -0
- package/serialization/types/ChatMessageRole.d.ts +10 -0
- package/serialization/types/{ChatRoleEnum.js → ChatMessageRole.js} +2 -2
- package/serialization/types/Document.d.ts +1 -1
- package/serialization/types/DocumentDocumentToDocumentIndex.d.ts +1 -1
- package/serialization/types/EnrichedNormalizedCompletion.d.ts +2 -2
- package/serialization/types/EnrichedNormalizedCompletion.js +1 -1
- package/serialization/types/FinishReasonEnum.d.ts +1 -1
- package/serialization/types/GenerateErrorResponse.d.ts +1 -1
- package/serialization/types/GenerateOptionsRequest.d.ts +1 -1
- package/serialization/types/GenerateRequest.d.ts +2 -1
- package/serialization/types/GenerateRequest.js +3 -0
- package/serialization/types/GenerateResponse.d.ts +1 -1
- package/serialization/types/GenerateResult.d.ts +1 -1
- package/serialization/types/GenerateResultData.d.ts +1 -1
- package/serialization/types/GenerateResultError.d.ts +1 -1
- package/serialization/types/IndexingStateEnum.d.ts +1 -1
- package/serialization/types/LogprobsEnum.d.ts +1 -1
- package/serialization/types/ModelTypeEnum.d.ts +1 -1
- package/serialization/types/ModelVersionBuildConfig.d.ts +1 -1
- package/serialization/types/ModelVersionExecConfigParameters.d.ts +2 -2
- package/serialization/types/ModelVersionExecConfigParameters.js +1 -1
- package/serialization/types/ModelVersionExecConfigRead.d.ts +1 -1
- package/serialization/types/ModelVersionRead.d.ts +1 -1
- package/serialization/types/ModelVersionReadStatusEnum.d.ts +1 -1
- package/serialization/types/ModelVersionSandboxSnapshot.d.ts +1 -1
- package/serialization/types/NormalizedLogProbs.d.ts +2 -2
- package/serialization/types/NormalizedLogProbs.js +1 -1
- package/serialization/types/NormalizedTokenLogProbs.d.ts +3 -3
- package/serialization/types/NormalizedTokenLogProbs.js +2 -2
- package/serialization/types/PaginatedSlimDocumentList.d.ts +1 -1
- package/serialization/types/ProcessingStateEnum.d.ts +1 -1
- package/serialization/types/PromptTemplateBlock.d.ts +1 -1
- package/serialization/types/PromptTemplateBlockData.d.ts +1 -1
- package/serialization/types/PromptTemplateBlockProperties.d.ts +2 -2
- package/serialization/types/PromptTemplateBlockProperties.js +1 -1
- package/serialization/types/ProviderEnum.d.ts +1 -1
- package/serialization/types/SearchErrorResponse.d.ts +1 -1
- package/serialization/types/SearchFiltersRequest.d.ts +1 -1
- package/serialization/types/SearchRequestOptionsRequest.d.ts +1 -1
- package/serialization/types/SearchResponse.d.ts +1 -1
- package/serialization/types/SearchResult.d.ts +1 -1
- package/serialization/types/SearchResultMergingRequest.d.ts +1 -1
- package/serialization/types/SearchWeightsRequest.d.ts +1 -1
- package/serialization/types/SlimDocument.d.ts +1 -1
- package/serialization/types/SlimDocumentStatusEnum.d.ts +1 -1
- package/serialization/types/SubmitCompletionActualRequest.d.ts +1 -1
- package/serialization/types/SubmitCompletionActualsErrorResponse.d.ts +1 -1
- package/serialization/types/UploadDocumentErrorResponse.d.ts +1 -1
- package/serialization/types/UploadDocumentResponse.d.ts +1 -1
- package/serialization/types/index.d.ts +2 -1
- package/serialization/types/index.js +2 -1
- package/dist/serialization/types/ChatRoleEnum.d.ts +0 -10
- package/serialization/types/ChatRoleEnum.d.ts +0 -10
package/Client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import
|
|
6
|
+
import * as Vellum from "./api";
|
|
7
7
|
import { Documents } from "./api/resources/documents/client/Client";
|
|
8
8
|
import { ModelVersions } from "./api/resources/modelVersions/client/Client";
|
|
9
9
|
export declare namespace VellumClient {
|
package/README.md
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
The Vellum Node.js library provides access to the Vellum API from JavaScript/TypeScript.
|
|
7
7
|
|
|
8
|
+
## API Docs
|
|
9
|
+
You can find Vellum's complete API docs at [docs.vellum.ai](https://docs.vellum.ai).
|
|
10
|
+
|
|
8
11
|
|
|
9
12
|
## Installation
|
|
10
13
|
|
|
@@ -19,7 +22,7 @@ yarn add vellum-ai
|
|
|
19
22
|
[](https://stackblitz.com/edit/typescript-example-using-sdk-built-with-fern-xbs4jx?file=app.ts)
|
|
20
23
|
|
|
21
24
|
```typescript
|
|
22
|
-
import { VellumClient } from '
|
|
25
|
+
import { VellumClient } from 'vellum-ai';
|
|
23
26
|
|
|
24
27
|
const vellum = new VellumClient({
|
|
25
28
|
apiKey: 'VELLUM_API_KEY',
|
|
@@ -39,7 +42,7 @@ Documents can be uploaded to Vellum via either the UI or this API. Once uploaded
|
|
|
39
42
|
```typescript
|
|
40
43
|
import * as fs from 'fs';
|
|
41
44
|
|
|
42
|
-
await vellum.
|
|
45
|
+
await vellum.documents.upload(fs.createReadStream('/path/to/your/file.txt'), {
|
|
43
46
|
addToIndexNames: ['<your-index-name>'],
|
|
44
47
|
externalId: '<your-external-id>',
|
|
45
48
|
label: 'Human-friendly label for your document',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface SearchRequestBodyRequest {
|
|
6
6
|
/** The ID of the index to search against. Must provide either this or index_name. */
|
|
7
7
|
indexId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface SubmitCompletionActualsRequest {
|
|
6
6
|
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
7
|
deploymentId?: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
import * as environments from "../../../../environments";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
import
|
|
7
|
+
import * as Vellum from "../../..";
|
|
8
8
|
import * as fs from "fs";
|
|
9
9
|
export declare namespace Documents {
|
|
10
10
|
interface Options {
|
|
@@ -95,14 +95,20 @@ class Documents {
|
|
|
95
95
|
}
|
|
96
96
|
async upload(contents, request) {
|
|
97
97
|
const _request = new form_data_1.default();
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
if (request.addToIndexNames != null) {
|
|
99
|
+
for (const _item of request.addToIndexNames) {
|
|
100
|
+
_request.append("add_to_index_names", _item);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (request.externalId != null) {
|
|
104
|
+
_request.append("external_id", request.externalId);
|
|
100
105
|
}
|
|
101
|
-
_request.append("external_id", request.externalId);
|
|
102
106
|
_request.append("label", request.label);
|
|
103
107
|
_request.append("contents", contents);
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (request.keywords != null) {
|
|
109
|
+
for (const _item of request.keywords) {
|
|
110
|
+
_request.append("keywords", _item);
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
const _response = await core.fetcher({
|
|
108
114
|
url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).documents, "v1/upload-document"),
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface UploadDocumentBodyRequest {
|
|
5
5
|
/** Optionally include the names of all indexes that you'd like this document to be included in */
|
|
6
|
-
addToIndexNames
|
|
6
|
+
addToIndexNames?: string[];
|
|
7
7
|
/** Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed. */
|
|
8
|
-
externalId
|
|
8
|
+
externalId?: string;
|
|
9
9
|
/** A human-friendly name for this document. Typically the filename. */
|
|
10
10
|
label: string;
|
|
11
11
|
/** Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches. */
|
|
12
|
-
keywords
|
|
12
|
+
keywords?: string[];
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
import
|
|
6
|
+
import * as Vellum from "../../..";
|
|
7
7
|
export declare namespace ModelVersions {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export declare type
|
|
5
|
-
export declare const
|
|
4
|
+
export declare type ChatMessageRole = "SYSTEM" | "ASSISTANT" | "USER";
|
|
5
|
+
export declare const ChatMessageRole: {
|
|
6
6
|
readonly System: "SYSTEM";
|
|
7
7
|
readonly Assistant: "ASSISTANT";
|
|
8
8
|
readonly User: "USER";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.ChatMessageRole = void 0;
|
|
7
|
+
exports.ChatMessageRole = {
|
|
8
8
|
System: "SYSTEM",
|
|
9
9
|
Assistant: "ASSISTANT",
|
|
10
10
|
User: "USER",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface DocumentDocumentToDocumentIndex {
|
|
6
6
|
/** Vellum-generated ID that uniquely identifies this link. */
|
|
7
7
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface EnrichedNormalizedCompletion {
|
|
6
6
|
/** The Vellum-generated ID of the completion. */
|
|
7
7
|
id: string;
|
|
@@ -10,7 +10,7 @@ export interface EnrichedNormalizedCompletion {
|
|
|
10
10
|
/** The text generated by the LLM. */
|
|
11
11
|
text: string;
|
|
12
12
|
/** The reason the generation finished. */
|
|
13
|
-
finishReason
|
|
13
|
+
finishReason?: Vellum.FinishReasonEnum;
|
|
14
14
|
/** The logprobs of the completion. Only present if specified in the original request options. */
|
|
15
15
|
logprobs?: Vellum.NormalizedLogProbs;
|
|
16
16
|
/** The ID of the model version used to generate this completion. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface GenerateOptionsRequest {
|
|
6
6
|
/** Which logprobs to include, if any. Defaults to NONE. */
|
|
7
7
|
logprobs?: Vellum.LogprobsEnum;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Vellum from "..";
|
|
4
5
|
export interface GenerateRequest {
|
|
5
6
|
/** Key/value pairs for each template variable defined in the deployment's prompt. */
|
|
6
7
|
inputValues: Record<string, unknown>;
|
|
8
|
+
/** Optionally provide a list of chat messages that'll be used in place of the special {$chat_history} variable, if included in the prompt. */
|
|
9
|
+
chatHistory?: Vellum.ChatMessageRequest[];
|
|
7
10
|
/** Optionally include a unique identifier for each generation, as represented outside of Vellum. Note that this should generally be a list of length one. */
|
|
8
11
|
externalIds?: string[];
|
|
9
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface GenerateResult {
|
|
6
6
|
/** An object containing the resulting generation. This key will be absent if the LLM provider experienced an error. */
|
|
7
7
|
data?: Vellum.GenerateResultData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface GenerateResultData {
|
|
6
6
|
/** The generated completions. This will generally be a list of length one. */
|
|
7
7
|
completions: Vellum.EnrichedNormalizedCompletion[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface ModelVersionBuildConfig {
|
|
6
6
|
/** The name of the base model used to create this model version, as identified by the LLM provider. */
|
|
7
7
|
baseModel: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface ModelVersionExecConfigRead {
|
|
6
6
|
/** The generation parameters that are passed to the LLM provider at runtime. */
|
|
7
7
|
parameters: Vellum.ModelVersionExecConfigParameters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface ModelVersionRead {
|
|
6
6
|
/** Vellum-generated ID that uniquely identifies this model version. */
|
|
7
7
|
id: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface NormalizedLogProbs {
|
|
6
6
|
tokens: Vellum.NormalizedTokenLogProbs[];
|
|
7
|
-
likelihood
|
|
7
|
+
likelihood?: number;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface PromptTemplateBlock {
|
|
6
6
|
blockType: Vellum.BlockTypeEnum;
|
|
7
7
|
properties: Vellum.PromptTemplateBlockProperties;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface PromptTemplateBlockProperties {
|
|
6
|
-
chatRole?: Vellum.
|
|
6
|
+
chatRole?: Vellum.ChatMessageRole;
|
|
7
7
|
text?: string;
|
|
8
8
|
variableName?: string;
|
|
9
9
|
blocks?: Record<string, unknown>[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface SearchResponse {
|
|
6
6
|
/** The results of the search. Each result represents a chunk that matches the search query. */
|
|
7
7
|
results: Vellum.SearchResult[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface SearchResult {
|
|
6
6
|
/** The document that contains the chunk that matched the search query. */
|
|
7
7
|
document: Vellum.Document;
|
package/api/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./BlockTypeEnum";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./ChatMessageRequest";
|
|
3
|
+
export * from "./ChatMessageRole";
|
|
3
4
|
export * from "./Document";
|
|
4
5
|
export * from "./DocumentDocumentToDocumentIndex";
|
|
5
6
|
export * from "./EnrichedNormalizedCompletion";
|
package/api/types/index.js
CHANGED
|
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BlockTypeEnum"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./ChatMessageRequest"), exports);
|
|
19
|
+
__exportStar(require("./ChatMessageRole"), exports);
|
|
19
20
|
__exportStar(require("./Document"), exports);
|
|
20
21
|
__exportStar(require("./DocumentDocumentToDocumentIndex"), exports);
|
|
21
22
|
__exportStar(require("./EnrichedNormalizedCompletion"), exports);
|
package/core/fetcher/Fetcher.js
CHANGED
package/dist/Client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import
|
|
6
|
+
import * as Vellum from "./api";
|
|
7
7
|
import { Documents } from "./api/resources/documents/client/Client";
|
|
8
8
|
import { ModelVersions } from "./api/resources/modelVersions/client/Client";
|
|
9
9
|
export declare namespace VellumClient {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface SearchRequestBodyRequest {
|
|
6
6
|
/** The ID of the index to search against. Must provide either this or index_name. */
|
|
7
7
|
indexId?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "../..";
|
|
5
5
|
export interface SubmitCompletionActualsRequest {
|
|
6
6
|
/** The ID of the deployment. Must provide either this or deployment_name. */
|
|
7
7
|
deploymentId?: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/// <reference types="node" />
|
|
5
5
|
import * as environments from "../../../../environments";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
import
|
|
7
|
+
import * as Vellum from "../../..";
|
|
8
8
|
import * as fs from "fs";
|
|
9
9
|
export declare namespace Documents {
|
|
10
10
|
interface Options {
|
|
@@ -95,14 +95,20 @@ class Documents {
|
|
|
95
95
|
}
|
|
96
96
|
async upload(contents, request) {
|
|
97
97
|
const _request = new form_data_1.default();
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
if (request.addToIndexNames != null) {
|
|
99
|
+
for (const _item of request.addToIndexNames) {
|
|
100
|
+
_request.append("add_to_index_names", _item);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (request.externalId != null) {
|
|
104
|
+
_request.append("external_id", request.externalId);
|
|
100
105
|
}
|
|
101
|
-
_request.append("external_id", request.externalId);
|
|
102
106
|
_request.append("label", request.label);
|
|
103
107
|
_request.append("contents", contents);
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (request.keywords != null) {
|
|
109
|
+
for (const _item of request.keywords) {
|
|
110
|
+
_request.append("keywords", _item);
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
const _response = await core.fetcher({
|
|
108
114
|
url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).documents, "v1/upload-document"),
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface UploadDocumentBodyRequest {
|
|
5
5
|
/** Optionally include the names of all indexes that you'd like this document to be included in */
|
|
6
|
-
addToIndexNames
|
|
6
|
+
addToIndexNames?: string[];
|
|
7
7
|
/** Optionally include an external ID for this document. This is useful if you want to re-upload the same document later when its contents change and would like it to be re-indexed. */
|
|
8
|
-
externalId
|
|
8
|
+
externalId?: string;
|
|
9
9
|
/** A human-friendly name for this document. Typically the filename. */
|
|
10
10
|
label: string;
|
|
11
11
|
/** Optionally include a list of keywords that'll be associated with this document. Used when performing keyword searches. */
|
|
12
|
-
keywords
|
|
12
|
+
keywords?: string[];
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
import
|
|
6
|
+
import * as Vellum from "../../..";
|
|
7
7
|
export declare namespace ModelVersions {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: environments.VellumEnvironment | environments.VellumEnvironmentUrls;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export declare type
|
|
5
|
-
export declare const
|
|
4
|
+
export declare type ChatMessageRole = "SYSTEM" | "ASSISTANT" | "USER";
|
|
5
|
+
export declare const ChatMessageRole: {
|
|
6
6
|
readonly System: "SYSTEM";
|
|
7
7
|
readonly Assistant: "ASSISTANT";
|
|
8
8
|
readonly User: "USER";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.ChatMessageRole = void 0;
|
|
7
|
+
exports.ChatMessageRole = {
|
|
8
8
|
System: "SYSTEM",
|
|
9
9
|
Assistant: "ASSISTANT",
|
|
10
10
|
User: "USER",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface DocumentDocumentToDocumentIndex {
|
|
6
6
|
/** Vellum-generated ID that uniquely identifies this link. */
|
|
7
7
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface EnrichedNormalizedCompletion {
|
|
6
6
|
/** The Vellum-generated ID of the completion. */
|
|
7
7
|
id: string;
|
|
@@ -10,7 +10,7 @@ export interface EnrichedNormalizedCompletion {
|
|
|
10
10
|
/** The text generated by the LLM. */
|
|
11
11
|
text: string;
|
|
12
12
|
/** The reason the generation finished. */
|
|
13
|
-
finishReason
|
|
13
|
+
finishReason?: Vellum.FinishReasonEnum;
|
|
14
14
|
/** The logprobs of the completion. Only present if specified in the original request options. */
|
|
15
15
|
logprobs?: Vellum.NormalizedLogProbs;
|
|
16
16
|
/** The ID of the model version used to generate this completion. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Vellum from "..";
|
|
5
5
|
export interface GenerateOptionsRequest {
|
|
6
6
|
/** Which logprobs to include, if any. Defaults to NONE. */
|
|
7
7
|
logprobs?: Vellum.LogprobsEnum;
|