55 lines
1.6 KiB
Python
55 lines
1.6 KiB
Python
import sys
|
|
import os
|
|
|
|
# Ensure src is in path (like inside container)
|
|
sys.path.append("/app")
|
|
|
|
try:
|
|
from src.router import SmartRouter
|
|
from src.crews.definitions import CrewDefinitions
|
|
from src.config import Config
|
|
except ImportError as e:
|
|
print(f"CRITICAL IMPORT ERROR: {e}")
|
|
sys.exit(1)
|
|
|
|
def test_system():
|
|
print("--- STARTING MANUAL TEST ---")
|
|
|
|
# 1. Check Config
|
|
try:
|
|
llm_config = Config.get_llm_config(mode="fast")
|
|
print(f"LLM Config: Provider={llm_config.get('model')}")
|
|
if not llm_config.get('api_key'):
|
|
print("WARNING: No API Key found in config!")
|
|
except Exception as e:
|
|
print(f"Config Error: {e}")
|
|
|
|
# 2. Test Router (Gemini Flash)
|
|
user_input = "pode me explicar oque voce consegue fazer?"
|
|
print(f"\nTesting Router with input: '{user_input}'")
|
|
|
|
try:
|
|
crew_name = SmartRouter.route(user_input)
|
|
print(f"SUCCESS: Router decided on: '{crew_name}'")
|
|
except Exception as e:
|
|
print(f"ROUTER FAILED: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
return
|
|
|
|
# 3. Test Crew Assembly (Gemini Pro/Flash)
|
|
print(f"\nTesting Crew Assembly for: '{crew_name}'")
|
|
try:
|
|
crew = CrewDefinitions.assemble_crew(crew_name, inputs={"topic": user_input})
|
|
print(f"SUCCESS: Crew '{crew_name}' assembled with {len(crew.agents)} agents.")
|
|
print(f"Agents: {[agent.role for agent in crew.agents]}")
|
|
except Exception as e:
|
|
print(f"CREW ASSEMBLY FAILED: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
print("\n--- TEST COMPLETE ---")
|
|
|
|
if __name__ == "__main__":
|
|
test_system()
|