31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
// Check SSE endpoints
|
|
$sse_candidates = glob("/var/www/html/api/*sse*.php") ?: [];
|
|
$stream_candidates = glob("/var/www/html/api/*stream*.php") ?: [];
|
|
$out["sse_files"] = array_map("basename", $sse_candidates);
|
|
$out["stream_files"] = array_map("basename", $stream_candidates);
|
|
|
|
// Check SSE in wevia.html
|
|
$wevia = file_exists("/var/www/html/wevia.html") ? file_get_contents("/var/www/html/wevia.html") : "";
|
|
$out["wevia_has_eventsource"] = substr_count($wevia, "EventSource");
|
|
$out["wevia_has_sse"] = substr_count($wevia, "text/event-stream");
|
|
|
|
// Check RAG / Qdrant / Chroma
|
|
$rag_files = array_merge(
|
|
glob("/var/www/html/api/*rag*.php") ?: [],
|
|
glob("/var/www/html/api/*qdrant*.php") ?: [],
|
|
glob("/var/www/html/api/*embedding*.php") ?: []
|
|
);
|
|
$out["rag_files"] = array_map("basename", array_slice($rag_files, 0, 15));
|
|
|
|
// Check Qdrant live
|
|
$qdrant = @file_get_contents("http://127.0.0.1:6333/collections");
|
|
$out["qdrant_alive"] = $qdrant ? substr($qdrant, 0, 500) : "unreachable";
|
|
|
|
// Check React CDN usage
|
|
$out["react_cdn_in_wevia"] = strpos($wevia, "react") !== false ? "yes" : "no";
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|