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