You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# this is similar to customizing the create_react_agent with state_modifier, but is a lot more flexible
63
-
system_prompt=SystemMessage(
64
-
"""
69
+
70
+
system_prompt_text="""
65
71
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.
66
72
Use the same language for your answers as the user used in their message.
67
73
Today is {CURRENT_DATE}.
68
74
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
75
Only use tools if you cannot answer the user without them.
70
-
Only use the duckduckgo_results_json tool if the user explicitly asks for a web search.
71
-
You can check which conversations exist using the list_talk_conversations tool, if a conversation cannot be found.
72
-
You can check which calendars exist using the list_calendars tool, if a calendar can not be found.
73
-
you can find out a user's email address and location by using the find_person_in_contacts tool.
74
-
you can find out the current user's location by using the find_details_of_current_user tool.
75
-
If an item should be added to a list, check list_calendars for a fitting calendar and add the item as a task there.
76
76
If you get a link as a tool output, always add the link to your response.
77
-
""".replace("{CURRENT_DATE}", current_date)
77
+
"""
78
+
iftool_enabled("duckduckgo_results_json"):
79
+
system_prompt_text+="Only use the duckduckgo_results_json tool if the user explicitly asks for a web search.\n"
80
+
iftool_enabled("list_talk_conversations"):
81
+
system_prompt_text+="Use the list_talk_conversations tool to check which conversations exist.\n"
82
+
iftool_enabled("list_calendars"):
83
+
system_prompt_text+="Use the list_calendars tool to check which calendars exist.\nIf an item should be added to a list, check list_calendars for a fitting calendar and add the item as a task there.\n"
84
+
iftool_enabled("find_person_in_contacts"):
85
+
system_prompt_text+="Use the find_person_in_contacts tool to find a person's email address and location.\n"
86
+
iftool_enabled("find_details_of_current_user"):
87
+
system_prompt_text+="Use the find_details_of_current_user tool to find the current user's location.\n"
88
+
# this is similar to customizing the create_react_agent with state_modifier, but is a lot more flexible
0 commit comments