File size: 663 Bytes
4e23b01 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { z } from 'zod';
import { messageRoleSchema, messageSchema } from './message';
import { cursorQuerySchema } from './pagination';
export const listMessagesQuerySchema = cursorQuerySchema.and(
z.object({
role: messageRoleSchema.optional(),
}),
);
export type ListMessagesQuery = z.infer<typeof listMessagesQuerySchema>;
export const listMessagesResponseSchema = z.object({
items: z.array(messageSchema),
has_more: z.boolean(),
});
export type ListMessagesResponse = z.infer<typeof listMessagesResponseSchema>;
export const getMessageResponseSchema = messageSchema;
export type GetMessageResponse = z.infer<typeof getMessageResponseSchema>;
|