mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 14:34:40 +00:00
fix(agent,webui): show agent error messages and fix IME enter key bug
This commit is contained in:
@@ -153,7 +153,7 @@ If you need to create files in the local filesystem (for example, a temporary fi
|
||||
}
|
||||
})
|
||||
|
||||
const text = assistantMessage.content
|
||||
let text = assistantMessage.content
|
||||
.filter((c) => c.type === 'text')
|
||||
.map((c) => {
|
||||
if ('text' in c && typeof c.text === 'string') {
|
||||
@@ -163,6 +163,13 @@ If you need to create files in the local filesystem (for example, a temporary fi
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
if (assistantMessage.stopReason === 'error' && assistantMessage.errorMessage) {
|
||||
if (text) {
|
||||
text += '\n\n'
|
||||
}
|
||||
text += `Error: ${assistantMessage.errorMessage}`
|
||||
}
|
||||
|
||||
const usage: Usage = {
|
||||
model: modelId,
|
||||
inputTokens: assistantMessage.usage?.input || 0,
|
||||
|
||||
Reference in New Issue
Block a user