jina rerank working

This commit is contained in:
2026-01-13 09:51:35 +08:00
parent 370fe6368a
commit 9745ca2476
23 changed files with 1967 additions and 6 deletions

44
check_rerank_config.py Normal file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env python3
"""Check current server rerank configuration"""
import requests
import json
def check_rerank_config():
try:
# Get health endpoint
response = requests.get("http://localhost:3015/health")
if response.status_code == 200:
data = response.json()
print("=== Current Server Configuration ===")
print(f"Server Status: {data.get('status', 'unknown')}")
print(f"Enable Rerank: {data.get('configuration', {}).get('enable_rerank', False)}")
print(f"Rerank Binding: {data.get('configuration', {}).get('rerank_binding', 'null')}")
print(f"Rerank Model: {data.get('configuration', {}).get('rerank_model', 'None')}")
print(f"Rerank Binding Host: {data.get('configuration', {}).get('rerank_binding_host', 'None')}")
# Check if Jina rerank is configured
rerank_binding = data.get('configuration', {}).get('rerank_binding', 'null')
if rerank_binding == 'jina':
print("\n✓ Jina rerank is configured")
rerank_host = data.get('configuration', {}).get('rerank_binding_host', 'None')
if rerank_host and 'api.jina.ai' in rerank_host:
print(" Using Jina Cloud API (requires API key)")
elif rerank_host and 'localhost' in rerank_host:
print(" Using local Ollama endpoint (no API key needed)")
else:
print(f" Using custom endpoint: {rerank_host}")
else:
print(f"\n✗ Jina rerank is NOT configured (binding: {rerank_binding})")
else:
print(f"Error: Server returned status {response.status_code}")
except requests.exceptions.ConnectionError:
print("Error: Cannot connect to server at http://localhost:3015")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
check_rerank_config()