@orq-ai/node 4.0.16 → 4.0.20
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/bin/mcp-server.js +213 -213
- package/bin/mcp-server.js.map +36 -36
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createtool.js +12 -12
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/packages/orq-rc/README.md +22 -18
- package/packages/orq-rc/docs/sdks/evals/README.md +103 -1
- package/packages/orq-rc/examples/package-lock.json +1 -1
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/evalsInvoke.ts +177 -0
- package/packages/orq-rc/src/lib/config.ts +2 -2
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +3 -1
- package/packages/orq-rc/src/mcp-server/tools/evalsInvoke.ts +35 -0
- package/packages/orq-rc/src/models/errors/index.ts +1 -0
- package/packages/orq-rc/src/models/errors/invokeeval.ts +128 -0
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +3 -0
- package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +8 -8
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/createtool.ts +12 -12
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +877 -685
- package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +35 -35
- package/packages/orq-rc/src/models/operations/deployments.ts +36 -36
- package/packages/orq-rc/src/models/operations/deploymentstream.ts +55 -38
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getalltools.ts +12 -12
- package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +28 -28
- package/packages/orq-rc/src/models/operations/index.ts +1 -0
- package/packages/orq-rc/src/models/operations/invokeeval.ts +2062 -0
- package/packages/orq-rc/src/models/operations/listagents.ts +3 -0
- package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +3 -0
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievetool.ts +12 -12
- package/packages/orq-rc/src/models/operations/runagent.ts +2 -2
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateagent.ts +3 -0
- package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +8 -8
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +28 -28
- package/packages/orq-rc/src/models/operations/updatetool.ts +14 -14
- package/packages/orq-rc/src/sdk/evals.ts +15 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatetool.ts +14 -14
|
@@ -0,0 +1,2062 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The role of the prompt message
|
|
14
|
+
*/
|
|
15
|
+
export const Role = {
|
|
16
|
+
System: "system",
|
|
17
|
+
Assistant: "assistant",
|
|
18
|
+
User: "user",
|
|
19
|
+
Exception: "exception",
|
|
20
|
+
Tool: "tool",
|
|
21
|
+
Prompt: "prompt",
|
|
22
|
+
Correction: "correction",
|
|
23
|
+
ExpectedOutput: "expected_output",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* The role of the prompt message
|
|
27
|
+
*/
|
|
28
|
+
export type Role = ClosedEnum<typeof Role>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The type of the content part. Always `file`.
|
|
32
|
+
*/
|
|
33
|
+
export const InvokeEval2Type = {
|
|
34
|
+
File: "file",
|
|
35
|
+
} as const;
|
|
36
|
+
/**
|
|
37
|
+
* The type of the content part. Always `file`.
|
|
38
|
+
*/
|
|
39
|
+
export type InvokeEval2Type = ClosedEnum<typeof InvokeEval2Type>;
|
|
40
|
+
|
|
41
|
+
export type FileT = {
|
|
42
|
+
/**
|
|
43
|
+
* The file data as a data URI string in the format 'data:<mime-type>;base64,<base64-encoded-data>'. Example: 'data:image/png;base64,iVBORw0KGgoAAAANS...'
|
|
44
|
+
*/
|
|
45
|
+
fileData?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* URL to the file. Only supported by Anthropic Claude models for PDF files.
|
|
48
|
+
*/
|
|
49
|
+
uri?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* MIME type of the file (e.g., application/pdf, image/png)
|
|
52
|
+
*/
|
|
53
|
+
mimeType?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The name of the file, used when passing the file to the model as a string.
|
|
56
|
+
*/
|
|
57
|
+
filename?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type Three = {
|
|
61
|
+
/**
|
|
62
|
+
* The type of the content part. Always `file`.
|
|
63
|
+
*/
|
|
64
|
+
type: InvokeEval2Type;
|
|
65
|
+
file: FileT;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const TwoType = {
|
|
69
|
+
ImageUrl: "image_url",
|
|
70
|
+
} as const;
|
|
71
|
+
export type TwoType = ClosedEnum<typeof TwoType>;
|
|
72
|
+
|
|
73
|
+
export type ImageUrl = {
|
|
74
|
+
/**
|
|
75
|
+
* Either a URL of the image or the base64 encoded data URI.
|
|
76
|
+
*/
|
|
77
|
+
url: string;
|
|
78
|
+
/**
|
|
79
|
+
* Specifies the detail level of the image. Currently only supported with OpenAI models
|
|
80
|
+
*/
|
|
81
|
+
detail?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The image part of the prompt message. Only supported with vision models.
|
|
86
|
+
*/
|
|
87
|
+
export type Two2 = {
|
|
88
|
+
type: TwoType;
|
|
89
|
+
imageUrl: ImageUrl;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Type = {
|
|
93
|
+
Text: "text",
|
|
94
|
+
} as const;
|
|
95
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Text content part of a prompt message
|
|
99
|
+
*/
|
|
100
|
+
export type One = {
|
|
101
|
+
type: Type;
|
|
102
|
+
text: string;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type Two = One | Two2 | Three;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Can be null for tool messages in certain scenarios.
|
|
109
|
+
*/
|
|
110
|
+
export type Content = string | Array<One | Two2 | Three>;
|
|
111
|
+
|
|
112
|
+
export const InvokeEvalType = {
|
|
113
|
+
Function: "function",
|
|
114
|
+
} as const;
|
|
115
|
+
export type InvokeEvalType = ClosedEnum<typeof InvokeEvalType>;
|
|
116
|
+
|
|
117
|
+
export type FunctionT = {
|
|
118
|
+
name: string;
|
|
119
|
+
/**
|
|
120
|
+
* JSON string arguments for the functions
|
|
121
|
+
*/
|
|
122
|
+
arguments: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type ToolCalls = {
|
|
126
|
+
id?: string | undefined;
|
|
127
|
+
index?: number | undefined;
|
|
128
|
+
type: InvokeEvalType;
|
|
129
|
+
function: FunctionT;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type Messages = {
|
|
133
|
+
/**
|
|
134
|
+
* The role of the prompt message
|
|
135
|
+
*/
|
|
136
|
+
role: Role;
|
|
137
|
+
/**
|
|
138
|
+
* The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Can be null for tool messages in certain scenarios.
|
|
139
|
+
*/
|
|
140
|
+
content: string | Array<One | Two2 | Three> | null;
|
|
141
|
+
toolCalls?: Array<ToolCalls> | undefined;
|
|
142
|
+
toolCallId?: string | undefined;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type InvokeEvalRequestBody = {
|
|
146
|
+
/**
|
|
147
|
+
* Latest user message
|
|
148
|
+
*/
|
|
149
|
+
query?: string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* The generated response from the model
|
|
152
|
+
*/
|
|
153
|
+
output?: string | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* The reference used to compare the output
|
|
156
|
+
*/
|
|
157
|
+
reference?: string | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Knowledge base retrievals
|
|
160
|
+
*/
|
|
161
|
+
retrievals?: Array<string> | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* The messages used to generate the output, without the last user message
|
|
164
|
+
*/
|
|
165
|
+
messages?: Array<Messages> | undefined;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export type InvokeEvalRequest = {
|
|
169
|
+
/**
|
|
170
|
+
* Evaluator ID
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
requestBody?: InvokeEvalRequestBody | undefined;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type = {
|
|
177
|
+
HttpEval: "http_eval",
|
|
178
|
+
} as const;
|
|
179
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type =
|
|
180
|
+
ClosedEnum<typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type>;
|
|
181
|
+
|
|
182
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue =
|
|
183
|
+
| number
|
|
184
|
+
| boolean;
|
|
185
|
+
|
|
186
|
+
export type InvokeEvalResponseBodyEvalsResponse200Value = {
|
|
187
|
+
type: string;
|
|
188
|
+
value: number | boolean;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type InvokeEvalResponseBodyHTTP = {
|
|
192
|
+
type: InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type;
|
|
193
|
+
value?: InvokeEvalResponseBodyEvalsResponse200Value | null | undefined;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type = {
|
|
197
|
+
LlmEvaluator: "llm_evaluator",
|
|
198
|
+
} as const;
|
|
199
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type =
|
|
200
|
+
ClosedEnum<typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type>;
|
|
201
|
+
|
|
202
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value =
|
|
203
|
+
| number
|
|
204
|
+
| boolean
|
|
205
|
+
| string;
|
|
206
|
+
|
|
207
|
+
export type OriginalValue = number | boolean | string;
|
|
208
|
+
|
|
209
|
+
export type InvokeEvalResponseBodyEvalsResponseValue = {
|
|
210
|
+
workflowRunId: string;
|
|
211
|
+
value: number | boolean | string;
|
|
212
|
+
explanation?: string | null | undefined;
|
|
213
|
+
originalValue?: number | boolean | string | null | undefined;
|
|
214
|
+
originalExplanation?: string | null | undefined;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export type InvokeEvalResponseBodyLLM = {
|
|
218
|
+
type: InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type;
|
|
219
|
+
value: InvokeEvalResponseBodyEvalsResponseValue | null;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type = {
|
|
223
|
+
BertScore: "bert_score",
|
|
224
|
+
} as const;
|
|
225
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type =
|
|
226
|
+
ClosedEnum<typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type>;
|
|
227
|
+
|
|
228
|
+
export type InvokeEvalResponseBodyEvalsValue = {
|
|
229
|
+
f1: number;
|
|
230
|
+
precision: number;
|
|
231
|
+
recall: number;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export type BERTScore = {
|
|
235
|
+
type: InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type;
|
|
236
|
+
value: InvokeEvalResponseBodyEvalsValue;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType = {
|
|
240
|
+
RougeN: "rouge_n",
|
|
241
|
+
} as const;
|
|
242
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType =
|
|
243
|
+
ClosedEnum<typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType>;
|
|
244
|
+
|
|
245
|
+
export type Rouge1 = {
|
|
246
|
+
f1: number;
|
|
247
|
+
precision: number;
|
|
248
|
+
recall: number;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export type Rouge2 = {
|
|
252
|
+
f1: number;
|
|
253
|
+
precision: number;
|
|
254
|
+
recall: number;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export type RougeL = {
|
|
258
|
+
f1: number;
|
|
259
|
+
precision: number;
|
|
260
|
+
recall: number;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export type InvokeEvalResponseBodyValue = {
|
|
264
|
+
rouge1: Rouge1;
|
|
265
|
+
rouge2: Rouge2;
|
|
266
|
+
rougeL: RougeL;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export type RougeN = {
|
|
270
|
+
type: InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType;
|
|
271
|
+
value: InvokeEvalResponseBodyValue;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export const InvokeEvalResponseBodyEvalsResponse200Type = {
|
|
275
|
+
StringArray: "string_array",
|
|
276
|
+
} as const;
|
|
277
|
+
export type InvokeEvalResponseBodyEvalsResponse200Type = ClosedEnum<
|
|
278
|
+
typeof InvokeEvalResponseBodyEvalsResponse200Type
|
|
279
|
+
>;
|
|
280
|
+
|
|
281
|
+
export type StringArray = {
|
|
282
|
+
type: InvokeEvalResponseBodyEvalsResponse200Type;
|
|
283
|
+
values: Array<string | null>;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export const InvokeEvalResponseBodyEvalsResponseType = {
|
|
287
|
+
Boolean: "boolean",
|
|
288
|
+
} as const;
|
|
289
|
+
export type InvokeEvalResponseBodyEvalsResponseType = ClosedEnum<
|
|
290
|
+
typeof InvokeEvalResponseBodyEvalsResponseType
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
export type ResponseBodyValue = boolean | string | number;
|
|
294
|
+
|
|
295
|
+
export type ResponseBodyBoolean = {
|
|
296
|
+
type: InvokeEvalResponseBodyEvalsResponseType;
|
|
297
|
+
value: boolean | string | number | null;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export const InvokeEvalResponseBodyEvalsType = {
|
|
301
|
+
Number: "number",
|
|
302
|
+
} as const;
|
|
303
|
+
export type InvokeEvalResponseBodyEvalsType = ClosedEnum<
|
|
304
|
+
typeof InvokeEvalResponseBodyEvalsType
|
|
305
|
+
>;
|
|
306
|
+
|
|
307
|
+
export const Style = {
|
|
308
|
+
Currency: "currency",
|
|
309
|
+
} as const;
|
|
310
|
+
export type Style = ClosedEnum<typeof Style>;
|
|
311
|
+
|
|
312
|
+
export const Currency = {
|
|
313
|
+
Usd: "USD",
|
|
314
|
+
} as const;
|
|
315
|
+
export type Currency = ClosedEnum<typeof Currency>;
|
|
316
|
+
|
|
317
|
+
export type FormatOptions2 = {
|
|
318
|
+
style: Style;
|
|
319
|
+
currency: Currency;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export type FormatOptions1 = {
|
|
323
|
+
significantDigits: number;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export type FormatOptions = FormatOptions2 | FormatOptions1;
|
|
327
|
+
|
|
328
|
+
export type ResponseBodyNumber = {
|
|
329
|
+
type: InvokeEvalResponseBodyEvalsType;
|
|
330
|
+
originalValue?: number | null | undefined;
|
|
331
|
+
value: number | null;
|
|
332
|
+
formatOptions?: FormatOptions2 | FormatOptions1 | undefined;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export const InvokeEvalResponseBodyType = {
|
|
336
|
+
String: "string",
|
|
337
|
+
} as const;
|
|
338
|
+
export type InvokeEvalResponseBodyType = ClosedEnum<
|
|
339
|
+
typeof InvokeEvalResponseBodyType
|
|
340
|
+
>;
|
|
341
|
+
|
|
342
|
+
export type String = {
|
|
343
|
+
type: InvokeEvalResponseBodyType;
|
|
344
|
+
originalValue?: string | null | undefined;
|
|
345
|
+
value?: string | null | undefined;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Returns the result of the evaluator run
|
|
350
|
+
*/
|
|
351
|
+
export type InvokeEvalResponseBody =
|
|
352
|
+
| ResponseBodyNumber
|
|
353
|
+
| ResponseBodyBoolean
|
|
354
|
+
| StringArray
|
|
355
|
+
| RougeN
|
|
356
|
+
| BERTScore
|
|
357
|
+
| InvokeEvalResponseBodyLLM
|
|
358
|
+
| String
|
|
359
|
+
| InvokeEvalResponseBodyHTTP;
|
|
360
|
+
|
|
361
|
+
/** @internal */
|
|
362
|
+
export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
|
|
363
|
+
Role,
|
|
364
|
+
);
|
|
365
|
+
/** @internal */
|
|
366
|
+
export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
|
|
367
|
+
Role$inboundSchema;
|
|
368
|
+
|
|
369
|
+
/** @internal */
|
|
370
|
+
export const InvokeEval2Type$inboundSchema: z.ZodNativeEnum<
|
|
371
|
+
typeof InvokeEval2Type
|
|
372
|
+
> = z.nativeEnum(InvokeEval2Type);
|
|
373
|
+
/** @internal */
|
|
374
|
+
export const InvokeEval2Type$outboundSchema: z.ZodNativeEnum<
|
|
375
|
+
typeof InvokeEval2Type
|
|
376
|
+
> = InvokeEval2Type$inboundSchema;
|
|
377
|
+
|
|
378
|
+
/** @internal */
|
|
379
|
+
export const FileT$inboundSchema: z.ZodType<FileT, z.ZodTypeDef, unknown> = z
|
|
380
|
+
.object({
|
|
381
|
+
file_data: z.string().optional(),
|
|
382
|
+
uri: z.string().optional(),
|
|
383
|
+
mimeType: z.string().optional(),
|
|
384
|
+
filename: z.string().optional(),
|
|
385
|
+
}).transform((v) => {
|
|
386
|
+
return remap$(v, {
|
|
387
|
+
"file_data": "fileData",
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
/** @internal */
|
|
391
|
+
export type FileT$Outbound = {
|
|
392
|
+
file_data?: string | undefined;
|
|
393
|
+
uri?: string | undefined;
|
|
394
|
+
mimeType?: string | undefined;
|
|
395
|
+
filename?: string | undefined;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
/** @internal */
|
|
399
|
+
export const FileT$outboundSchema: z.ZodType<
|
|
400
|
+
FileT$Outbound,
|
|
401
|
+
z.ZodTypeDef,
|
|
402
|
+
FileT
|
|
403
|
+
> = z.object({
|
|
404
|
+
fileData: z.string().optional(),
|
|
405
|
+
uri: z.string().optional(),
|
|
406
|
+
mimeType: z.string().optional(),
|
|
407
|
+
filename: z.string().optional(),
|
|
408
|
+
}).transform((v) => {
|
|
409
|
+
return remap$(v, {
|
|
410
|
+
fileData: "file_data",
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
export function fileToJSON(fileT: FileT): string {
|
|
415
|
+
return JSON.stringify(FileT$outboundSchema.parse(fileT));
|
|
416
|
+
}
|
|
417
|
+
export function fileFromJSON(
|
|
418
|
+
jsonString: string,
|
|
419
|
+
): SafeParseResult<FileT, SDKValidationError> {
|
|
420
|
+
return safeParse(
|
|
421
|
+
jsonString,
|
|
422
|
+
(x) => FileT$inboundSchema.parse(JSON.parse(x)),
|
|
423
|
+
`Failed to parse 'FileT' from JSON`,
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/** @internal */
|
|
428
|
+
export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
|
|
429
|
+
.object({
|
|
430
|
+
type: InvokeEval2Type$inboundSchema,
|
|
431
|
+
file: z.lazy(() => FileT$inboundSchema),
|
|
432
|
+
});
|
|
433
|
+
/** @internal */
|
|
434
|
+
export type Three$Outbound = {
|
|
435
|
+
type: string;
|
|
436
|
+
file: FileT$Outbound;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
/** @internal */
|
|
440
|
+
export const Three$outboundSchema: z.ZodType<
|
|
441
|
+
Three$Outbound,
|
|
442
|
+
z.ZodTypeDef,
|
|
443
|
+
Three
|
|
444
|
+
> = z.object({
|
|
445
|
+
type: InvokeEval2Type$outboundSchema,
|
|
446
|
+
file: z.lazy(() => FileT$outboundSchema),
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
export function threeToJSON(three: Three): string {
|
|
450
|
+
return JSON.stringify(Three$outboundSchema.parse(three));
|
|
451
|
+
}
|
|
452
|
+
export function threeFromJSON(
|
|
453
|
+
jsonString: string,
|
|
454
|
+
): SafeParseResult<Three, SDKValidationError> {
|
|
455
|
+
return safeParse(
|
|
456
|
+
jsonString,
|
|
457
|
+
(x) => Three$inboundSchema.parse(JSON.parse(x)),
|
|
458
|
+
`Failed to parse 'Three' from JSON`,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** @internal */
|
|
463
|
+
export const TwoType$inboundSchema: z.ZodNativeEnum<typeof TwoType> = z
|
|
464
|
+
.nativeEnum(TwoType);
|
|
465
|
+
/** @internal */
|
|
466
|
+
export const TwoType$outboundSchema: z.ZodNativeEnum<typeof TwoType> =
|
|
467
|
+
TwoType$inboundSchema;
|
|
468
|
+
|
|
469
|
+
/** @internal */
|
|
470
|
+
export const ImageUrl$inboundSchema: z.ZodType<
|
|
471
|
+
ImageUrl,
|
|
472
|
+
z.ZodTypeDef,
|
|
473
|
+
unknown
|
|
474
|
+
> = z.object({
|
|
475
|
+
url: z.string(),
|
|
476
|
+
detail: z.string().optional(),
|
|
477
|
+
});
|
|
478
|
+
/** @internal */
|
|
479
|
+
export type ImageUrl$Outbound = {
|
|
480
|
+
url: string;
|
|
481
|
+
detail?: string | undefined;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
/** @internal */
|
|
485
|
+
export const ImageUrl$outboundSchema: z.ZodType<
|
|
486
|
+
ImageUrl$Outbound,
|
|
487
|
+
z.ZodTypeDef,
|
|
488
|
+
ImageUrl
|
|
489
|
+
> = z.object({
|
|
490
|
+
url: z.string(),
|
|
491
|
+
detail: z.string().optional(),
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
export function imageUrlToJSON(imageUrl: ImageUrl): string {
|
|
495
|
+
return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl));
|
|
496
|
+
}
|
|
497
|
+
export function imageUrlFromJSON(
|
|
498
|
+
jsonString: string,
|
|
499
|
+
): SafeParseResult<ImageUrl, SDKValidationError> {
|
|
500
|
+
return safeParse(
|
|
501
|
+
jsonString,
|
|
502
|
+
(x) => ImageUrl$inboundSchema.parse(JSON.parse(x)),
|
|
503
|
+
`Failed to parse 'ImageUrl' from JSON`,
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** @internal */
|
|
508
|
+
export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
|
|
509
|
+
.object({
|
|
510
|
+
type: TwoType$inboundSchema,
|
|
511
|
+
image_url: z.lazy(() => ImageUrl$inboundSchema),
|
|
512
|
+
}).transform((v) => {
|
|
513
|
+
return remap$(v, {
|
|
514
|
+
"image_url": "imageUrl",
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
/** @internal */
|
|
518
|
+
export type Two2$Outbound = {
|
|
519
|
+
type: string;
|
|
520
|
+
image_url: ImageUrl$Outbound;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
/** @internal */
|
|
524
|
+
export const Two2$outboundSchema: z.ZodType<Two2$Outbound, z.ZodTypeDef, Two2> =
|
|
525
|
+
z.object({
|
|
526
|
+
type: TwoType$outboundSchema,
|
|
527
|
+
imageUrl: z.lazy(() => ImageUrl$outboundSchema),
|
|
528
|
+
}).transform((v) => {
|
|
529
|
+
return remap$(v, {
|
|
530
|
+
imageUrl: "image_url",
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
export function two2ToJSON(two2: Two2): string {
|
|
535
|
+
return JSON.stringify(Two2$outboundSchema.parse(two2));
|
|
536
|
+
}
|
|
537
|
+
export function two2FromJSON(
|
|
538
|
+
jsonString: string,
|
|
539
|
+
): SafeParseResult<Two2, SDKValidationError> {
|
|
540
|
+
return safeParse(
|
|
541
|
+
jsonString,
|
|
542
|
+
(x) => Two2$inboundSchema.parse(JSON.parse(x)),
|
|
543
|
+
`Failed to parse 'Two2' from JSON`,
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/** @internal */
|
|
548
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
549
|
+
Type,
|
|
550
|
+
);
|
|
551
|
+
/** @internal */
|
|
552
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
553
|
+
Type$inboundSchema;
|
|
554
|
+
|
|
555
|
+
/** @internal */
|
|
556
|
+
export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
|
|
557
|
+
.object({
|
|
558
|
+
type: Type$inboundSchema,
|
|
559
|
+
text: z.string(),
|
|
560
|
+
});
|
|
561
|
+
/** @internal */
|
|
562
|
+
export type One$Outbound = {
|
|
563
|
+
type: string;
|
|
564
|
+
text: string;
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
/** @internal */
|
|
568
|
+
export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
|
|
569
|
+
.object({
|
|
570
|
+
type: Type$outboundSchema,
|
|
571
|
+
text: z.string(),
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
export function oneToJSON(one: One): string {
|
|
575
|
+
return JSON.stringify(One$outboundSchema.parse(one));
|
|
576
|
+
}
|
|
577
|
+
export function oneFromJSON(
|
|
578
|
+
jsonString: string,
|
|
579
|
+
): SafeParseResult<One, SDKValidationError> {
|
|
580
|
+
return safeParse(
|
|
581
|
+
jsonString,
|
|
582
|
+
(x) => One$inboundSchema.parse(JSON.parse(x)),
|
|
583
|
+
`Failed to parse 'One' from JSON`,
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** @internal */
|
|
588
|
+
export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z.union(
|
|
589
|
+
[
|
|
590
|
+
z.lazy(() => One$inboundSchema),
|
|
591
|
+
z.lazy(() => Two2$inboundSchema),
|
|
592
|
+
z.lazy(() => Three$inboundSchema),
|
|
593
|
+
],
|
|
594
|
+
);
|
|
595
|
+
/** @internal */
|
|
596
|
+
export type Two$Outbound = One$Outbound | Two2$Outbound | Three$Outbound;
|
|
597
|
+
|
|
598
|
+
/** @internal */
|
|
599
|
+
export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
|
|
600
|
+
.union([
|
|
601
|
+
z.lazy(() => One$outboundSchema),
|
|
602
|
+
z.lazy(() => Two2$outboundSchema),
|
|
603
|
+
z.lazy(() => Three$outboundSchema),
|
|
604
|
+
]);
|
|
605
|
+
|
|
606
|
+
export function twoToJSON(two: Two): string {
|
|
607
|
+
return JSON.stringify(Two$outboundSchema.parse(two));
|
|
608
|
+
}
|
|
609
|
+
export function twoFromJSON(
|
|
610
|
+
jsonString: string,
|
|
611
|
+
): SafeParseResult<Two, SDKValidationError> {
|
|
612
|
+
return safeParse(
|
|
613
|
+
jsonString,
|
|
614
|
+
(x) => Two$inboundSchema.parse(JSON.parse(x)),
|
|
615
|
+
`Failed to parse 'Two' from JSON`,
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/** @internal */
|
|
620
|
+
export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
|
|
621
|
+
z.union([
|
|
622
|
+
z.string(),
|
|
623
|
+
z.array(z.union([
|
|
624
|
+
z.lazy(() => One$inboundSchema),
|
|
625
|
+
z.lazy(() => Two2$inboundSchema),
|
|
626
|
+
z.lazy(() => Three$inboundSchema),
|
|
627
|
+
])),
|
|
628
|
+
]);
|
|
629
|
+
/** @internal */
|
|
630
|
+
export type Content$Outbound =
|
|
631
|
+
| string
|
|
632
|
+
| Array<One$Outbound | Two2$Outbound | Three$Outbound>;
|
|
633
|
+
|
|
634
|
+
/** @internal */
|
|
635
|
+
export const Content$outboundSchema: z.ZodType<
|
|
636
|
+
Content$Outbound,
|
|
637
|
+
z.ZodTypeDef,
|
|
638
|
+
Content
|
|
639
|
+
> = z.union([
|
|
640
|
+
z.string(),
|
|
641
|
+
z.array(z.union([
|
|
642
|
+
z.lazy(() => One$outboundSchema),
|
|
643
|
+
z.lazy(() => Two2$outboundSchema),
|
|
644
|
+
z.lazy(() => Three$outboundSchema),
|
|
645
|
+
])),
|
|
646
|
+
]);
|
|
647
|
+
|
|
648
|
+
export function contentToJSON(content: Content): string {
|
|
649
|
+
return JSON.stringify(Content$outboundSchema.parse(content));
|
|
650
|
+
}
|
|
651
|
+
export function contentFromJSON(
|
|
652
|
+
jsonString: string,
|
|
653
|
+
): SafeParseResult<Content, SDKValidationError> {
|
|
654
|
+
return safeParse(
|
|
655
|
+
jsonString,
|
|
656
|
+
(x) => Content$inboundSchema.parse(JSON.parse(x)),
|
|
657
|
+
`Failed to parse 'Content' from JSON`,
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/** @internal */
|
|
662
|
+
export const InvokeEvalType$inboundSchema: z.ZodNativeEnum<
|
|
663
|
+
typeof InvokeEvalType
|
|
664
|
+
> = z.nativeEnum(InvokeEvalType);
|
|
665
|
+
/** @internal */
|
|
666
|
+
export const InvokeEvalType$outboundSchema: z.ZodNativeEnum<
|
|
667
|
+
typeof InvokeEvalType
|
|
668
|
+
> = InvokeEvalType$inboundSchema;
|
|
669
|
+
|
|
670
|
+
/** @internal */
|
|
671
|
+
export const FunctionT$inboundSchema: z.ZodType<
|
|
672
|
+
FunctionT,
|
|
673
|
+
z.ZodTypeDef,
|
|
674
|
+
unknown
|
|
675
|
+
> = z.object({
|
|
676
|
+
name: z.string(),
|
|
677
|
+
arguments: z.string(),
|
|
678
|
+
});
|
|
679
|
+
/** @internal */
|
|
680
|
+
export type FunctionT$Outbound = {
|
|
681
|
+
name: string;
|
|
682
|
+
arguments: string;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
/** @internal */
|
|
686
|
+
export const FunctionT$outboundSchema: z.ZodType<
|
|
687
|
+
FunctionT$Outbound,
|
|
688
|
+
z.ZodTypeDef,
|
|
689
|
+
FunctionT
|
|
690
|
+
> = z.object({
|
|
691
|
+
name: z.string(),
|
|
692
|
+
arguments: z.string(),
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
export function functionToJSON(functionT: FunctionT): string {
|
|
696
|
+
return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
|
|
697
|
+
}
|
|
698
|
+
export function functionFromJSON(
|
|
699
|
+
jsonString: string,
|
|
700
|
+
): SafeParseResult<FunctionT, SDKValidationError> {
|
|
701
|
+
return safeParse(
|
|
702
|
+
jsonString,
|
|
703
|
+
(x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
|
|
704
|
+
`Failed to parse 'FunctionT' from JSON`,
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/** @internal */
|
|
709
|
+
export const ToolCalls$inboundSchema: z.ZodType<
|
|
710
|
+
ToolCalls,
|
|
711
|
+
z.ZodTypeDef,
|
|
712
|
+
unknown
|
|
713
|
+
> = z.object({
|
|
714
|
+
id: z.string().optional(),
|
|
715
|
+
index: z.number().optional(),
|
|
716
|
+
type: InvokeEvalType$inboundSchema,
|
|
717
|
+
function: z.lazy(() => FunctionT$inboundSchema),
|
|
718
|
+
});
|
|
719
|
+
/** @internal */
|
|
720
|
+
export type ToolCalls$Outbound = {
|
|
721
|
+
id?: string | undefined;
|
|
722
|
+
index?: number | undefined;
|
|
723
|
+
type: string;
|
|
724
|
+
function: FunctionT$Outbound;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
/** @internal */
|
|
728
|
+
export const ToolCalls$outboundSchema: z.ZodType<
|
|
729
|
+
ToolCalls$Outbound,
|
|
730
|
+
z.ZodTypeDef,
|
|
731
|
+
ToolCalls
|
|
732
|
+
> = z.object({
|
|
733
|
+
id: z.string().optional(),
|
|
734
|
+
index: z.number().optional(),
|
|
735
|
+
type: InvokeEvalType$outboundSchema,
|
|
736
|
+
function: z.lazy(() => FunctionT$outboundSchema),
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
export function toolCallsToJSON(toolCalls: ToolCalls): string {
|
|
740
|
+
return JSON.stringify(ToolCalls$outboundSchema.parse(toolCalls));
|
|
741
|
+
}
|
|
742
|
+
export function toolCallsFromJSON(
|
|
743
|
+
jsonString: string,
|
|
744
|
+
): SafeParseResult<ToolCalls, SDKValidationError> {
|
|
745
|
+
return safeParse(
|
|
746
|
+
jsonString,
|
|
747
|
+
(x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
|
|
748
|
+
`Failed to parse 'ToolCalls' from JSON`,
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/** @internal */
|
|
753
|
+
export const Messages$inboundSchema: z.ZodType<
|
|
754
|
+
Messages,
|
|
755
|
+
z.ZodTypeDef,
|
|
756
|
+
unknown
|
|
757
|
+
> = z.object({
|
|
758
|
+
role: Role$inboundSchema,
|
|
759
|
+
content: z.nullable(
|
|
760
|
+
z.union([
|
|
761
|
+
z.string(),
|
|
762
|
+
z.array(z.union([
|
|
763
|
+
z.lazy(() => One$inboundSchema),
|
|
764
|
+
z.lazy(() => Two2$inboundSchema),
|
|
765
|
+
z.lazy(() => Three$inboundSchema),
|
|
766
|
+
])),
|
|
767
|
+
]),
|
|
768
|
+
),
|
|
769
|
+
tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
|
|
770
|
+
tool_call_id: z.string().optional(),
|
|
771
|
+
}).transform((v) => {
|
|
772
|
+
return remap$(v, {
|
|
773
|
+
"tool_calls": "toolCalls",
|
|
774
|
+
"tool_call_id": "toolCallId",
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
/** @internal */
|
|
778
|
+
export type Messages$Outbound = {
|
|
779
|
+
role: string;
|
|
780
|
+
content: string | Array<One$Outbound | Two2$Outbound | Three$Outbound> | null;
|
|
781
|
+
tool_calls?: Array<ToolCalls$Outbound> | undefined;
|
|
782
|
+
tool_call_id?: string | undefined;
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
/** @internal */
|
|
786
|
+
export const Messages$outboundSchema: z.ZodType<
|
|
787
|
+
Messages$Outbound,
|
|
788
|
+
z.ZodTypeDef,
|
|
789
|
+
Messages
|
|
790
|
+
> = z.object({
|
|
791
|
+
role: Role$outboundSchema,
|
|
792
|
+
content: z.nullable(
|
|
793
|
+
z.union([
|
|
794
|
+
z.string(),
|
|
795
|
+
z.array(z.union([
|
|
796
|
+
z.lazy(() => One$outboundSchema),
|
|
797
|
+
z.lazy(() => Two2$outboundSchema),
|
|
798
|
+
z.lazy(() => Three$outboundSchema),
|
|
799
|
+
])),
|
|
800
|
+
]),
|
|
801
|
+
),
|
|
802
|
+
toolCalls: z.array(z.lazy(() => ToolCalls$outboundSchema)).optional(),
|
|
803
|
+
toolCallId: z.string().optional(),
|
|
804
|
+
}).transform((v) => {
|
|
805
|
+
return remap$(v, {
|
|
806
|
+
toolCalls: "tool_calls",
|
|
807
|
+
toolCallId: "tool_call_id",
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
|
|
811
|
+
export function messagesToJSON(messages: Messages): string {
|
|
812
|
+
return JSON.stringify(Messages$outboundSchema.parse(messages));
|
|
813
|
+
}
|
|
814
|
+
export function messagesFromJSON(
|
|
815
|
+
jsonString: string,
|
|
816
|
+
): SafeParseResult<Messages, SDKValidationError> {
|
|
817
|
+
return safeParse(
|
|
818
|
+
jsonString,
|
|
819
|
+
(x) => Messages$inboundSchema.parse(JSON.parse(x)),
|
|
820
|
+
`Failed to parse 'Messages' from JSON`,
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/** @internal */
|
|
825
|
+
export const InvokeEvalRequestBody$inboundSchema: z.ZodType<
|
|
826
|
+
InvokeEvalRequestBody,
|
|
827
|
+
z.ZodTypeDef,
|
|
828
|
+
unknown
|
|
829
|
+
> = z.object({
|
|
830
|
+
query: z.string().optional(),
|
|
831
|
+
output: z.string().optional(),
|
|
832
|
+
reference: z.string().optional(),
|
|
833
|
+
retrievals: z.array(z.string()).optional(),
|
|
834
|
+
messages: z.array(z.lazy(() => Messages$inboundSchema)).optional(),
|
|
835
|
+
});
|
|
836
|
+
/** @internal */
|
|
837
|
+
export type InvokeEvalRequestBody$Outbound = {
|
|
838
|
+
query?: string | undefined;
|
|
839
|
+
output?: string | undefined;
|
|
840
|
+
reference?: string | undefined;
|
|
841
|
+
retrievals?: Array<string> | undefined;
|
|
842
|
+
messages?: Array<Messages$Outbound> | undefined;
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
/** @internal */
|
|
846
|
+
export const InvokeEvalRequestBody$outboundSchema: z.ZodType<
|
|
847
|
+
InvokeEvalRequestBody$Outbound,
|
|
848
|
+
z.ZodTypeDef,
|
|
849
|
+
InvokeEvalRequestBody
|
|
850
|
+
> = z.object({
|
|
851
|
+
query: z.string().optional(),
|
|
852
|
+
output: z.string().optional(),
|
|
853
|
+
reference: z.string().optional(),
|
|
854
|
+
retrievals: z.array(z.string()).optional(),
|
|
855
|
+
messages: z.array(z.lazy(() => Messages$outboundSchema)).optional(),
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
export function invokeEvalRequestBodyToJSON(
|
|
859
|
+
invokeEvalRequestBody: InvokeEvalRequestBody,
|
|
860
|
+
): string {
|
|
861
|
+
return JSON.stringify(
|
|
862
|
+
InvokeEvalRequestBody$outboundSchema.parse(invokeEvalRequestBody),
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
export function invokeEvalRequestBodyFromJSON(
|
|
866
|
+
jsonString: string,
|
|
867
|
+
): SafeParseResult<InvokeEvalRequestBody, SDKValidationError> {
|
|
868
|
+
return safeParse(
|
|
869
|
+
jsonString,
|
|
870
|
+
(x) => InvokeEvalRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
871
|
+
`Failed to parse 'InvokeEvalRequestBody' from JSON`,
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/** @internal */
|
|
876
|
+
export const InvokeEvalRequest$inboundSchema: z.ZodType<
|
|
877
|
+
InvokeEvalRequest,
|
|
878
|
+
z.ZodTypeDef,
|
|
879
|
+
unknown
|
|
880
|
+
> = z.object({
|
|
881
|
+
id: z.string(),
|
|
882
|
+
RequestBody: z.lazy(() => InvokeEvalRequestBody$inboundSchema).optional(),
|
|
883
|
+
}).transform((v) => {
|
|
884
|
+
return remap$(v, {
|
|
885
|
+
"RequestBody": "requestBody",
|
|
886
|
+
});
|
|
887
|
+
});
|
|
888
|
+
/** @internal */
|
|
889
|
+
export type InvokeEvalRequest$Outbound = {
|
|
890
|
+
id: string;
|
|
891
|
+
RequestBody?: InvokeEvalRequestBody$Outbound | undefined;
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
/** @internal */
|
|
895
|
+
export const InvokeEvalRequest$outboundSchema: z.ZodType<
|
|
896
|
+
InvokeEvalRequest$Outbound,
|
|
897
|
+
z.ZodTypeDef,
|
|
898
|
+
InvokeEvalRequest
|
|
899
|
+
> = z.object({
|
|
900
|
+
id: z.string(),
|
|
901
|
+
requestBody: z.lazy(() => InvokeEvalRequestBody$outboundSchema).optional(),
|
|
902
|
+
}).transform((v) => {
|
|
903
|
+
return remap$(v, {
|
|
904
|
+
requestBody: "RequestBody",
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
export function invokeEvalRequestToJSON(
|
|
909
|
+
invokeEvalRequest: InvokeEvalRequest,
|
|
910
|
+
): string {
|
|
911
|
+
return JSON.stringify(
|
|
912
|
+
InvokeEvalRequest$outboundSchema.parse(invokeEvalRequest),
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
export function invokeEvalRequestFromJSON(
|
|
916
|
+
jsonString: string,
|
|
917
|
+
): SafeParseResult<InvokeEvalRequest, SDKValidationError> {
|
|
918
|
+
return safeParse(
|
|
919
|
+
jsonString,
|
|
920
|
+
(x) => InvokeEvalRequest$inboundSchema.parse(JSON.parse(x)),
|
|
921
|
+
`Failed to parse 'InvokeEvalRequest' from JSON`,
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/** @internal */
|
|
926
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type$inboundSchema:
|
|
927
|
+
z.ZodNativeEnum<
|
|
928
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type
|
|
929
|
+
> = z.nativeEnum(InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type);
|
|
930
|
+
/** @internal */
|
|
931
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type$outboundSchema:
|
|
932
|
+
z.ZodNativeEnum<
|
|
933
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type
|
|
934
|
+
> = InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type$inboundSchema;
|
|
935
|
+
|
|
936
|
+
/** @internal */
|
|
937
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$inboundSchema:
|
|
938
|
+
z.ZodType<
|
|
939
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue,
|
|
940
|
+
z.ZodTypeDef,
|
|
941
|
+
unknown
|
|
942
|
+
> = z.union([z.number(), z.boolean()]);
|
|
943
|
+
/** @internal */
|
|
944
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$Outbound =
|
|
945
|
+
| number
|
|
946
|
+
| boolean;
|
|
947
|
+
|
|
948
|
+
/** @internal */
|
|
949
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$outboundSchema:
|
|
950
|
+
z.ZodType<
|
|
951
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$Outbound,
|
|
952
|
+
z.ZodTypeDef,
|
|
953
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue
|
|
954
|
+
> = z.union([z.number(), z.boolean()]);
|
|
955
|
+
|
|
956
|
+
export function invokeEvalResponseBodyEvalsResponse200ApplicationJSONValueToJSON(
|
|
957
|
+
invokeEvalResponseBodyEvalsResponse200ApplicationJSONValue:
|
|
958
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue,
|
|
959
|
+
): string {
|
|
960
|
+
return JSON.stringify(
|
|
961
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$outboundSchema
|
|
962
|
+
.parse(invokeEvalResponseBodyEvalsResponse200ApplicationJSONValue),
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
export function invokeEvalResponseBodyEvalsResponse200ApplicationJSONValueFromJSON(
|
|
966
|
+
jsonString: string,
|
|
967
|
+
): SafeParseResult<
|
|
968
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue,
|
|
969
|
+
SDKValidationError
|
|
970
|
+
> {
|
|
971
|
+
return safeParse(
|
|
972
|
+
jsonString,
|
|
973
|
+
(x) =>
|
|
974
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue$inboundSchema
|
|
975
|
+
.parse(JSON.parse(x)),
|
|
976
|
+
`Failed to parse 'InvokeEvalResponseBodyEvalsResponse200ApplicationJSONValue' from JSON`,
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/** @internal */
|
|
981
|
+
export const InvokeEvalResponseBodyEvalsResponse200Value$inboundSchema:
|
|
982
|
+
z.ZodType<
|
|
983
|
+
InvokeEvalResponseBodyEvalsResponse200Value,
|
|
984
|
+
z.ZodTypeDef,
|
|
985
|
+
unknown
|
|
986
|
+
> = z.object({
|
|
987
|
+
type: z.string(),
|
|
988
|
+
value: z.union([z.number(), z.boolean()]),
|
|
989
|
+
});
|
|
990
|
+
/** @internal */
|
|
991
|
+
export type InvokeEvalResponseBodyEvalsResponse200Value$Outbound = {
|
|
992
|
+
type: string;
|
|
993
|
+
value: number | boolean;
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
/** @internal */
|
|
997
|
+
export const InvokeEvalResponseBodyEvalsResponse200Value$outboundSchema:
|
|
998
|
+
z.ZodType<
|
|
999
|
+
InvokeEvalResponseBodyEvalsResponse200Value$Outbound,
|
|
1000
|
+
z.ZodTypeDef,
|
|
1001
|
+
InvokeEvalResponseBodyEvalsResponse200Value
|
|
1002
|
+
> = z.object({
|
|
1003
|
+
type: z.string(),
|
|
1004
|
+
value: z.union([z.number(), z.boolean()]),
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
export function invokeEvalResponseBodyEvalsResponse200ValueToJSON(
|
|
1008
|
+
invokeEvalResponseBodyEvalsResponse200Value:
|
|
1009
|
+
InvokeEvalResponseBodyEvalsResponse200Value,
|
|
1010
|
+
): string {
|
|
1011
|
+
return JSON.stringify(
|
|
1012
|
+
InvokeEvalResponseBodyEvalsResponse200Value$outboundSchema.parse(
|
|
1013
|
+
invokeEvalResponseBodyEvalsResponse200Value,
|
|
1014
|
+
),
|
|
1015
|
+
);
|
|
1016
|
+
}
|
|
1017
|
+
export function invokeEvalResponseBodyEvalsResponse200ValueFromJSON(
|
|
1018
|
+
jsonString: string,
|
|
1019
|
+
): SafeParseResult<
|
|
1020
|
+
InvokeEvalResponseBodyEvalsResponse200Value,
|
|
1021
|
+
SDKValidationError
|
|
1022
|
+
> {
|
|
1023
|
+
return safeParse(
|
|
1024
|
+
jsonString,
|
|
1025
|
+
(x) =>
|
|
1026
|
+
InvokeEvalResponseBodyEvalsResponse200Value$inboundSchema.parse(
|
|
1027
|
+
JSON.parse(x),
|
|
1028
|
+
),
|
|
1029
|
+
`Failed to parse 'InvokeEvalResponseBodyEvalsResponse200Value' from JSON`,
|
|
1030
|
+
);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** @internal */
|
|
1034
|
+
export const InvokeEvalResponseBodyHTTP$inboundSchema: z.ZodType<
|
|
1035
|
+
InvokeEvalResponseBodyHTTP,
|
|
1036
|
+
z.ZodTypeDef,
|
|
1037
|
+
unknown
|
|
1038
|
+
> = z.object({
|
|
1039
|
+
type:
|
|
1040
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type$inboundSchema,
|
|
1041
|
+
value: z.nullable(
|
|
1042
|
+
z.lazy(() => InvokeEvalResponseBodyEvalsResponse200Value$inboundSchema),
|
|
1043
|
+
).optional(),
|
|
1044
|
+
});
|
|
1045
|
+
/** @internal */
|
|
1046
|
+
export type InvokeEvalResponseBodyHTTP$Outbound = {
|
|
1047
|
+
type: string;
|
|
1048
|
+
value?:
|
|
1049
|
+
| InvokeEvalResponseBodyEvalsResponse200Value$Outbound
|
|
1050
|
+
| null
|
|
1051
|
+
| undefined;
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
/** @internal */
|
|
1055
|
+
export const InvokeEvalResponseBodyHTTP$outboundSchema: z.ZodType<
|
|
1056
|
+
InvokeEvalResponseBodyHTTP$Outbound,
|
|
1057
|
+
z.ZodTypeDef,
|
|
1058
|
+
InvokeEvalResponseBodyHTTP
|
|
1059
|
+
> = z.object({
|
|
1060
|
+
type:
|
|
1061
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson8Type$outboundSchema,
|
|
1062
|
+
value: z.nullable(
|
|
1063
|
+
z.lazy(() => InvokeEvalResponseBodyEvalsResponse200Value$outboundSchema),
|
|
1064
|
+
).optional(),
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1067
|
+
export function invokeEvalResponseBodyHTTPToJSON(
|
|
1068
|
+
invokeEvalResponseBodyHTTP: InvokeEvalResponseBodyHTTP,
|
|
1069
|
+
): string {
|
|
1070
|
+
return JSON.stringify(
|
|
1071
|
+
InvokeEvalResponseBodyHTTP$outboundSchema.parse(invokeEvalResponseBodyHTTP),
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
export function invokeEvalResponseBodyHTTPFromJSON(
|
|
1075
|
+
jsonString: string,
|
|
1076
|
+
): SafeParseResult<InvokeEvalResponseBodyHTTP, SDKValidationError> {
|
|
1077
|
+
return safeParse(
|
|
1078
|
+
jsonString,
|
|
1079
|
+
(x) => InvokeEvalResponseBodyHTTP$inboundSchema.parse(JSON.parse(x)),
|
|
1080
|
+
`Failed to parse 'InvokeEvalResponseBodyHTTP' from JSON`,
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/** @internal */
|
|
1085
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type$inboundSchema:
|
|
1086
|
+
z.ZodNativeEnum<
|
|
1087
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type
|
|
1088
|
+
> = z.nativeEnum(InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type);
|
|
1089
|
+
/** @internal */
|
|
1090
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type$outboundSchema:
|
|
1091
|
+
z.ZodNativeEnum<
|
|
1092
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type
|
|
1093
|
+
> = InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type$inboundSchema;
|
|
1094
|
+
|
|
1095
|
+
/** @internal */
|
|
1096
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$inboundSchema:
|
|
1097
|
+
z.ZodType<
|
|
1098
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value,
|
|
1099
|
+
z.ZodTypeDef,
|
|
1100
|
+
unknown
|
|
1101
|
+
> = z.union([z.number(), z.boolean(), z.string()]);
|
|
1102
|
+
/** @internal */
|
|
1103
|
+
export type InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$Outbound =
|
|
1104
|
+
| number
|
|
1105
|
+
| boolean
|
|
1106
|
+
| string;
|
|
1107
|
+
|
|
1108
|
+
/** @internal */
|
|
1109
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$outboundSchema:
|
|
1110
|
+
z.ZodType<
|
|
1111
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$Outbound,
|
|
1112
|
+
z.ZodTypeDef,
|
|
1113
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value
|
|
1114
|
+
> = z.union([z.number(), z.boolean(), z.string()]);
|
|
1115
|
+
|
|
1116
|
+
export function invokeEvalResponseBodyEvalsResponse200ApplicationJSON7ValueToJSON(
|
|
1117
|
+
invokeEvalResponseBodyEvalsResponse200ApplicationJson7Value:
|
|
1118
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value,
|
|
1119
|
+
): string {
|
|
1120
|
+
return JSON.stringify(
|
|
1121
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$outboundSchema
|
|
1122
|
+
.parse(invokeEvalResponseBodyEvalsResponse200ApplicationJson7Value),
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
export function invokeEvalResponseBodyEvalsResponse200ApplicationJSON7ValueFromJSON(
|
|
1126
|
+
jsonString: string,
|
|
1127
|
+
): SafeParseResult<
|
|
1128
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value,
|
|
1129
|
+
SDKValidationError
|
|
1130
|
+
> {
|
|
1131
|
+
return safeParse(
|
|
1132
|
+
jsonString,
|
|
1133
|
+
(x) =>
|
|
1134
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value$inboundSchema
|
|
1135
|
+
.parse(JSON.parse(x)),
|
|
1136
|
+
`Failed to parse 'InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Value' from JSON`,
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/** @internal */
|
|
1141
|
+
export const OriginalValue$inboundSchema: z.ZodType<
|
|
1142
|
+
OriginalValue,
|
|
1143
|
+
z.ZodTypeDef,
|
|
1144
|
+
unknown
|
|
1145
|
+
> = z.union([z.number(), z.boolean(), z.string()]);
|
|
1146
|
+
/** @internal */
|
|
1147
|
+
export type OriginalValue$Outbound = number | boolean | string;
|
|
1148
|
+
|
|
1149
|
+
/** @internal */
|
|
1150
|
+
export const OriginalValue$outboundSchema: z.ZodType<
|
|
1151
|
+
OriginalValue$Outbound,
|
|
1152
|
+
z.ZodTypeDef,
|
|
1153
|
+
OriginalValue
|
|
1154
|
+
> = z.union([z.number(), z.boolean(), z.string()]);
|
|
1155
|
+
|
|
1156
|
+
export function originalValueToJSON(originalValue: OriginalValue): string {
|
|
1157
|
+
return JSON.stringify(OriginalValue$outboundSchema.parse(originalValue));
|
|
1158
|
+
}
|
|
1159
|
+
export function originalValueFromJSON(
|
|
1160
|
+
jsonString: string,
|
|
1161
|
+
): SafeParseResult<OriginalValue, SDKValidationError> {
|
|
1162
|
+
return safeParse(
|
|
1163
|
+
jsonString,
|
|
1164
|
+
(x) => OriginalValue$inboundSchema.parse(JSON.parse(x)),
|
|
1165
|
+
`Failed to parse 'OriginalValue' from JSON`,
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/** @internal */
|
|
1170
|
+
export const InvokeEvalResponseBodyEvalsResponseValue$inboundSchema: z.ZodType<
|
|
1171
|
+
InvokeEvalResponseBodyEvalsResponseValue,
|
|
1172
|
+
z.ZodTypeDef,
|
|
1173
|
+
unknown
|
|
1174
|
+
> = z.object({
|
|
1175
|
+
workflow_run_id: z.string(),
|
|
1176
|
+
value: z.union([z.number(), z.boolean(), z.string()]),
|
|
1177
|
+
explanation: z.nullable(z.string()).optional(),
|
|
1178
|
+
original_value: z.nullable(z.union([z.number(), z.boolean(), z.string()]))
|
|
1179
|
+
.optional(),
|
|
1180
|
+
original_explanation: z.nullable(z.string()).optional(),
|
|
1181
|
+
}).transform((v) => {
|
|
1182
|
+
return remap$(v, {
|
|
1183
|
+
"workflow_run_id": "workflowRunId",
|
|
1184
|
+
"original_value": "originalValue",
|
|
1185
|
+
"original_explanation": "originalExplanation",
|
|
1186
|
+
});
|
|
1187
|
+
});
|
|
1188
|
+
/** @internal */
|
|
1189
|
+
export type InvokeEvalResponseBodyEvalsResponseValue$Outbound = {
|
|
1190
|
+
workflow_run_id: string;
|
|
1191
|
+
value: number | boolean | string;
|
|
1192
|
+
explanation?: string | null | undefined;
|
|
1193
|
+
original_value?: number | boolean | string | null | undefined;
|
|
1194
|
+
original_explanation?: string | null | undefined;
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
/** @internal */
|
|
1198
|
+
export const InvokeEvalResponseBodyEvalsResponseValue$outboundSchema: z.ZodType<
|
|
1199
|
+
InvokeEvalResponseBodyEvalsResponseValue$Outbound,
|
|
1200
|
+
z.ZodTypeDef,
|
|
1201
|
+
InvokeEvalResponseBodyEvalsResponseValue
|
|
1202
|
+
> = z.object({
|
|
1203
|
+
workflowRunId: z.string(),
|
|
1204
|
+
value: z.union([z.number(), z.boolean(), z.string()]),
|
|
1205
|
+
explanation: z.nullable(z.string()).optional(),
|
|
1206
|
+
originalValue: z.nullable(z.union([z.number(), z.boolean(), z.string()]))
|
|
1207
|
+
.optional(),
|
|
1208
|
+
originalExplanation: z.nullable(z.string()).optional(),
|
|
1209
|
+
}).transform((v) => {
|
|
1210
|
+
return remap$(v, {
|
|
1211
|
+
workflowRunId: "workflow_run_id",
|
|
1212
|
+
originalValue: "original_value",
|
|
1213
|
+
originalExplanation: "original_explanation",
|
|
1214
|
+
});
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
export function invokeEvalResponseBodyEvalsResponseValueToJSON(
|
|
1218
|
+
invokeEvalResponseBodyEvalsResponseValue:
|
|
1219
|
+
InvokeEvalResponseBodyEvalsResponseValue,
|
|
1220
|
+
): string {
|
|
1221
|
+
return JSON.stringify(
|
|
1222
|
+
InvokeEvalResponseBodyEvalsResponseValue$outboundSchema.parse(
|
|
1223
|
+
invokeEvalResponseBodyEvalsResponseValue,
|
|
1224
|
+
),
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
export function invokeEvalResponseBodyEvalsResponseValueFromJSON(
|
|
1228
|
+
jsonString: string,
|
|
1229
|
+
): SafeParseResult<
|
|
1230
|
+
InvokeEvalResponseBodyEvalsResponseValue,
|
|
1231
|
+
SDKValidationError
|
|
1232
|
+
> {
|
|
1233
|
+
return safeParse(
|
|
1234
|
+
jsonString,
|
|
1235
|
+
(x) =>
|
|
1236
|
+
InvokeEvalResponseBodyEvalsResponseValue$inboundSchema.parse(
|
|
1237
|
+
JSON.parse(x),
|
|
1238
|
+
),
|
|
1239
|
+
`Failed to parse 'InvokeEvalResponseBodyEvalsResponseValue' from JSON`,
|
|
1240
|
+
);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/** @internal */
|
|
1244
|
+
export const InvokeEvalResponseBodyLLM$inboundSchema: z.ZodType<
|
|
1245
|
+
InvokeEvalResponseBodyLLM,
|
|
1246
|
+
z.ZodTypeDef,
|
|
1247
|
+
unknown
|
|
1248
|
+
> = z.object({
|
|
1249
|
+
type:
|
|
1250
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type$inboundSchema,
|
|
1251
|
+
value: z.nullable(
|
|
1252
|
+
z.lazy(() => InvokeEvalResponseBodyEvalsResponseValue$inboundSchema),
|
|
1253
|
+
),
|
|
1254
|
+
});
|
|
1255
|
+
/** @internal */
|
|
1256
|
+
export type InvokeEvalResponseBodyLLM$Outbound = {
|
|
1257
|
+
type: string;
|
|
1258
|
+
value: InvokeEvalResponseBodyEvalsResponseValue$Outbound | null;
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
/** @internal */
|
|
1262
|
+
export const InvokeEvalResponseBodyLLM$outboundSchema: z.ZodType<
|
|
1263
|
+
InvokeEvalResponseBodyLLM$Outbound,
|
|
1264
|
+
z.ZodTypeDef,
|
|
1265
|
+
InvokeEvalResponseBodyLLM
|
|
1266
|
+
> = z.object({
|
|
1267
|
+
type:
|
|
1268
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson7Type$outboundSchema,
|
|
1269
|
+
value: z.nullable(
|
|
1270
|
+
z.lazy(() => InvokeEvalResponseBodyEvalsResponseValue$outboundSchema),
|
|
1271
|
+
),
|
|
1272
|
+
});
|
|
1273
|
+
|
|
1274
|
+
export function invokeEvalResponseBodyLLMToJSON(
|
|
1275
|
+
invokeEvalResponseBodyLLM: InvokeEvalResponseBodyLLM,
|
|
1276
|
+
): string {
|
|
1277
|
+
return JSON.stringify(
|
|
1278
|
+
InvokeEvalResponseBodyLLM$outboundSchema.parse(invokeEvalResponseBodyLLM),
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
export function invokeEvalResponseBodyLLMFromJSON(
|
|
1282
|
+
jsonString: string,
|
|
1283
|
+
): SafeParseResult<InvokeEvalResponseBodyLLM, SDKValidationError> {
|
|
1284
|
+
return safeParse(
|
|
1285
|
+
jsonString,
|
|
1286
|
+
(x) => InvokeEvalResponseBodyLLM$inboundSchema.parse(JSON.parse(x)),
|
|
1287
|
+
`Failed to parse 'InvokeEvalResponseBodyLLM' from JSON`,
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/** @internal */
|
|
1292
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type$inboundSchema:
|
|
1293
|
+
z.ZodNativeEnum<
|
|
1294
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type
|
|
1295
|
+
> = z.nativeEnum(InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type);
|
|
1296
|
+
/** @internal */
|
|
1297
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type$outboundSchema:
|
|
1298
|
+
z.ZodNativeEnum<
|
|
1299
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type
|
|
1300
|
+
> = InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type$inboundSchema;
|
|
1301
|
+
|
|
1302
|
+
/** @internal */
|
|
1303
|
+
export const InvokeEvalResponseBodyEvalsValue$inboundSchema: z.ZodType<
|
|
1304
|
+
InvokeEvalResponseBodyEvalsValue,
|
|
1305
|
+
z.ZodTypeDef,
|
|
1306
|
+
unknown
|
|
1307
|
+
> = z.object({
|
|
1308
|
+
f1: z.number(),
|
|
1309
|
+
precision: z.number(),
|
|
1310
|
+
recall: z.number(),
|
|
1311
|
+
});
|
|
1312
|
+
/** @internal */
|
|
1313
|
+
export type InvokeEvalResponseBodyEvalsValue$Outbound = {
|
|
1314
|
+
f1: number;
|
|
1315
|
+
precision: number;
|
|
1316
|
+
recall: number;
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
/** @internal */
|
|
1320
|
+
export const InvokeEvalResponseBodyEvalsValue$outboundSchema: z.ZodType<
|
|
1321
|
+
InvokeEvalResponseBodyEvalsValue$Outbound,
|
|
1322
|
+
z.ZodTypeDef,
|
|
1323
|
+
InvokeEvalResponseBodyEvalsValue
|
|
1324
|
+
> = z.object({
|
|
1325
|
+
f1: z.number(),
|
|
1326
|
+
precision: z.number(),
|
|
1327
|
+
recall: z.number(),
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
export function invokeEvalResponseBodyEvalsValueToJSON(
|
|
1331
|
+
invokeEvalResponseBodyEvalsValue: InvokeEvalResponseBodyEvalsValue,
|
|
1332
|
+
): string {
|
|
1333
|
+
return JSON.stringify(
|
|
1334
|
+
InvokeEvalResponseBodyEvalsValue$outboundSchema.parse(
|
|
1335
|
+
invokeEvalResponseBodyEvalsValue,
|
|
1336
|
+
),
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
export function invokeEvalResponseBodyEvalsValueFromJSON(
|
|
1340
|
+
jsonString: string,
|
|
1341
|
+
): SafeParseResult<InvokeEvalResponseBodyEvalsValue, SDKValidationError> {
|
|
1342
|
+
return safeParse(
|
|
1343
|
+
jsonString,
|
|
1344
|
+
(x) => InvokeEvalResponseBodyEvalsValue$inboundSchema.parse(JSON.parse(x)),
|
|
1345
|
+
`Failed to parse 'InvokeEvalResponseBodyEvalsValue' from JSON`,
|
|
1346
|
+
);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/** @internal */
|
|
1350
|
+
export const BERTScore$inboundSchema: z.ZodType<
|
|
1351
|
+
BERTScore,
|
|
1352
|
+
z.ZodTypeDef,
|
|
1353
|
+
unknown
|
|
1354
|
+
> = z.object({
|
|
1355
|
+
type:
|
|
1356
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type$inboundSchema,
|
|
1357
|
+
value: z.lazy(() => InvokeEvalResponseBodyEvalsValue$inboundSchema),
|
|
1358
|
+
});
|
|
1359
|
+
/** @internal */
|
|
1360
|
+
export type BERTScore$Outbound = {
|
|
1361
|
+
type: string;
|
|
1362
|
+
value: InvokeEvalResponseBodyEvalsValue$Outbound;
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
/** @internal */
|
|
1366
|
+
export const BERTScore$outboundSchema: z.ZodType<
|
|
1367
|
+
BERTScore$Outbound,
|
|
1368
|
+
z.ZodTypeDef,
|
|
1369
|
+
BERTScore
|
|
1370
|
+
> = z.object({
|
|
1371
|
+
type:
|
|
1372
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJson6Type$outboundSchema,
|
|
1373
|
+
value: z.lazy(() => InvokeEvalResponseBodyEvalsValue$outboundSchema),
|
|
1374
|
+
});
|
|
1375
|
+
|
|
1376
|
+
export function bertScoreToJSON(bertScore: BERTScore): string {
|
|
1377
|
+
return JSON.stringify(BERTScore$outboundSchema.parse(bertScore));
|
|
1378
|
+
}
|
|
1379
|
+
export function bertScoreFromJSON(
|
|
1380
|
+
jsonString: string,
|
|
1381
|
+
): SafeParseResult<BERTScore, SDKValidationError> {
|
|
1382
|
+
return safeParse(
|
|
1383
|
+
jsonString,
|
|
1384
|
+
(x) => BERTScore$inboundSchema.parse(JSON.parse(x)),
|
|
1385
|
+
`Failed to parse 'BERTScore' from JSON`,
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/** @internal */
|
|
1390
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType$inboundSchema:
|
|
1391
|
+
z.ZodNativeEnum<
|
|
1392
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType
|
|
1393
|
+
> = z.nativeEnum(InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType);
|
|
1394
|
+
/** @internal */
|
|
1395
|
+
export const InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType$outboundSchema:
|
|
1396
|
+
z.ZodNativeEnum<
|
|
1397
|
+
typeof InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType
|
|
1398
|
+
> = InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType$inboundSchema;
|
|
1399
|
+
|
|
1400
|
+
/** @internal */
|
|
1401
|
+
export const Rouge1$inboundSchema: z.ZodType<Rouge1, z.ZodTypeDef, unknown> = z
|
|
1402
|
+
.object({
|
|
1403
|
+
f1: z.number(),
|
|
1404
|
+
precision: z.number(),
|
|
1405
|
+
recall: z.number(),
|
|
1406
|
+
});
|
|
1407
|
+
/** @internal */
|
|
1408
|
+
export type Rouge1$Outbound = {
|
|
1409
|
+
f1: number;
|
|
1410
|
+
precision: number;
|
|
1411
|
+
recall: number;
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
/** @internal */
|
|
1415
|
+
export const Rouge1$outboundSchema: z.ZodType<
|
|
1416
|
+
Rouge1$Outbound,
|
|
1417
|
+
z.ZodTypeDef,
|
|
1418
|
+
Rouge1
|
|
1419
|
+
> = z.object({
|
|
1420
|
+
f1: z.number(),
|
|
1421
|
+
precision: z.number(),
|
|
1422
|
+
recall: z.number(),
|
|
1423
|
+
});
|
|
1424
|
+
|
|
1425
|
+
export function rouge1ToJSON(rouge1: Rouge1): string {
|
|
1426
|
+
return JSON.stringify(Rouge1$outboundSchema.parse(rouge1));
|
|
1427
|
+
}
|
|
1428
|
+
export function rouge1FromJSON(
|
|
1429
|
+
jsonString: string,
|
|
1430
|
+
): SafeParseResult<Rouge1, SDKValidationError> {
|
|
1431
|
+
return safeParse(
|
|
1432
|
+
jsonString,
|
|
1433
|
+
(x) => Rouge1$inboundSchema.parse(JSON.parse(x)),
|
|
1434
|
+
`Failed to parse 'Rouge1' from JSON`,
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/** @internal */
|
|
1439
|
+
export const Rouge2$inboundSchema: z.ZodType<Rouge2, z.ZodTypeDef, unknown> = z
|
|
1440
|
+
.object({
|
|
1441
|
+
f1: z.number(),
|
|
1442
|
+
precision: z.number(),
|
|
1443
|
+
recall: z.number(),
|
|
1444
|
+
});
|
|
1445
|
+
/** @internal */
|
|
1446
|
+
export type Rouge2$Outbound = {
|
|
1447
|
+
f1: number;
|
|
1448
|
+
precision: number;
|
|
1449
|
+
recall: number;
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
/** @internal */
|
|
1453
|
+
export const Rouge2$outboundSchema: z.ZodType<
|
|
1454
|
+
Rouge2$Outbound,
|
|
1455
|
+
z.ZodTypeDef,
|
|
1456
|
+
Rouge2
|
|
1457
|
+
> = z.object({
|
|
1458
|
+
f1: z.number(),
|
|
1459
|
+
precision: z.number(),
|
|
1460
|
+
recall: z.number(),
|
|
1461
|
+
});
|
|
1462
|
+
|
|
1463
|
+
export function rouge2ToJSON(rouge2: Rouge2): string {
|
|
1464
|
+
return JSON.stringify(Rouge2$outboundSchema.parse(rouge2));
|
|
1465
|
+
}
|
|
1466
|
+
export function rouge2FromJSON(
|
|
1467
|
+
jsonString: string,
|
|
1468
|
+
): SafeParseResult<Rouge2, SDKValidationError> {
|
|
1469
|
+
return safeParse(
|
|
1470
|
+
jsonString,
|
|
1471
|
+
(x) => Rouge2$inboundSchema.parse(JSON.parse(x)),
|
|
1472
|
+
`Failed to parse 'Rouge2' from JSON`,
|
|
1473
|
+
);
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/** @internal */
|
|
1477
|
+
export const RougeL$inboundSchema: z.ZodType<RougeL, z.ZodTypeDef, unknown> = z
|
|
1478
|
+
.object({
|
|
1479
|
+
f1: z.number(),
|
|
1480
|
+
precision: z.number(),
|
|
1481
|
+
recall: z.number(),
|
|
1482
|
+
});
|
|
1483
|
+
/** @internal */
|
|
1484
|
+
export type RougeL$Outbound = {
|
|
1485
|
+
f1: number;
|
|
1486
|
+
precision: number;
|
|
1487
|
+
recall: number;
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1490
|
+
/** @internal */
|
|
1491
|
+
export const RougeL$outboundSchema: z.ZodType<
|
|
1492
|
+
RougeL$Outbound,
|
|
1493
|
+
z.ZodTypeDef,
|
|
1494
|
+
RougeL
|
|
1495
|
+
> = z.object({
|
|
1496
|
+
f1: z.number(),
|
|
1497
|
+
precision: z.number(),
|
|
1498
|
+
recall: z.number(),
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1501
|
+
export function rougeLToJSON(rougeL: RougeL): string {
|
|
1502
|
+
return JSON.stringify(RougeL$outboundSchema.parse(rougeL));
|
|
1503
|
+
}
|
|
1504
|
+
export function rougeLFromJSON(
|
|
1505
|
+
jsonString: string,
|
|
1506
|
+
): SafeParseResult<RougeL, SDKValidationError> {
|
|
1507
|
+
return safeParse(
|
|
1508
|
+
jsonString,
|
|
1509
|
+
(x) => RougeL$inboundSchema.parse(JSON.parse(x)),
|
|
1510
|
+
`Failed to parse 'RougeL' from JSON`,
|
|
1511
|
+
);
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
/** @internal */
|
|
1515
|
+
export const InvokeEvalResponseBodyValue$inboundSchema: z.ZodType<
|
|
1516
|
+
InvokeEvalResponseBodyValue,
|
|
1517
|
+
z.ZodTypeDef,
|
|
1518
|
+
unknown
|
|
1519
|
+
> = z.object({
|
|
1520
|
+
rouge_1: z.lazy(() => Rouge1$inboundSchema),
|
|
1521
|
+
rouge_2: z.lazy(() => Rouge2$inboundSchema),
|
|
1522
|
+
rouge_l: z.lazy(() => RougeL$inboundSchema),
|
|
1523
|
+
}).transform((v) => {
|
|
1524
|
+
return remap$(v, {
|
|
1525
|
+
"rouge_1": "rouge1",
|
|
1526
|
+
"rouge_2": "rouge2",
|
|
1527
|
+
"rouge_l": "rougeL",
|
|
1528
|
+
});
|
|
1529
|
+
});
|
|
1530
|
+
/** @internal */
|
|
1531
|
+
export type InvokeEvalResponseBodyValue$Outbound = {
|
|
1532
|
+
rouge_1: Rouge1$Outbound;
|
|
1533
|
+
rouge_2: Rouge2$Outbound;
|
|
1534
|
+
rouge_l: RougeL$Outbound;
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
/** @internal */
|
|
1538
|
+
export const InvokeEvalResponseBodyValue$outboundSchema: z.ZodType<
|
|
1539
|
+
InvokeEvalResponseBodyValue$Outbound,
|
|
1540
|
+
z.ZodTypeDef,
|
|
1541
|
+
InvokeEvalResponseBodyValue
|
|
1542
|
+
> = z.object({
|
|
1543
|
+
rouge1: z.lazy(() => Rouge1$outboundSchema),
|
|
1544
|
+
rouge2: z.lazy(() => Rouge2$outboundSchema),
|
|
1545
|
+
rougeL: z.lazy(() => RougeL$outboundSchema),
|
|
1546
|
+
}).transform((v) => {
|
|
1547
|
+
return remap$(v, {
|
|
1548
|
+
rouge1: "rouge_1",
|
|
1549
|
+
rouge2: "rouge_2",
|
|
1550
|
+
rougeL: "rouge_l",
|
|
1551
|
+
});
|
|
1552
|
+
});
|
|
1553
|
+
|
|
1554
|
+
export function invokeEvalResponseBodyValueToJSON(
|
|
1555
|
+
invokeEvalResponseBodyValue: InvokeEvalResponseBodyValue,
|
|
1556
|
+
): string {
|
|
1557
|
+
return JSON.stringify(
|
|
1558
|
+
InvokeEvalResponseBodyValue$outboundSchema.parse(
|
|
1559
|
+
invokeEvalResponseBodyValue,
|
|
1560
|
+
),
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
export function invokeEvalResponseBodyValueFromJSON(
|
|
1564
|
+
jsonString: string,
|
|
1565
|
+
): SafeParseResult<InvokeEvalResponseBodyValue, SDKValidationError> {
|
|
1566
|
+
return safeParse(
|
|
1567
|
+
jsonString,
|
|
1568
|
+
(x) => InvokeEvalResponseBodyValue$inboundSchema.parse(JSON.parse(x)),
|
|
1569
|
+
`Failed to parse 'InvokeEvalResponseBodyValue' from JSON`,
|
|
1570
|
+
);
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/** @internal */
|
|
1574
|
+
export const RougeN$inboundSchema: z.ZodType<RougeN, z.ZodTypeDef, unknown> = z
|
|
1575
|
+
.object({
|
|
1576
|
+
type:
|
|
1577
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType$inboundSchema,
|
|
1578
|
+
value: z.lazy(() => InvokeEvalResponseBodyValue$inboundSchema),
|
|
1579
|
+
});
|
|
1580
|
+
/** @internal */
|
|
1581
|
+
export type RougeN$Outbound = {
|
|
1582
|
+
type: string;
|
|
1583
|
+
value: InvokeEvalResponseBodyValue$Outbound;
|
|
1584
|
+
};
|
|
1585
|
+
|
|
1586
|
+
/** @internal */
|
|
1587
|
+
export const RougeN$outboundSchema: z.ZodType<
|
|
1588
|
+
RougeN$Outbound,
|
|
1589
|
+
z.ZodTypeDef,
|
|
1590
|
+
RougeN
|
|
1591
|
+
> = z.object({
|
|
1592
|
+
type:
|
|
1593
|
+
InvokeEvalResponseBodyEvalsResponse200ApplicationJSONType$outboundSchema,
|
|
1594
|
+
value: z.lazy(() => InvokeEvalResponseBodyValue$outboundSchema),
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
export function rougeNToJSON(rougeN: RougeN): string {
|
|
1598
|
+
return JSON.stringify(RougeN$outboundSchema.parse(rougeN));
|
|
1599
|
+
}
|
|
1600
|
+
export function rougeNFromJSON(
|
|
1601
|
+
jsonString: string,
|
|
1602
|
+
): SafeParseResult<RougeN, SDKValidationError> {
|
|
1603
|
+
return safeParse(
|
|
1604
|
+
jsonString,
|
|
1605
|
+
(x) => RougeN$inboundSchema.parse(JSON.parse(x)),
|
|
1606
|
+
`Failed to parse 'RougeN' from JSON`,
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
/** @internal */
|
|
1611
|
+
export const InvokeEvalResponseBodyEvalsResponse200Type$inboundSchema:
|
|
1612
|
+
z.ZodNativeEnum<typeof InvokeEvalResponseBodyEvalsResponse200Type> = z
|
|
1613
|
+
.nativeEnum(InvokeEvalResponseBodyEvalsResponse200Type);
|
|
1614
|
+
/** @internal */
|
|
1615
|
+
export const InvokeEvalResponseBodyEvalsResponse200Type$outboundSchema:
|
|
1616
|
+
z.ZodNativeEnum<typeof InvokeEvalResponseBodyEvalsResponse200Type> =
|
|
1617
|
+
InvokeEvalResponseBodyEvalsResponse200Type$inboundSchema;
|
|
1618
|
+
|
|
1619
|
+
/** @internal */
|
|
1620
|
+
export const StringArray$inboundSchema: z.ZodType<
|
|
1621
|
+
StringArray,
|
|
1622
|
+
z.ZodTypeDef,
|
|
1623
|
+
unknown
|
|
1624
|
+
> = z.object({
|
|
1625
|
+
type: InvokeEvalResponseBodyEvalsResponse200Type$inboundSchema,
|
|
1626
|
+
values: z.array(z.nullable(z.string())),
|
|
1627
|
+
});
|
|
1628
|
+
/** @internal */
|
|
1629
|
+
export type StringArray$Outbound = {
|
|
1630
|
+
type: string;
|
|
1631
|
+
values: Array<string | null>;
|
|
1632
|
+
};
|
|
1633
|
+
|
|
1634
|
+
/** @internal */
|
|
1635
|
+
export const StringArray$outboundSchema: z.ZodType<
|
|
1636
|
+
StringArray$Outbound,
|
|
1637
|
+
z.ZodTypeDef,
|
|
1638
|
+
StringArray
|
|
1639
|
+
> = z.object({
|
|
1640
|
+
type: InvokeEvalResponseBodyEvalsResponse200Type$outboundSchema,
|
|
1641
|
+
values: z.array(z.nullable(z.string())),
|
|
1642
|
+
});
|
|
1643
|
+
|
|
1644
|
+
export function stringArrayToJSON(stringArray: StringArray): string {
|
|
1645
|
+
return JSON.stringify(StringArray$outboundSchema.parse(stringArray));
|
|
1646
|
+
}
|
|
1647
|
+
export function stringArrayFromJSON(
|
|
1648
|
+
jsonString: string,
|
|
1649
|
+
): SafeParseResult<StringArray, SDKValidationError> {
|
|
1650
|
+
return safeParse(
|
|
1651
|
+
jsonString,
|
|
1652
|
+
(x) => StringArray$inboundSchema.parse(JSON.parse(x)),
|
|
1653
|
+
`Failed to parse 'StringArray' from JSON`,
|
|
1654
|
+
);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
/** @internal */
|
|
1658
|
+
export const InvokeEvalResponseBodyEvalsResponseType$inboundSchema:
|
|
1659
|
+
z.ZodNativeEnum<typeof InvokeEvalResponseBodyEvalsResponseType> = z
|
|
1660
|
+
.nativeEnum(InvokeEvalResponseBodyEvalsResponseType);
|
|
1661
|
+
/** @internal */
|
|
1662
|
+
export const InvokeEvalResponseBodyEvalsResponseType$outboundSchema:
|
|
1663
|
+
z.ZodNativeEnum<typeof InvokeEvalResponseBodyEvalsResponseType> =
|
|
1664
|
+
InvokeEvalResponseBodyEvalsResponseType$inboundSchema;
|
|
1665
|
+
|
|
1666
|
+
/** @internal */
|
|
1667
|
+
export const ResponseBodyValue$inboundSchema: z.ZodType<
|
|
1668
|
+
ResponseBodyValue,
|
|
1669
|
+
z.ZodTypeDef,
|
|
1670
|
+
unknown
|
|
1671
|
+
> = z.union([z.boolean(), z.string(), z.number()]);
|
|
1672
|
+
/** @internal */
|
|
1673
|
+
export type ResponseBodyValue$Outbound = boolean | string | number;
|
|
1674
|
+
|
|
1675
|
+
/** @internal */
|
|
1676
|
+
export const ResponseBodyValue$outboundSchema: z.ZodType<
|
|
1677
|
+
ResponseBodyValue$Outbound,
|
|
1678
|
+
z.ZodTypeDef,
|
|
1679
|
+
ResponseBodyValue
|
|
1680
|
+
> = z.union([z.boolean(), z.string(), z.number()]);
|
|
1681
|
+
|
|
1682
|
+
export function responseBodyValueToJSON(
|
|
1683
|
+
responseBodyValue: ResponseBodyValue,
|
|
1684
|
+
): string {
|
|
1685
|
+
return JSON.stringify(
|
|
1686
|
+
ResponseBodyValue$outboundSchema.parse(responseBodyValue),
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
export function responseBodyValueFromJSON(
|
|
1690
|
+
jsonString: string,
|
|
1691
|
+
): SafeParseResult<ResponseBodyValue, SDKValidationError> {
|
|
1692
|
+
return safeParse(
|
|
1693
|
+
jsonString,
|
|
1694
|
+
(x) => ResponseBodyValue$inboundSchema.parse(JSON.parse(x)),
|
|
1695
|
+
`Failed to parse 'ResponseBodyValue' from JSON`,
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/** @internal */
|
|
1700
|
+
export const ResponseBodyBoolean$inboundSchema: z.ZodType<
|
|
1701
|
+
ResponseBodyBoolean,
|
|
1702
|
+
z.ZodTypeDef,
|
|
1703
|
+
unknown
|
|
1704
|
+
> = z.object({
|
|
1705
|
+
type: InvokeEvalResponseBodyEvalsResponseType$inboundSchema,
|
|
1706
|
+
value: z.nullable(z.union([z.boolean(), z.string(), z.number()])),
|
|
1707
|
+
});
|
|
1708
|
+
/** @internal */
|
|
1709
|
+
export type ResponseBodyBoolean$Outbound = {
|
|
1710
|
+
type: string;
|
|
1711
|
+
value: boolean | string | number | null;
|
|
1712
|
+
};
|
|
1713
|
+
|
|
1714
|
+
/** @internal */
|
|
1715
|
+
export const ResponseBodyBoolean$outboundSchema: z.ZodType<
|
|
1716
|
+
ResponseBodyBoolean$Outbound,
|
|
1717
|
+
z.ZodTypeDef,
|
|
1718
|
+
ResponseBodyBoolean
|
|
1719
|
+
> = z.object({
|
|
1720
|
+
type: InvokeEvalResponseBodyEvalsResponseType$outboundSchema,
|
|
1721
|
+
value: z.nullable(z.union([z.boolean(), z.string(), z.number()])),
|
|
1722
|
+
});
|
|
1723
|
+
|
|
1724
|
+
export function responseBodyBooleanToJSON(
|
|
1725
|
+
responseBodyBoolean: ResponseBodyBoolean,
|
|
1726
|
+
): string {
|
|
1727
|
+
return JSON.stringify(
|
|
1728
|
+
ResponseBodyBoolean$outboundSchema.parse(responseBodyBoolean),
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
export function responseBodyBooleanFromJSON(
|
|
1732
|
+
jsonString: string,
|
|
1733
|
+
): SafeParseResult<ResponseBodyBoolean, SDKValidationError> {
|
|
1734
|
+
return safeParse(
|
|
1735
|
+
jsonString,
|
|
1736
|
+
(x) => ResponseBodyBoolean$inboundSchema.parse(JSON.parse(x)),
|
|
1737
|
+
`Failed to parse 'ResponseBodyBoolean' from JSON`,
|
|
1738
|
+
);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
/** @internal */
|
|
1742
|
+
export const InvokeEvalResponseBodyEvalsType$inboundSchema: z.ZodNativeEnum<
|
|
1743
|
+
typeof InvokeEvalResponseBodyEvalsType
|
|
1744
|
+
> = z.nativeEnum(InvokeEvalResponseBodyEvalsType);
|
|
1745
|
+
/** @internal */
|
|
1746
|
+
export const InvokeEvalResponseBodyEvalsType$outboundSchema: z.ZodNativeEnum<
|
|
1747
|
+
typeof InvokeEvalResponseBodyEvalsType
|
|
1748
|
+
> = InvokeEvalResponseBodyEvalsType$inboundSchema;
|
|
1749
|
+
|
|
1750
|
+
/** @internal */
|
|
1751
|
+
export const Style$inboundSchema: z.ZodNativeEnum<typeof Style> = z.nativeEnum(
|
|
1752
|
+
Style,
|
|
1753
|
+
);
|
|
1754
|
+
/** @internal */
|
|
1755
|
+
export const Style$outboundSchema: z.ZodNativeEnum<typeof Style> =
|
|
1756
|
+
Style$inboundSchema;
|
|
1757
|
+
|
|
1758
|
+
/** @internal */
|
|
1759
|
+
export const Currency$inboundSchema: z.ZodNativeEnum<typeof Currency> = z
|
|
1760
|
+
.nativeEnum(Currency);
|
|
1761
|
+
/** @internal */
|
|
1762
|
+
export const Currency$outboundSchema: z.ZodNativeEnum<typeof Currency> =
|
|
1763
|
+
Currency$inboundSchema;
|
|
1764
|
+
|
|
1765
|
+
/** @internal */
|
|
1766
|
+
export const FormatOptions2$inboundSchema: z.ZodType<
|
|
1767
|
+
FormatOptions2,
|
|
1768
|
+
z.ZodTypeDef,
|
|
1769
|
+
unknown
|
|
1770
|
+
> = z.object({
|
|
1771
|
+
style: Style$inboundSchema,
|
|
1772
|
+
currency: Currency$inboundSchema,
|
|
1773
|
+
});
|
|
1774
|
+
/** @internal */
|
|
1775
|
+
export type FormatOptions2$Outbound = {
|
|
1776
|
+
style: string;
|
|
1777
|
+
currency: string;
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
/** @internal */
|
|
1781
|
+
export const FormatOptions2$outboundSchema: z.ZodType<
|
|
1782
|
+
FormatOptions2$Outbound,
|
|
1783
|
+
z.ZodTypeDef,
|
|
1784
|
+
FormatOptions2
|
|
1785
|
+
> = z.object({
|
|
1786
|
+
style: Style$outboundSchema,
|
|
1787
|
+
currency: Currency$outboundSchema,
|
|
1788
|
+
});
|
|
1789
|
+
|
|
1790
|
+
export function formatOptions2ToJSON(formatOptions2: FormatOptions2): string {
|
|
1791
|
+
return JSON.stringify(FormatOptions2$outboundSchema.parse(formatOptions2));
|
|
1792
|
+
}
|
|
1793
|
+
export function formatOptions2FromJSON(
|
|
1794
|
+
jsonString: string,
|
|
1795
|
+
): SafeParseResult<FormatOptions2, SDKValidationError> {
|
|
1796
|
+
return safeParse(
|
|
1797
|
+
jsonString,
|
|
1798
|
+
(x) => FormatOptions2$inboundSchema.parse(JSON.parse(x)),
|
|
1799
|
+
`Failed to parse 'FormatOptions2' from JSON`,
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
/** @internal */
|
|
1804
|
+
export const FormatOptions1$inboundSchema: z.ZodType<
|
|
1805
|
+
FormatOptions1,
|
|
1806
|
+
z.ZodTypeDef,
|
|
1807
|
+
unknown
|
|
1808
|
+
> = z.object({
|
|
1809
|
+
significant_digits: z.number(),
|
|
1810
|
+
}).transform((v) => {
|
|
1811
|
+
return remap$(v, {
|
|
1812
|
+
"significant_digits": "significantDigits",
|
|
1813
|
+
});
|
|
1814
|
+
});
|
|
1815
|
+
/** @internal */
|
|
1816
|
+
export type FormatOptions1$Outbound = {
|
|
1817
|
+
significant_digits: number;
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
/** @internal */
|
|
1821
|
+
export const FormatOptions1$outboundSchema: z.ZodType<
|
|
1822
|
+
FormatOptions1$Outbound,
|
|
1823
|
+
z.ZodTypeDef,
|
|
1824
|
+
FormatOptions1
|
|
1825
|
+
> = z.object({
|
|
1826
|
+
significantDigits: z.number(),
|
|
1827
|
+
}).transform((v) => {
|
|
1828
|
+
return remap$(v, {
|
|
1829
|
+
significantDigits: "significant_digits",
|
|
1830
|
+
});
|
|
1831
|
+
});
|
|
1832
|
+
|
|
1833
|
+
export function formatOptions1ToJSON(formatOptions1: FormatOptions1): string {
|
|
1834
|
+
return JSON.stringify(FormatOptions1$outboundSchema.parse(formatOptions1));
|
|
1835
|
+
}
|
|
1836
|
+
export function formatOptions1FromJSON(
|
|
1837
|
+
jsonString: string,
|
|
1838
|
+
): SafeParseResult<FormatOptions1, SDKValidationError> {
|
|
1839
|
+
return safeParse(
|
|
1840
|
+
jsonString,
|
|
1841
|
+
(x) => FormatOptions1$inboundSchema.parse(JSON.parse(x)),
|
|
1842
|
+
`Failed to parse 'FormatOptions1' from JSON`,
|
|
1843
|
+
);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
/** @internal */
|
|
1847
|
+
export const FormatOptions$inboundSchema: z.ZodType<
|
|
1848
|
+
FormatOptions,
|
|
1849
|
+
z.ZodTypeDef,
|
|
1850
|
+
unknown
|
|
1851
|
+
> = z.union([
|
|
1852
|
+
z.lazy(() => FormatOptions2$inboundSchema),
|
|
1853
|
+
z.lazy(() => FormatOptions1$inboundSchema),
|
|
1854
|
+
]);
|
|
1855
|
+
/** @internal */
|
|
1856
|
+
export type FormatOptions$Outbound =
|
|
1857
|
+
| FormatOptions2$Outbound
|
|
1858
|
+
| FormatOptions1$Outbound;
|
|
1859
|
+
|
|
1860
|
+
/** @internal */
|
|
1861
|
+
export const FormatOptions$outboundSchema: z.ZodType<
|
|
1862
|
+
FormatOptions$Outbound,
|
|
1863
|
+
z.ZodTypeDef,
|
|
1864
|
+
FormatOptions
|
|
1865
|
+
> = z.union([
|
|
1866
|
+
z.lazy(() => FormatOptions2$outboundSchema),
|
|
1867
|
+
z.lazy(() => FormatOptions1$outboundSchema),
|
|
1868
|
+
]);
|
|
1869
|
+
|
|
1870
|
+
export function formatOptionsToJSON(formatOptions: FormatOptions): string {
|
|
1871
|
+
return JSON.stringify(FormatOptions$outboundSchema.parse(formatOptions));
|
|
1872
|
+
}
|
|
1873
|
+
export function formatOptionsFromJSON(
|
|
1874
|
+
jsonString: string,
|
|
1875
|
+
): SafeParseResult<FormatOptions, SDKValidationError> {
|
|
1876
|
+
return safeParse(
|
|
1877
|
+
jsonString,
|
|
1878
|
+
(x) => FormatOptions$inboundSchema.parse(JSON.parse(x)),
|
|
1879
|
+
`Failed to parse 'FormatOptions' from JSON`,
|
|
1880
|
+
);
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
/** @internal */
|
|
1884
|
+
export const ResponseBodyNumber$inboundSchema: z.ZodType<
|
|
1885
|
+
ResponseBodyNumber,
|
|
1886
|
+
z.ZodTypeDef,
|
|
1887
|
+
unknown
|
|
1888
|
+
> = z.object({
|
|
1889
|
+
type: InvokeEvalResponseBodyEvalsType$inboundSchema,
|
|
1890
|
+
original_value: z.nullable(z.number()).optional(),
|
|
1891
|
+
value: z.nullable(z.number()),
|
|
1892
|
+
format_options: z.union([
|
|
1893
|
+
z.lazy(() => FormatOptions2$inboundSchema),
|
|
1894
|
+
z.lazy(() => FormatOptions1$inboundSchema),
|
|
1895
|
+
]).optional(),
|
|
1896
|
+
}).transform((v) => {
|
|
1897
|
+
return remap$(v, {
|
|
1898
|
+
"original_value": "originalValue",
|
|
1899
|
+
"format_options": "formatOptions",
|
|
1900
|
+
});
|
|
1901
|
+
});
|
|
1902
|
+
/** @internal */
|
|
1903
|
+
export type ResponseBodyNumber$Outbound = {
|
|
1904
|
+
type: string;
|
|
1905
|
+
original_value?: number | null | undefined;
|
|
1906
|
+
value: number | null;
|
|
1907
|
+
format_options?:
|
|
1908
|
+
| FormatOptions2$Outbound
|
|
1909
|
+
| FormatOptions1$Outbound
|
|
1910
|
+
| undefined;
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
/** @internal */
|
|
1914
|
+
export const ResponseBodyNumber$outboundSchema: z.ZodType<
|
|
1915
|
+
ResponseBodyNumber$Outbound,
|
|
1916
|
+
z.ZodTypeDef,
|
|
1917
|
+
ResponseBodyNumber
|
|
1918
|
+
> = z.object({
|
|
1919
|
+
type: InvokeEvalResponseBodyEvalsType$outboundSchema,
|
|
1920
|
+
originalValue: z.nullable(z.number()).optional(),
|
|
1921
|
+
value: z.nullable(z.number()),
|
|
1922
|
+
formatOptions: z.union([
|
|
1923
|
+
z.lazy(() => FormatOptions2$outboundSchema),
|
|
1924
|
+
z.lazy(() => FormatOptions1$outboundSchema),
|
|
1925
|
+
]).optional(),
|
|
1926
|
+
}).transform((v) => {
|
|
1927
|
+
return remap$(v, {
|
|
1928
|
+
originalValue: "original_value",
|
|
1929
|
+
formatOptions: "format_options",
|
|
1930
|
+
});
|
|
1931
|
+
});
|
|
1932
|
+
|
|
1933
|
+
export function responseBodyNumberToJSON(
|
|
1934
|
+
responseBodyNumber: ResponseBodyNumber,
|
|
1935
|
+
): string {
|
|
1936
|
+
return JSON.stringify(
|
|
1937
|
+
ResponseBodyNumber$outboundSchema.parse(responseBodyNumber),
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
export function responseBodyNumberFromJSON(
|
|
1941
|
+
jsonString: string,
|
|
1942
|
+
): SafeParseResult<ResponseBodyNumber, SDKValidationError> {
|
|
1943
|
+
return safeParse(
|
|
1944
|
+
jsonString,
|
|
1945
|
+
(x) => ResponseBodyNumber$inboundSchema.parse(JSON.parse(x)),
|
|
1946
|
+
`Failed to parse 'ResponseBodyNumber' from JSON`,
|
|
1947
|
+
);
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
/** @internal */
|
|
1951
|
+
export const InvokeEvalResponseBodyType$inboundSchema: z.ZodNativeEnum<
|
|
1952
|
+
typeof InvokeEvalResponseBodyType
|
|
1953
|
+
> = z.nativeEnum(InvokeEvalResponseBodyType);
|
|
1954
|
+
/** @internal */
|
|
1955
|
+
export const InvokeEvalResponseBodyType$outboundSchema: z.ZodNativeEnum<
|
|
1956
|
+
typeof InvokeEvalResponseBodyType
|
|
1957
|
+
> = InvokeEvalResponseBodyType$inboundSchema;
|
|
1958
|
+
|
|
1959
|
+
/** @internal */
|
|
1960
|
+
export const String$inboundSchema: z.ZodType<String, z.ZodTypeDef, unknown> = z
|
|
1961
|
+
.object({
|
|
1962
|
+
type: InvokeEvalResponseBodyType$inboundSchema,
|
|
1963
|
+
original_value: z.nullable(z.string()).optional(),
|
|
1964
|
+
value: z.nullable(z.string()).optional(),
|
|
1965
|
+
}).transform((v) => {
|
|
1966
|
+
return remap$(v, {
|
|
1967
|
+
"original_value": "originalValue",
|
|
1968
|
+
});
|
|
1969
|
+
});
|
|
1970
|
+
/** @internal */
|
|
1971
|
+
export type String$Outbound = {
|
|
1972
|
+
type: string;
|
|
1973
|
+
original_value?: string | null | undefined;
|
|
1974
|
+
value?: string | null | undefined;
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
/** @internal */
|
|
1978
|
+
export const String$outboundSchema: z.ZodType<
|
|
1979
|
+
String$Outbound,
|
|
1980
|
+
z.ZodTypeDef,
|
|
1981
|
+
String
|
|
1982
|
+
> = z.object({
|
|
1983
|
+
type: InvokeEvalResponseBodyType$outboundSchema,
|
|
1984
|
+
originalValue: z.nullable(z.string()).optional(),
|
|
1985
|
+
value: z.nullable(z.string()).optional(),
|
|
1986
|
+
}).transform((v) => {
|
|
1987
|
+
return remap$(v, {
|
|
1988
|
+
originalValue: "original_value",
|
|
1989
|
+
});
|
|
1990
|
+
});
|
|
1991
|
+
|
|
1992
|
+
export function stringToJSON(string: String): string {
|
|
1993
|
+
return JSON.stringify(String$outboundSchema.parse(string));
|
|
1994
|
+
}
|
|
1995
|
+
export function stringFromJSON(
|
|
1996
|
+
jsonString: string,
|
|
1997
|
+
): SafeParseResult<String, SDKValidationError> {
|
|
1998
|
+
return safeParse(
|
|
1999
|
+
jsonString,
|
|
2000
|
+
(x) => String$inboundSchema.parse(JSON.parse(x)),
|
|
2001
|
+
`Failed to parse 'String' from JSON`,
|
|
2002
|
+
);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
/** @internal */
|
|
2006
|
+
export const InvokeEvalResponseBody$inboundSchema: z.ZodType<
|
|
2007
|
+
InvokeEvalResponseBody,
|
|
2008
|
+
z.ZodTypeDef,
|
|
2009
|
+
unknown
|
|
2010
|
+
> = z.union([
|
|
2011
|
+
z.lazy(() => ResponseBodyNumber$inboundSchema),
|
|
2012
|
+
z.lazy(() => ResponseBodyBoolean$inboundSchema),
|
|
2013
|
+
z.lazy(() => StringArray$inboundSchema),
|
|
2014
|
+
z.lazy(() => RougeN$inboundSchema),
|
|
2015
|
+
z.lazy(() => BERTScore$inboundSchema),
|
|
2016
|
+
z.lazy(() => InvokeEvalResponseBodyLLM$inboundSchema),
|
|
2017
|
+
z.lazy(() => String$inboundSchema),
|
|
2018
|
+
z.lazy(() => InvokeEvalResponseBodyHTTP$inboundSchema),
|
|
2019
|
+
]);
|
|
2020
|
+
/** @internal */
|
|
2021
|
+
export type InvokeEvalResponseBody$Outbound =
|
|
2022
|
+
| ResponseBodyNumber$Outbound
|
|
2023
|
+
| ResponseBodyBoolean$Outbound
|
|
2024
|
+
| StringArray$Outbound
|
|
2025
|
+
| RougeN$Outbound
|
|
2026
|
+
| BERTScore$Outbound
|
|
2027
|
+
| InvokeEvalResponseBodyLLM$Outbound
|
|
2028
|
+
| String$Outbound
|
|
2029
|
+
| InvokeEvalResponseBodyHTTP$Outbound;
|
|
2030
|
+
|
|
2031
|
+
/** @internal */
|
|
2032
|
+
export const InvokeEvalResponseBody$outboundSchema: z.ZodType<
|
|
2033
|
+
InvokeEvalResponseBody$Outbound,
|
|
2034
|
+
z.ZodTypeDef,
|
|
2035
|
+
InvokeEvalResponseBody
|
|
2036
|
+
> = z.union([
|
|
2037
|
+
z.lazy(() => ResponseBodyNumber$outboundSchema),
|
|
2038
|
+
z.lazy(() => ResponseBodyBoolean$outboundSchema),
|
|
2039
|
+
z.lazy(() => StringArray$outboundSchema),
|
|
2040
|
+
z.lazy(() => RougeN$outboundSchema),
|
|
2041
|
+
z.lazy(() => BERTScore$outboundSchema),
|
|
2042
|
+
z.lazy(() => InvokeEvalResponseBodyLLM$outboundSchema),
|
|
2043
|
+
z.lazy(() => String$outboundSchema),
|
|
2044
|
+
z.lazy(() => InvokeEvalResponseBodyHTTP$outboundSchema),
|
|
2045
|
+
]);
|
|
2046
|
+
|
|
2047
|
+
export function invokeEvalResponseBodyToJSON(
|
|
2048
|
+
invokeEvalResponseBody: InvokeEvalResponseBody,
|
|
2049
|
+
): string {
|
|
2050
|
+
return JSON.stringify(
|
|
2051
|
+
InvokeEvalResponseBody$outboundSchema.parse(invokeEvalResponseBody),
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2054
|
+
export function invokeEvalResponseBodyFromJSON(
|
|
2055
|
+
jsonString: string,
|
|
2056
|
+
): SafeParseResult<InvokeEvalResponseBody, SDKValidationError> {
|
|
2057
|
+
return safeParse(
|
|
2058
|
+
jsonString,
|
|
2059
|
+
(x) => InvokeEvalResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
2060
|
+
`Failed to parse 'InvokeEvalResponseBody' from JSON`,
|
|
2061
|
+
);
|
|
2062
|
+
}
|