mirror of
https://github.com/myronblair/jarvis
synced 2026-07-28 08:43:00 -05:00
18783dc137
- config.example.php: error_reporting(0) -> E_ALL (live config.php matches); add JELLYFIN_URL/JELLYFIN_API_KEY placeholders - history.php, jellyfin.php: drop require of nonexistent includes/auth.php + AuthMiddleware call (router enforces auth centrally) — both endpoints were fataling on every request - remove stale kb_intent_generator .bak files from deployed tree DB (not in repo): kb_facts.fact_value TEXT -> MEDIUMTEXT; ha/entity_map had failed every write since Jul 2 at >64KB Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
498 B
PHP
20 lines
498 B
PHP
<?php
|
|
// Chat history search endpoint
|
|
require_once __DIR__ . '/../config.php';
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
$q = trim($_GET['q'] ?? '');
|
|
if (strlen($q) < 2) {
|
|
echo json_encode(['results' => [], 'error' => 'Query too short']);
|
|
exit;
|
|
}
|
|
|
|
$rows = JarvisDB::query(
|
|
"SELECT role, content, created_at FROM conversations
|
|
WHERE content LIKE ? ORDER BY created_at DESC LIMIT 25",
|
|
['%' . $q . '%']
|
|
) ?? [];
|
|
|
|
echo json_encode(['results' => $rows, 'total' => count($rows)]);
|