@@ -47,7 +47,16 @@ export type ChatSession = z.infer<typeof chatSessionSchema>
|
||||
const textMessageSchema = z
|
||||
.object({
|
||||
type: z.literal(BubbleBlockType.TEXT),
|
||||
content: textBubbleContentSchema,
|
||||
content: z.discriminatedUnion('type', [
|
||||
z.object({
|
||||
type: z.literal('richText'),
|
||||
richText: z.any(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('markdown'),
|
||||
markdown: z.string(),
|
||||
}),
|
||||
]),
|
||||
})
|
||||
.openapi({
|
||||
title: 'Text',
|
||||
@@ -211,6 +220,7 @@ export const startChatInputSchema = z.object({
|
||||
Email: 'john@gmail.com',
|
||||
},
|
||||
}),
|
||||
textBubbleContentFormat: z.enum(['richText', 'markdown']).default('richText'),
|
||||
})
|
||||
export type StartChatInput = z.infer<typeof startChatInputSchema>
|
||||
|
||||
@@ -265,6 +275,7 @@ export const startPreviewChatInputSchema = z.object({
|
||||
.describe(
|
||||
'If provided, will be used as the session ID and will overwrite any existing session with the same ID.'
|
||||
),
|
||||
textBubbleContentFormat: z.enum(['richText', 'markdown']).default('richText'),
|
||||
})
|
||||
export type StartPreviewChatInput = z.infer<typeof startPreviewChatInputSchema>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user