vellum-ai 0.0.37 → 0.0.39

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 (81) hide show
  1. package/Client.d.ts +9 -1
  2. package/Client.js +43 -1
  3. package/api/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +12 -0
  4. package/api/client/requests/index.d.ts +1 -0
  5. package/api/types/DocumentRead.d.ts +1 -1
  6. package/api/types/SearchResult.d.ts +1 -1
  7. package/api/types/{Document.d.ts → SearchResultDocument.d.ts} +3 -1
  8. package/api/types/SlimDocument.d.ts +2 -0
  9. package/api/types/SubmitWorkflowExecutionActualRequest.d.ts +16 -0
  10. package/api/types/SubmitWorkflowExecutionActualRequest.js +5 -0
  11. package/api/types/WorkflowExecutionActualChatHistoryRequest.d.ts +16 -0
  12. package/api/types/WorkflowExecutionActualChatHistoryRequest.js +5 -0
  13. package/api/types/WorkflowExecutionActualJsonRequest.d.ts +15 -0
  14. package/api/types/WorkflowExecutionActualJsonRequest.js +5 -0
  15. package/api/types/WorkflowExecutionActualStringRequest.d.ts +15 -0
  16. package/api/types/WorkflowExecutionActualStringRequest.js +5 -0
  17. package/api/types/index.d.ts +5 -1
  18. package/api/types/index.js +5 -1
  19. package/dist/Client.d.ts +9 -1
  20. package/dist/Client.js +43 -1
  21. package/dist/api/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +12 -0
  22. package/dist/api/client/requests/SubmitWorkflowExecutionActualsRequest.js +5 -0
  23. package/dist/api/client/requests/index.d.ts +1 -0
  24. package/dist/api/types/DocumentRead.d.ts +1 -1
  25. package/dist/api/types/SearchResult.d.ts +1 -1
  26. package/dist/api/types/{Document.d.ts → SearchResultDocument.d.ts} +3 -1
  27. package/dist/api/types/SearchResultDocument.js +5 -0
  28. package/dist/api/types/SlimDocument.d.ts +2 -0
  29. package/dist/api/types/SubmitWorkflowExecutionActualRequest.d.ts +16 -0
  30. package/dist/api/types/SubmitWorkflowExecutionActualRequest.js +5 -0
  31. package/dist/api/types/WorkflowExecutionActualChatHistoryRequest.d.ts +16 -0
  32. package/dist/api/types/WorkflowExecutionActualChatHistoryRequest.js +5 -0
  33. package/dist/api/types/WorkflowExecutionActualJsonRequest.d.ts +15 -0
  34. package/dist/api/types/WorkflowExecutionActualJsonRequest.js +5 -0
  35. package/dist/api/types/WorkflowExecutionActualStringRequest.d.ts +15 -0
  36. package/dist/api/types/WorkflowExecutionActualStringRequest.js +5 -0
  37. package/dist/api/types/index.d.ts +5 -1
  38. package/dist/api/types/index.js +5 -1
  39. package/dist/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +14 -0
  40. package/dist/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +35 -0
  41. package/dist/serialization/client/requests/index.d.ts +1 -0
  42. package/dist/serialization/client/requests/index.js +3 -1
  43. package/dist/serialization/types/SearchResult.d.ts +1 -1
  44. package/dist/serialization/types/SearchResult.js +1 -1
  45. package/dist/serialization/types/{Document.d.ts → SearchResultDocument.d.ts} +3 -2
  46. package/dist/serialization/types/{Document.js → SearchResultDocument.js} +3 -2
  47. package/dist/serialization/types/SlimDocument.d.ts +1 -0
  48. package/dist/serialization/types/SlimDocument.js +1 -0
  49. package/dist/serialization/types/SubmitWorkflowExecutionActualRequest.d.ts +19 -0
  50. package/dist/serialization/types/SubmitWorkflowExecutionActualRequest.js +40 -0
  51. package/dist/serialization/types/WorkflowExecutionActualChatHistoryRequest.d.ts +16 -0
  52. package/dist/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +39 -0
  53. package/dist/serialization/types/WorkflowExecutionActualJsonRequest.d.ts +16 -0
  54. package/dist/serialization/types/WorkflowExecutionActualJsonRequest.js +37 -0
  55. package/dist/serialization/types/WorkflowExecutionActualStringRequest.d.ts +16 -0
  56. package/dist/serialization/types/WorkflowExecutionActualStringRequest.js +37 -0
  57. package/dist/serialization/types/index.d.ts +5 -1
  58. package/dist/serialization/types/index.js +5 -1
  59. package/package.json +1 -1
  60. package/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.d.ts +14 -0
  61. package/serialization/client/requests/SubmitWorkflowExecutionActualsRequest.js +35 -0
  62. package/serialization/client/requests/index.d.ts +1 -0
  63. package/serialization/client/requests/index.js +3 -1
  64. package/serialization/types/SearchResult.d.ts +1 -1
  65. package/serialization/types/SearchResult.js +1 -1
  66. package/serialization/types/{Document.d.ts → SearchResultDocument.d.ts} +3 -2
  67. package/serialization/types/{Document.js → SearchResultDocument.js} +3 -2
  68. package/serialization/types/SlimDocument.d.ts +1 -0
  69. package/serialization/types/SlimDocument.js +1 -0
  70. package/serialization/types/SubmitWorkflowExecutionActualRequest.d.ts +19 -0
  71. package/serialization/types/SubmitWorkflowExecutionActualRequest.js +40 -0
  72. package/serialization/types/WorkflowExecutionActualChatHistoryRequest.d.ts +16 -0
  73. package/serialization/types/WorkflowExecutionActualChatHistoryRequest.js +39 -0
  74. package/serialization/types/WorkflowExecutionActualJsonRequest.d.ts +16 -0
  75. package/serialization/types/WorkflowExecutionActualJsonRequest.js +37 -0
  76. package/serialization/types/WorkflowExecutionActualStringRequest.d.ts +16 -0
  77. package/serialization/types/WorkflowExecutionActualStringRequest.js +37 -0
  78. package/serialization/types/index.d.ts +5 -1
  79. package/serialization/types/index.js +5 -1
  80. /package/api/{types/Document.js → client/requests/SubmitWorkflowExecutionActualsRequest.js} +0 -0
  81. /package/{dist/api/types/Document.js → api/types/SearchResultDocument.js} +0 -0
package/Client.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare class VellumClient {
21
21
  protected readonly options: VellumClient.Options;
22
22
  constructor(options: VellumClient.Options);
23
23
  /**
24
- * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
24
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Stable</strong>
25
25
  *
26
26
  * Executes a deployed Workflow and streams back its results.
27
27
  * @throws {Vellum.BadRequestError}
@@ -75,6 +75,14 @@ export declare class VellumClient {
75
75
  * @throws {Vellum.InternalServerError}
76
76
  */
77
77
  submitCompletionActuals(request: Vellum.SubmitCompletionActualsRequest): Promise<void>;
78
+ /**
79
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
80
+ *
81
+ * Used to submit feedback regarding the quality of previous workflow execution and its outputs.
82
+ *
83
+ * **Note:** Uses a base url of `https://predict.vellum.ai`.
84
+ */
85
+ submitWorkflowExecutionActuals(request: Vellum.SubmitWorkflowExecutionActualsRequest): Promise<void>;
78
86
  protected _deployments: Deployments | undefined;
79
87
  get deployments(): Deployments;
80
88
  protected _documentIndexes: DocumentIndexes | undefined;
package/Client.js CHANGED
@@ -49,7 +49,7 @@ class VellumClient {
49
49
  this.options = options;
50
50
  }
51
51
  /**
52
- * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
52
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Stable</strong>
53
53
  *
54
54
  * Executes a deployed Workflow and streams back its results.
55
55
  * @throws {Vellum.BadRequestError}
@@ -296,6 +296,48 @@ class VellumClient {
296
296
  });
297
297
  }
298
298
  }
299
+ /**
300
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
301
+ *
302
+ * Used to submit feedback regarding the quality of previous workflow execution and its outputs.
303
+ *
304
+ * **Note:** Uses a base url of `https://predict.vellum.ai`.
305
+ */
306
+ async submitWorkflowExecutionActuals(request) {
307
+ const _response = await core.fetcher({
308
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, "v1/submit-workflow-execution-actuals"),
309
+ method: "POST",
310
+ headers: {
311
+ X_API_KEY: await core.Supplier.get(this.options.apiKey),
312
+ },
313
+ contentType: "application/json",
314
+ body: await serializers.SubmitWorkflowExecutionActualsRequest.jsonOrThrow(request, {
315
+ unrecognizedObjectKeys: "strip",
316
+ }),
317
+ });
318
+ if (_response.ok) {
319
+ return;
320
+ }
321
+ if (_response.error.reason === "status-code") {
322
+ throw new errors.VellumError({
323
+ statusCode: _response.error.statusCode,
324
+ body: _response.error.body,
325
+ });
326
+ }
327
+ switch (_response.error.reason) {
328
+ case "non-json":
329
+ throw new errors.VellumError({
330
+ statusCode: _response.error.statusCode,
331
+ body: _response.error.rawBody,
332
+ });
333
+ case "timeout":
334
+ throw new errors.VellumTimeoutError();
335
+ case "unknown":
336
+ throw new errors.VellumError({
337
+ message: _response.error.errorMessage,
338
+ });
339
+ }
340
+ }
299
341
  _deployments;
300
342
  get deployments() {
301
343
  return (this._deployments ??= new Client_1.Deployments(this.options));
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "../..";
5
+ export interface SubmitWorkflowExecutionActualsRequest {
6
+ /** Feedback regarding the quality of an output on a previously executed workflow. */
7
+ actuals: Vellum.SubmitWorkflowExecutionActualRequest[];
8
+ /** The Vellum-generated ID of a previously executed workflow. Must provide either this or external_id. */
9
+ executionId?: string;
10
+ /** The external ID that was originally provided by when executing the workflow, if applicable, that you'd now like to submit actuals for. Must provide either this or execution_id. */
11
+ externalId?: string;
12
+ }
@@ -3,3 +3,4 @@ export { GenerateBodyRequest } from "./GenerateBodyRequest";
3
3
  export { GenerateStreamBodyRequest } from "./GenerateStreamBodyRequest";
4
4
  export { SearchRequestBodyRequest } from "./SearchRequestBodyRequest";
5
5
  export { SubmitCompletionActualsRequest } from "./SubmitCompletionActualsRequest";
6
+ export { SubmitWorkflowExecutionActualsRequest } from "./SubmitWorkflowExecutionActualsRequest";
@@ -27,6 +27,6 @@ export interface DocumentRead {
27
27
  originalFileUrl?: string;
28
28
  processedFileUrl?: string;
29
29
  documentToDocumentIndexes: Vellum.DocumentDocumentToDocumentIndex[];
30
- /** A previously supplied JSON object containing metadata that can filtered on when searching. */
30
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
31
31
  metadata?: Record<string, unknown>;
32
32
  }
@@ -9,5 +9,5 @@ export interface SearchResult {
9
9
  score: number;
10
10
  keywords: string[];
11
11
  /** The document that contains the chunk that matched the search query. */
12
- document: Vellum.Document;
12
+ document: Vellum.SearchResultDocument;
13
13
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface Document {
4
+ export interface SearchResultDocument {
5
5
  /** The ID of the document. */
6
6
  id: string;
7
7
  /** The human-readable name for the document. <span style="white-space: nowrap">`<= 1000 characters`</span> */
8
8
  label: string;
9
9
  /** The unique ID of the document as represented in an external system and specified when it was originally uploaded. */
10
10
  externalId?: string;
11
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
12
+ metadata?: Record<string, unknown>;
11
13
  }
@@ -35,5 +35,7 @@ export interface SlimDocument {
35
35
  status?: Vellum.DocumentStatus;
36
36
  /** A list of keywords associated with this document. Originally provided when uploading the document. */
37
37
  keywords?: string[];
38
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
39
+ metadata?: Record<string, unknown>;
38
40
  documentToDocumentIndexes: Vellum.DocumentDocumentToDocumentIndex[];
39
41
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export declare type SubmitWorkflowExecutionActualRequest = Vellum.SubmitWorkflowExecutionActualRequest.String | Vellum.SubmitWorkflowExecutionActualRequest.Json | Vellum.SubmitWorkflowExecutionActualRequest.ChatHistory;
6
+ export declare namespace SubmitWorkflowExecutionActualRequest {
7
+ interface String extends Vellum.WorkflowExecutionActualStringRequest {
8
+ outputType: "STRING";
9
+ }
10
+ interface Json extends Vellum.WorkflowExecutionActualJsonRequest {
11
+ outputType: "JSON";
12
+ }
13
+ interface ChatHistory extends Vellum.WorkflowExecutionActualChatHistoryRequest {
14
+ outputType: "CHAT_HISTORY";
15
+ }
16
+ }
@@ -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,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface WorkflowExecutionActualChatHistoryRequest {
6
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
7
+ outputId?: string;
8
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
9
+ outputKey?: string;
10
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
11
+ quality?: number;
12
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
13
+ timestamp?: number;
14
+ /** Optionally provide the value that the output ideally should have been. */
15
+ desiredOutputValue?: Vellum.ChatMessageRequest[];
16
+ }
@@ -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,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface WorkflowExecutionActualJsonRequest {
5
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
6
+ outputId?: string;
7
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
8
+ outputKey?: string;
9
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
10
+ quality?: number;
11
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
12
+ timestamp?: number;
13
+ /** Optionally provide the value that the output ideally should have been. */
14
+ desiredOutputValue?: Record<string, unknown>;
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,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface WorkflowExecutionActualStringRequest {
5
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
6
+ outputId?: string;
7
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
8
+ outputKey?: string;
9
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
10
+ quality?: number;
11
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
12
+ timestamp?: number;
13
+ /** Optionally provide the value that the output ideally should have been. */
14
+ desiredOutputValue?: 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 });
@@ -7,7 +7,6 @@ export * from "./ConditionalNodeResultData";
7
7
  export * from "./ContentType";
8
8
  export * from "./DeploymentRead";
9
9
  export * from "./DeploymentStatus";
10
- export * from "./Document";
11
10
  export * from "./DocumentDocumentToDocumentIndex";
12
11
  export * from "./DocumentIndexRead";
13
12
  export * from "./DocumentIndexStatus";
@@ -85,11 +84,13 @@ export * from "./SearchNodeResultData";
85
84
  export * from "./SearchRequestOptionsRequest";
86
85
  export * from "./SearchResponse";
87
86
  export * from "./SearchResult";
87
+ export * from "./SearchResultDocument";
88
88
  export * from "./SearchResultMergingRequest";
89
89
  export * from "./SearchWeightsRequest";
90
90
  export * from "./SlimDocument";
91
91
  export * from "./SubmitCompletionActualRequest";
92
92
  export * from "./SubmitCompletionActualsErrorResponse";
93
+ export * from "./SubmitWorkflowExecutionActualRequest";
93
94
  export * from "./TemplatingNodeChatHistoryResult";
94
95
  export * from "./TemplatingNodeJsonResult";
95
96
  export * from "./TemplatingNodeResult";
@@ -110,6 +111,9 @@ export * from "./UploadDocumentResponse";
110
111
  export * from "./VellumVariable";
111
112
  export * from "./VellumVariableType";
112
113
  export * from "./WorkflowEventError";
114
+ export * from "./WorkflowExecutionActualChatHistoryRequest";
115
+ export * from "./WorkflowExecutionActualJsonRequest";
116
+ export * from "./WorkflowExecutionActualStringRequest";
113
117
  export * from "./WorkflowExecutionEventErrorCode";
114
118
  export * from "./WorkflowExecutionEventType";
115
119
  export * from "./WorkflowExecutionNodeResultEvent";
@@ -23,7 +23,6 @@ __exportStar(require("./ConditionalNodeResultData"), exports);
23
23
  __exportStar(require("./ContentType"), exports);
24
24
  __exportStar(require("./DeploymentRead"), exports);
25
25
  __exportStar(require("./DeploymentStatus"), exports);
26
- __exportStar(require("./Document"), exports);
27
26
  __exportStar(require("./DocumentDocumentToDocumentIndex"), exports);
28
27
  __exportStar(require("./DocumentIndexRead"), exports);
29
28
  __exportStar(require("./DocumentIndexStatus"), exports);
@@ -101,11 +100,13 @@ __exportStar(require("./SearchNodeResultData"), exports);
101
100
  __exportStar(require("./SearchRequestOptionsRequest"), exports);
102
101
  __exportStar(require("./SearchResponse"), exports);
103
102
  __exportStar(require("./SearchResult"), exports);
103
+ __exportStar(require("./SearchResultDocument"), exports);
104
104
  __exportStar(require("./SearchResultMergingRequest"), exports);
105
105
  __exportStar(require("./SearchWeightsRequest"), exports);
106
106
  __exportStar(require("./SlimDocument"), exports);
107
107
  __exportStar(require("./SubmitCompletionActualRequest"), exports);
108
108
  __exportStar(require("./SubmitCompletionActualsErrorResponse"), exports);
109
+ __exportStar(require("./SubmitWorkflowExecutionActualRequest"), exports);
109
110
  __exportStar(require("./TemplatingNodeChatHistoryResult"), exports);
110
111
  __exportStar(require("./TemplatingNodeJsonResult"), exports);
111
112
  __exportStar(require("./TemplatingNodeResult"), exports);
@@ -126,6 +127,9 @@ __exportStar(require("./UploadDocumentResponse"), exports);
126
127
  __exportStar(require("./VellumVariable"), exports);
127
128
  __exportStar(require("./VellumVariableType"), exports);
128
129
  __exportStar(require("./WorkflowEventError"), exports);
130
+ __exportStar(require("./WorkflowExecutionActualChatHistoryRequest"), exports);
131
+ __exportStar(require("./WorkflowExecutionActualJsonRequest"), exports);
132
+ __exportStar(require("./WorkflowExecutionActualStringRequest"), exports);
129
133
  __exportStar(require("./WorkflowExecutionEventErrorCode"), exports);
130
134
  __exportStar(require("./WorkflowExecutionEventType"), exports);
131
135
  __exportStar(require("./WorkflowExecutionNodeResultEvent"), exports);
package/dist/Client.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare class VellumClient {
21
21
  protected readonly options: VellumClient.Options;
22
22
  constructor(options: VellumClient.Options);
23
23
  /**
24
- * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
24
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Stable</strong>
25
25
  *
26
26
  * Executes a deployed Workflow and streams back its results.
27
27
  * @throws {Vellum.BadRequestError}
@@ -75,6 +75,14 @@ export declare class VellumClient {
75
75
  * @throws {Vellum.InternalServerError}
76
76
  */
77
77
  submitCompletionActuals(request: Vellum.SubmitCompletionActualsRequest): Promise<void>;
78
+ /**
79
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
80
+ *
81
+ * Used to submit feedback regarding the quality of previous workflow execution and its outputs.
82
+ *
83
+ * **Note:** Uses a base url of `https://predict.vellum.ai`.
84
+ */
85
+ submitWorkflowExecutionActuals(request: Vellum.SubmitWorkflowExecutionActualsRequest): Promise<void>;
78
86
  protected _deployments: Deployments | undefined;
79
87
  get deployments(): Deployments;
80
88
  protected _documentIndexes: DocumentIndexes | undefined;
package/dist/Client.js CHANGED
@@ -49,7 +49,7 @@ class VellumClient {
49
49
  this.options = options;
50
50
  }
51
51
  /**
52
- * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Unstable</strong>
52
+ * <strong style="background-color:#ffc107; color:white; padding:4px; border-radius:4px">Stable</strong>
53
53
  *
54
54
  * Executes a deployed Workflow and streams back its results.
55
55
  * @throws {Vellum.BadRequestError}
@@ -296,6 +296,48 @@ class VellumClient {
296
296
  });
297
297
  }
298
298
  }
299
+ /**
300
+ * <strong style="background-color:#4caf50; color:white; padding:4px; border-radius:4px">Stable</strong>
301
+ *
302
+ * Used to submit feedback regarding the quality of previous workflow execution and its outputs.
303
+ *
304
+ * **Note:** Uses a base url of `https://predict.vellum.ai`.
305
+ */
306
+ async submitWorkflowExecutionActuals(request) {
307
+ const _response = await core.fetcher({
308
+ url: (0, url_join_1.default)((this.options.environment ?? environments.VellumEnvironment.Production).default, "v1/submit-workflow-execution-actuals"),
309
+ method: "POST",
310
+ headers: {
311
+ X_API_KEY: await core.Supplier.get(this.options.apiKey),
312
+ },
313
+ contentType: "application/json",
314
+ body: await serializers.SubmitWorkflowExecutionActualsRequest.jsonOrThrow(request, {
315
+ unrecognizedObjectKeys: "strip",
316
+ }),
317
+ });
318
+ if (_response.ok) {
319
+ return;
320
+ }
321
+ if (_response.error.reason === "status-code") {
322
+ throw new errors.VellumError({
323
+ statusCode: _response.error.statusCode,
324
+ body: _response.error.body,
325
+ });
326
+ }
327
+ switch (_response.error.reason) {
328
+ case "non-json":
329
+ throw new errors.VellumError({
330
+ statusCode: _response.error.statusCode,
331
+ body: _response.error.rawBody,
332
+ });
333
+ case "timeout":
334
+ throw new errors.VellumTimeoutError();
335
+ case "unknown":
336
+ throw new errors.VellumError({
337
+ message: _response.error.errorMessage,
338
+ });
339
+ }
340
+ }
299
341
  _deployments;
300
342
  get deployments() {
301
343
  return (this._deployments ??= new Client_1.Deployments(this.options));
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "../..";
5
+ export interface SubmitWorkflowExecutionActualsRequest {
6
+ /** Feedback regarding the quality of an output on a previously executed workflow. */
7
+ actuals: Vellum.SubmitWorkflowExecutionActualRequest[];
8
+ /** The Vellum-generated ID of a previously executed workflow. Must provide either this or external_id. */
9
+ executionId?: string;
10
+ /** The external ID that was originally provided by when executing the workflow, if applicable, that you'd now like to submit actuals for. Must provide either this or execution_id. */
11
+ externalId?: string;
12
+ }
@@ -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 });
@@ -3,3 +3,4 @@ export { GenerateBodyRequest } from "./GenerateBodyRequest";
3
3
  export { GenerateStreamBodyRequest } from "./GenerateStreamBodyRequest";
4
4
  export { SearchRequestBodyRequest } from "./SearchRequestBodyRequest";
5
5
  export { SubmitCompletionActualsRequest } from "./SubmitCompletionActualsRequest";
6
+ export { SubmitWorkflowExecutionActualsRequest } from "./SubmitWorkflowExecutionActualsRequest";
@@ -27,6 +27,6 @@ export interface DocumentRead {
27
27
  originalFileUrl?: string;
28
28
  processedFileUrl?: string;
29
29
  documentToDocumentIndexes: Vellum.DocumentDocumentToDocumentIndex[];
30
- /** A previously supplied JSON object containing metadata that can filtered on when searching. */
30
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
31
31
  metadata?: Record<string, unknown>;
32
32
  }
@@ -9,5 +9,5 @@ export interface SearchResult {
9
9
  score: number;
10
10
  keywords: string[];
11
11
  /** The document that contains the chunk that matched the search query. */
12
- document: Vellum.Document;
12
+ document: Vellum.SearchResultDocument;
13
13
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface Document {
4
+ export interface SearchResultDocument {
5
5
  /** The ID of the document. */
6
6
  id: string;
7
7
  /** The human-readable name for the document. <span style="white-space: nowrap">`<= 1000 characters`</span> */
8
8
  label: string;
9
9
  /** The unique ID of the document as represented in an external system and specified when it was originally uploaded. */
10
10
  externalId?: string;
11
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
12
+ metadata?: Record<string, unknown>;
11
13
  }
@@ -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 });
@@ -35,5 +35,7 @@ export interface SlimDocument {
35
35
  status?: Vellum.DocumentStatus;
36
36
  /** A list of keywords associated with this document. Originally provided when uploading the document. */
37
37
  keywords?: string[];
38
+ /** A previously supplied JSON object containing metadata that can be filtered on when searching. */
39
+ metadata?: Record<string, unknown>;
38
40
  documentToDocumentIndexes: Vellum.DocumentDocumentToDocumentIndex[];
39
41
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export declare type SubmitWorkflowExecutionActualRequest = Vellum.SubmitWorkflowExecutionActualRequest.String | Vellum.SubmitWorkflowExecutionActualRequest.Json | Vellum.SubmitWorkflowExecutionActualRequest.ChatHistory;
6
+ export declare namespace SubmitWorkflowExecutionActualRequest {
7
+ interface String extends Vellum.WorkflowExecutionActualStringRequest {
8
+ outputType: "STRING";
9
+ }
10
+ interface Json extends Vellum.WorkflowExecutionActualJsonRequest {
11
+ outputType: "JSON";
12
+ }
13
+ interface ChatHistory extends Vellum.WorkflowExecutionActualChatHistoryRequest {
14
+ outputType: "CHAT_HISTORY";
15
+ }
16
+ }
@@ -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,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Vellum from "..";
5
+ export interface WorkflowExecutionActualChatHistoryRequest {
6
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
7
+ outputId?: string;
8
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
9
+ outputKey?: string;
10
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
11
+ quality?: number;
12
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
13
+ timestamp?: number;
14
+ /** Optionally provide the value that the output ideally should have been. */
15
+ desiredOutputValue?: Vellum.ChatMessageRequest[];
16
+ }
@@ -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,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface WorkflowExecutionActualJsonRequest {
5
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
6
+ outputId?: string;
7
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
8
+ outputKey?: string;
9
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
10
+ quality?: number;
11
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
12
+ timestamp?: number;
13
+ /** Optionally provide the value that the output ideally should have been. */
14
+ desiredOutputValue?: Record<string, unknown>;
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,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface WorkflowExecutionActualStringRequest {
5
+ /** The Vellum-generated ID of a workflow output. Must provide either this or output_key. output_key is typically preferred. */
6
+ outputId?: string;
7
+ /** The user-defined name of a workflow output. Must provide either this or output_id. Should correspond to the `Name` specified in a Final Output Node. Generally preferred over output_id. */
8
+ outputKey?: string;
9
+ /** Optionally provide a decimal number between 0.0 and 1.0 (inclusive) representing the quality of the output. 0 is the worst, 1 is the best. */
10
+ quality?: number;
11
+ /** Optionally provide the timestamp representing when this feedback was collected. Used for reporting purposes. */
12
+ timestamp?: number;
13
+ /** Optionally provide the value that the output ideally should have been. */
14
+ desiredOutputValue?: 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 });
@@ -7,7 +7,6 @@ export * from "./ConditionalNodeResultData";
7
7
  export * from "./ContentType";
8
8
  export * from "./DeploymentRead";
9
9
  export * from "./DeploymentStatus";
10
- export * from "./Document";
11
10
  export * from "./DocumentDocumentToDocumentIndex";
12
11
  export * from "./DocumentIndexRead";
13
12
  export * from "./DocumentIndexStatus";
@@ -85,11 +84,13 @@ export * from "./SearchNodeResultData";
85
84
  export * from "./SearchRequestOptionsRequest";
86
85
  export * from "./SearchResponse";
87
86
  export * from "./SearchResult";
87
+ export * from "./SearchResultDocument";
88
88
  export * from "./SearchResultMergingRequest";
89
89
  export * from "./SearchWeightsRequest";
90
90
  export * from "./SlimDocument";
91
91
  export * from "./SubmitCompletionActualRequest";
92
92
  export * from "./SubmitCompletionActualsErrorResponse";
93
+ export * from "./SubmitWorkflowExecutionActualRequest";
93
94
  export * from "./TemplatingNodeChatHistoryResult";
94
95
  export * from "./TemplatingNodeJsonResult";
95
96
  export * from "./TemplatingNodeResult";
@@ -110,6 +111,9 @@ export * from "./UploadDocumentResponse";
110
111
  export * from "./VellumVariable";
111
112
  export * from "./VellumVariableType";
112
113
  export * from "./WorkflowEventError";
114
+ export * from "./WorkflowExecutionActualChatHistoryRequest";
115
+ export * from "./WorkflowExecutionActualJsonRequest";
116
+ export * from "./WorkflowExecutionActualStringRequest";
113
117
  export * from "./WorkflowExecutionEventErrorCode";
114
118
  export * from "./WorkflowExecutionEventType";
115
119
  export * from "./WorkflowExecutionNodeResultEvent";
@@ -23,7 +23,6 @@ __exportStar(require("./ConditionalNodeResultData"), exports);
23
23
  __exportStar(require("./ContentType"), exports);
24
24
  __exportStar(require("./DeploymentRead"), exports);
25
25
  __exportStar(require("./DeploymentStatus"), exports);
26
- __exportStar(require("./Document"), exports);
27
26
  __exportStar(require("./DocumentDocumentToDocumentIndex"), exports);
28
27
  __exportStar(require("./DocumentIndexRead"), exports);
29
28
  __exportStar(require("./DocumentIndexStatus"), exports);
@@ -101,11 +100,13 @@ __exportStar(require("./SearchNodeResultData"), exports);
101
100
  __exportStar(require("./SearchRequestOptionsRequest"), exports);
102
101
  __exportStar(require("./SearchResponse"), exports);
103
102
  __exportStar(require("./SearchResult"), exports);
103
+ __exportStar(require("./SearchResultDocument"), exports);
104
104
  __exportStar(require("./SearchResultMergingRequest"), exports);
105
105
  __exportStar(require("./SearchWeightsRequest"), exports);
106
106
  __exportStar(require("./SlimDocument"), exports);
107
107
  __exportStar(require("./SubmitCompletionActualRequest"), exports);
108
108
  __exportStar(require("./SubmitCompletionActualsErrorResponse"), exports);
109
+ __exportStar(require("./SubmitWorkflowExecutionActualRequest"), exports);
109
110
  __exportStar(require("./TemplatingNodeChatHistoryResult"), exports);
110
111
  __exportStar(require("./TemplatingNodeJsonResult"), exports);
111
112
  __exportStar(require("./TemplatingNodeResult"), exports);
@@ -126,6 +127,9 @@ __exportStar(require("./UploadDocumentResponse"), exports);
126
127
  __exportStar(require("./VellumVariable"), exports);
127
128
  __exportStar(require("./VellumVariableType"), exports);
128
129
  __exportStar(require("./WorkflowEventError"), exports);
130
+ __exportStar(require("./WorkflowExecutionActualChatHistoryRequest"), exports);
131
+ __exportStar(require("./WorkflowExecutionActualJsonRequest"), exports);
132
+ __exportStar(require("./WorkflowExecutionActualStringRequest"), exports);
129
133
  __exportStar(require("./WorkflowExecutionEventErrorCode"), exports);
130
134
  __exportStar(require("./WorkflowExecutionEventType"), exports);
131
135
  __exportStar(require("./WorkflowExecutionNodeResultEvent"), exports);