Remove plan from chat payload and UI
This commit is contained in:
@@ -859,7 +859,6 @@ export async function runLangGraphCrmAgentFor(input: {
|
||||
tools: [crmTool],
|
||||
responseFormat: z.object({
|
||||
answer: z.string().describe("Final assistant answer for the user."),
|
||||
plan: z.array(z.string()).min(1).max(10).describe("Short plan (3-8 steps)."),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -924,7 +923,7 @@ export async function runLangGraphCrmAgentFor(input: {
|
||||
return String(msg?.type ?? msg?.role ?? msg?.constructor?.name ?? "");
|
||||
};
|
||||
|
||||
const structured = res?.structuredResponse as { answer?: string; plan?: string[] } | undefined;
|
||||
const structured = res?.structuredResponse as { answer?: string } | undefined;
|
||||
const fallbackText = (() => {
|
||||
const messages = Array.isArray(res?.messages) ? res.messages : [];
|
||||
for (let i = messages.length - 1; i >= 0; i -= 1) {
|
||||
@@ -945,7 +944,7 @@ export async function runLangGraphCrmAgentFor(input: {
|
||||
if (!text) {
|
||||
throw new Error("Model returned empty response");
|
||||
}
|
||||
const plan = Array.isArray(structured?.plan) ? structured.plan : [];
|
||||
const plan: string[] = [];
|
||||
|
||||
return {
|
||||
text,
|
||||
|
||||
Reference in New Issue
Block a user