Skip to content

Commit

Permalink
✨ Add Together AI block (#1304)
Browse files Browse the repository at this point in the history
Closes #1253
  • Loading branch information
baptisteArno committed Mar 1, 2024
1 parent 275ba1b commit 648ec08
Show file tree
Hide file tree
Showing 27 changed files with 623 additions and 361 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const ZodFieldLayout = ({
const innerSchema = getZodInnerSchema(schema)
const layout = innerSchema._def.layout

if (layout?.isHidden) return null

switch (innerSchema._def.typeName) {
case 'ZodObject':
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Text,
} from '@chakra-ui/react'
import { z } from '@typebot.io/forge/zod'
import React from 'react'
import { ZodLayoutMetadata } from '@typebot.io/forge/zod'
import { ReactNode } from 'react'
import { ZodTypeAny } from 'zod'
Expand All @@ -32,7 +33,9 @@ export const ZodObjectLayout = ({
blockDef?: ForgedBlockDefinition
blockOptions?: ForgedBlock['options']
onDataChange: (value: any) => void
}) => {
}): ReactNode[] => {
const layout = getZodInnerSchema(schema)._def.layout
if (layout?.isHidden) return []
return Object.keys(schema.shape).reduce<{
nodes: ReactNode[]
accordionsCreated: string[]
Expand All @@ -43,6 +46,8 @@ export const ZodObjectLayout = ({
const layout = keySchema._def.layout as
| ZodLayoutMetadata<ZodTypeAny>
| undefined

if (layout?.isHidden) return nodes
if (
layout &&
layout.accordion &&
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/openapi/builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -18792,7 +18792,8 @@
"qr-code",
"dify-ai",
"mistral",
"elevenlabs"
"elevenlabs",
"together-ai"
]
},
"options": {}
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/openapi/viewer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9413,7 +9413,8 @@
"qr-code",
"dify-ai",
"mistral",
"elevenlabs"
"elevenlabs",
"together-ai"
]
},
"options": {}
Expand Down

0 comments on commit 648ec08

Please sign in to comment.