mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: Flexible Chat Configuration (#16293)
This commit is contained in:
@@ -19,10 +19,12 @@ import { useFormContext, useWatch } from 'react-hook-form';
|
||||
interface ChatBasicSettingProps {
|
||||
prefix?: string;
|
||||
option?: Record<string, any>;
|
||||
hideName?: boolean;
|
||||
}
|
||||
|
||||
export default function ChatBasicSetting({
|
||||
prefix = '',
|
||||
hideName = false,
|
||||
}: ChatBasicSettingProps) {
|
||||
const { t } = useTranslate('chat');
|
||||
const form = useFormContext();
|
||||
@@ -32,16 +34,20 @@ export default function ChatBasicSetting({
|
||||
name: prefixName(prefix, 'prompt_config.prologue'),
|
||||
});
|
||||
|
||||
const llmSettingPrefix = prefixName(prefix, 'llm_setting');
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
<AvatarNameDescription
|
||||
avatarField={prefixName(prefix, 'icon')}
|
||||
nameField={prefixName(prefix, 'name')}
|
||||
descriptionField={prefixName(prefix, 'description')}
|
||||
/>
|
||||
{hideName || (
|
||||
<AvatarNameDescription
|
||||
avatarField={prefixName(prefix, 'icon')}
|
||||
nameField={prefixName(prefix, 'name')}
|
||||
descriptionField={prefixName(prefix, 'description')}
|
||||
/>
|
||||
)}
|
||||
<LlmSettingFieldItems
|
||||
prefix="llm_setting"
|
||||
llmId="llm_id"
|
||||
prefix={llmSettingPrefix}
|
||||
llmId={prefixName(prefix, 'llm_id')}
|
||||
showCollapse
|
||||
></LlmSettingFieldItems>
|
||||
|
||||
|
||||
@@ -130,7 +130,9 @@ export function ChatPromptEngine({ prefix = '' }: ChatPromptEngineProps) {
|
||||
<TOCEnhanceFormField
|
||||
name={prefixName(prefix, 'prompt_config.toc_enhance')}
|
||||
></TOCEnhanceFormField>
|
||||
<TavilyFormField></TavilyFormField>
|
||||
<TavilyFormField
|
||||
name={prefixName(prefix, 'prompt_config.tavily_api_key')}
|
||||
></TavilyFormField>
|
||||
<MetadataFilter></MetadataFilter>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
||||
Reference in New Issue
Block a user