Implementation:Openai Openai python Eval Stored Completions Config
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
⚠️ DEPRECATED: This type is deprecated in favor of LogsDataSourceConfig. See Heuristic:Openai_Openai_python_Warning_Deprecated_Eval_Stored_Completions.
Concrete type for the stored completions data source configuration model used in evaluations, provided by the openai-python SDK.
Description
The EvalStoredCompletionsDataSourceConfig Pydantic model represents a data source configuration that pulls from stored completions. It is deprecated in favor of LogsDataSourceConfig. It contains a schema_ field (aliased from "schema" in JSON) holding the JSON schema for run data source items, a type field fixed to "stored_completions", and optional metadata for key-value filtering. This model appears as one variant in the discriminated union of data source configs on eval response objects.
Usage
Import this type when inspecting eval objects that use the legacy stored_completions data source type. For new evaluations, prefer the logs data source config instead.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/eval_stored_completions_data_source_config.py
Signature
class EvalStoredCompletionsDataSourceConfig(BaseModel):
schema_: Dict[str, object] = FieldInfo(alias="schema")
type: Literal["stored_completions"]
metadata: Optional[Metadata] = None
Import
from openai.types import EvalStoredCompletionsDataSourceConfig
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["stored_completions"] | Yes | Data source type, always "stored_completions" |
| metadata | Optional[Metadata] | No | Up to 16 key-value pairs for filtering stored completions |
Usage Examples
from openai import OpenAI
client = OpenAI()
eval_obj = client.evals.retrieve("eval_abc123")
# Check if this eval uses stored completions (deprecated)
if eval_obj.data_source_config.type == "stored_completions":
config = eval_obj.data_source_config
print(f"Schema: {config.schema_}")
if config.metadata:
print(f"Metadata filters: {config.metadata}")