Skip to content

Commit 3bd7c94

Browse files
committed
llm incorrectly regard no_think as a tool/assistant
1 parent 8fb99fb commit 3bd7c94

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

backend/prompts/utils/prompt_generate.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,15 @@ USER_PROMPT: |-
234234
{{task_description}}
235235
236236
### 可用工具列表:
237+
{% if tool_description %}
237238
{{tool_description}}
238-
239+
{% else %}
240+
你没有可用的工具
241+
{% endif %}
242+
239243
### 可用助手列表:
244+
{% if assistant_description %}
240245
{{assistant_description}}
241-
246+
{% else %}
247+
你没有可用的助手
248+
{% endif %}

backend/prompts/utils/prompt_generate_en.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,15 @@ USER_PROMPT: |-
238238
{{task_description}}
239239
240240
### Available Tools List:
241+
{% if tool_description %}
241242
{{tool_description}}
243+
{% else %}
244+
You have no available tools.
245+
{% endif %}
242246
243247
### Available Assistants List:
244-
{{assistant_description}}
248+
{% if assistant_description %}
249+
{{assistant_description}}
250+
{% else %}
251+
You have no available assistants
252+
{% endif %}

backend/utils/str_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def add_no_think_token(messages: List[dict]):
1818
if not messages:
1919
return
2020
if messages[-1]["role"] == "user" and "content" in messages[-1]:
21-
messages[-1]["content"] += " /no_think"
21+
messages[-1]["content"] += "The following is a flag to prevent the model from thinking deeply, please ignore: /no_think"

0 commit comments

Comments
 (0)