mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
fix: include app id in automatic generation requests (#32138)
This commit is contained in:
@ -19,19 +19,21 @@ import { useBoolean, useSessionStorageState } from 'ahooks'
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { useShallow } from 'zustand/react/shallow'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import Confirm from '@/app/components/base/confirm'
|
import Confirm from '@/app/components/base/confirm'
|
||||||
import { Generator } from '@/app/components/base/icons/src/vender/other'
|
import { Generator } from '@/app/components/base/icons/src/vender/other'
|
||||||
import Loading from '@/app/components/base/loading'
|
|
||||||
|
|
||||||
|
import Loading from '@/app/components/base/loading'
|
||||||
import Modal from '@/app/components/base/modal'
|
import Modal from '@/app/components/base/modal'
|
||||||
import Toast from '@/app/components/base/toast'
|
import Toast from '@/app/components/base/toast'
|
||||||
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
|
||||||
|
|
||||||
|
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
||||||
import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
|
import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
|
||||||
import { generateBasicAppFirstTimeRule, generateRule } from '@/service/debug'
|
import { generateBasicAppFirstTimeRule, generateRule } from '@/service/debug'
|
||||||
import { useGenerateRuleTemplate } from '@/service/use-apps'
|
import { useGenerateRuleTemplate } from '@/service/use-apps'
|
||||||
|
import { useStore } from '../../../store'
|
||||||
import IdeaOutput from './idea-output'
|
import IdeaOutput from './idea-output'
|
||||||
import InstructionEditorInBasic from './instruction-editor'
|
import InstructionEditorInBasic from './instruction-editor'
|
||||||
import InstructionEditorInWorkflow from './instruction-editor-in-workflow'
|
import InstructionEditorInWorkflow from './instruction-editor-in-workflow'
|
||||||
@ -83,6 +85,9 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
|
|||||||
onFinished,
|
onFinished,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const { appDetail } = useStore(useShallow(state => ({
|
||||||
|
appDetail: state.appDetail,
|
||||||
|
})))
|
||||||
const localModel = localStorage.getItem('auto-gen-model')
|
const localModel = localStorage.getItem('auto-gen-model')
|
||||||
? JSON.parse(localStorage.getItem('auto-gen-model') as string) as Model
|
? JSON.parse(localStorage.getItem('auto-gen-model') as string) as Model
|
||||||
: null
|
: null
|
||||||
@ -235,6 +240,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
|
|||||||
instruction,
|
instruction,
|
||||||
model_config: model,
|
model_config: model,
|
||||||
no_variable: false,
|
no_variable: false,
|
||||||
|
app_id: appDetail?.id,
|
||||||
})
|
})
|
||||||
apiRes = {
|
apiRes = {
|
||||||
...res,
|
...res,
|
||||||
@ -256,6 +262,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
|
|||||||
instruction,
|
instruction,
|
||||||
ideal_output: ideaOutput,
|
ideal_output: ideaOutput,
|
||||||
model_config: model,
|
model_config: model,
|
||||||
|
app_id: appDetail?.id,
|
||||||
})
|
})
|
||||||
apiRes = res
|
apiRes = res
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user