Extract the tool call type from a StateType's messages property. This is the canonical way to get typed tool calls in useStream.
Tool call types are now extracted from the messages property of StateType, rather than being specified separately in the Bag.
// Define state with typed messagestype MyToolCalls = | { name: "get_weather"; args: { location: string }; id?: string } | { name: "search"; args: { query: string }; id?: string };interface MyState { messages: Message<MyToolCalls>[];}// GetToolCallsType<MyState> = MyToolCalls Copy
// Define state with typed messagestype MyToolCalls = | { name: "get_weather"; args: { location: string }; id?: string } | { name: "search"; args: { query: string }; id?: string };interface MyState { messages: Message<MyToolCalls>[];}// GetToolCallsType<MyState> = MyToolCalls
Extract the tool call type from a StateType's messages property. This is the canonical way to get typed tool calls in useStream.
Tool call types are now extracted from the messages property of StateType, rather than being specified separately in the Bag.