mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
perf: count chat tool calls without a filtered array (#20328)
Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
@@ -298,7 +298,13 @@ export function summarizeToolRun(blocks: readonly NativeChatBlock[]): string {
|
||||
}
|
||||
|
||||
export function countToolCalls(blocks: readonly NativeChatBlock[]): number {
|
||||
return blocks.filter(isToolCallBlock).length
|
||||
let count = 0
|
||||
blocks.forEach((block) => {
|
||||
if (isToolCallBlock(block)) {
|
||||
count += 1
|
||||
}
|
||||
})
|
||||
return count
|
||||
}
|
||||
|
||||
function toRawPreview(input: unknown): string {
|
||||
|
||||
Reference in New Issue
Block a user