mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-03 06:42:27 +08:00
feat: add system message for flowchart assistance and improve message handling in chat API
This commit is contained in:
@@ -11,7 +11,6 @@ export function extractDiagramXML(xml_svg_string: string): string {
|
||||
if (!svgElement) {
|
||||
throw new Error("No SVG element found in the input string.");
|
||||
}
|
||||
console.log("svgElement", svgElement);
|
||||
// 2. Extract the 'content' attribute
|
||||
const encodedContent = svgElement.getAttribute('content');
|
||||
|
||||
@@ -34,10 +33,8 @@ export function extractDiagramXML(xml_svg_string: string): string {
|
||||
if (!diagramElement) {
|
||||
throw new Error("No diagram element found");
|
||||
}
|
||||
console.log("diagramElement", diagramElement);
|
||||
// 5. Extract base64 encoded data
|
||||
const base64EncodedData = diagramElement.textContent;
|
||||
console.log("base64EncodedData", base64EncodedData);
|
||||
|
||||
if (!base64EncodedData) {
|
||||
throw new Error("No encoded data found in the diagram element");
|
||||
|
||||
Reference in New Issue
Block a user