-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract the summary from the content
- Loading branch information
1 parent
d97a62e
commit 908386f
Showing
3 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/src/lib/components/chat-list/ChatListActionItems.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import { goto } from '$app/navigation'; | ||
import type { ContentCategory } from '@/utils/types'; | ||
export let sessionId: string; | ||
export let category: ContentCategory; | ||
function ongenerate(summary: string) { | ||
console.log('ongenerate', sessionId, summary, category); | ||
fetch('/api/generate', { | ||
method: 'POST', | ||
body: JSON.stringify({ sessionId, summary, category }), | ||
headers: { 'Content-Type': 'application/json' } | ||
}); | ||
} | ||
function onreviewSource() { | ||
console.log('reviewSource'); | ||
} | ||
async function onstartNew() { | ||
return goto('/', { invalidateAll: true, replaceState: true }); | ||
} | ||
</script> | ||
|
||
<div> | ||
<slot {ongenerate} {onreviewSource} {onstartNew}></slot> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters