feat: sync runtime search and schema quality updates from app repo
- port retrieval, validation, and eval improvements relevant to os - align prompts and dimensions with the flat single-agent model - replace the old eval suite with the focused core scenarios Generated with Codex
This commit is contained in:
+10
-1
@@ -1,5 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { edgeService } from '@/services/database';
|
||||
import { validateEdgeExplanation } from '@/services/database/quality';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
@@ -57,8 +58,16 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
const fromId = parseInt(body.from_node_id);
|
||||
const toId = parseInt(body.to_node_id);
|
||||
// Explanation can be empty - service will auto-generate
|
||||
const explanation = String(body.explanation || '').trim();
|
||||
if (explanation) {
|
||||
const explanationError = validateEdgeExplanation(explanation);
|
||||
if (explanationError) {
|
||||
return NextResponse.json({
|
||||
success: false,
|
||||
error: explanationError
|
||||
}, { status: 400 });
|
||||
}
|
||||
}
|
||||
|
||||
const skipInference = Boolean(body.skip_inference);
|
||||
const createdVia = (() => {
|
||||
|
||||
Reference in New Issue
Block a user