java/resources/evals/methods/update/index.md +0 −427 deleted
File Deleted View Diff
1## Update an eval
2
3`EvalUpdateResponse evals().update(EvalUpdateParamsparams = EvalUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
4
5**post** `/evals/{eval_id}`
6
7Update certain properties of an evaluation.
8
9### Parameters
10
11- `EvalUpdateParams params`
12
13 - `Optional<String> evalId`
14
15 - `Optional<Metadata> metadata`
16
17 Set of 16 key-value pairs that can be attached to an object. This can be
18 useful for storing additional information about the object in a structured
19 format, and querying for objects via API or the dashboard.
20
21 Keys are strings with a maximum length of 64 characters. Values are strings
22 with a maximum length of 512 characters.
23
24 - `Optional<String> name`
25
26 Rename the evaluation.
27
28### Returns
29
30- `class EvalUpdateResponse:`
31
32 An Eval object with a data source config and testing criteria.
33 An Eval represents a task to be done for your LLM integration.
34 Like:
35
36 - Improve the quality of my chatbot
37 - See how well my chatbot handles customer support
38 - Check if o4-mini is better at my usecase than gpt-4o
39
40 - `String id`
41
42 Unique identifier for the evaluation.
43
44 - `long createdAt`
45
46 The Unix timestamp (in seconds) for when the eval was created.
47
48 - `DataSourceConfig dataSourceConfig`
49
50 Configuration of data sources used in runs of the evaluation.
51
52 - `class EvalCustomDataSourceConfig:`
53
54 A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.
55 The response schema defines the shape of the data that will be:
56
57 - Used to define your testing criteria and
58 - What data is required when creating a run
59
60 - `Schema schema`
61
62 The json schema for the run data source items.
63 Learn how to build JSON schemas [here](https://json-schema.org/).
64
65 - `JsonValue; type "custom"constant`
66
67 The type of data source. Always `custom`.
68
69 - `CUSTOM("custom")`
70
71 - `class Logs:`
72
73 A LogsDataSourceConfig which specifies the metadata property of your logs query.
74 This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.
75 The schema returned by this data source config is used to defined what variables are available in your evals.
76 `item` and `sample` are both defined when using this data source config.
77
78 - `Schema schema`
79
80 The json schema for the run data source items.
81 Learn how to build JSON schemas [here](https://json-schema.org/).
82
83 - `JsonValue; type "logs"constant`
84
85 The type of data source. Always `logs`.
86
87 - `LOGS("logs")`
88
89 - `Optional<Metadata> metadata`
90
91 Set of 16 key-value pairs that can be attached to an object. This can be
92 useful for storing additional information about the object in a structured
93 format, and querying for objects via API or the dashboard.
94
95 Keys are strings with a maximum length of 64 characters. Values are strings
96 with a maximum length of 512 characters.
97
98 - `class EvalStoredCompletionsDataSourceConfig:`
99
100 Deprecated in favor of LogsDataSourceConfig.
101
102 - `Schema schema`
103
104 The json schema for the run data source items.
105 Learn how to build JSON schemas [here](https://json-schema.org/).
106
107 - `JsonValue; type "stored_completions"constant`
108
109 The type of data source. Always `stored_completions`.
110
111 - `STORED_COMPLETIONS("stored_completions")`
112
113 - `Optional<Metadata> metadata`
114
115 Set of 16 key-value pairs that can be attached to an object. This can be
116 useful for storing additional information about the object in a structured
117 format, and querying for objects via API or the dashboard.
118
119 Keys are strings with a maximum length of 64 characters. Values are strings
120 with a maximum length of 512 characters.
121
122 - `Optional<Metadata> metadata`
123
124 Set of 16 key-value pairs that can be attached to an object. This can be
125 useful for storing additional information about the object in a structured
126 format, and querying for objects via API or the dashboard.
127
128 Keys are strings with a maximum length of 64 characters. Values are strings
129 with a maximum length of 512 characters.
130
131 - `String name`
132
133 The name of the evaluation.
134
135 - `JsonValue; object_ "eval"constant`
136
137 The object type.
138
139 - `EVAL("eval")`
140
141 - `List<TestingCriterion> testingCriteria`
142
143 A list of testing criteria.
144
145 - `class LabelModelGrader:`
146
147 A LabelModelGrader object which uses a model to assign labels to each item
148 in the evaluation.
149
150 - `List<Input> input`
151
152 - `Content content`
153
154 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
155
156 - `String`
157
158 - `class ResponseInputText:`
159
160 A text input to the model.
161
162 - `String text`
163
164 The text input to the model.
165
166 - `JsonValue; type "input_text"constant`
167
168 The type of the input item. Always `input_text`.
169
170 - `INPUT_TEXT("input_text")`
171
172 - `class OutputText:`
173
174 A text output from the model.
175
176 - `String text`
177
178 The text output from the model.
179
180 - `JsonValue; type "output_text"constant`
181
182 The type of the output text. Always `output_text`.
183
184 - `OUTPUT_TEXT("output_text")`
185
186 - `class InputImage:`
187
188 An image input block used within EvalItem content arrays.
189
190 - `String imageUrl`
191
192 The URL of the image input.
193
194 - `JsonValue; type "input_image"constant`
195
196 The type of the image input. Always `input_image`.
197
198 - `INPUT_IMAGE("input_image")`
199
200 - `Optional<String> detail`
201
202 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
203
204 - `class ResponseInputAudio:`
205
206 An audio input to the model.
207
208 - `InputAudio inputAudio`
209
210 - `String data`
211
212 Base64-encoded audio data.
213
214 - `Format format`
215
216 The format of the audio data. Currently supported formats are `mp3` and
217 `wav`.
218
219 - `MP3("mp3")`
220
221 - `WAV("wav")`
222
223 - `JsonValue; type "input_audio"constant`
224
225 The type of the input item. Always `input_audio`.
226
227 - `INPUT_AUDIO("input_audio")`
228
229 - `List<EvalContentItem>`
230
231 - `String`
232
233 - `class ResponseInputText:`
234
235 A text input to the model.
236
237 - `OutputText`
238
239 - `String text`
240
241 The text output from the model.
242
243 - `JsonValue; type "output_text"constant`
244
245 The type of the output text. Always `output_text`.
246
247 - `OUTPUT_TEXT("output_text")`
248
249 - `InputImage`
250
251 - `String imageUrl`
252
253 The URL of the image input.
254
255 - `JsonValue; type "input_image"constant`
256
257 The type of the image input. Always `input_image`.
258
259 - `INPUT_IMAGE("input_image")`
260
261 - `Optional<String> detail`
262
263 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
264
265 - `class ResponseInputAudio:`
266
267 An audio input to the model.
268
269 - `Role role`
270
271 The role of the message input. One of `user`, `assistant`, `system`, or
272 `developer`.
273
274 - `USER("user")`
275
276 - `ASSISTANT("assistant")`
277
278 - `SYSTEM("system")`
279
280 - `DEVELOPER("developer")`
281
282 - `Optional<Type> type`
283
284 The type of the message input. Always `message`.
285
286 - `MESSAGE("message")`
287
288 - `List<String> labels`
289
290 The labels to assign to each item in the evaluation.
291
292 - `String model`
293
294 The model to use for the evaluation. Must support structured outputs.
295
296 - `String name`
297
298 The name of the grader.
299
300 - `List<String> passingLabels`
301
302 The labels that indicate a passing result. Must be a subset of labels.
303
304 - `JsonValue; type "label_model"constant`
305
306 The object type, which is always `label_model`.
307
308 - `LABEL_MODEL("label_model")`
309
310 - `class StringCheckGrader:`
311
312 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
313
314 - `String input`
315
316 The input text. This may include template strings.
317
318 - `String name`
319
320 The name of the grader.
321
322 - `Operation operation`
323
324 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
325
326 - `EQ("eq")`
327
328 - `NE("ne")`
329
330 - `LIKE("like")`
331
332 - `ILIKE("ilike")`
333
334 - `String reference`
335
336 The reference text. This may include template strings.
337
338 - `JsonValue; type "string_check"constant`
339
340 The object type, which is always `string_check`.
341
342 - `STRING_CHECK("string_check")`
343
344 - `class EvalGraderTextSimilarity:`
345
346 A TextSimilarityGrader object which grades text based on similarity metrics.
347
348 - `double passThreshold`
349
350 The threshold for the score.
351
352 - `class EvalGraderPython:`
353
354 A PythonGrader object that runs a python script on the input.
355
356 - `Optional<Double> passThreshold`
357
358 The threshold for the score.
359
360 - `class EvalGraderScoreModel:`
361
362 A ScoreModelGrader object that uses a model to assign a score to the input.
363
364 - `Optional<Double> passThreshold`
365
366 The threshold for the score.
367
368### Example
369
370```java
371package com.openai.example;
372
373import com.openai.client.OpenAIClient;
374import com.openai.client.okhttp.OpenAIOkHttpClient;
375import com.openai.models.evals.EvalUpdateParams;
376import com.openai.models.evals.EvalUpdateResponse;
377
378public final class Main {
379 private Main() {}
380
381 public static void main(String[] args) {
382 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
383
384 EvalUpdateResponse eval = client.evals().update("eval_id");
385 }
386}
387```
388
389#### Response
390
391```json
392{
393 "id": "id",
394 "created_at": 0,
395 "data_source_config": {
396 "schema": {
397 "foo": "bar"
398 },
399 "type": "custom"
400 },
401 "metadata": {
402 "foo": "string"
403 },
404 "name": "Chatbot effectiveness Evaluation",
405 "object": "eval",
406 "testing_criteria": [
407 {
408 "input": [
409 {
410 "content": "string",
411 "role": "user",
412 "type": "message"
413 }
414 ],
415 "labels": [
416 "string"
417 ],
418 "model": "model",
419 "name": "name",
420 "passing_labels": [
421 "string"
422 ],
423 "type": "label_model"
424 }
425 ]
426}
427```