2
0

🚸 Improve parsing preprocessing on typebots

This commit is contained in:
Baptiste Arnaud
2023-08-23 10:57:38 +02:00
parent fe54888350
commit 0acede92ef
24 changed files with 132 additions and 584 deletions

View File

@ -80,7 +80,10 @@ const chatCompletionOptionsSchema = z
responseMapping: z.array(
z.object({
id: z.string(),
valueToExtract: z.enum(chatCompletionResponseValues),
valueToExtract: z.preprocess(
(val) => (!val ? 'Message content' : val),
z.enum(chatCompletionResponseValues)
),
variableId: z.string().optional(),
})
),