sync: bug fixes + eval system from private repo
- Fix chunk_status: pass chunk_status/chunk/metadata to context builder - Fix vector search: scope by node_id BEFORE similarity search - Add eval logging system (RAH_EVALS_LOG=1) - Add eval dashboard at /evals - Add vitest for testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
e15f223ed8
commit
2f2ef10ec9
@@ -0,0 +1,24 @@
|
||||
import { NextRequest } from 'next/server';
|
||||
import { upsertEvalComment } from '@/services/evals/evalsStore';
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const evalsEnabled = process.env.RAH_EVALS_LOG === '1' || process.env.RAH_EVALS_LOG === 'true';
|
||||
if (process.env.NODE_ENV === 'production' || !evalsEnabled) {
|
||||
return new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
const body = await request.json();
|
||||
const traceId = typeof body?.traceId === 'string' ? body.traceId : null;
|
||||
const scenarioId = typeof body?.scenarioId === 'string' ? body.scenarioId : null;
|
||||
const comment = typeof body?.comment === 'string' ? body.comment : null;
|
||||
|
||||
if (!traceId || comment === null) {
|
||||
return new Response(JSON.stringify({ error: 'Invalid payload' }), { status: 400 });
|
||||
}
|
||||
|
||||
upsertEvalComment(traceId, scenarioId, comment);
|
||||
return new Response(JSON.stringify({ ok: true }), {
|
||||
status: 200,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user