From 08acbdf45d1033d3dab4cdfd02d0ed038e20310c Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Mon, 31 Mar 2025 11:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/chat.py | 10 +++++----- frontend/src/utils/request.js | 2 +- frontend/vite.config.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/app/routers/chat.py b/backend/app/routers/chat.py index 34d206d..157dbf6 100644 --- a/backend/app/routers/chat.py +++ b/backend/app/routers/chat.py @@ -12,10 +12,10 @@ client = OpenAI( api_key="sk-P7bm1Ioe7eovIWkbabAbY8yEON2VFu4RcHqumAFCfoxDVDdi", base_url="https://api.lkeap.cloud.tencent.com/v1" ) - -messages = [ - # {'role': 'system', 'content': '您现在是一个代码质量审核专家,您的任务是结合业务需求代码进行审核,判断代码是否符合需求'}, -] +# client = OpenAI( +# api_key="sk-56a83c7c71a5459ea181bc86f0a42af9", +# base_url="https://api.deepseek.com/chat/completions" +# ) class WorkScore(BaseModel): @@ -54,7 +54,7 @@ async def work_chat(work_score: WorkScore, """ print(">>> prompt: \n%s" % prompt) - messages.append({'role': 'system', 'content': prompt}) + messages = [{'role': 'user', 'content': prompt}] stream = client.chat.completions.create( model="deepseek-r1", messages=messages, diff --git a/frontend/src/utils/request.js b/frontend/src/utils/request.js index 7decbea..591bab9 100644 --- a/frontend/src/utils/request.js +++ b/frontend/src/utils/request.js @@ -3,7 +3,7 @@ import {useRouter} from "vue-router"; export const request = axios.create({ baseURL: import.meta.env.VITE_BACKEND_BASE_URL, - timeout: 3 * 60 * 1000, + timeout: 60 * 60 * 1000, headers: { 'Content-Type': 'application/json', } diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 04af4d6..85213a2 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -4,6 +4,6 @@ import vue from '@vitejs/plugin-vue' // https://vite.dev/config/ export default defineConfig({ plugins: [vue()], - mode: 'prod', + mode: 'dev', base: './', })