🐛 (whatsapp) Fix WA preview not starting and accept audio and documents messages

This commit is contained in:
Baptiste Arnaud
2023-12-20 10:35:34 +01:00
parent a6536461e5
commit 780b4dee18
28 changed files with 619 additions and 192 deletions

View File

@@ -10,15 +10,6 @@ import { OpenAI, ClientOptions } from 'openai'
import { defaultOpenAIOptions } from '@typebot.io/schemas/features/blocks/integrations/openai/constants'
export const listModels = authenticatedProcedure
.meta({
openapi: {
method: 'GET',
path: '/openai/models',
protect: true,
summary: 'List OpenAI models',
tags: ['OpenAI'],
},
})
.input(
z.object({
credentialsId: z.string(),
@@ -28,11 +19,6 @@ export const listModels = authenticatedProcedure
type: z.enum(['gpt', 'tts']),
})
)
.output(
z.object({
models: z.array(z.string()),
})
)
.query(
async ({
input: { credentialsId, workspaceId, baseUrl, apiVersion, type },

View File

@@ -8,31 +8,12 @@ import { ZemanticAiCredentials } from '@typebot.io/schemas/features/blocks/integ
import got from 'got'
export const listProjects = authenticatedProcedure
.meta({
openapi: {
method: 'GET',
path: '/zemantic-ai/projects',
protect: true,
summary: 'List Zemantic AI projects',
tags: ['ZemanticAi'],
},
})
.input(
z.object({
credentialsId: z.string(),
workspaceId: z.string(),
})
)
.output(
z.object({
projects: z.array(
z.object({
label: z.string(),
value: z.string(),
})
),
})
)
.query(async ({ input: { credentialsId, workspaceId }, ctx: { user } }) => {
const workspace = await prisma.workspace.findFirst({
where: { id: workspaceId },