mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 13:54:01 +00:00
fix: add synthetic user prompt after session compaction (#2659)
Co-authored-by: Julián Díaz <git@jdiaz.io>
This commit is contained in:
parent
0319043b49
commit
71076d5c68
@ -346,12 +346,37 @@ export namespace SessionPrompt {
|
||||
model: input.model,
|
||||
})
|
||||
) {
|
||||
const msg = await SessionCompaction.run({
|
||||
const summaryMsg = await SessionCompaction.run({
|
||||
sessionID: input.sessionID,
|
||||
providerID: input.providerID,
|
||||
modelID: input.model.id,
|
||||
})
|
||||
msgs = [msg]
|
||||
const resumeMsgID = Identifier.ascending("message")
|
||||
const resumeMsg = {
|
||||
info: await Session.updateMessage({
|
||||
id: resumeMsgID,
|
||||
role: "user",
|
||||
sessionID: input.sessionID,
|
||||
time: {
|
||||
created: Date.now(),
|
||||
},
|
||||
}),
|
||||
parts: [
|
||||
await Session.updatePart({
|
||||
type: "text",
|
||||
sessionID: input.sessionID,
|
||||
messageID: resumeMsgID,
|
||||
id: Identifier.ascending("part"),
|
||||
text: "Use the above summary generated from your last session to resume from where you left off.",
|
||||
time: {
|
||||
start: Date.now(),
|
||||
end: Date.now(),
|
||||
},
|
||||
synthetic: true,
|
||||
}),
|
||||
],
|
||||
}
|
||||
msgs = [summaryMsg, resumeMsg]
|
||||
}
|
||||
return msgs
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user