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

@ -19,15 +19,24 @@ export const continueChat = publicProcedure
.describe(
'The session ID you got from the [startChat](./start-chat) response.'
),
textBubbleContentFormat: z
.enum(['richText', 'markdown'])
.default('richText'),
})
)
.output(continueChatResponseSchema)
.mutation(async ({ input: { sessionId, message }, ctx: { origin, res } }) => {
const { corsOrigin, ...response } = await continueChatFn({
origin,
sessionId,
message,
})
if (corsOrigin) res.setHeader('Access-Control-Allow-Origin', corsOrigin)
return response
})
.mutation(
async ({
input: { sessionId, message, textBubbleContentFormat },
ctx: { origin, res },
}) => {
const { corsOrigin, ...response } = await continueChatFn({
origin,
sessionId,
message,
textBubbleContentFormat,
})
if (corsOrigin) res.setHeader('Access-Control-Allow-Origin', corsOrigin)
return response
}
)