| |
| """ |
| Test script to verify MCP and HTTP service availability |
| """ |
|
|
| import requests |
| import asyncio |
| import sys |
|
|
| def test_http_endpoints(): |
| """Test HTTP endpoints still work after MCP enablement""" |
| print("π Testing HTTP endpoints...") |
| |
| |
| stt_url = "https://pgits-stt-gpu-service.hf.space" |
| try: |
| response = requests.get(stt_url, timeout=10) |
| print(f"β
STT HTTP service accessible: {response.status_code}") |
| except Exception as e: |
| print(f"β STT HTTP service error: {e}") |
| |
| |
| tts_url = "https://pgits-tts-gpu-service.hf.space" |
| try: |
| response = requests.get(tts_url, timeout=10) |
| print(f"β
TTS HTTP service accessible: {response.status_code}") |
| except Exception as e: |
| print(f"β TTS HTTP service error: {e}") |
|
|
| async def test_mcp_services(): |
| """Test MCP service availability""" |
| print("π Testing MCP services...") |
| |
| try: |
| |
| from mcp import ClientSession |
| print("β
MCP client library available") |
| |
| |
| |
| print("π€ MCP STT service connection test...") |
| print("π MCP TTS service connection test...") |
| |
| |
| print("β
MCP framework ready for service connection") |
| |
| except ImportError as e: |
| print(f"β MCP client not available: {e}") |
| print("π¦ Installing MCP client may be needed") |
| except Exception as e: |
| print(f"β MCP connection error: {e}") |
|
|
| def main(): |
| """Main test function""" |
| print("π§ͺ ChatCal MCP Service Test") |
| print("=" * 50) |
| |
| |
| test_http_endpoints() |
| print() |
| |
| |
| asyncio.run(test_mcp_services()) |
| print() |
| |
| print("π Test completed!") |
| print("Next: Enable MCP on your HF services if not already done") |
|
|
| if __name__ == "__main__": |
| main() |