mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-09 02:56:02 +08:00
Add waitlist admin view and log OpenAI decision traces
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// server/api/llm/decide.post.ts
|
||||
import { readBody, createError } from 'h3'
|
||||
import { routeDecision, type LLMDecisionInput } from '../../utils/openai'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody<LLMDecisionInput | undefined>(event)
|
||||
@@ -11,7 +12,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const decision = await routeDecision(body)
|
||||
const { decision, trace } = await routeDecision(body)
|
||||
|
||||
// Log für Debugging bei off-schema oder radio check
|
||||
if (decision.off_schema) {
|
||||
@@ -21,6 +22,10 @@ export default defineEventHandler(async (event) => {
|
||||
console.log(`[ATC] Radio check processed: "${body.pilot_utterance}"`)
|
||||
}
|
||||
|
||||
if (trace?.calls?.length) {
|
||||
console.log('[ATC] Decision trace captured with', trace.calls.length, 'call(s)')
|
||||
}
|
||||
|
||||
return decision
|
||||
} catch (err: any) {
|
||||
console.error('Router failed:', err)
|
||||
|
||||
Reference in New Issue
Block a user