change model to claud 3.5

This commit is contained in:
dayuan.jiang
2025-04-03 15:10:53 +00:00
parent bc7ef5c5d4
commit 645980fbb6
5 changed files with 433 additions and 74 deletions

View File

@@ -42,6 +42,7 @@ export function ChatMessageDisplay({
{
const currentXml = toolInvocation.args?.xml || "";
console.log("toolInvocation", toolInvocation);
// Increment the step counter
// Determine whether to show details based on a simple threshold
@@ -54,7 +55,6 @@ export function ChatMessageDisplay({
convertedXml
);
onDisplayChart(replacedXML);
// if convertedXml changed
}
}
@@ -69,7 +69,12 @@ export function ChatMessageDisplay({
<div className="text-xs text-gray-500 mt-1">
Tool: display_diagram
<div className="mt-1 font-mono text-xs">
onDisplayChart
Args:{" "}
{JSON.stringify(
toolInvocation.args,
null,
2
)}
</div>
</div>
</div>

View File

@@ -14,12 +14,14 @@ import { useChat } from "@ai-sdk/react";
import { ChatInput } from "@/components/chat-input";
import { ChatMessageDisplay } from "./chat-message-display";
import { useDiagram } from "@/contexts/diagram-context";
import { replaceNodes } from "@/lib/utils";
export default function ChatPanel() {
const {
loadDiagram: onDisplayChart,
handleExport: onExport,
resolverRef,
chartXML,
clearDiagram,
} = useDiagram();
@@ -61,7 +63,7 @@ export default function ChatPanel() {
if (toolCall.toolName === "display_diagram") {
const { xml } = toolCall.args as { xml: string };
// do nothing because we will handle this streamingly in the ChatMessageDisplay component
// onDisplayChart(xml);
onDisplayChart(replaceNodes(chartXML, xml));
return "Successfully displayed the flowchart.";
}
},