feat: Add thread history sheet

This commit is contained in:
bracesproul
2025-03-04 10:34:52 -08:00
parent b41ee36ba6
commit 569fae88c2
10 changed files with 4395 additions and 2113 deletions

View File

@@ -12,6 +12,7 @@ import { LangGraphLogoSVG } from "@/components/icons/langgraph";
import { Label } from "@/components/ui/label";
import { ArrowRight } from "lucide-react";
import { PasswordInput } from "@/components/ui/password-input";
import { getApiKey } from "@/lib/api-key";
const useTypedStream = useStream<
{ messages: Message[]; ui: UIMessage[] },
@@ -59,13 +60,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
}) => {
const [apiUrl, setApiUrl] = useQueryParam("apiUrl", StringParam);
const [apiKey, _setApiKey] = useState(() => {
try {
const key = window.localStorage.getItem("lg:chat:apiKey");
return key || null;
} catch {
// pass
}
return null;
return getApiKey();
});
const setApiKey = (key: string) => {