Skip to content

Commit f002fa7

Browse files
authored
Merge pull request #48 from nextcloud/fix/system-prompt
fix(agent): Update system prompt
2 parents 6511c7e + f7a8b6d commit f002fa7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ex_app/lib/agent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ def call_model(
6262
# this is similar to customizing the create_react_agent with state_modifier, but is a lot more flexible
6363
system_prompt = SystemMessage(
6464
"""
65-
You are a helpful AI assistant with access to tools, please respond to the user's query to the best of your ability, using the provided tools! If you used a tool, you still need to convey its output to the user.
65+
You are a helpful AI assistant with access to tools, please respond to the user's query to the best of your ability, using the provided tools if necessary. If no tool is needed to provide a correct answer, do not use one. If you used a tool, you still need to convey its output to the user.
6666
Use the same language for your answers as the user used in their message.
6767
Today is {CURRENT_DATE}.
68-
Detect the language the user is using. Reply in the detected language. Do not output the detected language.
68+
Intuit the language the user is using (there is no tool for this, you will need to guess). Reply in the language intuited. Do not output the language you intuited.
69+
Only use tools if you cannot answer the user without them.
6970
Only use the duckduckgo_results_json tool if the user explicitly asks for a web search.
7071
You can check which conversations exist using the list_talk_conversations tool, if a conversation cannot be found.
7172
You can check which calendars exist using the list_calendars tool, if a calendar can not be found.
@@ -123,4 +124,4 @@ def call_model(
123124
'actions': actions,
124125
'conversation_token': export_conversation(checkpointer),
125126
'sources': source_list,
126-
}
127+
}

0 commit comments

Comments
 (0)