mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-29 17:35:16 +00:00
use native types List->list, Dict->dict, Set->set, Tuple->tuple
This commit is contained in:
parent
5d02064b5a
commit
3e7ff3b084
95 changed files with 754 additions and 760 deletions
|
|
@ -1,6 +1,6 @@
|
|||
"""Pydantic models for API request/response data."""
|
||||
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ class ExperimentCreate(BaseModel):
|
|||
name: str = Field(..., description="Unique name for the experiment")
|
||||
size: int = Field(500, description="Size of the dataset")
|
||||
seed: Optional[int] = Field(None, description="Random seed for reproducibility")
|
||||
datasets: Dict[str, Dict[str, Any]] = Field(..., description="Dictionary of datasets configurations")
|
||||
datasets: dict[str, dict[str, Any]] = Field(..., description="Dictionary of datasets configurations")
|
||||
|
||||
|
||||
class ExperimentResponse(BaseModel):
|
||||
|
|
@ -20,19 +20,19 @@ class ExperimentResponse(BaseModel):
|
|||
name: str = Field(..., description="Name of the experiment")
|
||||
size: int = Field(..., description="Size of the dataset")
|
||||
seed: Optional[int] = Field(None, description="Random seed used")
|
||||
datasets: Dict[str, Dict[str, Any]] = Field(..., description="Current dataset configurations")
|
||||
datasets: dict[str, dict[str, Any]] = Field(..., description="Current dataset configurations")
|
||||
|
||||
|
||||
class ExperimentList(BaseModel):
|
||||
"""Response model for listing experiments."""
|
||||
|
||||
experiments: List[str] = Field(default_factory=list, description="List of registered experiment names")
|
||||
experiments: list[str] = Field(default_factory=list, description="List of registered experiment names")
|
||||
|
||||
|
||||
class DatasetConfigUpdate(BaseModel):
|
||||
"""Request model for updating dataset configuration."""
|
||||
|
||||
config: Dict[str, Any] = Field(..., description="Configuration parameters to update")
|
||||
config: dict[str, Any] = Field(..., description="Configuration parameters to update")
|
||||
|
||||
|
||||
class ErrorResponse(BaseModel):
|
||||
|
|
@ -46,13 +46,13 @@ class BatchEntry(BaseModel):
|
|||
|
||||
question: str = Field(..., description="The question text")
|
||||
entry_id: str = Field(..., description="Unique identifier in format '{version}.{index}'")
|
||||
metadata: Dict[str, Any] = Field(default_factory=dict, description="Additional metadata about the entry")
|
||||
metadata: dict[str, Any] = Field(default_factory=dict, description="Additional metadata about the entry")
|
||||
|
||||
|
||||
class BatchResponse(BaseModel):
|
||||
"""Response containing a batch of entries"""
|
||||
|
||||
entries: List[BatchEntry] = Field(..., description="List of batch entries")
|
||||
entries: list[BatchEntry] = Field(..., description="List of batch entries")
|
||||
|
||||
|
||||
class AnswerItem(BaseModel):
|
||||
|
|
@ -65,11 +65,11 @@ class AnswerItem(BaseModel):
|
|||
class ScoringRequest(BaseModel):
|
||||
"""Request for scoring model outputs"""
|
||||
|
||||
answers: List[AnswerItem] = Field(..., description="List of entries to score")
|
||||
answers: list[AnswerItem] = Field(..., description="List of entries to score")
|
||||
|
||||
|
||||
class ScoringResponse(BaseModel):
|
||||
"""Response containing scores for answers"""
|
||||
|
||||
scores: List[float] = Field(..., description="List of scores in same order as request")
|
||||
entry_ids: List[str] = Field(..., description="List of entry_ids in same order as request")
|
||||
scores: list[float] = Field(..., description="List of scores in same order as request")
|
||||
entry_ids: list[str] = Field(..., description="List of entry_ids in same order as request")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue