Evals
List evaluation run output items
Returns a page of output items produced by the specified evaluation run. Each output item contains one evaluated input, its generated output when applicable, and the results from each testing criterion.
Paramètres de chemin d’accès
eval_id
string
obligatoire
The identifier of the evaluation that owns the run.
run_id
string
obligatoire
The identifier of the run whose output items to list.
Paramètres de la requête
after
string
The identifier of the last item from the previous page. Use this value to retrieve the next page.
limit
integer
The maximum number of items to return. The default is 20.
order
enum
The order in which to return items by timestamp. Use asc for ascending order or desc for descending order. The default is asc.
status
enum
Filter output items by evaluation outcome. Use fail for items that did
not pass or pass for items that passed.
Réponses
The request has succeeded.
Corps
data
EvalRunOutputItem[]
obligatoire
The requested list of items.
first_id
string
The first ID represented in this list.
last_id
string
The last ID represented in this list.
has_more
boolean
obligatoire
A value indicating whether there are additional values available not captured in this list.
Requête
curl https://api.openai.com/v1/evals/egroup_67abd54d9b0081909a86353f6fb9317a/runs/erun_67abd54d60ec8190832b46859da808f7/output_items \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json"
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
page = client.evals.runs.output_items.list(
run_id="run_id",
eval_id="eval_id",
)
page = page.data[0]
print(page.id)
import OpenAI from "openai";
const openai = new OpenAI();
const outputItems = await openai.evals.runs.outputItems.list(
"egroup_67abd54d9b0081909a86353f6fb9317a",
"erun_67abd54d60ec8190832b46859da808f7"
);
console.log(outputItems);
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const outputItemListResponse of client.evals.runs.outputItems.list('run_id', {
eval_id: 'eval_id',
})) {
console.log(outputItemListResponse.id);
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.evals.runs.outputitems.OutputItemListPage;
import com.openai.models.evals.runs.outputitems.OutputItemListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
OutputItemListParams params = OutputItemListParams.builder()
.evalId("eval_id")
.runId("run_id")
.build();
OutputItemListPage page = client.evals().runs().outputItems().list(params);
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
page = openai.evals.runs.output_items.list("run_id", eval_id: "eval_id")
puts(page)
Response
{
"object": "list",
"data": [
{
"object": "eval.run.output_item",
"id": "outputitem_67e5796c28e081909917bf79f6e6214d",
"created_at": 1743092076,
"run_id": "evalrun_67abd54d60ec8190832b46859da808f7",
"eval_id": "eval_67abd54d9b0081909a86353f6fb9317a",
"status": "pass",
"datasource_item_id": 5,
"datasource_item": {
"input": "Stock Markets Rally After Positive Economic Data Released",
"ground_truth": "Markets"
},
"results": [
{
"name": "String check-a2486074-d803-4445-b431-ad2262e85d47",
"sample": null,
"passed": true,
"score": 1.0
}
],
"sample": {
"input": [
{
"role": "developer",
"content": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.
# Steps
1. Analyze the content of the news headline to understand its primary focus.
2. Extract the subject matter, identifying any key indicators or keywords.
3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.
4. Ensure only one category is selected per headline.
# Output Format
Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports".
# Examples
**Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features"
**Output**: "Technology"
**Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions"
**Output**: "Markets"
**Input**: "War in Ukraine: Latest Updates on Negotiation Status"
**Output**: "World"
**Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion"
**Output**: "Business"
**Input**: "Manchester United Secures Win in Premier League Football Match"
**Output**: "Sports"
# Notes
- If the headline appears to fit into more than one category, choose the most dominant theme.
- Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification.
",
"tool_call_id": null,
"tool_calls": null,
"function_call": null
},
{
"role": "user",
"content": "Stock Markets Rally After Positive Economic Data Released",
"tool_call_id": null,
"tool_calls": null,
"function_call": null
}
],
"output": [
{
"role": "assistant",
"content": "Markets",
"tool_call_id": null,
"tool_calls": null,
"function_call": null
}
],
"finish_reason": "stop",
"model": "gpt-4o-mini-2024-07-18",
"usage": {
"total_tokens": 325,
"completion_tokens": 2,
"prompt_tokens": 323,
"cached_tokens": 0
},
"error": null,
"temperature": 1.0,
"max_completion_tokens": 2048,
"top_p": 1.0,
"seed": 42
}
}
],
"first_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
"last_id": "outputitem_67e5796c28e081909917bf79f6e6214d",
"has_more": true
}