fix some types
This commit is contained in:
@@ -65,7 +65,7 @@ export async function callTools(
|
||||
|
||||
return {
|
||||
messages: [message],
|
||||
ui: ui.collect,
|
||||
ui: ui.collect as StockbrokerUpdate["ui"],
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export async function callTools(
|
||||
|
||||
return {
|
||||
messages: [response],
|
||||
ui: ui.collect,
|
||||
ui: ui.collect as TripPlannerUpdate["ui"],
|
||||
timestamp: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { MessagesAnnotation, Annotation } from "@langchain/langgraph";
|
||||
import { uiMessageReducer } from "@langchain/langgraph-sdk/react-ui/types";
|
||||
import {
|
||||
RemoveUIMessage,
|
||||
UIMessage,
|
||||
uiMessageReducer,
|
||||
} from "@langchain/langgraph-sdk/react-ui/types";
|
||||
|
||||
export const GenerativeUIAnnotation = Annotation.Root({
|
||||
messages: MessagesAnnotation.spec["messages"],
|
||||
ui: Annotation({ default: () => [], reducer: uiMessageReducer }),
|
||||
ui: Annotation<
|
||||
UIMessage[],
|
||||
UIMessage | RemoveUIMessage | (UIMessage | RemoveUIMessage)[]
|
||||
>({ default: () => [], reducer: uiMessageReducer }),
|
||||
timestamp: Annotation<number>,
|
||||
next: Annotation<"stockbroker" | "tripPlanner" | "generalInput">(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user