feat(distill,conversations,scheduler,api,ui): close deep chats with a distiller fork, digest and index, idle and weekly state jobs
This commit is contained in:
@@ -234,6 +234,17 @@ export class ApiClient {
|
||||
return this.post(`/api/conversations/${id}/merge`);
|
||||
}
|
||||
|
||||
close(id: string): Promise<{
|
||||
id: string;
|
||||
status: string;
|
||||
fork?: string;
|
||||
text?: string;
|
||||
digest?: string | null;
|
||||
error?: string | null;
|
||||
}> {
|
||||
return this.post(`/api/conversations/${id}/close`);
|
||||
}
|
||||
|
||||
bind(
|
||||
id: string,
|
||||
frontend: string,
|
||||
|
||||
@@ -87,6 +87,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function distill() {
|
||||
const result = await client.close(info.id);
|
||||
if (result.error) {
|
||||
toast.warning(`Digest: ${result.error}`);
|
||||
} else if (result.digest) {
|
||||
toast.message(`Digest: ${result.digest}`);
|
||||
}
|
||||
}
|
||||
|
||||
function copyId() {
|
||||
navigator.clipboard
|
||||
.writeText(info.id)
|
||||
@@ -153,6 +162,11 @@
|
||||
Merge into parent
|
||||
</DropdownMenu.Item>
|
||||
{/if}
|
||||
{#if info.kind === "deep" && info.status === "open"}
|
||||
<DropdownMenu.Item onclick={() => run(distill, "Chat closed")}>
|
||||
Close with digest
|
||||
</DropdownMenu.Item>
|
||||
{/if}
|
||||
{#if info.status === "open"}
|
||||
<DropdownMenu.Item
|
||||
onclick={() =>
|
||||
|
||||
Reference in New Issue
Block a user