import type { InferUITool, UIMessage } from "ai"; import { z } from "zod"; import type { getWeather } from "./ai/tools/get-weather"; export const messageMetadataSchema = z.object({ createdAt: z.string(), }); export type MessageMetadata = z.infer; type weatherTool = InferUITool; export type ChatTools = { getWeather: weatherTool; }; export type CustomUIDataTypes = { appendMessage: string; "chat-title": string; }; export type ChatMessage = UIMessage< MessageMetadata, CustomUIDataTypes, ChatTools >; export type Attachment = { name: string; url: string; contentType: string; };