Tools is broken

This commit is contained in:
eweeman
2026-01-15 17:01:02 -08:00
parent 4a6e2b898f
commit fcc86b52c2
11 changed files with 596 additions and 109 deletions

View File

@@ -0,0 +1,45 @@
# test_llm_endpoint.py
import requests
import os
from dotenv import load_dotenv
load_dotenv()
base_url = os.getenv("LLM_API_URL", "http://api.chat.pathcore.org")
# Test different possible endpoints
endpoints = [
f"{base_url}/v1/chat/completions",
f"{base_url}/chat/completions",
f"{base_url}/completions",
f"{base_url}/v1/completions",
f"{base_url}/api/v1/chat/completions",
]
print(f"Testing LLM API endpoints...\n")
for endpoint in endpoints:
print(f"Testing: {endpoint}")
try:
# Try a simple GET request first
resp = requests.get(endpoint, timeout=5, verify=False)
print(f" GET response: {resp.status_code}")
# Try POST with minimal data
resp = requests.post(
endpoint,
json={
"model": "default",
"messages": [{"role": "user", "content": "test"}]
},
timeout=5,
verify=False
)
print(f" POST response: {resp.status_code}")
if resp.status_code == 200:
print(f" ✓ SUCCESS! This endpoint works!")
print(f" Response: {resp.json()}")
break
except Exception as e:
print(f" Error: {e}")
print()