|
|
@ -9,10 +9,11 @@ All components are now in one file: hierarchical_structured_communication_framew
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
from typing import Dict, Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add the project root to the Python path
|
|
|
|
# Add the project root to the Python path
|
|
|
|
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
|
|
|
project_root = os.path.abspath(
|
|
|
|
|
|
|
|
os.path.join(os.path.dirname(__file__), "..", "..")
|
|
|
|
|
|
|
|
)
|
|
|
|
sys.path.insert(0, project_root)
|
|
|
|
sys.path.insert(0, project_root)
|
|
|
|
|
|
|
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from dotenv import load_dotenv
|
|
|
@ -20,11 +21,6 @@ from dotenv import load_dotenv
|
|
|
|
# Import everything from the single file
|
|
|
|
# Import everything from the single file
|
|
|
|
from swarms.structs.hierarchical_structured_communication_framework import (
|
|
|
|
from swarms.structs.hierarchical_structured_communication_framework import (
|
|
|
|
HierarchicalStructuredCommunicationFramework,
|
|
|
|
HierarchicalStructuredCommunicationFramework,
|
|
|
|
HierarchicalStructuredCommunicationGenerator,
|
|
|
|
|
|
|
|
HierarchicalStructuredCommunicationEvaluator,
|
|
|
|
|
|
|
|
HierarchicalStructuredCommunicationRefiner,
|
|
|
|
|
|
|
|
HierarchicalStructuredCommunicationSupervisor,
|
|
|
|
|
|
|
|
# Convenience aliases
|
|
|
|
|
|
|
|
TalkHierarchicalGenerator,
|
|
|
|
TalkHierarchicalGenerator,
|
|
|
|
TalkHierarchicalEvaluator,
|
|
|
|
TalkHierarchicalEvaluator,
|
|
|
|
TalkHierarchicalRefiner,
|
|
|
|
TalkHierarchicalRefiner,
|
|
|
@ -42,29 +38,29 @@ def example_basic_usage():
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
print("BASIC USAGE EXAMPLE")
|
|
|
|
print("BASIC USAGE EXAMPLE")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
# Create framework with default configuration
|
|
|
|
# Create framework with default configuration
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
name="BasicFramework",
|
|
|
|
name="BasicFramework", max_loops=2, verbose=True
|
|
|
|
max_loops=2,
|
|
|
|
|
|
|
|
verbose=True
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Run a simple task
|
|
|
|
# Run a simple task
|
|
|
|
task = "Explain the benefits of structured communication in multi-agent systems"
|
|
|
|
task = "Explain the benefits of structured communication in multi-agent systems"
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print("Running framework...")
|
|
|
|
print("Running framework...")
|
|
|
|
|
|
|
|
|
|
|
|
result = framework.run(task)
|
|
|
|
result = framework.run(task)
|
|
|
|
|
|
|
|
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("=" * 50)
|
|
|
|
print("=" * 50)
|
|
|
|
print(result["final_result"])
|
|
|
|
print(result["final_result"])
|
|
|
|
|
|
|
|
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"Conversation history entries: {len(result['conversation_history'])}")
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"Conversation history entries: {len(result['conversation_history'])}"
|
|
|
|
|
|
|
|
)
|
|
|
|
print(f"Evaluation results: {len(result['evaluation_results'])}")
|
|
|
|
print(f"Evaluation results: {len(result['evaluation_results'])}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -75,40 +71,40 @@ def example_custom_agents():
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("CUSTOM AGENTS EXAMPLE")
|
|
|
|
print("CUSTOM AGENTS EXAMPLE")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
# Create custom agents using the convenience aliases
|
|
|
|
# Create custom agents using the convenience aliases
|
|
|
|
generator = TalkHierarchicalGenerator(
|
|
|
|
generator = TalkHierarchicalGenerator(
|
|
|
|
agent_name="ContentCreator",
|
|
|
|
agent_name="ContentCreator",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
evaluator1 = TalkHierarchicalEvaluator(
|
|
|
|
evaluator1 = TalkHierarchicalEvaluator(
|
|
|
|
agent_name="AccuracyChecker",
|
|
|
|
agent_name="AccuracyChecker",
|
|
|
|
evaluation_criteria=["accuracy", "technical_correctness"],
|
|
|
|
evaluation_criteria=["accuracy", "technical_correctness"],
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
evaluator2 = TalkHierarchicalEvaluator(
|
|
|
|
evaluator2 = TalkHierarchicalEvaluator(
|
|
|
|
agent_name="ClarityChecker",
|
|
|
|
agent_name="ClarityChecker",
|
|
|
|
evaluation_criteria=["clarity", "readability", "coherence"],
|
|
|
|
evaluation_criteria=["clarity", "readability", "coherence"],
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
refiner = TalkHierarchicalRefiner(
|
|
|
|
refiner = TalkHierarchicalRefiner(
|
|
|
|
agent_name="ContentImprover",
|
|
|
|
agent_name="ContentImprover",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
supervisor = TalkHierarchicalSupervisor(
|
|
|
|
supervisor = TalkHierarchicalSupervisor(
|
|
|
|
agent_name="WorkflowManager",
|
|
|
|
agent_name="WorkflowManager",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
model_name="gpt-4o-mini",
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Create framework with custom agents
|
|
|
|
# Create framework with custom agents
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
name="CustomFramework",
|
|
|
|
name="CustomFramework",
|
|
|
@ -117,24 +113,26 @@ def example_custom_agents():
|
|
|
|
evaluators=[evaluator1, evaluator2],
|
|
|
|
evaluators=[evaluator1, evaluator2],
|
|
|
|
refiners=[refiner],
|
|
|
|
refiners=[refiner],
|
|
|
|
max_loops=3,
|
|
|
|
max_loops=3,
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Run a complex task
|
|
|
|
# Run a complex task
|
|
|
|
task = "Design a comprehensive machine learning pipeline for sentiment analysis"
|
|
|
|
task = "Design a comprehensive machine learning pipeline for sentiment analysis"
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print("Running framework with custom agents...")
|
|
|
|
print("Running framework with custom agents...")
|
|
|
|
|
|
|
|
|
|
|
|
result = framework.run(task)
|
|
|
|
result = framework.run(task)
|
|
|
|
|
|
|
|
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("=" * 50)
|
|
|
|
print("=" * 50)
|
|
|
|
print(result["final_result"])
|
|
|
|
print(result["final_result"])
|
|
|
|
|
|
|
|
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"Conversation history entries: {len(result['conversation_history'])}")
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"Conversation history entries: {len(result['conversation_history'])}"
|
|
|
|
|
|
|
|
)
|
|
|
|
print(f"Evaluation results: {len(result['evaluation_results'])}")
|
|
|
|
print(f"Evaluation results: {len(result['evaluation_results'])}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +143,7 @@ def example_ollama_integration():
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("OLLAMA INTEGRATION EXAMPLE")
|
|
|
|
print("OLLAMA INTEGRATION EXAMPLE")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
# Create framework with Ollama configuration
|
|
|
|
# Create framework with Ollama configuration
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
name="OllamaFramework",
|
|
|
|
name="OllamaFramework",
|
|
|
@ -154,27 +152,31 @@ def example_ollama_integration():
|
|
|
|
model_name="llama3:latest",
|
|
|
|
model_name="llama3:latest",
|
|
|
|
use_ollama=True,
|
|
|
|
use_ollama=True,
|
|
|
|
ollama_base_url="http://localhost:11434/v1",
|
|
|
|
ollama_base_url="http://localhost:11434/v1",
|
|
|
|
ollama_api_key="ollama"
|
|
|
|
ollama_api_key="ollama",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Run a task with local model
|
|
|
|
# Run a task with local model
|
|
|
|
task = "Explain the concept of structured communication protocols"
|
|
|
|
task = "Explain the concept of structured communication protocols"
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print(f"Task: {task}")
|
|
|
|
print("Running framework with Ollama...")
|
|
|
|
print("Running framework with Ollama...")
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
result = framework.run(task)
|
|
|
|
result = framework.run(task)
|
|
|
|
|
|
|
|
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("\n" + "=" * 50)
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("FINAL RESULT")
|
|
|
|
print("=" * 50)
|
|
|
|
print("=" * 50)
|
|
|
|
print(result["final_result"])
|
|
|
|
print(result["final_result"])
|
|
|
|
|
|
|
|
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"\nTotal loops: {result['total_loops']}")
|
|
|
|
print(f"Conversation history entries: {len(result['conversation_history'])}")
|
|
|
|
print(
|
|
|
|
print(f"Evaluation results: {len(result['evaluation_results'])}")
|
|
|
|
f"Conversation history entries: {len(result['conversation_history'])}"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"Evaluation results: {len(result['evaluation_results'])}"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
print(f"Error with Ollama: {e}")
|
|
|
|
print(f"Error with Ollama: {e}")
|
|
|
|
print("Make sure Ollama is running: ollama serve")
|
|
|
|
print("Make sure Ollama is running: ollama serve")
|
|
|
@ -187,28 +189,31 @@ def example_structured_communication():
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("STRUCTURED COMMUNICATION EXAMPLE")
|
|
|
|
print("STRUCTURED COMMUNICATION EXAMPLE")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
# Create framework
|
|
|
|
# Create framework
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
framework = HierarchicalStructuredCommunicationFramework(
|
|
|
|
name="CommunicationDemo",
|
|
|
|
name="CommunicationDemo", verbose=True
|
|
|
|
verbose=True
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Demonstrate structured message sending
|
|
|
|
# Demonstrate structured message sending
|
|
|
|
print("Sending structured message...")
|
|
|
|
print("Sending structured message...")
|
|
|
|
|
|
|
|
|
|
|
|
structured_msg = framework.send_structured_message(
|
|
|
|
structured_msg = framework.send_structured_message(
|
|
|
|
sender="Supervisor",
|
|
|
|
sender="Supervisor",
|
|
|
|
recipient="Generator",
|
|
|
|
recipient="Generator",
|
|
|
|
message="Create a technical documentation outline",
|
|
|
|
message="Create a technical documentation outline",
|
|
|
|
background="For a Python library focused on data processing",
|
|
|
|
background="For a Python library focused on data processing",
|
|
|
|
intermediate_output="Previous research on similar libraries"
|
|
|
|
intermediate_output="Previous research on similar libraries",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Message sent: {structured_msg.message}")
|
|
|
|
print(f"Message sent: {structured_msg.message}")
|
|
|
|
print(f"Background: {structured_msg.background}")
|
|
|
|
print(f"Background: {structured_msg.background}")
|
|
|
|
print(f"Intermediate output: {structured_msg.intermediate_output}")
|
|
|
|
print(
|
|
|
|
print(f"From: {structured_msg.sender} -> To: {structured_msg.recipient}")
|
|
|
|
f"Intermediate output: {structured_msg.intermediate_output}"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"From: {structured_msg.sender} -> To: {structured_msg.recipient}"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def example_agent_interaction():
|
|
|
|
def example_agent_interaction():
|
|
|
@ -218,52 +223,51 @@ def example_agent_interaction():
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("AGENT INTERACTION EXAMPLE")
|
|
|
|
print("AGENT INTERACTION EXAMPLE")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
# Create agents
|
|
|
|
# Create agents
|
|
|
|
generator = TalkHierarchicalGenerator(
|
|
|
|
generator = TalkHierarchicalGenerator(
|
|
|
|
agent_name="ContentGenerator",
|
|
|
|
agent_name="ContentGenerator", verbose=True
|
|
|
|
verbose=True
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
evaluator = TalkHierarchicalEvaluator(
|
|
|
|
evaluator = TalkHierarchicalEvaluator(
|
|
|
|
agent_name="QualityEvaluator",
|
|
|
|
agent_name="QualityEvaluator",
|
|
|
|
evaluation_criteria=["accuracy", "clarity"],
|
|
|
|
evaluation_criteria=["accuracy", "clarity"],
|
|
|
|
verbose=True
|
|
|
|
verbose=True,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
refiner = TalkHierarchicalRefiner(
|
|
|
|
refiner = TalkHierarchicalRefiner(
|
|
|
|
agent_name="ContentRefiner",
|
|
|
|
agent_name="ContentRefiner", verbose=True
|
|
|
|
verbose=True
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Generate content
|
|
|
|
# Generate content
|
|
|
|
print("1. Generating content...")
|
|
|
|
print("1. Generating content...")
|
|
|
|
gen_result = generator.generate_with_structure(
|
|
|
|
gen_result = generator.generate_with_structure(
|
|
|
|
message="Create a brief explanation of machine learning",
|
|
|
|
message="Create a brief explanation of machine learning",
|
|
|
|
background="For beginners with no technical background",
|
|
|
|
background="For beginners with no technical background",
|
|
|
|
intermediate_output=""
|
|
|
|
intermediate_output="",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Generated content: {gen_result.content[:200]}...")
|
|
|
|
print(f"Generated content: {gen_result.content[:200]}...")
|
|
|
|
|
|
|
|
|
|
|
|
# Evaluate content
|
|
|
|
# Evaluate content
|
|
|
|
print("\n2. Evaluating content...")
|
|
|
|
print("\n2. Evaluating content...")
|
|
|
|
eval_result = evaluator.evaluate_with_criterion(
|
|
|
|
eval_result = evaluator.evaluate_with_criterion(
|
|
|
|
content=gen_result.content,
|
|
|
|
content=gen_result.content, criterion="clarity"
|
|
|
|
criterion="clarity"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Evaluation score: {eval_result.score}/10")
|
|
|
|
print(f"Evaluation score: {eval_result.score}/10")
|
|
|
|
print(f"Feedback: {eval_result.feedback[:200]}...")
|
|
|
|
print(f"Feedback: {eval_result.feedback[:200]}...")
|
|
|
|
|
|
|
|
|
|
|
|
# Refine content
|
|
|
|
# Refine content
|
|
|
|
print("\n3. Refining content...")
|
|
|
|
print("\n3. Refining content...")
|
|
|
|
refine_result = refiner.refine_with_feedback(
|
|
|
|
refine_result = refiner.refine_with_feedback(
|
|
|
|
original_content=gen_result.content,
|
|
|
|
original_content=gen_result.content,
|
|
|
|
evaluation_results=[eval_result]
|
|
|
|
evaluation_results=[eval_result],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"Refined content: {refine_result.refined_content[:200]}..."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Refined content: {refine_result.refined_content[:200]}...")
|
|
|
|
|
|
|
|
print(f"Changes made: {refine_result.changes_made}")
|
|
|
|
print(f"Changes made: {refine_result.changes_made}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -271,12 +275,16 @@ def main():
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Main function to run all examples
|
|
|
|
Main function to run all examples
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
print("SINGLE-FILE HIERARCHICAL STRUCTURED COMMUNICATION FRAMEWORK")
|
|
|
|
print(
|
|
|
|
|
|
|
|
"SINGLE-FILE HIERARCHICAL STRUCTURED COMMUNICATION FRAMEWORK"
|
|
|
|
|
|
|
|
)
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
print("This demonstrates the consolidated single-file implementation")
|
|
|
|
print(
|
|
|
|
|
|
|
|
"This demonstrates the consolidated single-file implementation"
|
|
|
|
|
|
|
|
)
|
|
|
|
print("based on the research paper: arXiv:2502.11098")
|
|
|
|
print("based on the research paper: arXiv:2502.11098")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# Run examples
|
|
|
|
# Run examples
|
|
|
|
example_basic_usage()
|
|
|
|
example_basic_usage()
|
|
|
@ -284,27 +292,30 @@ def main():
|
|
|
|
example_ollama_integration()
|
|
|
|
example_ollama_integration()
|
|
|
|
example_structured_communication()
|
|
|
|
example_structured_communication()
|
|
|
|
example_agent_interaction()
|
|
|
|
example_agent_interaction()
|
|
|
|
|
|
|
|
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("\n" + "=" * 80)
|
|
|
|
print("ALL EXAMPLES COMPLETED SUCCESSFULLY!")
|
|
|
|
print("ALL EXAMPLES COMPLETED SUCCESSFULLY!")
|
|
|
|
print("=" * 80)
|
|
|
|
print("=" * 80)
|
|
|
|
print("Framework Features Demonstrated:")
|
|
|
|
print("Framework Features Demonstrated:")
|
|
|
|
print("✓ Single-file implementation")
|
|
|
|
print("✓ Single-file implementation")
|
|
|
|
print("✓ Structured Communication Protocol (M_ij, B_ij, I_ij)")
|
|
|
|
print(
|
|
|
|
|
|
|
|
"✓ Structured Communication Protocol (M_ij, B_ij, I_ij)"
|
|
|
|
|
|
|
|
)
|
|
|
|
print("✓ Hierarchical Evaluation System")
|
|
|
|
print("✓ Hierarchical Evaluation System")
|
|
|
|
print("✓ Iterative Refinement Process")
|
|
|
|
print("✓ Iterative Refinement Process")
|
|
|
|
print("✓ Flexible Model Configuration (OpenAI/Ollama)")
|
|
|
|
print("✓ Flexible Model Configuration (OpenAI/Ollama)")
|
|
|
|
print("✓ Custom Agent Specialization")
|
|
|
|
print("✓ Custom Agent Specialization")
|
|
|
|
print("✓ Direct Agent Interaction")
|
|
|
|
print("✓ Direct Agent Interaction")
|
|
|
|
print("✓ Convenience Aliases")
|
|
|
|
print("✓ Convenience Aliases")
|
|
|
|
|
|
|
|
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
print("\nInterrupted by user")
|
|
|
|
print("\nInterrupted by user")
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
print(f"Error during execution: {e}")
|
|
|
|
print(f"Error during execution: {e}")
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
|
|
|
|
traceback.print_exc()
|
|
|
|
traceback.print_exc()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|