mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-05 17:05:53 +08:00
Improve flow activation handling and expose active nodes
This commit is contained in:
@@ -5,7 +5,8 @@ import { join } from "node:path";
|
||||
import { tmpdir } from "node:os";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { execFile } from "node:child_process";
|
||||
import { getOpenAIClient, routeDecision, type LLMDecisionResult } from "../../utils/openai";
|
||||
import { getOpenAIClient, routeDecision } from "../../utils/openai";
|
||||
import type { LLMDecisionResult } from "~~/shared/types/llm";
|
||||
import { createReadStream } from "node:fs";
|
||||
import { TransmissionLog } from "../../models/TransmissionLog";
|
||||
import { getUserFromEvent } from "../../utils/auth";
|
||||
@@ -33,6 +34,7 @@ interface PTTResponse {
|
||||
transcription: string;
|
||||
decision?: LLMDecisionResult['decision'];
|
||||
trace?: LLMDecisionResult['trace'];
|
||||
active_nodes?: LLMDecisionResult['active_nodes'];
|
||||
}
|
||||
|
||||
async function sh(cmd: string, args: string[]) {
|
||||
@@ -273,6 +275,9 @@ export default defineEventHandler(async (event) => {
|
||||
if (decisionResult?.trace) {
|
||||
result.trace = decisionResult.trace;
|
||||
}
|
||||
if (decisionResult?.active_nodes?.length) {
|
||||
result.active_nodes = decisionResult.active_nodes;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user