Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Eval Custom Data Source Config

From Leeroopedia
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

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}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment