feat: Add default tool call renderer, and error toasts
This commit is contained in:
@@ -14,8 +14,10 @@ import { ArrowRight } from "lucide-react";
|
||||
import { PasswordInput } from "@/components/ui/password-input";
|
||||
import { getApiKey } from "@/lib/api-key";
|
||||
|
||||
export type StateType = { messages: Message[]; ui?: UIMessage[] };
|
||||
|
||||
const useTypedStream = useStream<
|
||||
{ messages: Message[]; ui?: UIMessage[] },
|
||||
StateType,
|
||||
{
|
||||
UpdateType: {
|
||||
messages?: Message[] | Message | string;
|
||||
@@ -48,6 +50,12 @@ const StreamSession = ({
|
||||
onThreadId: setThreadId,
|
||||
});
|
||||
|
||||
if (streamValue.error) {
|
||||
if (typeof streamValue.error === "object") {
|
||||
console.log((streamValue.error as any)?.["message"]);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<StreamContext.Provider value={streamValue}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user