优化智能体代码

This commit is contained in:
Wenjie Zhang 2025-03-30 21:47:19 +08:00
parent 58df6a599e
commit 0c6829887b

View File

@ -115,11 +115,6 @@ import {
ThunderboltOutlined, ReloadOutlined, CheckCircleOutlined,
PlusCircleOutlined
} from '@ant-design/icons-vue';
import { Marked } from 'marked';
import { markedHighlight } from 'marked-highlight';
// import { onClickOutside } from '@vueuse/core';
import 'highlight.js/styles/github.css';
import hljs from 'highlight.js';
import MessageInputComponent from '@/components/MessageInputComponent.vue'
import MessageComponent from '@/components/MessageComponent.vue'
@ -128,17 +123,6 @@ const route = useRoute();
const router = useRouter();
const useSingleMode = computed(() => !!route.params.agent_id);
// ==================== ====================
// Markdown
const marked = new Marked(
{ gfm: true, breaks: true, tables: true },
markedHighlight({
langPrefix: 'hljs language-',
highlight(code) { return hljs.highlightAuto(code).value; }
})
);
// ==================== ====================
// UI
@ -172,11 +156,6 @@ const expandedToolCalls = ref(new Set()); // 展开的工具调用集合
// ==================== ====================
// Markdown
const renderMarkdown = (text) => {
if (!text) return '';
return marked.parse(text);
};
// TODO:
const scrollToBottom = async () => {