Spaces:
Sleeping
Sleeping
File size: 2,985 Bytes
db4d559 3786a3f db4d559 3786a3f db4d559 3786a3f 2fb781f 0527a95 db4d559 3786a3f db4d559 3786a3f db4d559 3786a3f db4d559 3786a3f 2fb781f 0527a95 3786a3f db4d559 3786a3f db4d559 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import TokenRefreshView
from .views import (
HealthCheckView,
RegisterView,
CustomTokenObtainPairView,
DocumentViewSet,
DocumentUploadView,
QueryView,
GraphOnlyQueryView,
VectorOnlyQueryView,
QueryCompareView,
QueryHistoryView,
GraphDataView,
GraphEntityDetailView,
GraphPathView,
GraphCypherView,
GraphStatsView,
CommunityListView,
CommunityDetailView,
GraphSearchView,
EvaluationView,
CypherQueryView,
ShortestPathView,
MultiHopQueryView,
MultiHopExplainPathView,
)
router = DefaultRouter()
router.register(r'documents', DocumentViewSet, basename='document')
urlpatterns = [
# === Health ===
path('health/', HealthCheckView.as_view(), name='health'),
# === Authentication ===
path('auth/register/', RegisterView.as_view(), name='auth_register'),
path('auth/login/', CustomTokenObtainPairView.as_view(), name='auth_login'),
path('auth/token/refresh/', TokenRefreshView.as_view(), name='auth_token_refresh'),
# === Documents ===
path('documents/upload/', DocumentUploadView.as_view(), name='document_upload'),
# === Query Endpoints ===
path('query/', QueryView.as_view(), name='query'),
path('query/graph-only/', GraphOnlyQueryView.as_view(), name='query_graph_only'),
path('query/vector-only/', VectorOnlyQueryView.as_view(), name='query_vector_only'),
path('query/compare/', QueryCompareView.as_view(), name='query_compare'),
path('query/multihop/', MultiHopQueryView.as_view(), name='query_multihop'),
path('query/multihop/explain/', MultiHopExplainPathView.as_view(), name='query_multihop_explain'),
# === Legacy endpoints (kept for backwards compat) ===
path('query/cypher/', CypherQueryView.as_view(), name='query_cypher'),
path('query/shortest-path/', ShortestPathView.as_view(), name='query_shortest_path'),
# === Graph Endpoints (NEW) ===
path('graph/', GraphDataView.as_view(), name='graph_data'),
path('graph/entity/<str:name>/', GraphEntityDetailView.as_view(), name='graph_entity_detail'),
path('graph/path/', GraphPathView.as_view(), name='graph_path'),
path('graph/cypher/', GraphCypherView.as_view(), name='graph_cypher'),
path('graph/stats/', GraphStatsView.as_view(), name='graph_stats'),
path('graph/communities/', CommunityListView.as_view(), name='graph_communities'),
path('graph/communities/<int:community_id>/', CommunityDetailView.as_view(), name='graph_community_detail'),
path('graph/search/', GraphSearchView.as_view(), name='graph_search'),
# === Query History ===
path('query/history/', QueryHistoryView.as_view(), name='query_history'),
# === Evaluation ===
path('evaluation/', EvaluationView.as_view(), name='evaluation'),
# === Document Management (router) ===
path('', include(router.urls)),
]
|