2
0

🚸 (openai) Parse stream on client to correctly handle errors

This commit is contained in:
Baptiste Arnaud
2023-06-16 19:26:29 +02:00
parent 83f2a29faa
commit 524f1565d8
11 changed files with 209 additions and 154 deletions

View File

@ -168,6 +168,13 @@ const startParamsSchema = z.object({
isStreamEnabled: z.boolean().optional(),
})
const replyLogSchema = logSchema
.pick({
status: true,
description: true,
})
.merge(z.object({ details: z.unknown().optional() }))
export const sendMessageInputSchema = z.object({
message: z
.string()
@ -181,18 +188,15 @@ export const sendMessageInputSchema = z.object({
.describe(
'Session ID that you get from the initial chat request to a bot. If not provided, it will create a new session.'
),
clientLogs: z
.array(replyLogSchema)
.optional()
.describe('Logs while executing client side actions'),
startParams: startParamsSchema.optional(),
})
const runtimeOptionsSchema = paymentInputRuntimeOptionsSchema.optional()
const replyLogSchema = logSchema
.pick({
status: true,
description: true,
})
.merge(z.object({ details: z.unknown().optional() }))
const clientSideActionSchema = z
.object({
lastBubbleBlockId: z.string().optional(),