mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
Fix annotation reply settings (#7696)
This commit is contained in:
parent
bc3a8e0ca2
commit
693fe912f2
|
@ -280,7 +280,7 @@ const Annotation: FC<Props> = ({
|
||||||
onSave={async (embeddingModel, score) => {
|
onSave={async (embeddingModel, score) => {
|
||||||
if (
|
if (
|
||||||
embeddingModel.embedding_model_name !== annotationConfig?.embedding_model?.embedding_model_name
|
embeddingModel.embedding_model_name !== annotationConfig?.embedding_model?.embedding_model_name
|
||||||
&& embeddingModel.embedding_provider_name !== annotationConfig?.embedding_model?.embedding_provider_name
|
|| embeddingModel.embedding_provider_name !== annotationConfig?.embedding_model?.embedding_provider_name
|
||||||
) {
|
) {
|
||||||
const { job_id: jobId }: any = await updateAnnotationStatus(appDetail.id, AnnotationEnableStatus.enable, embeddingModel, score)
|
const { job_id: jobId }: any = await updateAnnotationStatus(appDetail.id, AnnotationEnableStatus.enable, embeddingModel, score)
|
||||||
await ensureJobCompleted(jobId, AnnotationEnableStatus.enable)
|
await ensureJobCompleted(jobId, AnnotationEnableStatus.enable)
|
||||||
|
|
|
@ -98,7 +98,7 @@ const AnnotationReplyConfig: FC<Props> = ({
|
||||||
let isEmbeddingModelChanged = false
|
let isEmbeddingModelChanged = false
|
||||||
if (
|
if (
|
||||||
embeddingModel.embedding_model_name !== annotationConfig.embedding_model.embedding_model_name
|
embeddingModel.embedding_model_name !== annotationConfig.embedding_model.embedding_model_name
|
||||||
&& embeddingModel.embedding_provider_name !== annotationConfig.embedding_model.embedding_provider_name
|
|| embeddingModel.embedding_provider_name !== annotationConfig.embedding_model.embedding_provider_name
|
||||||
) {
|
) {
|
||||||
await onEmbeddingChange(embeddingModel)
|
await onEmbeddingChange(embeddingModel)
|
||||||
isEmbeddingModelChanged = true
|
isEmbeddingModelChanged = true
|
||||||
|
|
|
@ -32,7 +32,7 @@ const Toolbox: FC<ToolboxProps> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(showAnnotation || true) && (
|
showAnnotation && (
|
||||||
<Annotation
|
<Annotation
|
||||||
onEmbeddingChange={onEmbeddingChange}
|
onEmbeddingChange={onEmbeddingChange}
|
||||||
onScoreChange={onScoreChange}
|
onScoreChange={onScoreChange}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
|
@ -23,10 +23,14 @@ const LogAnnotation: FC<Props> = ({
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const appDetail = useAppStore(state => state.appDetail)
|
const appDetail = useAppStore(state => state.appDetail)
|
||||||
|
|
||||||
const options = [
|
const options = useMemo(() => {
|
||||||
{ value: PageType.log, text: t('appLog.title') },
|
if (appDetail?.mode === 'completion')
|
||||||
{ value: PageType.annotation, text: t('appAnnotation.title') },
|
return [{ value: PageType.log, text: t('appLog.title') }]
|
||||||
]
|
return [
|
||||||
|
{ value: PageType.log, text: t('appLog.title') },
|
||||||
|
{ value: PageType.annotation, text: t('appAnnotation.title') },
|
||||||
|
]
|
||||||
|
}, [appDetail])
|
||||||
|
|
||||||
if (!appDetail) {
|
if (!appDetail) {
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user