mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
sync
This commit is contained in:
@@ -384,6 +384,11 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
assistant.cost = usage.cost
|
||||
assistant.tokens = usage.tokens
|
||||
await updateMessage(next)
|
||||
if (text) {
|
||||
Bus.publish(Message.Event.PartUpdated, {
|
||||
part: text,
|
||||
})
|
||||
}
|
||||
text = undefined
|
||||
},
|
||||
async onChunk(input) {
|
||||
@@ -397,8 +402,7 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
text = value
|
||||
next.parts.push(value)
|
||||
break
|
||||
}
|
||||
text.text += value.text
|
||||
} else text.text += value.text
|
||||
break
|
||||
|
||||
case "tool-call":
|
||||
@@ -411,6 +415,9 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
args: value.args as any,
|
||||
},
|
||||
})
|
||||
Bus.publish(Message.Event.PartUpdated, {
|
||||
part: next.parts[next.parts.length - 1],
|
||||
})
|
||||
break
|
||||
|
||||
case "tool-call-streaming-start":
|
||||
@@ -423,6 +430,9 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
args: {},
|
||||
},
|
||||
})
|
||||
Bus.publish(Message.Event.PartUpdated, {
|
||||
part: next.parts[next.parts.length - 1],
|
||||
})
|
||||
break
|
||||
|
||||
case "tool-call-delta":
|
||||
@@ -442,6 +452,9 @@ ${app.git ? await ListTool.execute({ path: app.path.cwd }, { sessionID: input.se
|
||||
state: "result",
|
||||
result: value.result as string,
|
||||
}
|
||||
Bus.publish(Message.Event.PartUpdated, {
|
||||
part: match,
|
||||
})
|
||||
}
|
||||
break
|
||||
|
||||
|
||||
@@ -168,5 +168,6 @@ export namespace Message {
|
||||
info: Info,
|
||||
}),
|
||||
),
|
||||
PartUpdated: Bus.event("message.part.updated", z.object({ part: Part })),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user