Implementation:Openai Openai python Eval Custom Data Source Config
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for the custom data source configuration model used in evaluations, provided by the openai-python SDK.
Description
The EvalCustomDataSourceConfig Pydantic model represents a custom data source configuration that specifies the schema of your item and optionally sample namespaces for evaluation runs. It contains a schema_ field (aliased from "schema" in JSON) holding the JSON schema for run data source items, and a type field fixed to "custom". The schema defines both what testing criteria can reference and what data is required when creating an evaluation run.
Usage
Import this type when inspecting the data_source_config field on eval response objects where the type is "custom", or when building type-safe evaluation configurations.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/eval_custom_data_source_config.py
Signature
class EvalCustomDataSourceConfig(BaseModel):
schema_: Dict[str, object] = FieldInfo(alias="schema")
type: Literal["custom"]
Import
from openai.types import EvalCustomDataSourceConfig
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| schema_ | Dict[str, object] | Yes | JSON schema for run data source items (aliased from "schema" in JSON) |
| type | Literal["custom"] | Yes | Data source type, always "custom" |
Usage Examples
from openai import OpenAI
client = OpenAI()
eval_obj = client.evals.retrieve("eval_abc123")
# Check if this eval uses a custom data source
if eval_obj.data_source_config.type == "custom":
config = eval_obj.data_source_config
print(f"Schema: {config.schema_}")
print(f"Type: {config.type}")