mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Fix: Fixed the issue where the thinking mode on the chat page could not be turned off #9789 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -102,8 +102,8 @@ export function LlmSettingFieldItems({
|
||||
control={form.control}
|
||||
name={'parameter'}
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('freedom')}</FormLabel>
|
||||
<FormItem className="flex justify-between items-center">
|
||||
<FormLabel className="flex-1">{t('freedom')}</FormLabel>
|
||||
<FormControl>
|
||||
<Select
|
||||
{...field}
|
||||
@ -112,7 +112,7 @@ export function LlmSettingFieldItems({
|
||||
field.onChange(val);
|
||||
}}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectTrigger className="flex-1 !m-0">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
.messageTextDark {
|
||||
.chunkText();
|
||||
.messageTextBase();
|
||||
background-color: #1668dc;
|
||||
word-break: break-word;
|
||||
:global(section.think) {
|
||||
color: rgb(166, 166, 166);
|
||||
|
||||
@ -10,6 +10,8 @@ export interface PromptConfig {
|
||||
keyword: boolean;
|
||||
refine_multiturn: boolean;
|
||||
use_kg: boolean;
|
||||
reasoning?: boolean;
|
||||
cross_languages?: Array<string>;
|
||||
}
|
||||
|
||||
export interface Parameter {
|
||||
|
||||
@ -13,13 +13,6 @@ import {
|
||||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useFormContext } from 'react-hook-form';
|
||||
@ -28,17 +21,6 @@ export default function ChatBasicSetting() {
|
||||
const { t } = useTranslate('chat');
|
||||
const form = useFormContext();
|
||||
|
||||
const languageOptions = [
|
||||
{ value: 'English', label: 'English' },
|
||||
{ value: 'Chinese', label: 'Chinese' },
|
||||
{ value: 'Spanish', label: 'Spanish' },
|
||||
{ value: 'French', label: 'French' },
|
||||
{ value: 'German', label: 'German' },
|
||||
{ value: 'Japanese', label: 'Japanese' },
|
||||
{ value: 'Korean', label: 'Korean' },
|
||||
{ value: 'Vietnamese', label: 'Vietnamese' },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
<FormField
|
||||
@ -69,30 +51,6 @@ export default function ChatBasicSetting() {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="language"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('language')}</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={t('common.languagePlaceholder')} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
{languageOptions.map((option) => (
|
||||
<SelectItem key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="description"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { CrossLanguageFormField } from '@/components/cross-language-form-field';
|
||||
import { RerankFormFields } from '@/components/rerank';
|
||||
import { SimilaritySliderFormField } from '@/components/similarity-slider';
|
||||
import { SwitchFormField } from '@/components/switch-fom-field';
|
||||
@ -30,7 +31,7 @@ export function ChatPromptEngine() {
|
||||
<FormItem>
|
||||
<FormLabel>{t('system')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea {...field} />
|
||||
<Textarea {...field} rows={8} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@ -43,7 +44,13 @@ export function ChatPromptEngine() {
|
||||
label={t('multiTurn')}
|
||||
></SwitchFormField>
|
||||
<UseKnowledgeGraphFormField name="prompt_config.use_kg"></UseKnowledgeGraphFormField>
|
||||
<SwitchFormField
|
||||
name={'prompt_config.reasoning'}
|
||||
label={t('reasoning')}
|
||||
tooltip={t('reasoningTip')}
|
||||
></SwitchFormField>
|
||||
<RerankFormFields></RerankFormFields>
|
||||
<CrossLanguageFormField></CrossLanguageFormField>
|
||||
<DynamicVariableForm></DynamicVariableForm>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -36,7 +36,6 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||
defaultValues: {
|
||||
name: '',
|
||||
icon: '',
|
||||
language: 'English',
|
||||
description: '',
|
||||
kb_ids: [],
|
||||
prompt_config: {
|
||||
@ -47,6 +46,8 @@ export function ChatSettings({ switchSettingVisible }: ChatSettingsProps) {
|
||||
refine_multiturn: true,
|
||||
system: '',
|
||||
parameters: [],
|
||||
reasoning: false,
|
||||
cross_languages: [],
|
||||
},
|
||||
top_n: 8,
|
||||
vector_similarity_weight: 0.2,
|
||||
|
||||
@ -41,6 +41,11 @@ export function DynamicVariableForm() {
|
||||
<Plus />
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex gap-2 pr-12 text-text-secondary text-xs">
|
||||
<span className="flex-1">Key</span>
|
||||
<span className="w-3"></span>
|
||||
<span className="flex-1">Optional</span>
|
||||
</div>
|
||||
<div className="space-y-5">
|
||||
{fields.map((field, index) => {
|
||||
const typeField = `${name}.${index}.key`;
|
||||
|
||||
@ -28,14 +28,13 @@ export function useChatSettingSchema() {
|
||||
}),
|
||||
),
|
||||
tavily_api_key: z.string().optional(),
|
||||
reasoning: z.boolean().optional(),
|
||||
cross_languages: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
const formSchema = z.object({
|
||||
name: z.string().min(1, { message: t('assistantNameMessage') }),
|
||||
icon: z.string(),
|
||||
language: z.string().min(1, {
|
||||
message: t('languageMessage'),
|
||||
}),
|
||||
description: z.string().optional(),
|
||||
kb_ids: z.array(z.string()).min(0, {
|
||||
message: t('knowledgeBasesMessage'),
|
||||
|
||||
@ -70,7 +70,12 @@ export function Sessions({
|
||||
/>
|
||||
</section>
|
||||
<div className="flex justify-between items-center mb-4 pt-10">
|
||||
<span className="text-base font-bold">Conversations</span>
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-base font-bold">Conversations</span>
|
||||
<span className="text-text-secondary text-xs">
|
||||
{conversationList.length}
|
||||
</span>
|
||||
</div>
|
||||
<Button variant={'ghost'} onClick={addTemporaryConversation}>
|
||||
<Plus></Plus>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user