mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 20:15:58 +08:00
style: minimium codemod
This commit is contained in:
parent
024028bc52
commit
cdd2a40086
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import type { Preview } from '@storybook/react'
|
import type { Preview } from '@storybook/react'
|
||||||
import { withThemeByDataAttribute } from '@storybook/addon-themes';
|
import { withThemeByDataAttribute } from '@storybook/addon-themes'
|
||||||
import I18nServer from '../app/components/i18n-server'
|
import I18nServer from '../app/components/i18n-server'
|
||||||
|
|
||||||
import '../app/styles/globals.css'
|
import '../app/styles/globals.css'
|
||||||
@ -16,12 +16,12 @@ export const decorators = [
|
|||||||
defaultTheme: 'light',
|
defaultTheme: 'light',
|
||||||
attributeName: 'data-theme',
|
attributeName: 'data-theme',
|
||||||
}),
|
}),
|
||||||
Story => {
|
(Story) => {
|
||||||
return <I18nServer>
|
return <I18nServer>
|
||||||
<Story />
|
<Story />
|
||||||
</I18nServer>
|
</I18nServer>
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
|
||||||
const preview: Preview = {
|
const preview: Preview = {
|
||||||
parameters: {
|
parameters: {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { type Locale } from '@/i18n'
|
import type { Locale } from '@/i18n'
|
||||||
import DevelopMain from '@/app/components/develop'
|
import DevelopMain from '@/app/components/develop'
|
||||||
|
|
||||||
export type IDevelopProps = {
|
export type IDevelopProps = {
|
||||||
|
@ -8,12 +8,11 @@ import { useBoolean } from 'ahooks'
|
|||||||
import {
|
import {
|
||||||
Cog8ToothIcon,
|
Cog8ToothIcon,
|
||||||
// CommandLineIcon,
|
// CommandLineIcon,
|
||||||
Squares2X2Icon,
|
|
||||||
// eslint-disable-next-line sort-imports
|
|
||||||
PuzzlePieceIcon,
|
|
||||||
DocumentTextIcon,
|
DocumentTextIcon,
|
||||||
PaperClipIcon,
|
PaperClipIcon,
|
||||||
|
PuzzlePieceIcon,
|
||||||
QuestionMarkCircleIcon,
|
QuestionMarkCircleIcon,
|
||||||
|
Squares2X2Icon,
|
||||||
} from '@heroicons/react/24/outline'
|
} from '@heroicons/react/24/outline'
|
||||||
import {
|
import {
|
||||||
Cog8ToothIcon as Cog8ToothSolidIcon,
|
Cog8ToothIcon as Cog8ToothSolidIcon,
|
||||||
|
@ -9,7 +9,7 @@ import ConfirmAddVar from './confirm-add-var'
|
|||||||
import s from './style.module.css'
|
import s from './style.module.css'
|
||||||
import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap'
|
import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
import { type PromptVariable } from '@/models/debug'
|
import type { PromptVariable } from '@/models/debug'
|
||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
import type { CompletionParams } from '@/types/app'
|
import type { CompletionParams } from '@/types/app'
|
||||||
import { AppType } from '@/types/app'
|
import { AppType } from '@/types/app'
|
||||||
|
@ -19,7 +19,7 @@ import AgentTools from './agent/agent-tools'
|
|||||||
import ConfigContext from '@/context/debug-configuration'
|
import ConfigContext from '@/context/debug-configuration'
|
||||||
import ConfigPrompt from '@/app/components/app/configuration/config-prompt'
|
import ConfigPrompt from '@/app/components/app/configuration/config-prompt'
|
||||||
import ConfigVar from '@/app/components/app/configuration/config-var'
|
import ConfigVar from '@/app/components/app/configuration/config-var'
|
||||||
import { type CitationConfig, type ModelConfig, type ModerationConfig, type MoreLikeThisConfig, type PromptVariable, type SpeechToTextConfig, type SuggestedQuestionsAfterAnswerConfig, type TextToSpeechConfig } from '@/models/debug'
|
import type { CitationConfig, ModelConfig, ModerationConfig, MoreLikeThisConfig, PromptVariable, SpeechToTextConfig, SuggestedQuestionsAfterAnswerConfig, TextToSpeechConfig } from '@/models/debug'
|
||||||
import type { AppType } from '@/types/app'
|
import type { AppType } from '@/types/app'
|
||||||
import { ModelModeType } from '@/types/app'
|
import { ModelModeType } from '@/types/app'
|
||||||
import { useModalContext } from '@/context/modal-context'
|
import { useModalContext } from '@/context/modal-context'
|
||||||
@ -134,11 +134,11 @@ const Config: FC = () => {
|
|||||||
annotation: annotationConfig.enabled,
|
annotation: annotationConfig.enabled,
|
||||||
setAnnotation: async (value) => {
|
setAnnotation: async (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
setIsShowAnnotationConfigInit(true)
|
setIsShowAnnotationConfigInit(true)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
await handleDisableAnnotation(annotationConfig.embedding_model)
|
await handleDisableAnnotation(annotationConfig.embedding_model)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,7 +55,7 @@ import ModelParameterModal from '@/app/components/header/account-setting/model-p
|
|||||||
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
import { useTextGenerationCurrentProviderAndModelAndModelList } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
import { useTextGenerationCurrentProviderAndModelAndModelList } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
||||||
import { fetchCollectionList } from '@/service/tools'
|
import { fetchCollectionList } from '@/service/tools'
|
||||||
import { type Collection } from '@/app/components/tools/types'
|
import type { Collection } from '@/app/components/tools/types'
|
||||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||||
import {
|
import {
|
||||||
getMultipleRetrievalConfig,
|
getMultipleRetrievalConfig,
|
||||||
@ -142,7 +142,7 @@ const Configuration: FC = () => {
|
|||||||
const setCompletionParams = (value: FormValue) => {
|
const setCompletionParams = (value: FormValue) => {
|
||||||
const params = { ...value }
|
const params = { ...value }
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
if ((!params.stop || params.stop.length === 0) && (modeModeTypeRef.current === ModelModeType.completion)) {
|
if ((!params.stop || params.stop.length === 0) && (modeModeTypeRef.current === ModelModeType.completion)) {
|
||||||
params.stop = getTempStop()
|
params.stop = getTempStop()
|
||||||
setTempStop([])
|
setTempStop([])
|
||||||
@ -331,7 +331,7 @@ const Configuration: FC = () => {
|
|||||||
const [canReturnToSimpleMode, setCanReturnToSimpleMode] = useState(true)
|
const [canReturnToSimpleMode, setCanReturnToSimpleMode] = useState(true)
|
||||||
const setPromptMode = async (mode: PromptMode) => {
|
const setPromptMode = async (mode: PromptMode) => {
|
||||||
if (mode === PromptMode.advanced) {
|
if (mode === PromptMode.advanced) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
await migrateToDefaultPrompt()
|
await migrateToDefaultPrompt()
|
||||||
setCanReturnToSimpleMode(true)
|
setCanReturnToSimpleMode(true)
|
||||||
}
|
}
|
||||||
@ -523,7 +523,6 @@ const Configuration: FC = () => {
|
|||||||
sensitive_word_avoidance: modelConfig.sensitive_word_avoidance,
|
sensitive_word_avoidance: modelConfig.sensitive_word_avoidance,
|
||||||
external_data_tools: modelConfig.external_data_tools,
|
external_data_tools: modelConfig.external_data_tools,
|
||||||
dataSets: datasets || [],
|
dataSets: datasets || [],
|
||||||
// eslint-disable-next-line multiline-ternary
|
|
||||||
agentConfig: res.mode === 'agent-chat' ? {
|
agentConfig: res.mode === 'agent-chat' ? {
|
||||||
max_iteration: DEFAULT_AGENT_SETTING.max_iteration,
|
max_iteration: DEFAULT_AGENT_SETTING.max_iteration,
|
||||||
...modelConfig.agent_mode,
|
...modelConfig.agent_mode,
|
||||||
|
@ -20,7 +20,7 @@ const Progress: FC<IProgressProps> = ({
|
|||||||
className={cn(s.bar, exhausted && s['bar-error'], 'absolute top-0 left-0 right-0 bottom-0')}
|
className={cn(s.bar, exhausted && s['bar-error'], 'absolute top-0 left-0 right-0 bottom-0')}
|
||||||
style={{ width: `${value}%` }}
|
style={{ width: `${value}%` }}
|
||||||
/>
|
/>
|
||||||
{Array(10).fill(0).map((i, k) => (
|
{Array.from({ length: 10 }).fill(0).map((i, k) => (
|
||||||
<div key={k} className={s['bar-item']} />
|
<div key={k} className={s['bar-item']} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import AudioPlayer from '@/app/components/base/audio-btn/audio'
|
import AudioPlayer from '@/app/components/base/audio-btn/audio'
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
// eslint-disable-next-line ts/consistent-type-definitions
|
||||||
interface AudioPlayerManager {
|
interface AudioPlayerManager {
|
||||||
instance: AudioPlayerManager
|
instance: AudioPlayerManager
|
||||||
}
|
}
|
||||||
@ -12,6 +12,7 @@ export class AudioPlayerManager {
|
|||||||
private audioPlayers: AudioPlayer | null = null
|
private audioPlayers: AudioPlayer | null = null
|
||||||
private msgId: string | undefined
|
private msgId: string | undefined
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
private constructor() {
|
private constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import Toast from '@/app/components/base/toast'
|
|||||||
import { textToAudioStream } from '@/service/share'
|
import { textToAudioStream } from '@/service/share'
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
// eslint-disable-next-line ts/consistent-type-definitions
|
||||||
interface Window {
|
interface Window {
|
||||||
ManagedMediaSource: any
|
ManagedMediaSource: any
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ const AudioPlayer: React.FC<AudioPlayerProps> = ({ src }) => {
|
|||||||
audio.load()
|
audio.load()
|
||||||
|
|
||||||
// Delayed generation of waveform data
|
// Delayed generation of waveform data
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
const timer = setTimeout(() => generateWaveformData(src), 1000)
|
const timer = setTimeout(() => generateWaveformData(src), 1000)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -49,4 +49,6 @@ const AutoHeightTextarea = forwardRef<HTMLTextAreaElement, AutoHeightTextareaPro
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AutoHeightTextarea.displayName = 'AutoHeightTextarea'
|
||||||
|
|
||||||
export default AutoHeightTextarea
|
export default AutoHeightTextarea
|
||||||
|
@ -12,8 +12,9 @@ import Divider from '@/app/components/base/divider'
|
|||||||
import { searchEmoji } from '@/utils/emoji'
|
import { searchEmoji } from '@/utils/emoji'
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
// eslint-disable-next-line ts/no-namespace
|
||||||
namespace JSX {
|
namespace JSX {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
// eslint-disable-next-line ts/consistent-type-definitions
|
||||||
interface IntrinsicElements {
|
interface IntrinsicElements {
|
||||||
'em-emoji': React.DetailedHTMLProps< React.HTMLAttributes<HTMLElement>, HTMLElement >
|
'em-emoji': React.DetailedHTMLProps< React.HTMLAttributes<HTMLElement>, HTMLElement >
|
||||||
}
|
}
|
||||||
|
@ -28,4 +28,6 @@ const IconBase = forwardRef<React.MutableRefObject<HTMLOrSVGElement>, IconBasePr
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
IconBase.displayName = 'IconBase'
|
||||||
|
|
||||||
export default IconBase
|
export default IconBase
|
||||||
|
@ -75,7 +75,6 @@ export function PreCode(props: { children: any }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
||||||
const useLazyLoad = (ref: RefObject<Element>): boolean => {
|
const useLazyLoad = (ref: RefObject<Element>): boolean => {
|
||||||
const [isIntersecting, setIntersecting] = useState<boolean>(false)
|
const [isIntersecting, setIntersecting] = useState<boolean>(false)
|
||||||
|
|
||||||
@ -297,11 +296,11 @@ export default class ErrorBoundary extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line ts/ban-ts-comment
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
if (this.state.hasError)
|
if (this.state.hasError)
|
||||||
return <div>Oops! An error occurred. This could be due to an ECharts runtime error or invalid SVG content. <br />(see the browser console for more information)</div>
|
return <div>Oops! An error occurred. This could be due to an ECharts runtime error or invalid SVG content. <br />(see the browser console for more information)</div>
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line ts/ban-ts-comment
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
return this.props.children
|
return this.props.children
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ const Flowchart = React.forwardRef((props: {
|
|||||||
const chartId = useRef(`flowchart_${CryptoJS.MD5(props.PrimitiveCode).toString()}`)
|
const chartId = useRef(`flowchart_${CryptoJS.MD5(props.PrimitiveCode).toString()}`)
|
||||||
const prevPrimitiveCode = usePrevious(props.PrimitiveCode)
|
const prevPrimitiveCode = usePrevious(props.PrimitiveCode)
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const timeRef = useRef<NodeJS.Timeout>()
|
const timeRef = useRef<number>()
|
||||||
const [errMsg, setErrMsg] = useState('')
|
const [errMsg, setErrMsg] = useState('')
|
||||||
|
|
||||||
const renderFlowchart = async (PrimitiveCode: string) => {
|
const renderFlowchart = async (PrimitiveCode: string) => {
|
||||||
@ -74,15 +74,15 @@ const Flowchart = React.forwardRef((props: {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (timeRef.current)
|
if (timeRef.current)
|
||||||
clearTimeout(timeRef.current)
|
window.clearTimeout(timeRef.current)
|
||||||
|
|
||||||
timeRef.current = setTimeout(() => {
|
timeRef.current = window.setTimeout(() => {
|
||||||
renderFlowchart(props.PrimitiveCode)
|
renderFlowchart(props.PrimitiveCode)
|
||||||
}, 300)
|
}, 300)
|
||||||
}, [props.PrimitiveCode])
|
}, [props.PrimitiveCode])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line ts/ban-ts-comment
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
<div ref={ref}>
|
<div ref={ref}>
|
||||||
{
|
{
|
||||||
@ -108,4 +108,6 @@ const Flowchart = React.forwardRef((props: {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Flowchart.displayName = 'Flowchart'
|
||||||
|
|
||||||
export default Flowchart
|
export default Flowchart
|
||||||
|
@ -34,15 +34,15 @@ export default function CustomPopover({
|
|||||||
disabled = false,
|
disabled = false,
|
||||||
}: IPopover) {
|
}: IPopover) {
|
||||||
const buttonRef = useRef<HTMLButtonElement>(null)
|
const buttonRef = useRef<HTMLButtonElement>(null)
|
||||||
const timeOutRef = useRef<NodeJS.Timeout | null>(null)
|
const timeOutRef = useRef<number | null>(null)
|
||||||
|
|
||||||
const onMouseEnter = (isOpen: boolean) => {
|
const onMouseEnter = (isOpen: boolean) => {
|
||||||
timeOutRef.current && clearTimeout(timeOutRef.current)
|
timeOutRef.current && window.clearTimeout(timeOutRef.current)
|
||||||
!isOpen && buttonRef.current?.click()
|
!isOpen && buttonRef.current?.click()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onMouseLeave = (isOpen: boolean) => {
|
const onMouseLeave = (isOpen: boolean) => {
|
||||||
timeOutRef.current = setTimeout(() => {
|
timeOutRef.current = window.setTimeout(() => {
|
||||||
isOpen && buttonRef.current?.click()
|
isOpen && buttonRef.current?.click()
|
||||||
}, timeoutDuration)
|
}, timeoutDuration)
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { EditorConfig, NodeKey, SerializedTextNode } from 'lexical'
|
import type { EditorConfig, SerializedTextNode } from 'lexical'
|
||||||
import { $createTextNode, TextNode } from 'lexical'
|
import { $createTextNode, TextNode } from 'lexical'
|
||||||
|
|
||||||
export class CustomTextNode extends TextNode {
|
export class CustomTextNode extends TextNode {
|
||||||
@ -10,9 +10,9 @@ export class CustomTextNode extends TextNode {
|
|||||||
return new CustomTextNode(node.__text, node.__key)
|
return new CustomTextNode(node.__text, node.__key)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(text: string, key?: NodeKey) {
|
// constructor(text: string, key?: NodeKey) {
|
||||||
super(text, key)
|
// super(text, key)
|
||||||
}
|
// }
|
||||||
|
|
||||||
createDOM(config: EditorConfig) {
|
createDOM(config: EditorConfig) {
|
||||||
const dom = super.createDOM(config)
|
const dom = super.createDOM(config)
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import type {
|
import type {
|
||||||
EditorConfig,
|
EditorConfig,
|
||||||
LexicalNode,
|
LexicalNode,
|
||||||
NodeKey,
|
|
||||||
SerializedTextNode,
|
SerializedTextNode,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
import {
|
import {
|
||||||
@ -18,9 +17,9 @@ export class VariableValueBlockNode extends TextNode {
|
|||||||
return new VariableValueBlockNode(node.__text, node.__key)
|
return new VariableValueBlockNode(node.__text, node.__key)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(text: string, key?: NodeKey) {
|
// constructor(text: string, key?: NodeKey) {
|
||||||
super(text, key)
|
// super(text, key)
|
||||||
}
|
// }
|
||||||
|
|
||||||
createDOM(config: EditorConfig): HTMLElement {
|
createDOM(config: EditorConfig): HTMLElement {
|
||||||
const element = super.createDOM(config)
|
const element = super.createDOM(config)
|
||||||
|
@ -30,7 +30,7 @@ const TagManagementModal = ({ show, type }: TagManagementModalProps) => {
|
|||||||
setTagList(res)
|
setTagList(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
const [pending, setPending] = useState<Boolean>(false)
|
const [pending, setPending] = useState<boolean>(false)
|
||||||
const [name, setName] = useState<string>('')
|
const [name, setName] = useState<string>('')
|
||||||
const createNewTag = async () => {
|
const createNewTag = async () => {
|
||||||
if (!name)
|
if (!name)
|
||||||
|
@ -54,7 +54,7 @@ const Panel = (props: PanelProps) => {
|
|||||||
return tagList.filter(tag => tag.type === type && !value.includes(tag.id) && tag.name.includes(keywords))
|
return tagList.filter(tag => tag.type === type && !value.includes(tag.id) && tag.name.includes(keywords))
|
||||||
}, [type, tagList, value, keywords])
|
}, [type, tagList, value, keywords])
|
||||||
|
|
||||||
const [creating, setCreating] = useState<Boolean>(false)
|
const [creating, setCreating] = useState<boolean>(false)
|
||||||
const createNewTag = async () => {
|
const createNewTag = async () => {
|
||||||
if (!keywords)
|
if (!keywords)
|
||||||
return
|
return
|
||||||
|
@ -78,7 +78,7 @@ const TagItemEditor: FC<TagItemEditorProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const [showRemoveModal, setShowRemoveModal] = useState(false)
|
const [showRemoveModal, setShowRemoveModal] = useState(false)
|
||||||
const [pending, setPending] = useState<Boolean>(false)
|
const [pending, setPending] = useState<boolean>(false)
|
||||||
const removeTag = async (tagID: string) => {
|
const removeTag = async (tagID: string) => {
|
||||||
if (pending)
|
if (pending)
|
||||||
return
|
return
|
||||||
|
@ -21,7 +21,7 @@ import VectorSpaceFull from '@/app/components/billing/vector-space-full'
|
|||||||
type IStepOneProps = {
|
type IStepOneProps = {
|
||||||
datasetId?: string
|
datasetId?: string
|
||||||
dataSourceType?: DataSourceType
|
dataSourceType?: DataSourceType
|
||||||
dataSourceTypeDisable: Boolean
|
dataSourceTypeDisable: boolean
|
||||||
hasConnection: boolean
|
hasConnection: boolean
|
||||||
onSetting: () => void
|
onSetting: () => void
|
||||||
files: FileItem[]
|
files: FileItem[]
|
||||||
|
@ -28,7 +28,7 @@ import Loading from '@/app/components/base/loading'
|
|||||||
import FloatRightContainer from '@/app/components/base/float-right-container'
|
import FloatRightContainer from '@/app/components/base/float-right-container'
|
||||||
import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config'
|
import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config'
|
||||||
import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/economical-retrieval-method-config'
|
import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/economical-retrieval-method-config'
|
||||||
import { type RetrievalConfig } from '@/types/app'
|
import type { RetrievalConfig } from '@/types/app'
|
||||||
import { ensureRerankModelSelected, isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'
|
import { ensureRerankModelSelected, isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'
|
||||||
import Toast from '@/app/components/base/toast'
|
import Toast from '@/app/components/base/toast'
|
||||||
import { formatNumber } from '@/utils/format'
|
import { formatNumber } from '@/utils/format'
|
||||||
@ -202,7 +202,7 @@ const StepTwo = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fetchFileIndexingEstimate = async (docForm = DocForm.TEXT, language?: string) => {
|
const fetchFileIndexingEstimate = async (docForm = DocForm.TEXT, language?: string) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
const res = await didFetchFileIndexingEstimate(getFileIndexingEstimateParams(docForm, language)!)
|
const res = await didFetchFileIndexingEstimate(getFileIndexingEstimateParams(docForm, language)!)
|
||||||
if (segmentationType === SegmentType.CUSTOM)
|
if (segmentationType === SegmentType.CUSTOM)
|
||||||
setCustomFileIndexingEstimate(res)
|
setCustomFileIndexingEstimate(res)
|
||||||
@ -344,7 +344,7 @@ const StepTwo = ({
|
|||||||
doc_form: docForm,
|
doc_form: docForm,
|
||||||
doc_language: docLanguage,
|
doc_language: docLanguage,
|
||||||
process_rule: getProcessRule(),
|
process_rule: getProcessRule(),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
retrieval_model: retrievalConfig, // Readonly. If want to changed, just go to settings page.
|
retrieval_model: retrievalConfig, // Readonly. If want to changed, just go to settings page.
|
||||||
embedding_model: embeddingModel.model, // Readonly
|
embedding_model: embeddingModel.model, // Readonly
|
||||||
embedding_model_provider: embeddingModel.provider, // Readonly
|
embedding_model_provider: embeddingModel.provider, // Readonly
|
||||||
@ -357,7 +357,7 @@ const StepTwo = ({
|
|||||||
rerankDefaultModel,
|
rerankDefaultModel,
|
||||||
isRerankDefaultModelValid: !!isRerankDefaultModelValid,
|
isRerankDefaultModelValid: !!isRerankDefaultModelValid,
|
||||||
rerankModelList,
|
rerankModelList,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
retrievalConfig,
|
retrievalConfig,
|
||||||
indexMethod: indexMethod as string,
|
indexMethod: indexMethod as string,
|
||||||
})
|
})
|
||||||
@ -367,7 +367,7 @@ const StepTwo = ({
|
|||||||
}
|
}
|
||||||
const postRetrievalConfig = ensureRerankModelSelected({
|
const postRetrievalConfig = ensureRerankModelSelected({
|
||||||
rerankDefaultModel: rerankDefaultModel!,
|
rerankDefaultModel: rerankDefaultModel!,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
retrievalConfig,
|
retrievalConfig,
|
||||||
indexMethod: indexMethod as string,
|
indexMethod: indexMethod as string,
|
||||||
})
|
})
|
||||||
|
@ -87,4 +87,6 @@ const Form: FC<FormProps> = React.memo(({
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Form.displayName = 'Form'
|
||||||
|
|
||||||
export default Form
|
export default Form
|
||||||
|
@ -18,7 +18,7 @@ import { ApiConnectionMod } from '@/app/components/base/icons/src/vender/solid/d
|
|||||||
import { updateDatasetSetting } from '@/service/datasets'
|
import { updateDatasetSetting } from '@/service/datasets'
|
||||||
import type { DataSetListResponse } from '@/models/datasets'
|
import type { DataSetListResponse } from '@/models/datasets'
|
||||||
import DatasetDetailContext from '@/context/dataset-detail'
|
import DatasetDetailContext from '@/context/dataset-detail'
|
||||||
import { type RetrievalConfig } from '@/types/app'
|
import type { RetrievalConfig } from '@/types/app'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
import { ensureRerankModelSelected, isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'
|
import { ensureRerankModelSelected, isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'
|
||||||
import ModelSelector from '@/app/components/header/account-setting/model-provider-page/model-selector'
|
import ModelSelector from '@/app/components/header/account-setting/model-provider-page/model-selector'
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
RiRobot2Line,
|
RiRobot2Line,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import Nav from '../nav'
|
import Nav from '../nav'
|
||||||
import { type NavItem } from '../nav/nav-selector'
|
import type { NavItem } from '../nav/nav-selector'
|
||||||
import { fetchAppList } from '@/service/apps'
|
import { fetchAppList } from '@/service/apps'
|
||||||
import CreateAppTemplateDialog from '@/app/components/app/create-app-dialog'
|
import CreateAppTemplateDialog from '@/app/components/app/create-app-dialog'
|
||||||
import CreateAppModal from '@/app/components/app/create-app-modal'
|
import CreateAppModal from '@/app/components/app/create-app-modal'
|
||||||
|
@ -132,9 +132,9 @@ const TextGeneration: FC<IMainProps> = ({
|
|||||||
const handleSend = () => {
|
const handleSend = () => {
|
||||||
setIsCallBatchAPI(false)
|
setIsCallBatchAPI(false)
|
||||||
setControlSend(Date.now())
|
setControlSend(Date.now())
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
setAllTaskList([]) // clear batch task running status
|
setAllTaskList([]) // clear batch task running status
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
showResSidebar()
|
showResSidebar()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ const TextGeneration: FC<IMainProps> = ({
|
|||||||
setControlSend(Date.now())
|
setControlSend(Date.now())
|
||||||
// clear run once task status
|
// clear run once task status
|
||||||
setControlStopResponding(Date.now())
|
setControlStopResponding(Date.now())
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
showResSidebar()
|
showResSidebar()
|
||||||
}
|
}
|
||||||
const handleCompleted = (completionRes: string, taskId?: number, isSuccess?: boolean) => {
|
const handleCompleted = (completionRes: string, taskId?: number, isSuccess?: boolean) => {
|
||||||
|
@ -37,7 +37,7 @@ const WorkflowToolAsModal: FC<Props> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const [showEmojiPicker, setShowEmojiPicker] = useState<Boolean>(false)
|
const [showEmojiPicker, setShowEmojiPicker] = useState<boolean>(false)
|
||||||
const [emoji, setEmoji] = useState<Emoji>(payload.icon)
|
const [emoji, setEmoji] = useState<Emoji>(payload.icon)
|
||||||
const [label, setLabel] = useState<string>(payload.label)
|
const [label, setLabel] = useState<string>(payload.label)
|
||||||
const [name, setName] = useState(payload.name)
|
const [name, setName] = useState(payload.name)
|
||||||
|
@ -582,7 +582,7 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.LLM: {
|
case BlockEnum.LLM: {
|
||||||
const payload = (data as LLMNodeType)
|
const payload = data as LLMNodeType
|
||||||
const isChatModel = payload.model?.mode === 'chat'
|
const isChatModel = payload.model?.mode === 'chat'
|
||||||
let prompts: string[] = []
|
let prompts: string[] = []
|
||||||
if (isChatModel) {
|
if (isChatModel) {
|
||||||
@ -620,19 +620,19 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.QuestionClassifier: {
|
case BlockEnum.QuestionClassifier: {
|
||||||
const payload = (data as QuestionClassifierNodeType)
|
const payload = data as QuestionClassifierNodeType
|
||||||
res = [payload.query_variable_selector]
|
res = [payload.query_variable_selector]
|
||||||
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
||||||
res.push(...varInInstructions)
|
res.push(...varInInstructions)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.HttpRequest: {
|
case BlockEnum.HttpRequest: {
|
||||||
const payload = (data as HttpNodeType)
|
const payload = data as HttpNodeType
|
||||||
res = matchNotSystemVars([payload.url, payload.headers, payload.params, payload.body.data])
|
res = matchNotSystemVars([payload.url, payload.headers, payload.params, payload.body.data])
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case BlockEnum.Tool: {
|
case BlockEnum.Tool: {
|
||||||
const payload = (data as ToolNodeType)
|
const payload = data as ToolNodeType
|
||||||
const mixVars = matchNotSystemVars(Object.keys(payload.tool_parameters)?.filter(key => payload.tool_parameters[key].type === ToolVarType.mixed).map(key => payload.tool_parameters[key].value) as string[])
|
const mixVars = matchNotSystemVars(Object.keys(payload.tool_parameters)?.filter(key => payload.tool_parameters[key].type === ToolVarType.mixed).map(key => payload.tool_parameters[key].value) as string[])
|
||||||
const vars = Object.keys(payload.tool_parameters).filter(key => payload.tool_parameters[key].type === ToolVarType.variable).map(key => payload.tool_parameters[key].value as string) || []
|
const vars = Object.keys(payload.tool_parameters).filter(key => payload.tool_parameters[key].type === ToolVarType.variable).map(key => payload.tool_parameters[key].value as string) || []
|
||||||
res = [...(mixVars as ValueSelector[]), ...(vars as any)]
|
res = [...(mixVars as ValueSelector[]), ...(vars as any)]
|
||||||
@ -650,7 +650,7 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BlockEnum.ParameterExtractor: {
|
case BlockEnum.ParameterExtractor: {
|
||||||
const payload = (data as ParameterExtractorNodeType)
|
const payload = data as ParameterExtractorNodeType
|
||||||
res = [payload.query]
|
res = [payload.query]
|
||||||
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
||||||
res.push(...varInInstructions)
|
res.push(...varInInstructions)
|
||||||
@ -672,7 +672,7 @@ export const getNodeUsedVarPassToServerKey = (node: Node, valueSelector: ValueSe
|
|||||||
let res: string | string[] = ''
|
let res: string | string[] = ''
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BlockEnum.LLM: {
|
case BlockEnum.LLM: {
|
||||||
const payload = (data as LLMNodeType)
|
const payload = data as LLMNodeType
|
||||||
res = [`#${valueSelector.join('.')}#`]
|
res = [`#${valueSelector.join('.')}#`]
|
||||||
if (payload.context?.variable_selector.join('.') === valueSelector.join('.'))
|
if (payload.context?.variable_selector.join('.') === valueSelector.join('.'))
|
||||||
res.push('#context#')
|
res.push('#context#')
|
||||||
|
@ -127,7 +127,7 @@ const Item: FC<ItemProps> = ({
|
|||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
}}>
|
}}>
|
||||||
{isObj && (
|
{isObj && (
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
<ObjectChildren
|
<ObjectChildren
|
||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
title={title}
|
title={title}
|
||||||
|
@ -42,6 +42,7 @@ const { checkValid: checkVariableAssignerValid } = VariableAssigner
|
|||||||
const { checkValid: checkParameterExtractorValid } = ParameterExtractorDefault
|
const { checkValid: checkParameterExtractorValid } = ParameterExtractorDefault
|
||||||
const { checkValid: checkIterationValid } = IterationDefault
|
const { checkValid: checkIterationValid } = IterationDefault
|
||||||
|
|
||||||
|
// eslint-disable-next-line ts/no-unsafe-function-type
|
||||||
const checkValidFns: Record<BlockEnum, Function> = {
|
const checkValidFns: Record<BlockEnum, Function> = {
|
||||||
[BlockEnum.LLM]: checkLLMValid,
|
[BlockEnum.LLM]: checkLLMValid,
|
||||||
[BlockEnum.KnowledgeRetrieval]: checkKnowledgeRetrievalValid,
|
[BlockEnum.KnowledgeRetrieval]: checkKnowledgeRetrievalValid,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import produce from 'immer'
|
import produce from 'immer'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { type OutputVar } from '../../code/types'
|
import type { OutputVar } from '../../code/types'
|
||||||
import type { ValueSelector } from '@/app/components/workflow/types'
|
import type { ValueSelector } from '@/app/components/workflow/types'
|
||||||
import { VarType } from '@/app/components/workflow/types'
|
import { VarType } from '@/app/components/workflow/types'
|
||||||
import {
|
import {
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react'
|
|||||||
import { useNodes } from 'reactflow'
|
import { useNodes } from 'reactflow'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import NodeVariableItem from '../variable-assigner/components/node-variable-item'
|
import NodeVariableItem from '../variable-assigner/components/node-variable-item'
|
||||||
import { type AssignerNodeType } from './types'
|
import type { AssignerNodeType } from './types'
|
||||||
import { isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils'
|
import { isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils'
|
||||||
import { BlockEnum, type Node, type NodeProps } from '@/app/components/workflow/types'
|
import { BlockEnum, type Node, type NodeProps } from '@/app/components/workflow/types'
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import useConfig from './use-config'
|
|||||||
import { WriteMode } from './types'
|
import { WriteMode } from './types'
|
||||||
import type { AssignerNodeType } from './types'
|
import type { AssignerNodeType } from './types'
|
||||||
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
||||||
import { type NodePanelProps } from '@/app/components/workflow/types'
|
import type { NodePanelProps } from '@/app/components/workflow/types'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
|
|
||||||
const i18nPrefix = 'workflow.nodes.assigner'
|
const i18nPrefix = 'workflow.nodes.assigner'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { BlockEnum } from '../../types'
|
import { BlockEnum } from '../../types'
|
||||||
import type { NodeDefault } from '../../types'
|
import type { NodeDefault } from '../../types'
|
||||||
import { type EndNodeType } from './types'
|
import type { EndNodeType } from './types'
|
||||||
import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/constants'
|
import { ALL_CHAT_AVAILABLE_BLOCKS, ALL_COMPLETION_AVAILABLE_BLOCKS } from '@/app/components/workflow/constants'
|
||||||
|
|
||||||
const nodeDefault: NodeDefault<EndNodeType> = {
|
const nodeDefault: NodeDefault<EndNodeType> = {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import useConfig from './use-config'
|
import useConfig from './use-config'
|
||||||
@ -6,7 +6,7 @@ import type { EndNodeType } from './types'
|
|||||||
import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list'
|
import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list'
|
||||||
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
||||||
import AddButton from '@/app/components/base/button/add-button'
|
import AddButton from '@/app/components/base/button/add-button'
|
||||||
import { type NodePanelProps } from '@/app/components/workflow/types'
|
import type { NodePanelProps } from '@/app/components/workflow/types'
|
||||||
|
|
||||||
const i18nPrefix = 'workflow.nodes.end'
|
const i18nPrefix = 'workflow.nodes.end'
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ const EditBody: FC<Props> = ({
|
|||||||
type: newType,
|
type: newType,
|
||||||
data: '',
|
data: '',
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
setBody([])
|
setBody([])
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [onChange])
|
}, [onChange])
|
||||||
|
@ -162,7 +162,7 @@ const useConfig = (id: string, payload: ToolNodeType) => {
|
|||||||
const [inputVarValues, doSetInputVarValues] = useState<Record<string, any>>({})
|
const [inputVarValues, doSetInputVarValues] = useState<Record<string, any>>({})
|
||||||
const setInputVarValues = (value: Record<string, any>) => {
|
const setInputVarValues = (value: Record<string, any>) => {
|
||||||
doSetInputVarValues(value)
|
doSetInputVarValues(value)
|
||||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
// eslint-disable-next-line ts/no-use-before-define
|
||||||
setRunInputData(value)
|
setRunInputData(value)
|
||||||
}
|
}
|
||||||
// fill single run form variable with constant value first time
|
// fill single run form variable with constant value first time
|
||||||
|
@ -7,7 +7,7 @@ import useConfig from './use-config'
|
|||||||
import type { VariableAssignerNodeType } from './types'
|
import type { VariableAssignerNodeType } from './types'
|
||||||
import VarGroupItem from './components/var-group-item'
|
import VarGroupItem from './components/var-group-item'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
import { type NodePanelProps } from '@/app/components/workflow/types'
|
import type { NodePanelProps } from '@/app/components/workflow/types'
|
||||||
import Split from '@/app/components/workflow/nodes/_base/components/split'
|
import Split from '@/app/components/workflow/nodes/_base/components/split'
|
||||||
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
||||||
import Switch from '@/app/components/base/switch'
|
import Switch from '@/app/components/base/switch'
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react'
|
|||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
import Select from '@/app/components/base/select/locale'
|
import Select from '@/app/components/base/select/locale'
|
||||||
import { languages } from '@/i18n/language'
|
import { languages } from '@/i18n/language'
|
||||||
import { type Locale } from '@/i18n'
|
import type { Locale } from '@/i18n'
|
||||||
import I18n from '@/context/i18n'
|
import I18n from '@/context/i18n'
|
||||||
import LogoSite from '@/app/components/base/logo/logo-site'
|
import LogoSite from '@/app/components/base/logo/logo-site'
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ export const useModalContext = () => useContext(ModalContext)
|
|||||||
|
|
||||||
// Adding a dangling comma to avoid the generic parsing issue in tsx, see:
|
// Adding a dangling comma to avoid the generic parsing issue in tsx, see:
|
||||||
// https://github.com/microsoft/TypeScript/issues/15713
|
// https://github.com/microsoft/TypeScript/issues/15713
|
||||||
// eslint-disable-next-line @typescript-eslint/comma-dangle
|
|
||||||
export const useModalContextSelector = <T,>(selector: (state: ModalContextState) => T): T =>
|
export const useModalContextSelector = <T,>(selector: (state: ModalContextState) => T): T =>
|
||||||
useContextSelector(ModalContext, selector)
|
useContextSelector(ModalContext, selector)
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ export const useProviderContext = () => useContext(ProviderContext)
|
|||||||
|
|
||||||
// Adding a dangling comma to avoid the generic parsing issue in tsx, see:
|
// Adding a dangling comma to avoid the generic parsing issue in tsx, see:
|
||||||
// https://github.com/microsoft/TypeScript/issues/15713
|
// https://github.com/microsoft/TypeScript/issues/15713
|
||||||
// eslint-disable-next-line @typescript-eslint/comma-dangle
|
|
||||||
export const useProviderContextSelector = <T,>(selector: (state: ProviderContextState) => T): T =>
|
export const useProviderContextSelector = <T,>(selector: (state: ProviderContextState) => T): T =>
|
||||||
useContextSelector(ProviderContext, selector)
|
useContextSelector(ProviderContext, selector)
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ const translation = {
|
|||||||
welcome: 'आपका स्वागत है',
|
welcome: 'आपका स्वागत है',
|
||||||
appUnavailable: 'ऐप उपलब्ध नहीं है',
|
appUnavailable: 'ऐप उपलब्ध नहीं है',
|
||||||
appUnknownError: 'अज्ञात त्रुटि, कृपया पुनः प्रयास करें',
|
appUnknownError: 'अज्ञात त्रुटि, कृपया पुनः प्रयास करें',
|
||||||
|
// @ts-expect-error TODO: fix this
|
||||||
|
// eslint-disable-next-line no-dupe-keys
|
||||||
appUnknownError: 'ऐप अनुपलब्ध है',
|
appUnknownError: 'ऐप अनुपलब्ध है',
|
||||||
},
|
},
|
||||||
chat: {
|
chat: {
|
||||||
|
@ -559,7 +559,8 @@ export const ssePost = (
|
|||||||
}
|
}
|
||||||
onData?.(str, isFirstMessage, moreInfo)
|
onData?.(str, isFirstMessage, moreInfo)
|
||||||
}, onCompleted, onThought, onMessageEnd, onMessageReplace, onFile, onWorkflowStarted, onWorkflowFinished, onNodeStarted, onNodeFinished, onIterationStart, onIterationNext, onIterationFinish, onParallelBranchStarted, onParallelBranchFinished, onTextChunk, onTTSChunk, onTTSEnd, onTextReplace)
|
}, onCompleted, onThought, onMessageEnd, onMessageReplace, onFile, onWorkflowStarted, onWorkflowFinished, onNodeStarted, onNodeFinished, onIterationStart, onIterationNext, onIterationFinish, onParallelBranchStarted, onParallelBranchFinished, onTextChunk, onTTSChunk, onTTSEnd, onTextReplace)
|
||||||
}).catch((e) => {
|
})
|
||||||
|
.catch((e) => {
|
||||||
if (e.toString() !== 'AbortError: The user aborted a request.' && !e.toString().errorMessage.includes('TypeError: Cannot assign to read only property'))
|
if (e.toString() !== 'AbortError: The user aborted a request.' && !e.toString().errorMessage.includes('TypeError: Cannot assign to read only property'))
|
||||||
Toast.notify({ type: 'error', message: e })
|
Toast.notify({ type: 'error', message: e })
|
||||||
onError?.(e)
|
onError?.(e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user