feat: add /compact session command
This commit is contained in:
parent
a4c67515c9
commit
c51fa7cb24
1 changed files with 25 additions and 0 deletions
|
|
@ -555,6 +555,31 @@ export default function Page() {
|
||||||
setActiveMessage(priorMsg)
|
setActiveMessage(priorMsg)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "session.compact",
|
||||||
|
title: "Compact session",
|
||||||
|
description: "Summarize the session to reduce context size",
|
||||||
|
category: "Session",
|
||||||
|
slash: "compact",
|
||||||
|
disabled: !params.id || visibleUserMessages().length === 0,
|
||||||
|
onSelect: async () => {
|
||||||
|
const sessionID = params.id
|
||||||
|
if (!sessionID) return
|
||||||
|
const model = local.model.current()
|
||||||
|
if (!model) {
|
||||||
|
showToast({
|
||||||
|
title: "No model selected",
|
||||||
|
description: "Connect a provider to summarize this session",
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await sdk.client.session.summarize({
|
||||||
|
sessionID,
|
||||||
|
modelID: model.id,
|
||||||
|
providerID: model.provider.id,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue