From 0aaf073ed1564c6e7c5483a4ebde3253a89a0f21 Mon Sep 17 00:00:00 2001 From: Farouk Adeleke Date: Sun, 19 Oct 2025 19:41:16 -0400 Subject: [PATCH] Complete Migration --- agent/agent.py | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/agent/agent.py b/agent/agent.py index d5cf78b..5c7f332 100644 --- a/agent/agent.py +++ b/agent/agent.py @@ -100,50 +100,4 @@ class TweetOptimizerAgent(PrecompiledAgent): def reset(self): self.current_tweet = "" - self.previous_evaluation = None - - -if __name__ == "__main__": - # create agent with default config - config = TweetOptimizerConfig() - tweet_optimizer = TweetOptimizerAgent(config) - import os - - # set up test environment (replace with real API key for actual usage) - if not os.getenv("OPENROUTER_API_KEY"): - raise ValueError("OPENROUTER_API_KEY environment variable is not set") - - # full optimization process - print("\n=== Full Optimization Process ===") - try: - results = tweet_optimizer( - input_text="Anthropic added a new OSS model on HuggingFace.", - iterations=10, # Reduced for testing - patience=8 - ) - print(f"Initial text: {results['initial_text']}") - print(f"Final tweet: {results['final_tweet']}") - print(f"Best score: {results['best_score']:.2f}") - print(f"Iterations run: {results['iterations_run']}") - print(f"Improvements found: {results['improvement_count']}") - print(f"Early stopped: {results['early_stopped']}") - except Exception as e: - print(f"Error in optimization: {e}") - - # push to hub - print("\n=== Push to Hub ===") - try: - tweet_optimizer.push_to_hub( - "farouk1/tweet-optimizer-v2", - commit_message="Complete Migration", - with_code=True - ) - print("Successfully pushed to hub!") - except Exception as e: - print(f"Error pushing to hub: {e}") - - print("\n=== Agent Configuration ===") - print(f"Model: {config.lm}") - print(f"Categories: {config.categories}") - print(f"Max iterations: {config.max_iterations}") - print(f"Patience: {config.patience}") \ No newline at end of file + self.previous_evaluation = None \ No newline at end of file