mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
change model to claud 3.5
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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.";
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user