diff --git a/api/system.go b/api/system.go index da94161e7..82e886586 100644 --- a/api/system.go +++ b/api/system.go @@ -24,6 +24,4 @@ type SystemStatus struct { StorageServiceID int `json:"storageServiceId"` // Local storage path LocalStoragePath string `json:"localStoragePath"` - // Local storage path - OpenAIConfig OpenAIConfig `json:"openAIConfig"` } diff --git a/server/system.go b/server/system.go index 5581a17bb..ac5214571 100644 --- a/server/system.go +++ b/server/system.go @@ -56,10 +56,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) { }, StorageServiceID: api.DatabaseStorage, LocalStoragePath: "", - OpenAIConfig: api.OpenAIConfig{ - Key: "", - Host: "", - }, } systemSettingList, err := s.Store.FindSystemSettingList(ctx, &api.SystemSettingFind{}) @@ -99,13 +95,6 @@ func (s *Server) registerSystemRoutes(g *echo.Group) { systemStatus.StorageServiceID = int(baseValue.(float64)) } else if systemSetting.Name == api.SystemSettingLocalStoragePathName { systemStatus.LocalStoragePath = baseValue.(string) - } else if systemSetting.Name == api.SystemSettingOpenAIConfigName { - openAIConfig := api.OpenAIConfig{} - err := json.Unmarshal([]byte(systemSetting.Value), &openAIConfig) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unmarshal system setting open ai config value").SetInternal(err) - } - systemStatus.OpenAIConfig = openAIConfig } } diff --git a/web/src/components/AskAIDialog.tsx b/web/src/components/AskAIDialog.tsx index 6496c4893..2e49110b2 100644 --- a/web/src/components/AskAIDialog.tsx +++ b/web/src/components/AskAIDialog.tsx @@ -89,7 +89,7 @@ const AskAIDialog: React.FC = (props: Props) => {
{messageList.map((message, index) => ( -
+
{message.role === "user" ? (
diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 6df7b50f2..f4ff0031b 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { NavLink, useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { useGlobalStore, useLayoutStore, useUserStore } from "@/store/module"; +import { useLayoutStore, useUserStore } from "@/store/module"; import { resolution } from "@/utils/layout"; import Icon from "./Icon"; import showSettingDialog from "./SettingDialog"; @@ -14,10 +14,8 @@ const Header = () => { const { t } = useTranslation(); const location = useLocation(); const userStore = useUserStore(); - const globalStore = useGlobalStore(); const layoutStore = useLayoutStore(); const showHeader = layoutStore.state.showHeader; - const showAskAI = globalStore.showAskAI(); const isVisitorMode = userStore.isVisitorMode() && !userStore.state.user; useEffect(() => { @@ -109,15 +107,13 @@ const Header = () => { {!isVisitorMode && ( <> - {showAskAI && ( - - )} +