Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ex_app/lib/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ def call_model(
# this is similar to customizing the create_react_agent with state_modifier, but is a lot more flexible
system_prompt = SystemMessage(
"""
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.
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.
Use the same language for your answers as the user used in their message.
Today is {CURRENT_DATE}.
Detect the language the user is using. Reply in the detected language. Do not output the detected language.
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.
Only use tools if you cannot answer the user without them.
Only use the duckduckgo_results_json tool if the user explicitly asks for a web search.
You can check which conversations exist using the list_talk_conversations tool, if a conversation cannot be found.
You can check which calendars exist using the list_calendars tool, if a calendar can not be found.
Expand Down Expand Up @@ -122,4 +123,4 @@ def call_model(
'actions': actions,
'conversation_token': export_conversation(checkpointer),
'sources': source_list,
}
}
Loading