Files
html/api/training-status.php
opus f96f2871c5
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
auto-sync via WEVIA git_sync_all intent 2026-04-21T03:23:36+02:00
2026-04-21 03:23:36 +02:00

63 lines
2.1 KiB
PHP

<?php
/**
* V114 - Training Status API - expose real training metrics
*/
header('Content-Type: application/json');
$out = [
'ts' => date('c'),
'qdrant' => ['vectors' => '?', 'collections' => '?'],
'hf_model' => 'yace222/weval-brain-v4',
'wiki' => ['entries' => 0],
'vault' => ['files' => 0, 'gold' => 0],
'catalog' => ['total' => 0, 'categories' => 0],
'cognitive' => ['fn' => 635, 'file' => '/opt/wevia-brain/cognitive-opus46.php'],
'intents' => ['wired' => 0],
'cron_training' => [
'WeviaAutoLrn' => 'active',
'WeviaDream' => 'active',
'WeviaEmbed' => 'active',
]
];
// Qdrant count (via local http)
$qCh = curl_init("http://127.0.0.1:6333/collections/wevia_memory");
curl_setopt_array($qCh, [CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>3]);
$qResp = @curl_exec($qCh);
if ($qResp) {
$q = json_decode($qResp, true);
if (isset($q['result']['vectors_count'])) {
$out['qdrant']['vectors'] = $q['result']['vectors_count'];
} elseif (isset($q['result']['points_count'])) {
$out['qdrant']['vectors'] = $q['result']['points_count'];
}
}
curl_close($qCh);
// Wiki count
$wiki = glob('/var/www/html/wiki/*.md');
$out['wiki']['entries'] = $wiki ? count($wiki) : 0;
// Vault count
$vault = glob('/opt/wevads/vault/*');
$out['vault']['files'] = $vault ? count($vault) : 0;
$gold = glob('/opt/wevads/vault/*GOLD*');
$out['vault']['gold'] = $gold ? count($gold) : 0;
// Catalog
$catCh = curl_init("http://127.0.0.1/api/agents-catalog-api.php");
curl_setopt_array($catCh, [CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>3, CURLOPT_HTTPHEADER=>['Host: weval-consulting.com']]);
$catResp = @curl_exec($catCh);
if ($catResp) {
$cat = json_decode($catResp, true);
if (isset($cat['total'])) $out['catalog']['total'] = $cat['total'];
if (isset($cat['categories'])) $out['catalog']['categories'] = count($cat['categories']);
}
curl_close($catCh);
// Intents count
$intents = glob('/var/www/html/api/wired-pending/intent-opus4-*.php');
$out['intents']['wired'] = $intents ? count($intents) : 0;
echo json_encode($out, JSON_UNESCAPED_UNICODE);