Initial commit: PROMETHEUS v0.1.0 - Prompt optimizer
- Clean architecture (domain/application/infrastructure) - DSPy-based evolution engine with scoring - CLI via pyproject.toml entry point - Unit + integration tests (~300 tests) - Configs for glm-5.1 and glm-4.5-air models - Z.AI endpoint integration
This commit is contained in:
47
src/prometheus/application/dto.py
Normal file
47
src/prometheus/application/dto.py
Normal file
@@ -0,0 +1,47 @@
|
||||
"""Data Transfer Objects — configuration and results."""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass
|
||||
class OptimizationConfig:
|
||||
"""Complete configuration for a PROMETHEUS run."""
|
||||
|
||||
# --- Prompt ---
|
||||
seed_prompt: str
|
||||
task_description: str
|
||||
|
||||
# --- Models ---
|
||||
task_model: str = "openai/gpt-4o-mini"
|
||||
judge_model: str = "openai/gpt-4o"
|
||||
proposer_model: str = "openai/gpt-4o"
|
||||
synth_model: str = "openai/gpt-4o"
|
||||
|
||||
# --- Evolution parameters ---
|
||||
max_iterations: int = 30
|
||||
n_synthetic_inputs: int = 20
|
||||
minibatch_size: int = 5
|
||||
perfect_score: float = 1.0
|
||||
|
||||
# --- Reproducibility ---
|
||||
seed: int = 42
|
||||
|
||||
# --- Output ---
|
||||
output_path: str = "output.yaml"
|
||||
verbose: bool = False
|
||||
|
||||
|
||||
@dataclass
|
||||
class OptimizationResult:
|
||||
"""Result of a complete optimization."""
|
||||
|
||||
optimized_prompt: str
|
||||
initial_prompt: str
|
||||
iterations_used: int
|
||||
total_llm_calls: int
|
||||
initial_score: float
|
||||
final_score: float
|
||||
improvement: float
|
||||
history: list[dict[str, Any]] = field(default_factory=list)
|
||||
Reference in New Issue
Block a user