diff --git a/system3-nonconformance/web/ai-assistant.html b/system3-nonconformance/web/ai-assistant.html index 776b8ed..2ea6c40 100644 --- a/system3-nonconformance/web/ai-assistant.html +++ b/system3-nonconformance/web/ai-assistant.html @@ -8,7 +8,8 @@ - + + @@ -279,6 +280,6 @@ - + diff --git a/system3-nonconformance/web/static/css/ai-assistant.css b/system3-nonconformance/web/static/css/ai-assistant.css index 3640338..69e4b49 100644 --- a/system3-nonconformance/web/static/css/ai-assistant.css +++ b/system3-nonconformance/web/static/css/ai-assistant.css @@ -67,6 +67,20 @@ padding: 10px 16px; } +/* AI 답변 마크다운 스타일 */ +.chat-bubble-ai .prose { color: #1e293b; } +.chat-bubble-ai .prose h1, +.chat-bubble-ai .prose h2, +.chat-bubble-ai .prose h3 { font-size: 0.95em; font-weight: 700; margin: 0.8em 0 0.3em; color: #334155; } +.chat-bubble-ai .prose p { margin: 0.4em 0; } +.chat-bubble-ai .prose ul, +.chat-bubble-ai .prose ol { margin: 0.3em 0; padding-left: 1.4em; } +.chat-bubble-ai .prose li { margin: 0.15em 0; } +.chat-bubble-ai .prose strong { color: #7c3aed; } +.chat-bubble-ai .prose code { background: #e2e8f0; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.85em; } +.chat-bubble-ai .prose blockquote { border-left: 3px solid #7c3aed; padding-left: 0.8em; margin: 0.5em 0; color: #64748b; } +.chat-bubble-ai .prose hr { border-color: #e2e8f0; margin: 0.6em 0; } + .chat-bubble-ai .source-link { color: #7c3aed; cursor: pointer; diff --git a/system3-nonconformance/web/static/js/pages/ai-assistant.js b/system3-nonconformance/web/static/js/pages/ai-assistant.js index 418340c..d9492b8 100644 --- a/system3-nonconformance/web/static/js/pages/ai-assistant.js +++ b/system3-nonconformance/web/static/js/pages/ai-assistant.js @@ -127,7 +127,8 @@ async function checkAiHealth() { const model = health.model || health.llm_model - || (health.ollama?.models?.[0]); + || health.ollama?.ollama?.models?.[0] + || health.ollama?.models?.[0]; if (model) { modelName.textContent = model; } @@ -193,8 +194,13 @@ function appendChatMessage(role, content, sources) { // 내용 렌더링 const contentDiv = document.createElement('div'); - contentDiv.className = 'text-sm whitespace-pre-line'; - contentDiv.textContent = content; + if (role === 'ai' && typeof marked !== 'undefined') { + contentDiv.className = 'text-sm prose prose-sm max-w-none'; + contentDiv.innerHTML = marked.parse(content); + } else { + contentDiv.className = 'text-sm whitespace-pre-line'; + contentDiv.textContent = content; + } bubble.appendChild(contentDiv); // AI 답변 참고 사례