Commit 32c328e

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-04-11 19:23:07
chore(gpt): add timezone in system prompt for online search tool
1 parent 03bbbc0
Changed files (1)
src
src/llm/tools.py
@@ -94,7 +94,7 @@ def add_tools(params: dict) -> dict:
     tools = []
     if (GPT.PRIMARY_SEARCH_ENGINE == "google" and TOKEN.GOOGLE_SEARCH_API_KEY and TOKEN.GOOGLE_SEARCH_CX) or (GPT.PRIMARY_SEARCH_ENGINE == "glm" and GPT.GLM_API_KEY and GPT.GLM_BASE_URL):
         tools = [ONLINE_SEARCH]
-        system_prompt = f"你是一个具备网络访问能力的智能助手. 在需要时可以访问互联网进行相关搜索获取信息以确保用户得到最新、准确的帮助。当前日期是 {nowdt(TZ):%Y-%m-%d}"
+        system_prompt = f"你是一个具备网络访问能力的智能助手. 在需要时可以访问互联网进行相关搜索获取信息以确保用户得到最新、准确的帮助。当前时间是{nowdt(TZ):%Y-%m-%d %H:%M:%S} ({TZ})。"
         params["messages"] = modify_prompts(params["messages"], system_prompt, method="overwrite")
 
     if tools: