|
68 | 68 | print(f' {key}: {value[:10] if len(value) > 10 else value}...') |
69 | 69 | " |
70 | 70 |
|
| 71 | + - name: Debug YAML Loading and Roles |
| 72 | + run: | |
| 73 | + echo "🔍 Tracing YAML file loading and role creation..." |
| 74 | + python -c " |
| 75 | + import os |
| 76 | + import sys |
| 77 | + import yaml |
| 78 | + sys.path.insert(0, '.') |
| 79 | + |
| 80 | + print('📁 Available YAML files in tests/:') |
| 81 | + import glob |
| 82 | + yaml_files = glob.glob('tests/*.yaml') |
| 83 | + for f in yaml_files: |
| 84 | + print(f' {f}') |
| 85 | + |
| 86 | + print() |
| 87 | + print('📋 Content of autogen-agents.yaml:') |
| 88 | + with open('tests/autogen-agents.yaml', 'r') as f: |
| 89 | + config = yaml.safe_load(f) |
| 90 | + print(f' Framework: {config.get(\"framework\")}') |
| 91 | + print(f' Topic: {config.get(\"topic\")}') |
| 92 | + print(f' Roles: {list(config.get(\"roles\", {}).keys())}') |
| 93 | + for role_key, role_data in config.get('roles', {}).items(): |
| 94 | + print(f' {role_key} -> {role_data.get(\"role\", \"NO_ROLE\")}') |
| 95 | + |
| 96 | + print() |
| 97 | + print('🔍 Checking if execution uses a different YAML:') |
| 98 | + |
| 99 | + # Check other YAML files for 'Researcher' role |
| 100 | + for yaml_file in yaml_files: |
| 101 | + try: |
| 102 | + with open(yaml_file, 'r') as f: |
| 103 | + test_config = yaml.safe_load(f) |
| 104 | + roles = test_config.get('roles', {}) |
| 105 | + for role_key, role_data in roles.items(): |
| 106 | + if 'researcher' in role_key.lower() or 'researcher' in role_data.get('role', '').lower(): |
| 107 | + print(f' 🎯 FOUND Researcher in {yaml_file}!') |
| 108 | + print(f' Framework: {test_config.get(\"framework\")}') |
| 109 | + print(f' Role key: {role_key} -> {role_data.get(\"role\")}') |
| 110 | + except: |
| 111 | + pass |
| 112 | + " |
| 113 | + continue-on-error: true |
| 114 | + |
| 115 | + - name: Debug Framework Detection |
| 116 | + run: | |
| 117 | + echo "🔍 Testing framework detection and config flow..." |
| 118 | + python -c " |
| 119 | + import os |
| 120 | + import sys |
| 121 | + import yaml |
| 122 | + sys.path.insert(0, '.') |
| 123 | + |
| 124 | + print('🔧 Testing framework detection:') |
| 125 | + |
| 126 | + # Load the YAML file |
| 127 | + with open('tests/autogen-agents.yaml', 'r') as f: |
| 128 | + config = yaml.safe_load(f) |
| 129 | + |
| 130 | + print(f' 📋 YAML framework: {config.get(\"framework\", \"NOT_SET\")}') |
| 131 | + print(f' 📋 YAML topic: {config.get(\"topic\", \"NOT_SET\")}') |
| 132 | + |
| 133 | + try: |
| 134 | + from praisonai import PraisonAI |
| 135 | + from praisonai.agents_generator import AgentsGenerator |
| 136 | + |
| 137 | + # Test PraisonAI initialization |
| 138 | + praisonai = PraisonAI(agent_file='tests/autogen-agents.yaml') |
| 139 | + print(f' 🎯 PraisonAI framework: {praisonai.framework}') |
| 140 | + |
| 141 | + # Test AgentsGenerator initialization |
| 142 | + agents_gen = AgentsGenerator( |
| 143 | + agent_file='tests/autogen-agents.yaml', |
| 144 | + framework=praisonai.framework, |
| 145 | + config_list=praisonai.config_list |
| 146 | + ) |
| 147 | + print(f' ⚙️ AgentsGenerator framework: {agents_gen.framework}') |
| 148 | + print(f' ⚙️ Final framework decision: {agents_gen.framework or config.get(\"framework\")}') |
| 149 | + |
| 150 | + # Check config_list |
| 151 | + print(f' 🔑 Config list model: {praisonai.config_list[0].get(\"model\")}') |
| 152 | + print(f' 🔑 Config list API key: {praisonai.config_list[0].get(\"api_key\", \"NOT_SET\")[:10]}...') |
| 153 | + |
| 154 | + except Exception as e: |
| 155 | + print(f'❌ Error in framework detection: {e}') |
| 156 | + " |
| 157 | + continue-on-error: true |
| 158 | + |
71 | 159 | - name: Debug PraisonAIModel API Key Flow |
72 | 160 | run: | |
73 | 161 | echo "🔍 Testing PraisonAIModel API key handling..." |
|
0 commit comments