new version of pm using decision tree

This commit is contained in:
itsrubberduck
2025-09-16 12:23:32 +02:00
parent a9064e0ae3
commit 4b8da310b4
11 changed files with 651 additions and 1377 deletions

View File

@@ -0,0 +1,18 @@
// server/api/llm/decide.post.ts
import { readBody, createError } from 'h3'
export default defineEventHandler(async (event) => {
const body = await readBody<LLMDecisionInput | undefined>(event)
if (!body) {
throw createError({ statusCode: 400, statusMessage: 'Missing body' })
}
if (!body.state_id || !Array.isArray(body.candidates)) {
throw createError({ statusCode: 400, statusMessage: 'Invalid shape' })
}
try {
const decision = await routeDecision(body)
return decision // direkt das JSON des Routers zurückgeben
} catch (err: any) {
throw createError({ statusCode: 500, statusMessage: err?.message || 'Router failed' })
}
})