Skip to content

Commit

Permalink
fixed model network search
Browse files Browse the repository at this point in the history
  • Loading branch information
greywen committed Dec 6, 2024
1 parent 16a4224 commit 371b435
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/FE/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
field: 'selectModel',
value: model,
});
handleUpdateUserModelConfig({
...userModelConfig,
enableSearch: model.allowSearch,
});
putUserChatModel(selectChat.id, model.modelId);
}}
/>
Expand All @@ -408,8 +412,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
{hasModel() && (
<div className="flex h-full flex-col space-y-4 rounded-lg border border-neutral-200 p-4 dark:border-neutral-600">
<ModelSelect />
{selectModel &&
selectModel.allowSystemPrompt &&
{selectModel?.allowSystemPrompt &&
userModelConfig?.prompt && (
<SystemPrompt
currentPrompt={userModelConfig?.prompt}
Expand All @@ -421,8 +424,8 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
onChangePrompt={onChangePrompt}
/>
)}
{userModelConfig?.temperature !== undefined &&
selectModel?.allowTemperature && (
{selectModel?.allowTemperature &&
userModelConfig?.temperature !== undefined && (
<TemperatureSlider
label={t('Temperature')}
min={0}
Expand All @@ -435,17 +438,18 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
}
/>
)}
{userModelConfig?.enableSearch != undefined && (
<EnableNetworkSearch
label={t('Internet Search')}
enable={userModelConfig.enableSearch}
onChange={(enableSearch) => {
handleUpdateUserModelConfig({
enableSearch,
});
}}
/>
)}
{selectModel?.allowSearch &&
userModelConfig?.enableSearch != undefined && (
<EnableNetworkSearch
label={t('Internet Search')}
enable={userModelConfig.enableSearch}
onChange={(enableSearch) => {
handleUpdateUserModelConfig({
enableSearch,
});
}}
/>
)}
{/* <Button
onClick={() => {
handleUpdateSettings('showChatSettingBar', true);
Expand Down

0 comments on commit 371b435

Please sign in to comment.