|
|
|
@ -21,8 +21,8 @@ import { MittProvider, VisualEditorContextProvider, useMittContext } from './vis
|
|
|
|
import ErrorMessage from './error-message'
|
|
|
|
import ErrorMessage from './error-message'
|
|
|
|
import { useVisualEditorStore } from './visual-editor/store'
|
|
|
|
import { useVisualEditorStore } from './visual-editor/store'
|
|
|
|
import Toast from '@/app/components/base/toast'
|
|
|
|
import Toast from '@/app/components/base/toast'
|
|
|
|
import { useGetDocLanguage } from '@/context/i18n'
|
|
|
|
|
|
|
|
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
|
|
|
|
import { JSON_SCHEMA_MAX_DEPTH } from '@/config'
|
|
|
|
|
|
|
|
import { useDocLink } from '@/context/i18n'
|
|
|
|
|
|
|
|
|
|
|
|
type JsonSchemaConfigProps = {
|
|
|
|
type JsonSchemaConfigProps = {
|
|
|
|
defaultSchema?: SchemaRoot
|
|
|
|
defaultSchema?: SchemaRoot
|
|
|
|
@ -53,7 +53,7 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
|
|
|
onClose,
|
|
|
|
onClose,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const docLanguage = useGetDocLanguage()
|
|
|
|
const docLink = useDocLink()
|
|
|
|
const [currentTab, setCurrentTab] = useState(SchemaView.VisualEditor)
|
|
|
|
const [currentTab, setCurrentTab] = useState(SchemaView.VisualEditor)
|
|
|
|
const [jsonSchema, setJsonSchema] = useState(defaultSchema || DEFAULT_SCHEMA)
|
|
|
|
const [jsonSchema, setJsonSchema] = useState(defaultSchema || DEFAULT_SCHEMA)
|
|
|
|
const [json, setJson] = useState(JSON.stringify(jsonSchema, null, 2))
|
|
|
|
const [json, setJson] = useState(JSON.stringify(jsonSchema, null, 2))
|
|
|
|
@ -252,7 +252,7 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
|
|
|
<div className='flex items-center gap-x-2 p-6 pt-5'>
|
|
|
|
<div className='flex items-center gap-x-2 p-6 pt-5'>
|
|
|
|
<a
|
|
|
|
<a
|
|
|
|
className='flex grow items-center gap-x-1 text-text-accent'
|
|
|
|
className='flex grow items-center gap-x-1 text-text-accent'
|
|
|
|
href={`https://docs.dify.ai/${docLanguage}/guides/workflow/structured-outputs`}
|
|
|
|
href={docLink('/guides/workflow/structured-outputs')}
|
|
|
|
target='_blank'
|
|
|
|
target='_blank'
|
|
|
|
rel='noopener noreferrer'
|
|
|
|
rel='noopener noreferrer'
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|