Rework header a bit + remove assumption of all personas having a prompt

This commit is contained in:
Weves 2023-12-14 23:05:08 -08:00 committed by Chris Weaver
parent 16c8969028
commit a099f8e296
4 changed files with 11 additions and 12 deletions

View File

@ -40,7 +40,6 @@ def upgrade() -> None:
# This is irrecoverable, whatever
op.execute("DELETE FROM chat_feedback")
op.execute("DELETE FROM document_retrieval_feedback")
op.execute("DELETE FROM persona")
op.create_table(
"search_doc",

View File

@ -67,10 +67,10 @@ export function PersonaEditor({
const existingPrompt = existingPersona?.prompts[0] ?? null;
useEffect(() => {
if (isUpdate) {
if (isUpdate && existingPrompt) {
triggerFinalPromptUpdate(
existingPrompt!.system_prompt,
existingPrompt!.task_prompt,
existingPrompt.system_prompt,
existingPrompt.task_prompt,
existingPersona.num_chunks === 0
);
}

View File

@ -35,7 +35,6 @@ import { buildFilters } from "@/lib/search/utils";
import { QA, SearchTypeSelector } from "./modifiers/SearchTypeSelector";
import { SelectedDocuments } from "./modifiers/SelectedDocuments";
import { usePopup } from "@/components/admin/connectors/Popup";
import { useSWRConfig } from "swr";
const MAX_INPUT_HEIGHT = 200;

View File

@ -2,13 +2,13 @@
import { User } from "@/lib/types";
import { logout } from "@/lib/user";
import { UserCircle } from "@phosphor-icons/react";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
import React, { useEffect, useRef, useState } from "react";
import { CustomDropdown, DefaultDropdownElement } from "./Dropdown";
import { FiMessageSquare, FiSearch } from "react-icons/fi";
import { usePathname } from "next/navigation";
interface HeaderProps {
user: User | null;
@ -16,6 +16,7 @@ interface HeaderProps {
export const Header: React.FC<HeaderProps> = ({ user }) => {
const router = useRouter();
const pathname = usePathname();
const [dropdownOpen, setDropdownOpen] = useState(false);
const dropdownRef = useRef<HTMLDivElement>(null);
@ -68,21 +69,21 @@ export const Header: React.FC<HeaderProps> = ({ user }) => {
<Link
href="/search"
className="ml-8 h-full flex flex-col hover:bg-hover"
className={"ml-6 h-full flex flex-col hover:bg-hover"}
>
<div className="w-28 flex my-auto">
<div className="mx-auto flex text-strong px-2">
<div className="w-24 flex my-auto">
<div className={"mx-auto flex text-strong px-2"}>
<FiSearch className="my-auto mr-1" />
<h1 className="flex text-base font-medium my-auto">Search</h1>
<h1 className="flex text-sm font-bold my-auto">Search</h1>
</div>
</div>
</Link>
<Link href="/chat" className="h-full flex flex-col hover:bg-hover">
<div className="w-28 flex my-auto">
<div className="w-24 flex my-auto">
<div className="mx-auto flex text-strong px-2">
<FiMessageSquare className="my-auto mr-1" />
<h1 className="flex text-base font-medium my-auto">Chat</h1>
<h1 className="flex text-sm font-bold my-auto">Chat</h1>
</div>
</div>
</Link>