MCPcopy Create free account
hub / github.com/IBM/mcp-cli / suggest_fixes

Function suggest_fixes

diagnostics/debug_models.py:159–209  ·  view source on GitHub ↗

Suggest potential fixes based on what we found.

()

Source from the content-addressed store, hash-verified

157
158
159def suggest_fixes():
160 """Suggest potential fixes based on what we found."""
161 print("\n🔧 Suggested Fixes:")
162
163 # Check chuk-llm version
164 try:
165 from chuk_llm.configuration.unified_config import get_config
166
167 print("1. ✅ chuk-llm 0.6+ features available")
168
169 # Check if models are actually empty
170 config = get_config()
171 providers = config.get_all_providers()
172
173 if providers:
174 total_models = 0
175 for provider_name in providers:
176 try:
177 provider_config = config.get_provider(provider_name)
178 total_models += len(provider_config.models)
179 except Exception:
180 pass
181
182 if total_models == 0:
183 print("2. ⚠️ chuk-llm config found but no models loaded")
184 print(" 💡 Try: config.reload() or check YAML configuration")
185 else:
186 print(f"2. ✅ Found {total_models} total models in configuration")
187 print(" 🎯 ISSUE IDENTIFIED: MCP CLI looking for wrong key!")
188 print(" 💡 chuk-llm 0.7 uses 'models' key, not 'available_models'")
189
190 except ImportError:
191 print("1. ❌ chuk-llm 0.6 not available")
192 print(" 💡 Try: pip install 'chuk-llm>=0.6.0'")
193
194 # Check API keys
195 openai_key = os.getenv("OPENAI_API_KEY")
196 if not openai_key:
197 print("3. ❌ No OPENAI_API_KEY found")
198 print(" 💡 Set in environment or ~/.chuk_llm/.env")
199 else:
200 print("3. ✅ OPENAI_API_KEY configured")
201
202 # Check config files
203 chuk_config = Path.home() / ".chuk_llm"
204 if not chuk_config.exists():
205 print("4. ❌ No ~/.chuk_llm directory")
206 print(" 💡 chuk-llm might not be properly initialized")
207 print(" 💡 Try running a basic chuk-llm command first")
208 else:
209 print("4. ✅ ~/.chuk_llm directory exists")
210
211
212def debug_model_key_structure():

Callers

nothing calls this directly

Calls 1

get_configFunction · 0.85

Tested by

no test coverage detected