Complete Migration
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from modaic import PrecompiledAgent, PrecompiledConfig
|
||||
from .modules import TweetGeneratorModule, TweetEvaluatorModule
|
||||
from .models import EvaluationResult
|
||||
from .models import EvaluationResult, FinalResult
|
||||
from .hill_climbing import HillClimbingOptimizer
|
||||
from typing import Optional, List
|
||||
from .utils import get_dspy_lm
|
||||
@@ -50,7 +50,7 @@ class TweetOptimizerAgent(PrecompiledAgent):
|
||||
input_text: str,
|
||||
iterations: Optional[int] = None,
|
||||
patience: Optional[int] = None,
|
||||
) -> str:
|
||||
) -> FinalResult:
|
||||
"""Run full optimization process."""
|
||||
max_iterations = iterations or self.max_iterations
|
||||
patience_limit = patience or self.patience
|
||||
@@ -97,6 +97,7 @@ class TweetOptimizerAgent(PrecompiledAgent):
|
||||
results.update({"final_tweet": best_tweet, "best_score": best_score})
|
||||
|
||||
self.reset()
|
||||
results = FinalResult(**results)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user