2
0

(api) Add textBubbleContentFormat option

Closes #1111
This commit is contained in:
Baptiste Arnaud
2024-05-23 16:30:56 +02:00
parent 3031d26f03
commit c53ce349af
22 changed files with 155 additions and 37 deletions

View File

@@ -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>