This commit is contained in:
Dhravya Shah 2024-07-25 17:30:40 -05:00
commit 1fd47f9081
3 changed files with 15 additions and 5 deletions

View file

@ -21,7 +21,12 @@ const History = memo(({ setQuery }: { setQuery: (q: string) => void }) => {
}
console.log(suggestions);
if (typeof suggestions.data === "string") {
setSuggestions(JSON.parse(suggestions.data));
const queries = suggestions.data.slice(1, -1).split(", ");
const parsedQueries = queries.map((query) =>
query.replace(/^'|'$/g, ""),
);
console.log(parsedQueries);
setSuggestions(parsedQueries);
return;
}
setSuggestions(suggestions.data.reverse().slice(0, 3));

View file

@ -785,7 +785,7 @@ export async function getQuerySuggestions() {
messages: [
{
role: "system",
content: `You are a model that suggests questions based on the user's content. you MUST suggest atleast 1 question to ask. Create 3 suggestions at most.`,
content: `You are a model that suggests questions based on the user's content. you MUST suggest atleast 1 question to ask. AT MAX, create 3 suggestions. not more than that.`,
},
{
role: "user",

View file

@ -66,9 +66,14 @@ export default function RootLayout({
}): JSX.Element {
return (
<html lang="en" className="overflow-x-hidden" suppressHydrationWarning>
{/* <head>
<ThemeScript />
</head> */}
<head>
{/* Cloudflare web analytics */}
<script
defer
src="https://static.cloudflareinsights.com/beacon.min.js"
data-cf-beacon='{"token": "16d76ebb82c74d9983b71d09ab6617bc"}'
></script>
</head>
{/* TODO: when lightmode support is added, remove the 'dark' class from the body tag */}
<body
className={cn(