vellum-ai 0.0.24 → 0.0.26

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.
Files changed (157) hide show
  1. package/Client.js +1 -1
  2. package/api/resources/documents/client/Client.d.ts +11 -0
  3. package/api/resources/documents/client/Client.js +58 -0
  4. package/api/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.d.ts +11 -0
  5. package/api/resources/documents/client/requests/index.d.ts +1 -0
  6. package/api/types/DeploymentRead.d.ts +1 -0
  7. package/api/types/InputVariable.d.ts +9 -0
  8. package/api/types/InputVariableType.d.ts +14 -0
  9. package/api/types/InputVariableType.js +11 -0
  10. package/api/types/MetadataFilterConfigRequest.d.ts +15 -0
  11. package/api/types/MetadataFilterRuleCombinator.d.ts +12 -0
  12. package/api/types/MetadataFilterRuleCombinator.js +10 -0
  13. package/api/types/MetadataFilterRuleRequest.d.ts +15 -0
  14. package/api/types/ModelVersionExecConfig.d.ts +2 -2
  15. package/api/types/PromptTemplateBlockProperties.d.ts +1 -0
  16. package/api/types/PromptTemplateBlockPropertiesRequest.d.ts +1 -0
  17. package/api/types/RegisterPromptPromptInfoRequest.d.ts +2 -2
  18. package/api/types/RegisteredPromptInputVariableRequest.d.ts +11 -0
  19. package/api/types/RegisteredPromptInputVariableRequest.js +5 -0
  20. package/api/types/SearchFiltersRequest.d.ts +3 -0
  21. package/api/types/SetDocumentMetadataErrorResponse.d.ts +6 -0
  22. package/api/types/SetDocumentMetadataErrorResponse.js +5 -0
  23. package/api/types/SetDocumentMetadataResponse.d.ts +7 -0
  24. package/api/types/SetDocumentMetadataResponse.js +5 -0
  25. package/api/types/WorkflowExecutionEventErrorCode.d.ts +3 -1
  26. package/api/types/WorkflowExecutionEventErrorCode.js +1 -0
  27. package/api/types/index.d.ts +8 -2
  28. package/api/types/index.js +8 -2
  29. package/dist/Client.js +1 -1
  30. package/dist/api/resources/documents/client/Client.d.ts +11 -0
  31. package/dist/api/resources/documents/client/Client.js +58 -0
  32. package/dist/api/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.d.ts +11 -0
  33. package/dist/api/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.js +5 -0
  34. package/dist/api/resources/documents/client/requests/index.d.ts +1 -0
  35. package/dist/api/types/DeploymentRead.d.ts +1 -0
  36. package/dist/api/types/InputVariable.d.ts +9 -0
  37. package/dist/api/types/InputVariable.js +5 -0
  38. package/dist/api/types/InputVariableType.d.ts +14 -0
  39. package/dist/api/types/InputVariableType.js +11 -0
  40. package/dist/api/types/MetadataFilterConfigRequest.d.ts +15 -0
  41. package/dist/api/types/MetadataFilterConfigRequest.js +5 -0
  42. package/dist/api/types/MetadataFilterRuleCombinator.d.ts +12 -0
  43. package/dist/api/types/MetadataFilterRuleCombinator.js +10 -0
  44. package/dist/api/types/MetadataFilterRuleRequest.d.ts +15 -0
  45. package/dist/api/types/MetadataFilterRuleRequest.js +5 -0
  46. package/dist/api/types/ModelVersionExecConfig.d.ts +2 -2
  47. package/dist/api/types/PromptTemplateBlockProperties.d.ts +1 -0
  48. package/dist/api/types/PromptTemplateBlockPropertiesRequest.d.ts +1 -0
  49. package/dist/api/types/RegisterPromptPromptInfoRequest.d.ts +2 -2
  50. package/dist/api/types/RegisteredPromptInputVariableRequest.d.ts +11 -0
  51. package/dist/api/types/RegisteredPromptInputVariableRequest.js +5 -0
  52. package/dist/api/types/SearchFiltersRequest.d.ts +3 -0
  53. package/dist/api/types/SetDocumentMetadataErrorResponse.d.ts +6 -0
  54. package/dist/api/types/SetDocumentMetadataErrorResponse.js +5 -0
  55. package/dist/api/types/SetDocumentMetadataResponse.d.ts +7 -0
  56. package/dist/api/types/SetDocumentMetadataResponse.js +5 -0
  57. package/dist/api/types/WorkflowExecutionEventErrorCode.d.ts +3 -1
  58. package/dist/api/types/WorkflowExecutionEventErrorCode.js +1 -0
  59. package/dist/api/types/index.d.ts +8 -2
  60. package/dist/api/types/index.js +8 -2
  61. package/dist/serialization/resources/documents/client/index.d.ts +1 -0
  62. package/dist/serialization/resources/documents/client/index.js +17 -0
  63. package/dist/serialization/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.d.ts +14 -0
  64. package/dist/serialization/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.js +35 -0
  65. package/dist/serialization/resources/documents/client/requests/index.d.ts +1 -0
  66. package/dist/serialization/resources/documents/client/requests/index.js +5 -0
  67. package/dist/serialization/resources/documents/index.d.ts +1 -0
  68. package/dist/serialization/resources/documents/index.js +17 -0
  69. package/dist/serialization/resources/index.d.ts +2 -0
  70. package/dist/serialization/resources/index.js +3 -1
  71. package/dist/serialization/types/DeploymentRead.d.ts +1 -0
  72. package/dist/serialization/types/DeploymentRead.js +1 -0
  73. package/dist/serialization/types/InputVariable.d.ts +14 -0
  74. package/dist/serialization/types/InputVariable.js +35 -0
  75. package/dist/serialization/types/InputVariableType.d.ts +10 -0
  76. package/dist/serialization/types/{PromptTemplateInputVariable.js → InputVariableType.js} +2 -4
  77. package/dist/serialization/types/MetadataFilterConfigRequest.d.ts +17 -0
  78. package/dist/serialization/types/MetadataFilterConfigRequest.js +40 -0
  79. package/dist/serialization/types/MetadataFilterRuleCombinator.d.ts +10 -0
  80. package/{serialization/types/PromptTemplateInputVariable.js → dist/serialization/types/MetadataFilterRuleCombinator.js} +2 -4
  81. package/dist/serialization/types/MetadataFilterRuleRequest.d.ts +17 -0
  82. package/dist/serialization/types/MetadataFilterRuleRequest.js +40 -0
  83. package/dist/serialization/types/ModelVersionExecConfig.d.ts +1 -1
  84. package/dist/serialization/types/ModelVersionExecConfig.js +1 -1
  85. package/dist/serialization/types/PromptTemplateBlockProperties.d.ts +1 -0
  86. package/dist/serialization/types/PromptTemplateBlockProperties.js +1 -0
  87. package/dist/serialization/types/PromptTemplateBlockPropertiesRequest.d.ts +1 -0
  88. package/dist/serialization/types/PromptTemplateBlockPropertiesRequest.js +1 -0
  89. package/dist/serialization/types/RegisterPromptPromptInfoRequest.d.ts +1 -1
  90. package/dist/serialization/types/RegisterPromptPromptInfoRequest.js +1 -1
  91. package/dist/serialization/types/RegisteredPromptInputVariableRequest.d.ts +14 -0
  92. package/dist/serialization/types/RegisteredPromptInputVariableRequest.js +35 -0
  93. package/dist/serialization/types/SearchFiltersRequest.d.ts +1 -0
  94. package/dist/serialization/types/SearchFiltersRequest.js +1 -0
  95. package/dist/serialization/types/SetDocumentMetadataErrorResponse.d.ts +12 -0
  96. package/dist/serialization/types/{PromptTemplateInputVariableRequest.js → SetDocumentMetadataErrorResponse.js} +3 -3
  97. package/dist/serialization/types/SetDocumentMetadataResponse.d.ts +12 -0
  98. package/dist/serialization/types/SetDocumentMetadataResponse.js +33 -0
  99. package/dist/serialization/types/WorkflowExecutionEventErrorCode.d.ts +1 -1
  100. package/dist/serialization/types/WorkflowExecutionEventErrorCode.js +1 -1
  101. package/dist/serialization/types/index.d.ts +8 -2
  102. package/dist/serialization/types/index.js +8 -2
  103. package/package.json +1 -1
  104. package/serialization/resources/documents/client/index.d.ts +1 -0
  105. package/serialization/resources/documents/client/index.js +17 -0
  106. package/serialization/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.d.ts +14 -0
  107. package/serialization/resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.js +35 -0
  108. package/serialization/resources/documents/client/requests/index.d.ts +1 -0
  109. package/serialization/resources/documents/client/requests/index.js +5 -0
  110. package/serialization/resources/documents/index.d.ts +1 -0
  111. package/serialization/resources/documents/index.js +17 -0
  112. package/serialization/resources/index.d.ts +2 -0
  113. package/serialization/resources/index.js +3 -1
  114. package/serialization/types/DeploymentRead.d.ts +1 -0
  115. package/serialization/types/DeploymentRead.js +1 -0
  116. package/serialization/types/InputVariable.d.ts +14 -0
  117. package/serialization/types/InputVariable.js +35 -0
  118. package/serialization/types/InputVariableType.d.ts +10 -0
  119. package/serialization/types/InputVariableType.js +31 -0
  120. package/serialization/types/MetadataFilterConfigRequest.d.ts +17 -0
  121. package/serialization/types/MetadataFilterConfigRequest.js +40 -0
  122. package/serialization/types/MetadataFilterRuleCombinator.d.ts +10 -0
  123. package/serialization/types/MetadataFilterRuleCombinator.js +31 -0
  124. package/serialization/types/MetadataFilterRuleRequest.d.ts +17 -0
  125. package/serialization/types/MetadataFilterRuleRequest.js +40 -0
  126. package/serialization/types/ModelVersionExecConfig.d.ts +1 -1
  127. package/serialization/types/ModelVersionExecConfig.js +1 -1
  128. package/serialization/types/PromptTemplateBlockProperties.d.ts +1 -0
  129. package/serialization/types/PromptTemplateBlockProperties.js +1 -0
  130. package/serialization/types/PromptTemplateBlockPropertiesRequest.d.ts +1 -0
  131. package/serialization/types/PromptTemplateBlockPropertiesRequest.js +1 -0
  132. package/serialization/types/RegisterPromptPromptInfoRequest.d.ts +1 -1
  133. package/serialization/types/RegisterPromptPromptInfoRequest.js +1 -1
  134. package/serialization/types/RegisteredPromptInputVariableRequest.d.ts +14 -0
  135. package/serialization/types/RegisteredPromptInputVariableRequest.js +35 -0
  136. package/serialization/types/SearchFiltersRequest.d.ts +1 -0
  137. package/serialization/types/SearchFiltersRequest.js +1 -0
  138. package/serialization/types/SetDocumentMetadataErrorResponse.d.ts +12 -0
  139. package/serialization/types/{PromptTemplateInputVariableRequest.js → SetDocumentMetadataErrorResponse.js} +3 -3
  140. package/serialization/types/SetDocumentMetadataResponse.d.ts +12 -0
  141. package/serialization/types/SetDocumentMetadataResponse.js +33 -0
  142. package/serialization/types/WorkflowExecutionEventErrorCode.d.ts +1 -1
  143. package/serialization/types/WorkflowExecutionEventErrorCode.js +1 -1
  144. package/serialization/types/index.d.ts +8 -2
  145. package/serialization/types/index.js +8 -2
  146. package/api/types/PromptTemplateInputVariable.d.ts +0 -7
  147. package/api/types/PromptTemplateInputVariableRequest.d.ts +0 -7
  148. package/dist/api/types/PromptTemplateInputVariable.d.ts +0 -7
  149. package/dist/api/types/PromptTemplateInputVariableRequest.d.ts +0 -7
  150. package/dist/serialization/types/PromptTemplateInputVariable.d.ts +0 -12
  151. package/dist/serialization/types/PromptTemplateInputVariableRequest.d.ts +0 -12
  152. package/serialization/types/PromptTemplateInputVariable.d.ts +0 -12
  153. package/serialization/types/PromptTemplateInputVariableRequest.d.ts +0 -12
  154. /package/api/{types/PromptTemplateInputVariable.js → resources/documents/client/requests/SetDocumentMetadataRequestBodyRequest.js} +0 -0
  155. /package/api/types/{PromptTemplateInputVariableRequest.js → InputVariable.js} +0 -0
  156. /package/{dist/api/types/PromptTemplateInputVariable.js → api/types/MetadataFilterConfigRequest.js} +0 -0
  157. /package/{dist/api/types/PromptTemplateInputVariableRequest.js → api/types/MetadataFilterRuleRequest.js} +0 -0
package/Client.js CHANGED
@@ -197,7 +197,7 @@ class VellumClient {
197
197
  */
198
198
  async search(request) {
199
199
  const _response = await core.fetcher({
200
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).predict, "v1/search"),
200
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, "v1/search"),
201
201
  method: "POST",
202
202
  headers: {
203
203
  X_API_KEY: await core.Supplier.get(this.options.apiKey),
@@ -23,6 +23,17 @@ export declare class Documents {
23
23
  *
24
24
  */
25
25
  list(request?: Vellum.DocumentsListRequest): Promise<Vellum.PaginatedSlimDocumentList>;
26
+ /**
27
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
28
+ *
29
+ * Set the metadata for a document to be used for search filtering.
30
+ *
31
+ * **Note:** Uses a base url of `https://documents.vellum.ai`.
32
+ * @throws {Vellum.BadRequestError}
33
+ * @throws {Vellum.NotFoundError}
34
+ * @throws {Vellum.InternalServerError}
35
+ */
36
+ setDocumentMetadata(request: Vellum.SetDocumentMetadataRequestBodyRequest): Promise<Vellum.SetDocumentMetadataResponse>;
26
37
  /**
27
38
  * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
28
39
  *
@@ -101,6 +101,64 @@ class Documents {
101
101
  });
102
102
  }
103
103
  }
104
+ /**
105
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
106
+ *
107
+ * Set the metadata for a document to be used for search filtering.
108
+ *
109
+ * **Note:** Uses a base url of `https://documents.vellum.ai`.
110
+ * @throws {Vellum.BadRequestError}
111
+ * @throws {Vellum.NotFoundError}
112
+ * @throws {Vellum.InternalServerError}
113
+ */
114
+ async setDocumentMetadata(request) {
115
+ const _response = await core.fetcher({
116
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).documents, "v1/set-document-metadata"),
117
+ method: "POST",
118
+ headers: {
119
+ X_API_KEY: await core.Supplier.get(this.options.apiKey),
120
+ },
121
+ contentType: "application/json",
122
+ body: await serializers.SetDocumentMetadataRequestBodyRequest.jsonOrThrow(request, {
123
+ unrecognizedObjectKeys: "strip",
124
+ }),
125
+ });
126
+ if (_response.ok) {
127
+ return await serializers.SetDocumentMetadataResponse.parseOrThrow(_response.body, {
128
+ unrecognizedObjectKeys: "passthrough",
129
+ allowUnrecognizedUnionMembers: true,
130
+ allowUnrecognizedEnumValues: true,
131
+ });
132
+ }
133
+ if (_response.error.reason === "status-code") {
134
+ switch (_response.error.statusCode) {
135
+ case 400:
136
+ throw new Vellum.BadRequestError(_response.error.body);
137
+ case 404:
138
+ throw new Vellum.NotFoundError(_response.error.body);
139
+ case 500:
140
+ throw new Vellum.InternalServerError(_response.error.body);
141
+ default:
142
+ throw new errors.VellumError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ });
146
+ }
147
+ }
148
+ switch (_response.error.reason) {
149
+ case "non-json":
150
+ throw new errors.VellumError({
151
+ statusCode: _response.error.statusCode,
152
+ body: _response.error.rawBody,
153
+ });
154
+ case "timeout":
155
+ throw new errors.VellumTimeoutError();
156
+ case "unknown":
157
+ throw new errors.VellumError({
158
+ message: _response.error.errorMessage,
159
+ });
160
+ }
161
+ }
104
162
  /**
105
163
  * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
106
164
  *
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SetDocumentMetadataRequestBodyRequest {
5
+ /** The ID of the document to update. Must provide either this or `external_id` */
6
+ documentId?: string;
7
+ /** The external ID of the document to update. Must provide either this or `document_id` */
8
+ externalId?: string;
9
+ /** The metadata to set on the document. This will overwrite any existing metadata. */
10
+ metadata: Record<string, unknown>;
11
+ }
@@ -1,2 +1,3 @@
1
1
  export { DocumentsListRequest } from "./DocumentsListRequest";
2
+ export { SetDocumentMetadataRequestBodyRequest } from "./SetDocumentMetadataRequestBodyRequest";
2
3
  export { UploadDocumentBodyRequest } from "./UploadDocumentBodyRequest";
@@ -34,4 +34,5 @@ export interface DeploymentRead {
34
34
  modelType: Vellum.ModelTypeEnum;
35
35
  activeModelVersionIds: string[];
36
36
  lastDeployedOn: string;
37
+ inputVariables: Vellum.InputVariable[];
37
38
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface InputVariable {
6
+ id: string;
7
+ key: string;
8
+ type: Vellum.InputVariableType;
9
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * * `STRING` - STRING
6
+ * * `JSON` - JSON
7
+ * * `CHAT_HISTORY` - CHAT_HISTORY
8
+ */
9
+ export declare type InputVariableType = "STRING" | "JSON" | "CHAT_HISTORY";
10
+ export declare const InputVariableType: {
11
+ readonly String: "STRING";
12
+ readonly Json: "JSON";
13
+ readonly ChatHistory: "CHAT_HISTORY";
14
+ };
@@ -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.InputVariableType = void 0;
7
+ exports.InputVariableType = {
8
+ String: "STRING",
9
+ Json: "JSON",
10
+ ChatHistory: "CHAT_HISTORY",
11
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface MetadataFilterConfigRequest {
6
+ combinator?: Vellum.MetadataFilterRuleCombinator;
7
+ negated?: boolean;
8
+ rules?: Vellum.MetadataFilterRuleRequest[];
9
+ /** <span style="white-space: nowrap">`non-empty`</span> */
10
+ field?: string;
11
+ /** <span style="white-space: nowrap">`non-empty`</span> */
12
+ operator?: string;
13
+ /** <span style="white-space: nowrap">`non-empty`</span> */
14
+ value?: string;
15
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * * `and` - AND
6
+ * * `or` - OR
7
+ */
8
+ export declare type MetadataFilterRuleCombinator = "and" | "or";
9
+ export declare const MetadataFilterRuleCombinator: {
10
+ readonly And: "and";
11
+ readonly Or: "or";
12
+ };
@@ -0,0 +1,10 @@
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.MetadataFilterRuleCombinator = void 0;
7
+ exports.MetadataFilterRuleCombinator = {
8
+ And: "and",
9
+ Or: "or",
10
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface MetadataFilterRuleRequest {
6
+ combinator?: Vellum.MetadataFilterRuleCombinator;
7
+ negated?: boolean;
8
+ rules?: Vellum.MetadataFilterRuleRequest[];
9
+ /** <span style="white-space: nowrap">`non-empty`</span> */
10
+ field?: string;
11
+ /** <span style="white-space: nowrap">`non-empty`</span> */
12
+ operator?: string;
13
+ /** <span style="white-space: nowrap">`non-empty`</span> */
14
+ value?: string;
15
+ }
@@ -5,8 +5,8 @@ import * as Vellum from "..";
5
5
  export interface ModelVersionExecConfig {
6
6
  /** The generation parameters that are passed to the LLM provider at runtime. */
7
7
  parameters: Vellum.ModelVersionExecConfigParameters;
8
- /** Names of the input variables specified in the prompt template. */
9
- inputVariables: Vellum.PromptTemplateInputVariable[];
8
+ /** Input variables specified in the prompt template. */
9
+ inputVariables: Vellum.InputVariable[];
10
10
  /** The template used to generate prompts for this model version. */
11
11
  promptTemplate?: string;
12
12
  promptBlockData?: Vellum.PromptTemplateBlockData;
@@ -10,5 +10,6 @@ export interface PromptTemplateBlockProperties {
10
10
  functionName?: string;
11
11
  functionDescription?: string;
12
12
  functionParameters?: Record<string, unknown>;
13
+ functionForced?: boolean;
13
14
  blocks?: Vellum.PromptTemplateBlock[];
14
15
  }
@@ -12,5 +12,6 @@ export interface PromptTemplateBlockPropertiesRequest {
12
12
  /** <span style="white-space: nowrap">`non-empty`</span> */
13
13
  functionDescription?: string;
14
14
  functionParameters?: Record<string, unknown>;
15
+ functionForced?: boolean;
15
16
  blocks?: Vellum.PromptTemplateBlockRequest[];
16
17
  }
@@ -5,6 +5,6 @@ import * as Vellum from "..";
5
5
  export interface RegisterPromptPromptInfoRequest {
6
6
  promptSyntaxVersion?: number;
7
7
  promptBlockData: Vellum.PromptTemplateBlockDataRequest;
8
- /** Names of the input variables specified in the prompt template. */
9
- inputVariables: Vellum.PromptTemplateInputVariableRequest[];
8
+ /** The input variables specified in the prompt template. */
9
+ inputVariables: Vellum.RegisteredPromptInputVariableRequest[];
10
10
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface RegisteredPromptInputVariableRequest {
6
+ /** <span style="white-space: nowrap">`non-empty`</span> */
7
+ key: string;
8
+ /** <span style="white-space: nowrap">`non-empty`</span> */
9
+ id?: string;
10
+ type?: Vellum.InputVariableType;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,10 @@
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 SearchFiltersRequest {
5
6
  /** The document external IDs to filter by */
6
7
  externalIds?: string[];
8
+ /** The metadata filters to apply to the search */
9
+ metadata?: Vellum.MetadataFilterConfigRequest;
7
10
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SetDocumentMetadataErrorResponse {
5
+ detail: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SetDocumentMetadataResponse {
5
+ /** The ID of the newly created document. */
6
+ documentId: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,9 +4,11 @@
4
4
  /**
5
5
  * * `WORKFLOW_INITIALIZATION` - WORKFLOW_INITIALIZATION
6
6
  * * `NODE_EXECUTION` - NODE_EXECUTION
7
+ * * `NODE_EXECUTION_COUNT_LIMIT_REACHED` - NODE_EXECUTION_COUNT_LIMIT_REACHED
7
8
  */
8
- export declare type WorkflowExecutionEventErrorCode = "WORKFLOW_INITIALIZATION" | "NODE_EXECUTION";
9
+ export declare type WorkflowExecutionEventErrorCode = "WORKFLOW_INITIALIZATION" | "NODE_EXECUTION" | "NODE_EXECUTION_COUNT_LIMIT_REACHED";
9
10
  export declare const WorkflowExecutionEventErrorCode: {
10
11
  readonly WorkflowInitialization: "WORKFLOW_INITIALIZATION";
11
12
  readonly NodeExecution: "NODE_EXECUTION";
13
+ readonly NodeExecutionCountLimitReached: "NODE_EXECUTION_COUNT_LIMIT_REACHED";
12
14
  };
@@ -7,4 +7,5 @@ exports.WorkflowExecutionEventErrorCode = void 0;
7
7
  exports.WorkflowExecutionEventErrorCode = {
8
8
  WorkflowInitialization: "WORKFLOW_INITIALIZATION",
9
9
  NodeExecution: "NODE_EXECUTION",
10
+ NodeExecutionCountLimitReached: "NODE_EXECUTION_COUNT_LIMIT_REACHED",
10
11
  };
@@ -30,7 +30,12 @@ export * from "./GenerateStreamResponse";
30
30
  export * from "./GenerateStreamResult";
31
31
  export * from "./GenerateStreamResultData";
32
32
  export * from "./IndexingStateEnum";
33
+ export * from "./InputVariable";
34
+ export * from "./InputVariableType";
33
35
  export * from "./LogprobsEnum";
36
+ export * from "./MetadataFilterConfigRequest";
37
+ export * from "./MetadataFilterRuleCombinator";
38
+ export * from "./MetadataFilterRuleRequest";
34
39
  export * from "./ModelTypeEnum";
35
40
  export * from "./ModelVersionBuildConfig";
36
41
  export * from "./ModelVersionCompilePromptResponse";
@@ -53,8 +58,6 @@ export * from "./PromptTemplateBlockDataRequest";
53
58
  export * from "./PromptTemplateBlockProperties";
54
59
  export * from "./PromptTemplateBlockPropertiesRequest";
55
60
  export * from "./PromptTemplateBlockRequest";
56
- export * from "./PromptTemplateInputVariable";
57
- export * from "./PromptTemplateInputVariableRequest";
58
61
  export * from "./ProviderEnum";
59
62
  export * from "./RegisterPromptErrorResponse";
60
63
  export * from "./RegisterPromptModelParametersRequest";
@@ -62,6 +65,7 @@ export * from "./RegisterPromptPrompt";
62
65
  export * from "./RegisterPromptPromptInfoRequest";
63
66
  export * from "./RegisterPromptResponse";
64
67
  export * from "./RegisteredPromptDeployment";
68
+ export * from "./RegisteredPromptInputVariableRequest";
65
69
  export * from "./RegisteredPromptModelVersion";
66
70
  export * from "./RegisteredPromptSandbox";
67
71
  export * from "./RegisteredPromptSandboxSnapshot";
@@ -82,6 +86,8 @@ export * from "./SearchResponse";
82
86
  export * from "./SearchResult";
83
87
  export * from "./SearchResultMergingRequest";
84
88
  export * from "./SearchWeightsRequest";
89
+ export * from "./SetDocumentMetadataErrorResponse";
90
+ export * from "./SetDocumentMetadataResponse";
85
91
  export * from "./SlimDocument";
86
92
  export * from "./SlimDocumentStatusEnum";
87
93
  export * from "./SubmitCompletionActualRequest";
@@ -46,7 +46,12 @@ __exportStar(require("./GenerateStreamResponse"), exports);
46
46
  __exportStar(require("./GenerateStreamResult"), exports);
47
47
  __exportStar(require("./GenerateStreamResultData"), exports);
48
48
  __exportStar(require("./IndexingStateEnum"), exports);
49
+ __exportStar(require("./InputVariable"), exports);
50
+ __exportStar(require("./InputVariableType"), exports);
49
51
  __exportStar(require("./LogprobsEnum"), exports);
52
+ __exportStar(require("./MetadataFilterConfigRequest"), exports);
53
+ __exportStar(require("./MetadataFilterRuleCombinator"), exports);
54
+ __exportStar(require("./MetadataFilterRuleRequest"), exports);
50
55
  __exportStar(require("./ModelTypeEnum"), exports);
51
56
  __exportStar(require("./ModelVersionBuildConfig"), exports);
52
57
  __exportStar(require("./ModelVersionCompilePromptResponse"), exports);
@@ -69,8 +74,6 @@ __exportStar(require("./PromptTemplateBlockDataRequest"), exports);
69
74
  __exportStar(require("./PromptTemplateBlockProperties"), exports);
70
75
  __exportStar(require("./PromptTemplateBlockPropertiesRequest"), exports);
71
76
  __exportStar(require("./PromptTemplateBlockRequest"), exports);
72
- __exportStar(require("./PromptTemplateInputVariable"), exports);
73
- __exportStar(require("./PromptTemplateInputVariableRequest"), exports);
74
77
  __exportStar(require("./ProviderEnum"), exports);
75
78
  __exportStar(require("./RegisterPromptErrorResponse"), exports);
76
79
  __exportStar(require("./RegisterPromptModelParametersRequest"), exports);
@@ -78,6 +81,7 @@ __exportStar(require("./RegisterPromptPrompt"), exports);
78
81
  __exportStar(require("./RegisterPromptPromptInfoRequest"), exports);
79
82
  __exportStar(require("./RegisterPromptResponse"), exports);
80
83
  __exportStar(require("./RegisteredPromptDeployment"), exports);
84
+ __exportStar(require("./RegisteredPromptInputVariableRequest"), exports);
81
85
  __exportStar(require("./RegisteredPromptModelVersion"), exports);
82
86
  __exportStar(require("./RegisteredPromptSandbox"), exports);
83
87
  __exportStar(require("./RegisteredPromptSandboxSnapshot"), exports);
@@ -98,6 +102,8 @@ __exportStar(require("./SearchResponse"), exports);
98
102
  __exportStar(require("./SearchResult"), exports);
99
103
  __exportStar(require("./SearchResultMergingRequest"), exports);
100
104
  __exportStar(require("./SearchWeightsRequest"), exports);
105
+ __exportStar(require("./SetDocumentMetadataErrorResponse"), exports);
106
+ __exportStar(require("./SetDocumentMetadataResponse"), exports);
101
107
  __exportStar(require("./SlimDocument"), exports);
102
108
  __exportStar(require("./SlimDocumentStatusEnum"), exports);
103
109
  __exportStar(require("./SubmitCompletionActualRequest"), exports);
package/dist/Client.js CHANGED
@@ -197,7 +197,7 @@ class VellumClient {
197
197
  */
198
198
  async search(request) {
199
199
  const _response = await core.fetcher({
200
- url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).predict, "v1/search"),
200
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, "v1/search"),
201
201
  method: "POST",
202
202
  headers: {
203
203
  X_API_KEY: await core.Supplier.get(this.options.apiKey),
@@ -23,6 +23,17 @@ export declare class Documents {
23
23
  *
24
24
  */
25
25
  list(request?: Vellum.DocumentsListRequest): Promise<Vellum.PaginatedSlimDocumentList>;
26
+ /**
27
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
28
+ *
29
+ * Set the metadata for a document to be used for search filtering.
30
+ *
31
+ * **Note:** Uses a base url of `https://documents.vellum.ai`.
32
+ * @throws {Vellum.BadRequestError}
33
+ * @throws {Vellum.NotFoundError}
34
+ * @throws {Vellum.InternalServerError}
35
+ */
36
+ setDocumentMetadata(request: Vellum.SetDocumentMetadataRequestBodyRequest): Promise<Vellum.SetDocumentMetadataResponse>;
26
37
  /**
27
38
  * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
28
39
  *
@@ -101,6 +101,64 @@ class Documents {
101
101
  });
102
102
  }
103
103
  }
104
+ /**
105
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
106
+ *
107
+ * Set the metadata for a document to be used for search filtering.
108
+ *
109
+ * **Note:** Uses a base url of `https://documents.vellum.ai`.
110
+ * @throws {Vellum.BadRequestError}
111
+ * @throws {Vellum.NotFoundError}
112
+ * @throws {Vellum.InternalServerError}
113
+ */
114
+ async setDocumentMetadata(request) {
115
+ const _response = await core.fetcher({
116
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).documents, "v1/set-document-metadata"),
117
+ method: "POST",
118
+ headers: {
119
+ X_API_KEY: await core.Supplier.get(this.options.apiKey),
120
+ },
121
+ contentType: "application/json",
122
+ body: await serializers.SetDocumentMetadataRequestBodyRequest.jsonOrThrow(request, {
123
+ unrecognizedObjectKeys: "strip",
124
+ }),
125
+ });
126
+ if (_response.ok) {
127
+ return await serializers.SetDocumentMetadataResponse.parseOrThrow(_response.body, {
128
+ unrecognizedObjectKeys: "passthrough",
129
+ allowUnrecognizedUnionMembers: true,
130
+ allowUnrecognizedEnumValues: true,
131
+ });
132
+ }
133
+ if (_response.error.reason === "status-code") {
134
+ switch (_response.error.statusCode) {
135
+ case 400:
136
+ throw new Vellum.BadRequestError(_response.error.body);
137
+ case 404:
138
+ throw new Vellum.NotFoundError(_response.error.body);
139
+ case 500:
140
+ throw new Vellum.InternalServerError(_response.error.body);
141
+ default:
142
+ throw new errors.VellumError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ });
146
+ }
147
+ }
148
+ switch (_response.error.reason) {
149
+ case "non-json":
150
+ throw new errors.VellumError({
151
+ statusCode: _response.error.statusCode,
152
+ body: _response.error.rawBody,
153
+ });
154
+ case "timeout":
155
+ throw new errors.VellumTimeoutError();
156
+ case "unknown":
157
+ throw new errors.VellumError({
158
+ message: _response.error.errorMessage,
159
+ });
160
+ }
161
+ }
104
162
  /**
105
163
  * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
106
164
  *
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SetDocumentMetadataRequestBodyRequest {
5
+ /** The ID of the document to update. Must provide either this or `external_id` */
6
+ documentId?: string;
7
+ /** The external ID of the document to update. Must provide either this or `document_id` */
8
+ externalId?: string;
9
+ /** The metadata to set on the document. This will overwrite any existing metadata. */
10
+ metadata: Record<string, unknown>;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,3 @@
1
1
  export { DocumentsListRequest } from "./DocumentsListRequest";
2
+ export { SetDocumentMetadataRequestBodyRequest } from "./SetDocumentMetadataRequestBodyRequest";
2
3
  export { UploadDocumentBodyRequest } from "./UploadDocumentBodyRequest";
@@ -34,4 +34,5 @@ export interface DeploymentRead {
34
34
  modelType: Vellum.ModelTypeEnum;
35
35
  activeModelVersionIds: string[];
36
36
  lastDeployedOn: string;
37
+ inputVariables: Vellum.InputVariable[];
37
38
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface InputVariable {
6
+ id: string;
7
+ key: string;
8
+ type: Vellum.InputVariableType;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * * `STRING` - STRING
6
+ * * `JSON` - JSON
7
+ * * `CHAT_HISTORY` - CHAT_HISTORY
8
+ */
9
+ export declare type InputVariableType = "STRING" | "JSON" | "CHAT_HISTORY";
10
+ export declare const InputVariableType: {
11
+ readonly String: "STRING";
12
+ readonly Json: "JSON";
13
+ readonly ChatHistory: "CHAT_HISTORY";
14
+ };
@@ -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.InputVariableType = void 0;
7
+ exports.InputVariableType = {
8
+ String: "STRING",
9
+ Json: "JSON",
10
+ ChatHistory: "CHAT_HISTORY",
11
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface MetadataFilterConfigRequest {
6
+ combinator?: Vellum.MetadataFilterRuleCombinator;
7
+ negated?: boolean;
8
+ rules?: Vellum.MetadataFilterRuleRequest[];
9
+ /** <span style="white-space: nowrap">`non-empty`</span> */
10
+ field?: string;
11
+ /** <span style="white-space: nowrap">`non-empty`</span> */
12
+ operator?: string;
13
+ /** <span style="white-space: nowrap">`non-empty`</span> */
14
+ value?: string;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * * `and` - AND
6
+ * * `or` - OR
7
+ */
8
+ export declare type MetadataFilterRuleCombinator = "and" | "or";
9
+ export declare const MetadataFilterRuleCombinator: {
10
+ readonly And: "and";
11
+ readonly Or: "or";
12
+ };
@@ -0,0 +1,10 @@
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.MetadataFilterRuleCombinator = void 0;
7
+ exports.MetadataFilterRuleCombinator = {
8
+ And: "and",
9
+ Or: "or",
10
+ };