Fix generating title from messages (#442)
This commit is contained in:
parent
2705d83d6c
commit
00b125378c
4 changed files with 103 additions and 77 deletions
|
|
@ -10,7 +10,7 @@ import { toast } from "sonner";
|
|||
import useSWR from "swr";
|
||||
|
||||
import { Chat } from "@/db/schema";
|
||||
import { fetcher } from "@/lib/utils";
|
||||
import { fetcher, getTitleFromChat } from "@/lib/utils";
|
||||
|
||||
import {
|
||||
InfoIcon,
|
||||
|
|
@ -183,7 +183,7 @@ export const History = ({ user }: { user: User | undefined }) => {
|
|||
href={`/chat/${chat.id}`}
|
||||
className="text-ellipsis overflow-hidden text-left py-2 pl-2 rounded-lg outline-zinc-900"
|
||||
>
|
||||
{chat.messages[0].content as string}
|
||||
{getTitleFromChat(chat)}
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue