malek-messaoudii
commited on
Commit
·
91ae7d9
1
Parent(s):
0e19c41
chore: Update requirements.txt to address urllib3 compatibility issues and add requests-toolbelt for enhanced HTTP request handling.
Browse files- requirements.txt +4 -0
- verify_routes.py +61 -0
requirements.txt
CHANGED
|
@@ -16,6 +16,10 @@ langchain-core>=0.1.0
|
|
| 16 |
langchain-groq>=0.1.0
|
| 17 |
langsmith>=0.1.0
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# Audio processing (optionnel si vous avez besoin de traitement local)
|
| 20 |
soundfile>=0.12.1
|
| 21 |
|
|
|
|
| 16 |
langchain-groq>=0.1.0
|
| 17 |
langsmith>=0.1.0
|
| 18 |
|
| 19 |
+
# Fix urllib3 compatibility issues
|
| 20 |
+
urllib3>=1.26.0,<3.0.0
|
| 21 |
+
requests-toolbelt>=1.0.0
|
| 22 |
+
|
| 23 |
# Audio processing (optionnel si vous avez besoin de traitement local)
|
| 24 |
soundfile>=0.12.1
|
| 25 |
|
verify_routes.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Script to verify MCP routes are properly registered"""
|
| 2 |
+
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
# Add project root to path
|
| 7 |
+
sys.path.insert(0, str(Path(__file__).parent))
|
| 8 |
+
|
| 9 |
+
try:
|
| 10 |
+
from main import app
|
| 11 |
+
|
| 12 |
+
print("=" * 60)
|
| 13 |
+
print("Checking registered routes...")
|
| 14 |
+
print("=" * 60)
|
| 15 |
+
|
| 16 |
+
mcp_routes = []
|
| 17 |
+
all_routes = []
|
| 18 |
+
|
| 19 |
+
for route in app.routes:
|
| 20 |
+
if hasattr(route, 'path') and hasattr(route, 'methods'):
|
| 21 |
+
path = route.path
|
| 22 |
+
methods = route.methods if route.methods else set()
|
| 23 |
+
all_routes.append((path, methods))
|
| 24 |
+
|
| 25 |
+
if '/mcp' in path:
|
| 26 |
+
mcp_routes.append((path, methods))
|
| 27 |
+
|
| 28 |
+
print(f"\nTotal routes found: {len(all_routes)}")
|
| 29 |
+
print(f"MCP-related routes found: {len(mcp_routes)}")
|
| 30 |
+
|
| 31 |
+
print("\n" + "=" * 60)
|
| 32 |
+
print("MCP Routes:")
|
| 33 |
+
print("=" * 60)
|
| 34 |
+
|
| 35 |
+
for path, methods in sorted(mcp_routes):
|
| 36 |
+
methods_str = ', '.join(sorted(methods)) if methods else 'N/A'
|
| 37 |
+
print(f" {methods_str:15} {path}")
|
| 38 |
+
|
| 39 |
+
# Check for new routes
|
| 40 |
+
extract_topic_found = any('/extract-topic' in path for path, _ in mcp_routes)
|
| 41 |
+
voice_chat_found = any('/voice-chat' in path for path, _ in mcp_routes)
|
| 42 |
+
|
| 43 |
+
print("\n" + "=" * 60)
|
| 44 |
+
print("Route Verification:")
|
| 45 |
+
print("=" * 60)
|
| 46 |
+
print(f" extract-topic route: {'✓ FOUND' if extract_topic_found else '✗ NOT FOUND'}")
|
| 47 |
+
print(f" voice-chat route: {'✓ FOUND' if voice_chat_found else '✗ NOT FOUND'}")
|
| 48 |
+
|
| 49 |
+
if extract_topic_found and voice_chat_found:
|
| 50 |
+
print("\n✓ All new routes are properly registered!")
|
| 51 |
+
print("\nIf routes don't appear in Swagger UI:")
|
| 52 |
+
print(" 1. Restart the FastAPI server")
|
| 53 |
+
print(" 2. Clear browser cache or use Ctrl+Shift+R")
|
| 54 |
+
print(" 3. Check server logs for any import errors")
|
| 55 |
+
else:
|
| 56 |
+
print("\n✗ Some routes are missing. Check for import errors in server logs.")
|
| 57 |
+
|
| 58 |
+
except Exception as e:
|
| 59 |
+
print(f"Error: {e}")
|
| 60 |
+
import traceback
|
| 61 |
+
traceback.print_exc()
|