Syntaksikorostus agents-terminaalin ja network-näkymän LLM-vastauksiin
Highlight.js:n automaattinen kielentunnistus nyt myös agents-terminaalin koodivastauksissa ja network-näkymän chatBoxissa (aiemmin vain codelabissa). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1765,7 +1765,8 @@
|
|||||||
const tokGen = data.tokens_generated || 0;
|
const tokGen = data.tokens_generated || 0;
|
||||||
termLog(` <span style="color:#3fb950">✓</span> <span style="color:#58a6ff">${data.model || model}</span> <span style="color:#8b949e">(${tokGen} tok)</span>`);
|
termLog(` <span style="color:#3fb950">✓</span> <span style="color:#58a6ff">${data.model || model}</span> <span style="color:#8b949e">(${tokGen} tok)</span>`);
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
termLog(` ${esc(response).replace(/\n/g,'\n ')}`, '#c9d1d9');
|
const highlighted = highlightCode(response).replace(/\n/g, '\n ');
|
||||||
|
termLog(` <pre style="margin:0;font:inherit;white-space:pre-wrap">${highlighted}</pre>`);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -2116,7 +2117,7 @@
|
|||||||
Prompt: <span style="color:#d29922">"${esc(stripSystemPrompt(data.prompt))}"</span>
|
Prompt: <span style="color:#d29922">"${esc(stripSystemPrompt(data.prompt))}"</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size:14px;color:var(--text-color);line-height:1.5;${(model.includes('Coder') || (data.response||'').includes('def ')) ? 'font-family:Courier New,monospace;background:#010409;padding:10px;border-radius:4px;white-space:pre-wrap;font-size:12px' : ''}">
|
<div style="font-size:14px;color:var(--text-color);line-height:1.5;${(model.includes('Coder') || (data.response||'').includes('def ')) ? 'font-family:Courier New,monospace;background:#010409;padding:10px;border-radius:4px;white-space:pre-wrap;font-size:12px' : ''}">
|
||||||
${data.response ? esc(data.response) : '<em>tyhjä vastaus</em>'}
|
${data.response ? highlightCode(data.response) : '<em>tyhjä vastaus</em>'}
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top:8px;font-size:12px;color:#8b949e">
|
<div style="margin-top:8px;font-size:12px;color:#8b949e">
|
||||||
${tokGen} tokenia generoitu | malli ladattu: ${typeof loadMs === 'number' ? loadMs.toFixed(0) : loadMs}ms
|
${tokGen} tokenia generoitu | malli ladattu: ${typeof loadMs === 'number' ? loadMs.toFixed(0) : loadMs}ms
|
||||||
|
|||||||
Reference in New Issue
Block a user