feat(chat): collapse tool calls by run
This commit is contained in:
@@ -20,7 +20,9 @@ export function groupRunMessages(messages: Message[], runActive: boolean): Messa
|
||||
isStreaming: assistants.some(m => m.isStreaming),
|
||||
})
|
||||
}
|
||||
result.push(...tools)
|
||||
if (tools.length) {
|
||||
result.push({ id: `tool-group-${tools[0].id}`, role: 'system', content: '', timestamp: tools[0].timestamp, systemType: 'tool-group', toolMessages: tools })
|
||||
}
|
||||
if (completed && assistants.length) {
|
||||
result.push({ id: `run-end-${assistants[0].id}`, role: 'system', content: '', timestamp: assistants[assistants.length - 1].timestamp, systemType: 'run-end' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user