Files
agent-chat-ui/agent/types.ts

49 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-02-27 15:41:47 -08:00
import { MessagesAnnotation, Annotation } from "@langchain/langgraph";
2025-03-05 12:09:57 -08:00
import {
RemoveUIMessage,
UIMessage,
uiMessageReducer,
2025-03-05 17:58:51 +01:00
} from "@langchain/langgraph-sdk/react-ui/server";
2025-02-27 15:41:47 -08:00
export const GenerativeUIAnnotation = Annotation.Root({
messages: MessagesAnnotation.spec["messages"],
2025-03-05 12:09:57 -08:00
ui: Annotation<
UIMessage[],
UIMessage | RemoveUIMessage | (UIMessage | RemoveUIMessage)[]
>({ default: () => [], reducer: uiMessageReducer }),
2025-02-27 15:41:47 -08:00
timestamp: Annotation<number>,
2025-03-07 10:47:08 -08:00
next: Annotation<
"stockbroker" | "tripPlanner" | "openCode" | "generalInput"
>(),
2025-02-27 15:41:47 -08:00
});
export type GenerativeUIState = typeof GenerativeUIAnnotation.State;
export type Accommodation = {
id: string;
name: string;
price: number;
rating: number;
city: string;
image: string;
};
export type Price = {
ticker: string;
open: number;
close: number;
high: number;
low: number;
volume: number;
time: string;
};
2025-03-06 11:10:15 -08:00
export type Snapshot = {
price: number;
ticker: string;
day_change: number;
day_change_percent: number;
market_cap: number;
time: string;
};