Spaces:
Running
Running
david-oplatka
commited on
Commit
•
025b139
1
Parent(s):
e012c9e
Update Agent Instructions
Browse files
agent.py
CHANGED
@@ -27,7 +27,7 @@ def create_assistant_tools(cfg):
|
|
27 |
tool_name = "ask_complaints",
|
28 |
tool_description = """
|
29 |
Given a user query,
|
30 |
-
returns a response to a user question about customer complaints
|
31 |
""",
|
32 |
tool_args_schema = QueryCFPBComplaints,
|
33 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
@@ -54,11 +54,12 @@ def create_assistant_tools(cfg):
|
|
54 |
def initialize_agent(_cfg, update_func=None):
|
55 |
cfpb_complaints_bot_instructions = """
|
56 |
- You are a helpful research assistant, with expertise in complaints from the Consumer Financial Protection Bureau, in conversation with a user.
|
57 |
-
-
|
58 |
-
to get sample data from each table in the database, so that you can understand NULL and unique values for each column.
|
59 |
- For a query with multiple sub-questions, break down the query into the sub-questions,
|
60 |
and make separate calls to the ask_complaints tool to answer each sub-question,
|
61 |
then combine the answers to provide a complete response.
|
|
|
|
|
62 |
- Use the database tools (cfpb_load_data, cfpb_describe_tables and cfpb_list_tables) to answer analytical queries.
|
63 |
- IMPORTANT: When using database_tools, always call the ev_load_sample_data tool with the table you want to query
|
64 |
to understand the table structure, column naming, and values in the table. Never call the cfpb_load_data tool for a query until you have called cfpb_load_sample_data.
|
|
|
27 |
tool_name = "ask_complaints",
|
28 |
tool_description = """
|
29 |
Given a user query,
|
30 |
+
returns a response to a user question about customer complaints for bank services.
|
31 |
""",
|
32 |
tool_args_schema = QueryCFPBComplaints,
|
33 |
reranker = "multilingual_reranker_v1", rerank_k = 100,
|
|
|
54 |
def initialize_agent(_cfg, update_func=None):
|
55 |
cfpb_complaints_bot_instructions = """
|
56 |
- You are a helpful research assistant, with expertise in complaints from the Consumer Financial Protection Bureau, in conversation with a user.
|
57 |
+
- Your primary tool for answering questions is the ask_complaints tool.
|
|
|
58 |
- For a query with multiple sub-questions, break down the query into the sub-questions,
|
59 |
and make separate calls to the ask_complaints tool to answer each sub-question,
|
60 |
then combine the answers to provide a complete response.
|
61 |
+
- Before answering any user query, use cfpb_describe_tables to understand schema of each table, and use get_sample_data
|
62 |
+
to get sample data from each table in the database, so that you can understand NULL and unique values for each column.
|
63 |
- Use the database tools (cfpb_load_data, cfpb_describe_tables and cfpb_list_tables) to answer analytical queries.
|
64 |
- IMPORTANT: When using database_tools, always call the ev_load_sample_data tool with the table you want to query
|
65 |
to understand the table structure, column naming, and values in the table. Never call the cfpb_load_data tool for a query until you have called cfpb_load_sample_data.
|