diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ee788f25..ea3a390e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: # 安装 nltk pip install nltk python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')" - mv /home/runner/nltk_data/taggers ./ + mv /home/runner/nltk_data ./ cd ../../ - name: Build backend and push diff --git a/src/backend/Dockerfile b/src/backend/Dockerfile index 9207973b7..6b79e7b41 100644 --- a/src/backend/Dockerfile +++ b/src/backend/Dockerfile @@ -18,7 +18,7 @@ ENV PATH="${PATH}:/root/.local/bin" COPY ./ ./ # Install NLTK data -RUN mv -f ./taggers /root/nltk_data/ +RUN mv -f ./nltk_data /root/nltk_data/ RUN python -m pip install --upgrade pip && \ pip install shapely==2.0.1 diff --git a/src/backend/bisheng/chat/client.py b/src/backend/bisheng/chat/client.py index 4909a247d..c02fa262f 100644 --- a/src/backend/bisheng/chat/client.py +++ b/src/backend/bisheng/chat/client.py @@ -268,9 +268,10 @@ async def handle_gpts_message(self, message: Dict[any, any]): # todo: 后续优化代码解释器的实现方案,保证输出的文件可以公开访问 ugly solve # 获取minio的share地址,把share域名去掉, 为毕昇的部署方案特殊处理下 - if gpts_tool_conf := self.gpts_conf.get('tools'): - if bisheng_code_conf := gpts_tool_conf.get("bisheng_code_interpreter"): - answer = answer.replace(f"http://{bisheng_code_conf['minio']['MINIO_SHAREPOIN']}", "") + for one in self.gpts_agent.tools: + if one.name == "bisheng_code_interpreter": + minio_share = settings.get_knowledge().get('minio', {}).get('MINIO_SHAREPOIN', '') + answer = answer.replace(f"http://{minio_share}", "") answer_end_type = 'end' # 如果是流式的llm则用end_cover结束, 覆盖之前流式的输出 if getattr(self.gpts_agent.llm, 'streaming', False): diff --git a/src/frontend/src/pages/ModelPage/manage/CustomForm.tsx b/src/frontend/src/pages/ModelPage/manage/CustomForm.tsx index b4d7587b7..ab9249c8a 100644 --- a/src/frontend/src/pages/ModelPage/manage/CustomForm.tsx +++ b/src/frontend/src/pages/ModelPage/manage/CustomForm.tsx @@ -196,7 +196,7 @@ const modelProviders = { label: "Base Url", type: "text", placeholder: "", - default: "https://open.bigmodel.cn/api/paas/v4/", + default: "https://spark-api-open.xf-yun.com/v1", required: true, key: "openai_api_base", } diff --git a/src/frontend/src/pages/SkillPage/components/ToolSet.tsx b/src/frontend/src/pages/SkillPage/components/ToolSet.tsx index 351d184a6..fa54577e5 100644 --- a/src/frontend/src/pages/SkillPage/components/ToolSet.tsx +++ b/src/frontend/src/pages/SkillPage/components/ToolSet.tsx @@ -51,12 +51,13 @@ const ToolSet = forwardRef(function ToolSet({ onChange }, ref) { if (configStr) { const config = JSON.parse(configStr); config.provider = config.azure_deployment ? 'azure' : 'openai'; + const apiKey = config.openai_api_key if (config.provider === 'openai') { - config.openai_api_key = config.openai_api_key; + config.openai_api_key = apiKey; config.azure_api_key = '' } else { config.openai_api_key = ''; - config.azure_api_key = config.openai_api_key; + config.azure_api_key = apiKey; } setFormData(config); } else { diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index 1e1b27c25..e4961c47a 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -6,7 +6,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'; import svgr from "vite-plugin-svgr"; // Use environment variable to determine the target. -const target = process.env.VITE_PROXY_TARGET || "https://bisheng.dataelem.com/"; +const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002"; const apiRoutes = ["^/api/", "/health"]; const proxyTargets = apiRoutes.reduce((proxyObj, route) => {