diff --git a/src/js/config.js b/src/js/config.js index 5c83f4e63a511d822e682763253749b721f67e38..6be99f78b82a987618dd767a5d7407efcaf8afb0 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -61,7 +61,7 @@ export default { "default_prompt": default_prompt, "max_request_len": "2048", "prompt_template": prompt_template, - "api_prompt_prefix":"如果问题不是技术问题,请直接回答不知道。\n问题为:", + "api_prompt_prefix":"结合上下文回答问题,如果问题不是技术问题,请直接回答不知道。\n问题为:", "show_profile_setting":false, "index_url": index_url, "index_name":"inscode", diff --git a/src/js/prompt.js b/src/js/prompt.js index 552d0c4423c3d6480dad81757e177fbc84d4d809..f350a926e20d7e3dcbde8389ed515efb5a6f2a00 100644 --- a/src/js/prompt.js +++ b/src/js/prompt.js @@ -60,7 +60,7 @@ export default { if (config?.prompt_template) { const contextContent = getContextContent(context, config?.max_request_len??1024) message.unshift({ - "role": "user", + "role": "system", "content": config.prompt_template.replace(/\{question\}/ig, '').replace(/\{context\}/ig, contextContent).replace(/\{user_call_name\}/ig, config.user_call_name) }) }