mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 12:43:42 +08:00
feat: 添加联网搜索功能,更新相关配置和多语言支持
This commit is contained in:
@@ -48,6 +48,7 @@ import PluginIcon from "../icons/plugin.svg";
|
||||
import ShortcutkeyIcon from "../icons/shortcutkey.svg";
|
||||
import McpToolIcon from "../icons/tool.svg";
|
||||
import HeadphoneIcon from "../icons/headphone.svg";
|
||||
import NetWorkIcon from "../icons/network.svg";
|
||||
import {
|
||||
BOT_HELLO,
|
||||
ChatMessage,
|
||||
@@ -75,6 +76,7 @@ import {
|
||||
useMobileScreen,
|
||||
selectOrCopy,
|
||||
showPlugins,
|
||||
canUseNetWork,
|
||||
} from "../utils";
|
||||
|
||||
import { uploadImage as uploadImageRemote } from "@/app/utils/chat";
|
||||
@@ -510,6 +512,7 @@ export function ChatActions(props: {
|
||||
|
||||
// switch themes
|
||||
const theme = config.theme;
|
||||
const enableNetWork = config.modelConfig.enableNetWork;
|
||||
|
||||
function nextTheme() {
|
||||
const themes = [Theme.Auto, Theme.Light, Theme.Dark];
|
||||
@@ -519,6 +522,13 @@ export function ChatActions(props: {
|
||||
config.update((config) => (config.theme = nextTheme));
|
||||
}
|
||||
|
||||
function nextNetWork() {
|
||||
config.update(
|
||||
(config) =>
|
||||
(config.modelConfig.enableNetWork = !config.modelConfig.enableNetWork),
|
||||
);
|
||||
}
|
||||
|
||||
// stop all responses
|
||||
const couldStop = ChatControllerPool.hasPending();
|
||||
const stopAll = () => ChatControllerPool.stopAll();
|
||||
@@ -831,6 +841,16 @@ export function ChatActions(props: {
|
||||
/>
|
||||
)}
|
||||
{!isMobileScreen && <MCPAction />}
|
||||
|
||||
{canUseNetWork(currentModel) && (
|
||||
<ChatAction
|
||||
onClick={nextNetWork}
|
||||
text={
|
||||
Locale.Chat.InputActions.NetWork[enableNetWork ? "on" : "off"]
|
||||
}
|
||||
icon={<NetWorkIcon />}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<div className={styles["chat-input-actions-end"]}>
|
||||
{config.realtimeConfig.enable && (
|
||||
|
||||
Reference in New Issue
Block a user