Implementation:Openai Openai python Eval Retrieve Response
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for the evaluation retrieve response object provided by the openai-python SDK.
Description
The EvalRetrieveResponse Pydantic model represents an Eval object returned when retrieving an evaluation by ID. It has the same structure as EvalCreateResponse and EvalListResponse: an id, created_at timestamp, data_source_config (a discriminated union of EvalCustomDataSourceConfig, DataSourceConfigLogs, or EvalStoredCompletionsDataSourceConfig), optional metadata, a name, object type "eval", and testing_criteria list containing grader variants (LabelModelGrader, StringCheckGrader, TextSimilarity, Python, or ScoreModel graders with pass_threshold extensions).
Usage
Import this type when inspecting the return value of client.evals.retrieve().
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/eval_retrieve_response.py
Signature
class EvalRetrieveResponse(BaseModel):
id: str
created_at: int
data_source_config: DataSourceConfig
metadata: Optional[Metadata] = None
name: str
object: Literal["eval"]
testing_criteria: List[TestingCriterion]
DataSourceConfig = Annotated[
Union[EvalCustomDataSourceConfig, DataSourceConfigLogs, EvalStoredCompletionsDataSourceConfig],
PropertyInfo(discriminator="type"),
]
TestingCriterion = Union[
LabelModelGrader, StringCheckGrader,
TestingCriterionEvalGraderTextSimilarity,
TestingCriterionEvalGraderPython,
TestingCriterionEvalGraderScoreModel,
]
Import
from openai.types import EvalRetrieveResponse
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | Unique identifier for the evaluation |
| created_at | int | Yes | Unix timestamp (seconds) when the eval was created |
| data_source_config | DataSourceConfig | Yes | Configuration of data sources (custom, logs, or stored_completions) |
| metadata | Optional[Metadata] | No | Up to 16 key-value pairs for additional information |
| name | str | Yes | Name of the evaluation |
| object | Literal["eval"] | Yes | Object type, always "eval" |
| testing_criteria | List[TestingCriterion] | Yes | List of graders for the evaluation |
Usage Examples
from openai import OpenAI
client = OpenAI()
eval_obj = client.evals.retrieve("eval_abc123")
print(f"Name: {eval_obj.name}")
print(f"Created: {eval_obj.created_at}")
print(f"Data source type: {eval_obj.data_source_config.type}")
for criterion in eval_obj.testing_criteria:
print(f" Grader: {criterion}")