diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/ProjectsDropdown.tsx b/apps/builder/src/features/blocks/integrations/zemanticAi/ProjectsDropdown.tsx
deleted file mode 100644
index 0738196be..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/ProjectsDropdown.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { Select } from '@/components/inputs/Select'
-import { useTypebot } from '@/features/editor/providers/TypebotProvider'
-import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
-import { useToast } from '@/hooks/useToast'
-import { trpc } from '@/lib/trpc'
-
-type Props = {
- credentialsId: string
- blockId: string
- defaultValue: string
- onChange: (projectId: string | undefined) => void
-}
-
-export const ProjectsDropdown = ({
- defaultValue,
- onChange,
- credentialsId,
-}: Props) => {
- const { typebot } = useTypebot()
- const { workspace } = useWorkspace()
- const { showToast } = useToast()
-
- const { data } = trpc.zemanticAI.listProjects.useQuery(
- {
- credentialsId,
- workspaceId: workspace?.id as string,
- },
- {
- enabled: !!typebot && !!workspace,
- onError: (error) => {
- showToast({
- description: error.message,
- status: 'error',
- })
- },
- }
- )
-
- return (
-
- )
-}
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/SearchResponseItem.tsx b/apps/builder/src/features/blocks/integrations/zemanticAi/SearchResponseItem.tsx
deleted file mode 100644
index a517c9b31..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/SearchResponseItem.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { DropdownList } from '@/components/DropdownList'
-import { VariableSearchInput } from '@/components/inputs/VariableSearchInput'
-import { TableListItemProps } from '@/components/TableList'
-import { Stack } from '@chakra-ui/react'
-import { Variable, ZemanticAiBlock } from '@typebot.io/schemas'
-import {
- defaultZemanticAiResponseMappingItem,
- searchResponseValues,
-} from '@typebot.io/schemas/features/blocks/integrations/zemanticAi/constants'
-
-type Props = TableListItemProps<
- NonNullable<
- NonNullable['responseMapping']
- >[number]
->
-
-export const SearchResponseItem = ({ item, onItemChange }: Props) => {
- const changeValueToExtract = (
- valueToExtract: (typeof searchResponseValues)[number]
- ) => {
- onItemChange({ ...item, valueToExtract })
- }
-
- const changeVariableId = (variable: Pick | undefined) => {
- onItemChange({ ...item, variableId: variable ? variable.id : undefined })
- }
-
- return (
-
-
-
-
- )
-}
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiLogo.tsx b/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiLogo.tsx
deleted file mode 100644
index f6d5e1926..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiLogo.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Icon, IconProps } from '@chakra-ui/react'
-
-export const ZemanticAiLogo = (props: IconProps) => (
-
-
-
-
-
-
-
-
-
-)
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiNodeBody.tsx b/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiNodeBody.tsx
deleted file mode 100644
index e203ae77f..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiNodeBody.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react'
-import { Stack, Text } from '@chakra-ui/react'
-import { useTypebot } from '@/features/editor/providers/TypebotProvider'
-import { SetVariableLabel } from '@/components/SetVariableLabel'
-import { ZemanticAiBlock } from '@typebot.io/schemas'
-
-type Props = {
- options: ZemanticAiBlock['options']
-}
-
-export const ZemanticAiNodeBody = ({
- options: { query, projectId, responseMapping } = {},
-}: Props) => {
- const { typebot } = useTypebot()
- return (
-
-
- {query && projectId ? `Ask: ${query}` : 'Configure...'}
-
- {typebot &&
- responseMapping
- ?.map((mapping) => mapping.variableId)
- .map((variableId, idx) =>
- variableId ? (
-
- ) : null
- )}
-
- )
-}
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiSettings.tsx b/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiSettings.tsx
deleted file mode 100644
index 47695d832..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/ZemanticAiSettings.tsx
+++ /dev/null
@@ -1,148 +0,0 @@
-import { TextInput, Textarea, NumberInput } from '@/components/inputs'
-import {
- Accordion,
- AccordionButton,
- AccordionIcon,
- AccordionItem,
- AccordionPanel,
- Stack,
- Text,
-} from '@chakra-ui/react'
-import { isEmpty } from '@typebot.io/lib'
-import { ZemanticAiBlock } from '@typebot.io/schemas'
-import { ProjectsDropdown } from './ProjectsDropdown'
-import { SearchResponseItem } from './SearchResponseItem'
-import { TableList } from '@/components/TableList'
-
-type Props = {
- block: ZemanticAiBlock
- onOptionsChange: (options: ZemanticAiBlock['options']) => void
-}
-
-export const ZemanticAiSettings = ({
- block: { id: blockId, options },
- onOptionsChange,
-}: Props) => {
- const updateProjectId = (projectId: string | undefined) => {
- onOptionsChange({
- ...options,
- projectId: isEmpty(projectId) ? undefined : projectId,
- })
- }
-
- const updateQuery = (query: string) => {
- onOptionsChange({
- ...options,
- query: isEmpty(query) ? undefined : query,
- })
- }
-
- const updateMaxResults = (
- maxResults: number | `{{${string}}}` | undefined
- ) => {
- onOptionsChange({
- ...options,
- maxResults: maxResults as number,
- })
- }
-
- const updateSystemPrompt = (systemPrompt: string) => {
- onOptionsChange({
- ...options,
- systemPrompt: isEmpty(systemPrompt) ? undefined : systemPrompt,
- })
- }
-
- const updatePrompt = (prompt: string) => {
- onOptionsChange({
- ...options,
- prompt: isEmpty(prompt) ? undefined : prompt,
- })
- }
-
- const updateResponseMapping = (
- responseMapping: NonNullable['responseMapping']
- ) => {
- onOptionsChange({
- ...options,
- responseMapping,
- })
- }
-
- return (
-
- {options?.credentialsId && (
- <>
-
-
-
-
-
-
-
- Advanced settings
-
-
-
-
-
-
-
-
-
-
-
- Save answer
-
-
-
-
-
- {(props) => }
-
-
-
-
- >
- )}
-
- )
-}
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/api/listProjects.ts b/apps/builder/src/features/blocks/integrations/zemanticAi/api/listProjects.ts
deleted file mode 100644
index e764ee869..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/api/listProjects.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import prisma from '@typebot.io/lib/prisma'
-import { authenticatedProcedure } from '@/helpers/server/trpc'
-import { TRPCError } from '@trpc/server'
-import { z } from 'zod'
-import { isReadWorkspaceFobidden } from '@/features/workspace/helpers/isReadWorkspaceFobidden'
-import { decrypt } from '@typebot.io/lib/api/encryption/decrypt'
-import { ZemanticAiCredentials } from '@typebot.io/schemas/features/blocks/integrations/zemanticAi'
-import ky from 'ky'
-
-export const listProjects = authenticatedProcedure
- .input(
- z.object({
- credentialsId: z.string(),
- workspaceId: z.string(),
- })
- )
- .query(async ({ input: { credentialsId, workspaceId }, ctx: { user } }) => {
- const workspace = await prisma.workspace.findFirst({
- where: { id: workspaceId },
- select: {
- members: {
- select: {
- userId: true,
- },
- },
- credentials: {
- where: {
- id: credentialsId,
- },
- select: {
- id: true,
- data: true,
- iv: true,
- },
- },
- },
- })
-
- if (!workspace || isReadWorkspaceFobidden(workspace, user))
- throw new TRPCError({
- code: 'NOT_FOUND',
- message: 'No workspace found',
- })
-
- const credentials = workspace.credentials.at(0)
-
- if (!credentials)
- throw new TRPCError({
- code: 'NOT_FOUND',
- message: 'No credentials found',
- })
-
- const data = (await decrypt(
- credentials.data,
- credentials.iv
- )) as ZemanticAiCredentials['data']
-
- const url = 'https://api.zemantic.ai/v1/projects'
-
- try {
- const response = await ky
- .get(url, {
- headers: {
- Authorization: `Bearer ${data.apiKey}`,
- },
- })
- .json()
-
- const projectsData = response as {
- id: string
- name: string
- }[]
-
- return {
- projects: projectsData.map((project) => ({
- label: project.name,
- value: project.id,
- })),
- }
- } catch (e) {
- throw new TRPCError({
- code: 'INTERNAL_SERVER_ERROR',
- message: 'Could not list projects',
- cause: e,
- })
- }
- })
diff --git a/apps/builder/src/features/blocks/integrations/zemanticAi/api/router.ts b/apps/builder/src/features/blocks/integrations/zemanticAi/api/router.ts
deleted file mode 100644
index 200436ab6..000000000
--- a/apps/builder/src/features/blocks/integrations/zemanticAi/api/router.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { router } from '@/helpers/server/trpc'
-import { listProjects } from './listProjects'
-
-export const zemanticAiRouter = router({
- listProjects,
-})
diff --git a/apps/builder/src/features/credentials/components/CredentialsCreateModal.tsx b/apps/builder/src/features/credentials/components/CredentialsCreateModal.tsx
index f7e5eac32..41e19e0d4 100644
--- a/apps/builder/src/features/credentials/components/CredentialsCreateModal.tsx
+++ b/apps/builder/src/features/credentials/components/CredentialsCreateModal.tsx
@@ -62,8 +62,6 @@ const CredentialsCreateModalContent = ({
onClose={onClose}
/>
)
- case 'zemanticAi':
- return null
default:
return (
case 'whatsApp':
return
- case 'zemanticAi':
- return null
default:
return
}
@@ -247,8 +245,6 @@ const CredentialsLabel = ({
WhatsApp
)
- case 'zemanticAi':
- return null
default:
return
}
diff --git a/apps/builder/src/features/credentials/components/CredentialsUpdateModal.tsx b/apps/builder/src/features/credentials/components/CredentialsUpdateModal.tsx
index 62feacb0a..c2e2d5d83 100644
--- a/apps/builder/src/features/credentials/components/CredentialsUpdateModal.tsx
+++ b/apps/builder/src/features/credentials/components/CredentialsUpdateModal.tsx
@@ -57,7 +57,6 @@ const CredentialsUpdateModalContent = ({
onUpdate={onSubmit}
/>
)
- case 'zemanticAi':
case 'whatsApp':
return null
default:
diff --git a/apps/builder/src/features/editor/components/BlockIcon.tsx b/apps/builder/src/features/editor/components/BlockIcon.tsx
index ac82fe6e2..e344494da 100644
--- a/apps/builder/src/features/editor/components/BlockIcon.tsx
+++ b/apps/builder/src/features/editor/components/BlockIcon.tsx
@@ -31,7 +31,6 @@ import { TypebotLinkIcon } from '@/features/blocks/logic/typebotLink/components/
import { AbTestIcon } from '@/features/blocks/logic/abTest/components/AbTestIcon'
import { PictureChoiceIcon } from '@/features/blocks/inputs/pictureChoice/components/PictureChoiceIcon'
import { PixelLogo } from '@/features/blocks/integrations/pixel/components/PixelLogo'
-import { ZemanticAiLogo } from '@/features/blocks/integrations/zemanticAi/ZemanticAiLogo'
import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/constants'
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
@@ -117,8 +116,6 @@ export const BlockIcon = ({ type, ...props }: BlockIconProps): JSX.Element => {
return
case IntegrationBlockType.PIXEL:
return
- case IntegrationBlockType.ZEMANTIC_AI:
- return
case 'start':
return
case IntegrationBlockType.OPEN_AI:
diff --git a/apps/builder/src/features/editor/components/BlockLabel.tsx b/apps/builder/src/features/editor/components/BlockLabel.tsx
index b648e9045..35baa6f34 100644
--- a/apps/builder/src/features/editor/components/BlockLabel.tsx
+++ b/apps/builder/src/features/editor/components/BlockLabel.tsx
@@ -219,12 +219,6 @@ export const BlockLabel = ({ type, ...props }: Props): JSX.Element => {
{t('editor.sidebarBlock.pixel.label')}
)
- case IntegrationBlockType.ZEMANTIC_AI:
- return (
-
- {t('editor.sidebarBlock.zemanticAi.label')}
-
- )
default:
return
}
diff --git a/apps/builder/src/features/editor/components/BlocksSideBar.tsx b/apps/builder/src/features/editor/components/BlocksSideBar.tsx
index 41e20a5d5..e49541660 100644
--- a/apps/builder/src/features/editor/components/BlocksSideBar.tsx
+++ b/apps/builder/src/features/editor/components/BlocksSideBar.tsx
@@ -27,10 +27,7 @@ import { useDebouncedCallback } from 'use-debounce'
import { forgedBlockIds } from '@typebot.io/forge-repository/constants'
// Integration blocks migrated to forged blocks
-const legacyIntegrationBlocks = [
- IntegrationBlockType.OPEN_AI,
- IntegrationBlockType.ZEMANTIC_AI,
-]
+const legacyIntegrationBlocks = [IntegrationBlockType.OPEN_AI]
export const BlocksSideBar = () => {
const { t } = useTranslate()
diff --git a/apps/builder/src/features/forge/components/credentials/CreateForgedCredentialsModal.tsx b/apps/builder/src/features/forge/components/credentials/CreateForgedCredentialsModal.tsx
index 39d178303..94c9d4241 100644
--- a/apps/builder/src/features/forge/components/credentials/CreateForgedCredentialsModal.tsx
+++ b/apps/builder/src/features/forge/components/credentials/CreateForgedCredentialsModal.tsx
@@ -16,7 +16,7 @@ import {
import React, { useState } from 'react'
import { ZodObjectLayout } from '../zodLayouts/ZodObjectLayout'
import { ForgedBlockDefinition } from '@typebot.io/forge-repository/types'
-import { CredentialsWithoutLegacy } from '@typebot.io/schemas'
+import { Credentials } from '@typebot.io/schemas'
type Props = {
blockDef: ForgedBlockDefinition
@@ -91,7 +91,7 @@ export const CreateForgedCredentialsModalContent = ({
workspaceId: workspace.id,
name,
data,
- } as CredentialsWithoutLegacy,
+ } as Credentials,
})
}
diff --git a/apps/builder/src/features/forge/components/credentials/UpdateForgedCredentialsModalContent.tsx b/apps/builder/src/features/forge/components/credentials/UpdateForgedCredentialsModalContent.tsx
index 82f25df61..092673d7b 100644
--- a/apps/builder/src/features/forge/components/credentials/UpdateForgedCredentialsModalContent.tsx
+++ b/apps/builder/src/features/forge/components/credentials/UpdateForgedCredentialsModalContent.tsx
@@ -14,7 +14,7 @@ import {
import React, { useEffect, useState } from 'react'
import { ZodObjectLayout } from '../zodLayouts/ZodObjectLayout'
import { ForgedBlockDefinition } from '@typebot.io/forge-repository/types'
-import { CredentialsWithoutLegacy } from '@typebot.io/schemas'
+import { Credentials } from '@typebot.io/schemas'
type Props = {
credentialsId: string
@@ -76,7 +76,7 @@ export const UpdateForgedCredentialsModalContent = ({
workspaceId: workspace.id,
name,
data,
- } as CredentialsWithoutLegacy,
+ } as Credentials,
})
}
diff --git a/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx b/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
index b15b6efce..e986f5321 100644
--- a/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
+++ b/apps/builder/src/features/graph/components/nodes/block/BlockNodeContent.tsx
@@ -32,7 +32,6 @@ import { ChatwootNodeBody } from '@/features/blocks/integrations/chatwoot/compon
import { AbTestNodeBody } from '@/features/blocks/logic/abTest/components/AbTestNodeBody'
import { PictureChoiceNode } from '@/features/blocks/inputs/pictureChoice/components/PictureChoiceNode'
import { PixelNodeBody } from '@/features/blocks/integrations/pixel/components/PixelNodeBody'
-import { ZemanticAiNodeBody } from '@/features/blocks/integrations/zemanticAi/ZemanticAiNodeBody'
import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/constants'
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants'
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/constants'
@@ -151,9 +150,6 @@ export const BlockNodeContent = ({
case IntegrationBlockType.PIXEL: {
return
}
- case IntegrationBlockType.ZEMANTIC_AI: {
- return
- }
default: {
return
}
diff --git a/apps/builder/src/features/graph/components/nodes/block/SettingsPopoverContent.tsx b/apps/builder/src/features/graph/components/nodes/block/SettingsPopoverContent.tsx
index b6922f719..94ed318d2 100644
--- a/apps/builder/src/features/graph/components/nodes/block/SettingsPopoverContent.tsx
+++ b/apps/builder/src/features/graph/components/nodes/block/SettingsPopoverContent.tsx
@@ -39,7 +39,6 @@ import { AbTestSettings } from '@/features/blocks/logic/abTest/components/AbTest
import { PictureChoiceSettings } from '@/features/blocks/inputs/pictureChoice/components/PictureChoiceSettings'
import { SettingsHoverBar } from './SettingsHoverBar'
import { PixelSettings } from '@/features/blocks/integrations/pixel/components/PixelSettings'
-import { ZemanticAiSettings } from '@/features/blocks/integrations/zemanticAi/ZemanticAiSettings'
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/constants'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/constants'
@@ -338,11 +337,6 @@ export const BlockSettings = ({
/>
)
}
- case IntegrationBlockType.ZEMANTIC_AI: {
- return (
-
- )
- }
case LogicBlockType.CONDITION:
return null
default: {
diff --git a/apps/builder/src/features/graph/helpers/getHelpDocUrl.ts b/apps/builder/src/features/graph/helpers/getHelpDocUrl.ts
index f24221a08..c3c3b26ec 100644
--- a/apps/builder/src/features/graph/helpers/getHelpDocUrl.ts
+++ b/apps/builder/src/features/graph/helpers/getHelpDocUrl.ts
@@ -65,8 +65,6 @@ export const getHelpDocUrl = (
return 'https://docs.typebot.io/editor/blocks/logic/jump'
case IntegrationBlockType.PIXEL:
return 'https://docs.typebot.io/editor/blocks/integrations/pixel'
- case IntegrationBlockType.ZEMANTIC_AI:
- return 'https://docs.typebot.io/editor/blocks/integrations/zemantic-ai'
case LogicBlockType.CONDITION:
return 'https://docs.typebot.io/editor/blocks/logic/condition'
default:
diff --git a/apps/builder/src/helpers/server/routers/internalRouter.ts b/apps/builder/src/helpers/server/routers/internalRouter.ts
index bb0154624..072252dd8 100644
--- a/apps/builder/src/helpers/server/routers/internalRouter.ts
+++ b/apps/builder/src/helpers/server/routers/internalRouter.ts
@@ -3,7 +3,6 @@ import { router } from '../trpc'
import { generateUploadUrl } from '@/features/upload/api/generateUploadUrl'
import { openAIRouter } from '@/features/blocks/integrations/openai/api/router'
import { internalWhatsAppRouter } from '@/features/whatsapp/router'
-import { zemanticAiRouter } from '@/features/blocks/integrations/zemanticAi/api/router'
import { forgeRouter } from '@/features/forge/api/router'
import { googleSheetsRouter } from '@/features/blocks/integrations/googleSheets/api/router'
import { telemetryRouter } from '@/features/telemetry/api/router'
@@ -13,7 +12,6 @@ export const internalRouter = router({
generateUploadUrl,
whatsAppInternal: internalWhatsAppRouter,
openAI: openAIRouter,
- zemanticAI: zemanticAiRouter,
forge: forgeRouter,
sheets: googleSheetsRouter,
telemetry: telemetryRouter,
diff --git a/apps/docs/editor/blocks/integrations/zemantic-ai.mdx b/apps/docs/editor/blocks/integrations/zemantic-ai.mdx
deleted file mode 100644
index a1e68cff4..000000000
--- a/apps/docs/editor/blocks/integrations/zemantic-ai.mdx
+++ /dev/null
@@ -1,48 +0,0 @@
----
-title: Zemantic AI
----
-
-With the Zemantic AI block, you can search and retrieve results or LLM summaries from your documents stored on Zemantic AI.
-
-
-
-
-
-## Settings
-
-This integration requires a Zemantic AI account. If you don't have one yet, you can create one [here](https://zemantic.ai/).
-
-The block has the following settings:
-
-
-
-
-
-- Zemantic AI account: create or select the Zemantic AI credentials you want to use.
-- Project ID: The project id of the project containing the documents you want to search
-- Question or Query: The question you want to ask your Zemantic AI documents
-- Max Results: The maximum number of results you want to retrieve
-
-### Prompt Settings
-
-- System Prompt: The prompt you want to use to guide the LLM behavior
-- Prompt: The prompt you want to use to summarize your documents
-
-## Troobleshooting
-
-### Error message: "Zemantic AI block returned error"
-
-It means your Zemantic AI block is not configured properly. Please check the following:
-
-- You have selected an Zemantic AI account
-- You have filled out the Question or Query field
-
-### It returns an empty message
-
-Either you misconfigured the block or your may have have gone over the context limits of the LLM. You can try lowering the number of results to retrieve or shortening your prompt.
diff --git a/apps/docs/images/blocks/integrations/zemanticAi/overview.png b/apps/docs/images/blocks/integrations/zemanticAi/overview.png
deleted file mode 100644
index b39cf3723..000000000
Binary files a/apps/docs/images/blocks/integrations/zemanticAi/overview.png and /dev/null differ
diff --git a/apps/docs/images/blocks/integrations/zemanticAi/settings.png b/apps/docs/images/blocks/integrations/zemanticAi/settings.png
deleted file mode 100644
index 41b5e727d..000000000
Binary files a/apps/docs/images/blocks/integrations/zemanticAi/settings.png and /dev/null differ
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 567e11199..021abd56e 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -122,7 +122,6 @@
"editor/blocks/integrations/chatwoot",
"editor/blocks/integrations/meta-pixel",
"editor/blocks/integrations/openai",
- "editor/blocks/integrations/zemantic-ai",
"editor/blocks/integrations/mistral",
"editor/blocks/integrations/elevenlabs",
"editor/blocks/integrations/anthropic",
diff --git a/apps/docs/openapi/builder.json b/apps/docs/openapi/builder.json
index 2da6f2fcf..0c616e256 100644
--- a/apps/docs/openapi/builder.json
+++ b/apps/docs/openapi/builder.json
@@ -2469,78 +2469,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
@@ -6838,78 +6766,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
@@ -10344,78 +10200,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
@@ -12949,37 +12733,6 @@
"name"
]
},
- {
- "type": "object",
- "properties": {
- "data": {
- "type": "object",
- "properties": {
- "apiKey": {
- "type": "string"
- }
- }
- },
- "type": {
- "type": "string",
- "enum": [
- "zemantic-ai"
- ]
- },
- "workspaceId": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- },
- "required": [
- "data",
- "type",
- "workspaceId",
- "name"
- ]
- },
{
"type": "object",
"properties": {
@@ -13345,9 +13098,7 @@
"google sheets",
"stripe",
"whatsApp",
- "zemanticAi",
"openai",
- "zemantic-ai",
"chat-node",
"dify-ai",
"mistral",
@@ -13383,9 +13134,7 @@
"google sheets",
"stripe",
"whatsApp",
- "zemanticAi",
"openai",
- "zemantic-ai",
"chat-node",
"dify-ai",
"mistral",
@@ -13836,37 +13585,6 @@
"workspaceId"
]
},
- {
- "type": "object",
- "properties": {
- "name": {
- "type": "string"
- },
- "data": {
- "type": "object",
- "properties": {
- "apiKey": {
- "type": "string"
- }
- }
- },
- "type": {
- "type": "string",
- "enum": [
- "zemantic-ai"
- ]
- },
- "workspaceId": {
- "type": "string"
- }
- },
- "required": [
- "name",
- "data",
- "type",
- "workspaceId"
- ]
- },
{
"type": "object",
"properties": {
@@ -19821,78 +19539,6 @@
"type"
]
},
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
- },
{
"type": "object",
"properties": {
@@ -20462,99 +20108,6 @@
"type"
]
},
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "zemantic-ai"
- ]
- },
- "options": {
- "oneOf": [
- {
- "type": "object",
- "properties": {
- "projectId": {
- "type": "string"
- },
- "credentialsId": {
- "type": "string"
- }
- }
- },
- {
- "type": "object",
- "properties": {
- "projectId": {
- "type": "string"
- },
- "credentialsId": {
- "type": "string"
- },
- "action": {
- "type": "string",
- "enum": [
- "Search documents"
- ]
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "anyOf": [
- {
- "type": "number"
- },
- {}
- ]
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "item": {
- "type": "string",
- "enum": [
- "Summary",
- "Document IDs",
- "Texts",
- "Scores"
- ]
- },
- "variableId": {
- "type": "string"
- }
- }
- }
- }
- },
- "required": [
- "action"
- ]
- }
- ]
- }
- },
- "required": [
- "id",
- "type"
- ]
- },
{
"type": "object",
"properties": {
@@ -26532,78 +26085,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
@@ -29407,78 +28888,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
diff --git a/apps/docs/openapi/viewer.json b/apps/docs/openapi/viewer.json
index ecf1100ad..47714bbd3 100644
--- a/apps/docs/openapi/viewer.json
+++ b/apps/docs/openapi/viewer.json
@@ -5753,78 +5753,6 @@
"id",
"type"
]
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
}
]
}
@@ -9888,78 +9816,6 @@
"type"
]
},
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "Zemantic AI"
- ]
- },
- "blockId": {
- "type": "string"
- },
- "options": {
- "type": "object",
- "properties": {
- "credentialsId": {
- "type": "string"
- },
- "projectId": {
- "type": "string"
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "type": "integer"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "valueToExtract": {
- "type": "string",
- "enum": [
- "Summary",
- "Results"
- ]
- },
- "variableId": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "valueToExtract"
- ]
- }
- }
- }
- }
- },
- "required": [
- "id",
- "type"
- ]
- },
{
"type": "object",
"properties": {
@@ -10529,99 +10385,6 @@
"type"
]
},
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "outgoingEdgeId": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "zemantic-ai"
- ]
- },
- "options": {
- "oneOf": [
- {
- "type": "object",
- "properties": {
- "projectId": {
- "type": "string"
- },
- "credentialsId": {
- "type": "string"
- }
- }
- },
- {
- "type": "object",
- "properties": {
- "projectId": {
- "type": "string"
- },
- "credentialsId": {
- "type": "string"
- },
- "action": {
- "type": "string",
- "enum": [
- "Search documents"
- ]
- },
- "query": {
- "type": "string"
- },
- "maxResults": {
- "anyOf": [
- {
- "type": "number"
- },
- {}
- ]
- },
- "systemPrompt": {
- "type": "string"
- },
- "prompt": {
- "type": "string"
- },
- "responseMapping": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "item": {
- "type": "string",
- "enum": [
- "Summary",
- "Document IDs",
- "Texts",
- "Scores"
- ]
- },
- "variableId": {
- "type": "string"
- }
- }
- }
- }
- },
- "required": [
- "action"
- ]
- }
- ]
- }
- },
- "required": [
- "id",
- "type"
- ]
- },
{
"type": "object",
"properties": {
diff --git a/packages/bot-engine/blocks/integrations/zemanticAi/executeZemanticAiBlock.ts b/packages/bot-engine/blocks/integrations/zemanticAi/executeZemanticAiBlock.ts
deleted file mode 100644
index 40c37f875..000000000
--- a/packages/bot-engine/blocks/integrations/zemanticAi/executeZemanticAiBlock.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-import { SessionState } from '@typebot.io/schemas'
-import {
- ZemanticAiBlock,
- ZemanticAiCredentials,
- ZemanticAiResponse,
-} from '@typebot.io/schemas/features/blocks/integrations/zemanticAi'
-import ky from 'ky'
-import { decrypt } from '@typebot.io/lib/api/encryption/decrypt'
-import { byId, isDefined, isEmpty } from '@typebot.io/lib'
-import { ExecuteIntegrationResponse } from '../../../types'
-import { updateVariablesInSession } from '@typebot.io/variables/updateVariablesInSession'
-import { getCredentials } from '../../../queries/getCredentials'
-import { parseAnswers } from '@typebot.io/results/parseAnswers'
-
-const URL = 'https://api.zemantic.ai/v1/search-documents'
-
-export const executeZemanticAiBlock = async (
- state: SessionState,
- block: ZemanticAiBlock
-): Promise => {
- let newSessionState = state
- let setVariableHistory = []
-
- if (!block.options?.credentialsId)
- return {
- outgoingEdgeId: block.outgoingEdgeId,
- }
-
- const credentials = await getCredentials(block.options.credentialsId)
-
- if (!credentials) {
- return {
- outgoingEdgeId: block.outgoingEdgeId,
- logs: [
- {
- status: 'error',
- description: 'Make sure to select a Zemantic AI account',
- },
- ],
- }
- }
- const { apiKey } = (await decrypt(
- credentials.data,
- credentials.iv
- )) as ZemanticAiCredentials['data']
-
- const { typebot, answers } = newSessionState.typebotsQueue[0]
-
- const templateVars = parseAnswers({
- variables: typebot.variables,
- answers: answers,
- })
-
- try {
- const res: ZemanticAiResponse = await ky
- .post(URL, {
- headers: {
- Authorization: `Bearer ${apiKey}`,
- },
- json: {
- projectId: block.options.projectId,
- query: replaceTemplateVars(
- block.options.query as string,
- templateVars
- ),
- maxResults: block.options.maxResults,
- summarize: true,
- summaryOptions: {
- system_prompt:
- replaceTemplateVars(
- block.options.systemPrompt as string,
- templateVars
- ) ?? '',
- prompt:
- replaceTemplateVars(
- block.options.prompt as string,
- templateVars
- ) ?? '',
- },
- },
- })
- .json()
-
- for (const r of block.options.responseMapping || []) {
- const variable = typebot.variables.find(byId(r.variableId))
- let newVariables = []
- switch (r.valueToExtract) {
- case 'Summary':
- if (isDefined(variable) && !isEmpty(res.summary)) {
- newVariables.push({ ...variable, value: res.summary })
- }
- break
- case 'Results':
- if (isDefined(variable) && res.results.length) {
- newVariables.push({
- ...variable,
- value: JSON.stringify(res.results),
- })
- }
- break
- default:
- break
- }
- if (newVariables.length > 0) {
- const { newSetVariableHistory, updatedState } =
- updateVariablesInSession({
- newVariables,
- state: newSessionState,
- currentBlockId: block.id,
- })
- newSessionState = updatedState
- setVariableHistory.push(...newSetVariableHistory)
- }
- }
- } catch (e) {
- console.error(e)
- return {
- startTimeShouldBeUpdated: true,
- outgoingEdgeId: block.outgoingEdgeId,
- logs: [
- {
- status: 'error',
- description: 'Could not execute Zemantic AI request',
- },
- ],
- newSetVariableHistory: setVariableHistory,
- }
- }
-
- return {
- outgoingEdgeId: block.outgoingEdgeId,
- newSessionState,
- startTimeShouldBeUpdated: true,
- }
-}
-
-const replaceTemplateVars = (
- template: string,
- vars: Record
-) => {
- if (!template) return
- let result = template
- for (const [key, value] of Object.entries(vars)) {
- result = result.replaceAll(`{{${key}}}`, value)
- }
- return result
-}
diff --git a/packages/bot-engine/executeIntegration.ts b/packages/bot-engine/executeIntegration.ts
index 0820e4995..902a4a2f4 100644
--- a/packages/bot-engine/executeIntegration.ts
+++ b/packages/bot-engine/executeIntegration.ts
@@ -4,7 +4,6 @@ import { executeChatwootBlock } from './blocks/integrations/chatwoot/executeChat
import { executeGoogleAnalyticsBlock } from './blocks/integrations/legacy/googleAnalytics/executeGoogleAnalyticsBlock'
import { executeGoogleSheetBlock } from './blocks/integrations/googleSheets/executeGoogleSheetBlock'
import { executePixelBlock } from './blocks/integrations/pixel/executePixelBlock'
-import { executeZemanticAiBlock } from './blocks/integrations/zemanticAi/executeZemanticAiBlock'
import { IntegrationBlock, SessionState } from '@typebot.io/schemas'
import { ExecuteIntegrationResponse } from './types'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/constants'
@@ -50,11 +49,6 @@ export const executeIntegration =
}
case IntegrationBlockType.PIXEL:
return executePixelBlock(state, block)
- case IntegrationBlockType.ZEMANTIC_AI:
- return {
- ...(await executeZemanticAiBlock(state, block)),
- startTimeShouldBeUpdated: true,
- }
default:
return {
...(await executeForgedBlock(state, block)),
diff --git a/packages/forge/blocks/zemanticAi/actions/searchDocuments.ts b/packages/forge/blocks/zemanticAi/actions/searchDocuments.ts
deleted file mode 100644
index 89e0e4b91..000000000
--- a/packages/forge/blocks/zemanticAi/actions/searchDocuments.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import { createAction, option } from '@typebot.io/forge'
-import { isDefined } from '@typebot.io/lib'
-import { ZemanticAiResponse } from '../types'
-import ky from 'ky'
-import { apiBaseUrl } from '../constants'
-import { auth } from '../auth'
-import { baseOptions } from '../baseOptions'
-
-export const searchDocuments = createAction({
- baseOptions,
- auth,
- name: 'Search documents',
- options: option.object({
- query: option.string.layout({
- label: 'Query',
- placeholder: 'Content',
- moreInfoTooltip:
- 'The question you want to ask or search against the documents in the project.',
- }),
- maxResults: option.number.layout({
- label: 'Max results',
- placeholder: 'i.e. 3',
- defaultValue: 3,
- moreInfoTooltip:
- 'The maximum number of document chunk results to return from your search.',
- }),
- systemPrompt: option.string.layout({
- accordion: 'Advanced settings',
- label: 'System prompt',
- moreInfoTooltip:
- 'System prompt to send to the summarization LLM. This is prepended to the prompt and helps guide system behavior.',
- inputType: 'textarea',
- }),
- prompt: option.string.layout({
- accordion: 'Advanced settings',
- label: 'Prompt',
- moreInfoTooltip: 'Prompt to send to the summarization LLM.',
- inputType: 'textarea',
- }),
- responseMapping: option
- .saveResponseArray([
- 'Summary',
- 'Document IDs',
- 'Texts',
- 'Scores',
- ] as const)
- .layout({
- accordion: 'Save response',
- }),
- }),
- getSetVariableIds: ({ responseMapping }) =>
- responseMapping?.map((r) => r.variableId).filter(isDefined) ?? [],
- run: {
- server: async ({
- credentials: { apiKey },
- options: {
- maxResults,
- projectId,
- prompt,
- query,
- responseMapping,
- systemPrompt,
- },
- variables,
- }) => {
- const res = await ky
- .post(apiBaseUrl, {
- headers: {
- Authorization: `Bearer ${apiKey}`,
- },
- json: {
- projectId,
- query,
- maxResults,
- summarize: true,
- summaryOptions: {
- system_prompt: systemPrompt,
- prompt: prompt,
- },
- },
- })
- .json()
-
- responseMapping?.forEach((mapping) => {
- if (!mapping.variableId || !mapping.item) return
-
- if (mapping.item === 'Document IDs')
- variables.set(
- mapping.variableId,
- res.results.map((r) => r.documentId)
- )
-
- if (mapping.item === 'Texts')
- variables.set(
- mapping.variableId,
- res.results.map((r) => r.text)
- )
-
- if (mapping.item === 'Scores')
- variables.set(
- mapping.variableId,
- res.results.map((r) => r.score)
- )
-
- if (mapping.item === 'Summary')
- variables.set(mapping.variableId, res.summary)
- })
- },
- },
-})
diff --git a/packages/forge/blocks/zemanticAi/auth.ts b/packages/forge/blocks/zemanticAi/auth.ts
deleted file mode 100644
index 71298e6f8..000000000
--- a/packages/forge/blocks/zemanticAi/auth.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { AuthDefinition, option } from '@typebot.io/forge'
-
-export const auth = {
- type: 'encryptedCredentials',
- name: 'Zemantic AI account',
- schema: option.object({
- apiKey: option.string.layout({
- label: 'API key',
- isRequired: true,
- placeholder: 'ze...',
- inputType: 'password',
- helperText:
- 'You can generate an API key [here](https://zemantic.ai/dashboard/settings).',
- isDebounceDisabled: true,
- }),
- }),
-} satisfies AuthDefinition
diff --git a/packages/forge/blocks/zemanticAi/baseOptions.ts b/packages/forge/blocks/zemanticAi/baseOptions.ts
deleted file mode 100644
index c343e4b5e..000000000
--- a/packages/forge/blocks/zemanticAi/baseOptions.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { option } from '@typebot.io/forge'
-
-export const baseOptions = option.object({
- projectId: option.string.layout({
- placeholder: 'Select a project',
- fetcher: 'fetchProjects',
- }),
-})
diff --git a/packages/forge/blocks/zemanticAi/constants.ts b/packages/forge/blocks/zemanticAi/constants.ts
deleted file mode 100644
index 5c3ce59fd..000000000
--- a/packages/forge/blocks/zemanticAi/constants.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const apiBaseUrl = 'https://api.zemantic.ai/v1/search-documents'
diff --git a/packages/forge/blocks/zemanticAi/index.ts b/packages/forge/blocks/zemanticAi/index.ts
deleted file mode 100644
index e43015ebe..000000000
--- a/packages/forge/blocks/zemanticAi/index.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { createBlock } from '@typebot.io/forge'
-import { ZemanticAiLogo } from './logo'
-import ky from 'ky'
-import { searchDocuments } from './actions/searchDocuments'
-import { auth } from './auth'
-import { baseOptions } from './baseOptions'
-
-export const zemanticAiBlock = createBlock({
- id: 'zemantic-ai',
- name: 'Zemantic AI',
- tags: [],
- LightLogo: ZemanticAiLogo,
- auth,
- options: baseOptions,
- fetchers: [
- {
- id: 'fetchProjects',
- dependencies: [],
- fetch: async ({ credentials }) => {
- if (!credentials?.apiKey) return []
-
- const url = 'https://api.zemantic.ai/v1/projects'
-
- const response = await ky
- .get(url, {
- headers: {
- Authorization: `Bearer ${credentials.apiKey}`,
- },
- })
- .json()
-
- const projectsData = response as {
- id: string
- name: string
- }[]
-
- return projectsData.map((project) => ({
- label: project.name,
- value: project.id,
- }))
- },
- },
- ],
- actions: [searchDocuments],
-})
diff --git a/packages/forge/blocks/zemanticAi/logo.tsx b/packages/forge/blocks/zemanticAi/logo.tsx
deleted file mode 100644
index 723cf7774..000000000
--- a/packages/forge/blocks/zemanticAi/logo.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-/** @jsxImportSource react */
-
-export const ZemanticAiLogo = (props: React.SVGProps) => (
-
-)
diff --git a/packages/forge/blocks/zemanticAi/package.json b/packages/forge/blocks/zemanticAi/package.json
deleted file mode 100644
index 9154d1404..000000000
--- a/packages/forge/blocks/zemanticAi/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "@typebot.io/zemantic-ai-block",
- "version": "1.0.0",
- "description": "",
- "main": "index.ts",
- "keywords": [],
- "license": "AGPL-3.0-or-later",
- "devDependencies": {
- "@typebot.io/forge": "workspace:*",
- "@typebot.io/tsconfig": "workspace:*",
- "@types/react": "18.2.15",
- "typescript": "5.4.5",
- "@typebot.io/lib": "workspace:*",
- "ky": "1.2.4"
- }
-}
\ No newline at end of file
diff --git a/packages/forge/blocks/zemanticAi/schemas.ts b/packages/forge/blocks/zemanticAi/schemas.ts
deleted file mode 100644
index 774b80f07..000000000
--- a/packages/forge/blocks/zemanticAi/schemas.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-// Do not edit this file manually
-import { parseBlockCredentials, parseBlockSchema } from '@typebot.io/forge'
-import { zemanticAiBlock } from '.'
-import { auth } from './auth'
-
-export const zemanticAiBlockSchema = parseBlockSchema(zemanticAiBlock)
-export const zemanticAiCredentialsSchema = parseBlockCredentials(
- zemanticAiBlock.id,
- auth.schema
-)
diff --git a/packages/forge/blocks/zemanticAi/tsconfig.json b/packages/forge/blocks/zemanticAi/tsconfig.json
deleted file mode 100644
index 950c0c115..000000000
--- a/packages/forge/blocks/zemanticAi/tsconfig.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "@typebot.io/tsconfig/base.json",
- "include": ["**/*.ts", "**/*.tsx"],
- "exclude": ["node_modules"],
- "compilerOptions": {
- "lib": ["ESNext", "DOM"],
- "noEmit": true,
- "jsx": "preserve",
- "jsxImportSource": "react"
- }
-}
diff --git a/packages/forge/blocks/zemanticAi/types.ts b/packages/forge/blocks/zemanticAi/types.ts
deleted file mode 100644
index 256600e92..000000000
--- a/packages/forge/blocks/zemanticAi/types.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export type ZemanticAiResponse = {
- results: { documentId: string; text: string; score: number }[]
- summary: string
-}
diff --git a/packages/forge/repository/constants.ts b/packages/forge/repository/constants.ts
index 034313869..93d98d9f6 100644
--- a/packages/forge/repository/constants.ts
+++ b/packages/forge/repository/constants.ts
@@ -3,7 +3,6 @@ import { ForgedBlock } from './types'
export const forgedBlockIds = [
'openai',
- 'zemantic-ai',
'cal-com',
'chat-node',
'qr-code',
diff --git a/packages/forge/repository/credentials.ts b/packages/forge/repository/credentials.ts
index 78c666296..fa27d1717 100644
--- a/packages/forge/repository/credentials.ts
+++ b/packages/forge/repository/credentials.ts
@@ -14,14 +14,11 @@ import { openAIBlock } from '@typebot.io/openai-block'
import { openAICredentialsSchema } from '@typebot.io/openai-block/schemas'
import { togetherAiBlock } from '@typebot.io/together-ai-block'
import { togetherAiCredentialsSchema } from '@typebot.io/together-ai-block/schemas'
-import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
-import { zemanticAiCredentialsSchema } from '@typebot.io/zemantic-ai-block/schemas'
import { nocodbBlock } from '@typebot.io/nocodb-block'
import { nocodbCredentialsSchema } from '@typebot.io/nocodb-block/schemas'
export const forgedCredentialsSchemas = {
[openAIBlock.id]: openAICredentialsSchema,
- [zemanticAiBlock.id]: zemanticAiCredentialsSchema,
[chatNodeBlock.id]: chatNodeCredentialsSchema,
[difyAiBlock.id]: difyAiCredentialsSchema,
[mistralBlock.id]: mistralCredentialsSchema,
diff --git a/packages/forge/repository/definitions.ts b/packages/forge/repository/definitions.ts
index e2c2db916..899aa4d71 100644
--- a/packages/forge/repository/definitions.ts
+++ b/packages/forge/repository/definitions.ts
@@ -8,13 +8,11 @@ import { mistralBlock } from '@typebot.io/mistral-block'
import { qrCodeBlock } from '@typebot.io/qrcode-block'
import { chatNodeBlock } from '@typebot.io/chat-node-block'
import { calComBlock } from '@typebot.io/cal-com-block'
-import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
import { openAIBlock } from '@typebot.io/openai-block'
import { nocodbBlock } from '@typebot.io/nocodb-block'
export const forgedBlocks = {
[openAIBlock.id]: openAIBlock,
- [zemanticAiBlock.id]: zemanticAiBlock,
[calComBlock.id]: calComBlock,
[chatNodeBlock.id]: chatNodeBlock,
[qrCodeBlock.id]: qrCodeBlock,
diff --git a/packages/forge/repository/package.json b/packages/forge/repository/package.json
index d18c05bc1..b5d9f0a10 100644
--- a/packages/forge/repository/package.json
+++ b/packages/forge/repository/package.json
@@ -8,7 +8,6 @@
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/openai-block": "workspace:*",
- "@typebot.io/zemantic-ai-block": "workspace:*",
"@typebot.io/cal-com-block": "workspace:*",
"@typebot.io/chat-node-block": "workspace:*",
"@typebot.io/qrcode-block": "workspace:*",
diff --git a/packages/forge/repository/schemas.ts b/packages/forge/repository/schemas.ts
index 6f0d53168..a3d5dae90 100644
--- a/packages/forge/repository/schemas.ts
+++ b/packages/forge/repository/schemas.ts
@@ -19,14 +19,11 @@ import { qrCodeBlock } from '@typebot.io/qrcode-block'
import { qrCodeBlockSchema } from '@typebot.io/qrcode-block/schemas'
import { togetherAiBlock } from '@typebot.io/together-ai-block'
import { togetherAiBlockSchema } from '@typebot.io/together-ai-block/schemas'
-import { zemanticAiBlock } from '@typebot.io/zemantic-ai-block'
-import { zemanticAiBlockSchema } from '@typebot.io/zemantic-ai-block/schemas'
import { nocodbBlock } from '@typebot.io/nocodb-block'
import { nocodbBlockSchema } from '@typebot.io/nocodb-block/schemas'
export const forgedBlockSchemas = {
[openAIBlock.id]: openAIBlockSchema,
- [zemanticAiBlock.id]: zemanticAiBlockSchema,
[calComBlock.id]: calComBlockSchema,
[chatNodeBlock.id]: chatNodeBlockSchema,
[qrCodeBlock.id]: qrCodeBlockSchema,
diff --git a/packages/schemas/features/blocks/integrations/constants.ts b/packages/schemas/features/blocks/integrations/constants.ts
index c5567de42..0e23b8c94 100644
--- a/packages/schemas/features/blocks/integrations/constants.ts
+++ b/packages/schemas/features/blocks/integrations/constants.ts
@@ -9,5 +9,4 @@ export enum IntegrationBlockType {
PABBLY_CONNECT = 'Pabbly',
CHATWOOT = 'Chatwoot',
PIXEL = 'Pixel',
- ZEMANTIC_AI = 'Zemantic AI',
}
diff --git a/packages/schemas/features/blocks/integrations/index.ts b/packages/schemas/features/blocks/integrations/index.ts
index 8e92c00cf..6ecb74778 100644
--- a/packages/schemas/features/blocks/integrations/index.ts
+++ b/packages/schemas/features/blocks/integrations/index.ts
@@ -7,5 +7,4 @@ export * from './sendEmail'
export * from './webhook'
export * from './zapier'
export * from './pixel'
-export * from './zemanticAi'
export * from './schema'
diff --git a/packages/schemas/features/blocks/integrations/schema.ts b/packages/schemas/features/blocks/integrations/schema.ts
index cd4aba8a3..88f286895 100644
--- a/packages/schemas/features/blocks/integrations/schema.ts
+++ b/packages/schemas/features/blocks/integrations/schema.ts
@@ -5,7 +5,6 @@ import { googleSheetsBlockSchemas } from './googleSheets'
import { openAIBlockSchema } from './openai'
import { pixelBlockSchema } from './pixel/schema'
import { sendEmailBlockSchema } from './sendEmail'
-import { zemanticAiBlockSchema } from './zemanticAi'
import { zapierBlockSchemas } from './zapier'
import { httpBlockSchemas } from './webhook'
import { makeComBlockSchemas } from './makeCom'
@@ -23,7 +22,6 @@ export const integrationBlockSchemas = {
httpBlockSchemas.v5,
zapierBlockSchemas.v5,
pixelBlockSchema,
- zemanticAiBlockSchema,
],
v6: [
chatwootBlockSchema,
@@ -36,7 +34,6 @@ export const integrationBlockSchemas = {
httpBlockSchemas.v6,
zapierBlockSchemas.v6,
pixelBlockSchema,
- zemanticAiBlockSchema,
],
} as const
diff --git a/packages/schemas/features/blocks/integrations/zemanticAi/constants.ts b/packages/schemas/features/blocks/integrations/zemanticAi/constants.ts
deleted file mode 100644
index 21af70408..000000000
--- a/packages/schemas/features/blocks/integrations/zemanticAi/constants.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { ZemanticAiBlock } from './schema'
-
-export const searchResponseValues = ['Summary', 'Results'] as const
-
-export const defaultZemanticAiOptions = {
- maxResults: 3,
-} as const satisfies ZemanticAiBlock['options']
-
-export const defaultZemanticAiResponseMappingItem = {
- valueToExtract: 'Summary',
-} as const
diff --git a/packages/schemas/features/blocks/integrations/zemanticAi/index.ts b/packages/schemas/features/blocks/integrations/zemanticAi/index.ts
deleted file mode 100644
index cb7cdd48b..000000000
--- a/packages/schemas/features/blocks/integrations/zemanticAi/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './schema'
diff --git a/packages/schemas/features/blocks/integrations/zemanticAi/schema.ts b/packages/schemas/features/blocks/integrations/zemanticAi/schema.ts
deleted file mode 100644
index 23f928575..000000000
--- a/packages/schemas/features/blocks/integrations/zemanticAi/schema.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { z } from '../../../../zod'
-import { blockBaseSchema, credentialsBaseSchema } from '../../shared'
-import { IntegrationBlockType } from '../constants'
-import { searchResponseValues } from './constants'
-
-export const zemanticAiOptionsSchema = z.object({
- credentialsId: z.string().optional(),
- projectId: z.string().optional(),
- systemPrompt: z.string().optional(),
- prompt: z.string().optional(),
- query: z.string().optional(),
- maxResults: z.number().int().optional(),
- responseMapping: z
- .array(
- z.object({
- id: z.string(),
- valueToExtract: z.preprocess(
- (val) => (!val ? 'Summary' : val),
- z.enum(searchResponseValues)
- ),
- variableId: z.string().optional(),
- })
- )
- .optional(),
-})
-
-export const zemanticAiBlockSchema = blockBaseSchema.merge(
- z.object({
- type: z.enum([IntegrationBlockType.ZEMANTIC_AI]),
- blockId: z.string().optional(),
- options: zemanticAiOptionsSchema.optional(),
- })
-)
-
-export const zemanticAiCredentialsSchema = z
- .object({
- type: z.literal('zemanticAi'),
- data: z.object({
- apiKey: z.string(),
- }),
- })
- .merge(credentialsBaseSchema)
-
-export const zemanticSearchResponseSchema = z.object({
- results: z.array(
- z.object({
- documentId: z.string(),
- text: z.string(),
- score: z.number(),
- })
- ),
- summary: z.string(),
-})
-
-export type ZemanticAiResponse = z.infer
-export type ZemanticAiCredentials = z.infer
-export type ZemanticAiBlock = z.infer
diff --git a/packages/schemas/features/credentials.ts b/packages/schemas/features/credentials.ts
index 23ab0e59b..08a9cdae7 100644
--- a/packages/schemas/features/credentials.ts
+++ b/packages/schemas/features/credentials.ts
@@ -1,5 +1,4 @@
import { z } from '../zod'
-import { zemanticAiCredentialsSchema } from './blocks'
import { stripeCredentialsSchema } from './blocks/inputs/payment/schema'
import { googleSheetsCredentialsSchema } from './blocks/integrations/googleSheets/schema'
import { smtpCredentialsSchema } from './blocks/integrations/sendEmail'
@@ -11,30 +10,19 @@ const credentialsSchema = z.discriminatedUnion('type', [
googleSheetsCredentialsSchema,
stripeCredentialsSchema,
whatsAppCredentialsSchema,
- zemanticAiCredentialsSchema,
...Object.values(forgedCredentialsSchemas),
])
export type Credentials = z.infer
-export type CredentialsWithoutLegacy = Exclude<
- Credentials,
- {
- type: 'zemanticAi'
- }
->
-
export const credentialsTypes = [
'smtp',
'google sheets',
'stripe',
'whatsApp',
- 'zemanticAi',
...(Object.keys(forgedCredentialsSchemas) as Array<
keyof typeof forgedCredentialsSchemas
>),
] as const
export const credentialsTypeSchema = z.enum(credentialsTypes)
-
-export const legacyCredentialsTypes = ['zemanticAi']
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fa1af2a27..ab5b5f053 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1612,27 +1612,6 @@ importers:
specifier: 5.4.5
version: 5.4.5
- packages/forge/blocks/zemanticAi:
- devDependencies:
- '@typebot.io/forge':
- specifier: workspace:*
- version: link:../../core
- '@typebot.io/lib':
- specifier: workspace:*
- version: link:../../../lib
- '@typebot.io/tsconfig':
- specifier: workspace:*
- version: link:../../../tsconfig
- '@types/react':
- specifier: 18.2.15
- version: 18.2.15
- ky:
- specifier: 1.2.4
- version: 1.2.4
- typescript:
- specifier: 5.4.5
- version: 5.4.5
-
packages/forge/cli:
devDependencies:
'@clack/prompts':
@@ -1702,9 +1681,6 @@ importers:
'@typebot.io/together-ai-block':
specifier: workspace:*
version: link:../blocks/togetherAi
- '@typebot.io/zemantic-ai-block':
- specifier: workspace:*
- version: link:../blocks/zemanticAi
packages/lib:
dependencies: