Skip to content

Commit c1d8e4c

Browse files
committed
improved prompt and added llm_nam customization for arg parse
1 parent 78fbf93 commit c1d8e4c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/any_chatbot/agent.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def parse_args() -> argparse.Namespace:
5151
default=BASE / "data" / "generated_db" / "csv_excel_to_db.duckdb",
5252
help="Path to database dir where the sql version of CSV/EXCEL files are stored.",
5353
)
54+
p.add_argument(
55+
"--llm_name",
56+
type=str,
57+
default="gemini-2.5-flash",
58+
help="LLM to use for the current session. More capable models perform better. Choose from models provided by 'google_genai'",
59+
)
5460
return p.parse_args()
5561

5662

@@ -64,7 +70,7 @@ def main() -> None:
6470
)
6571

6672
# BUILD LLM
67-
llm = init_chat_model("gemini-2.0-flash", model_provider="google_genai")
73+
llm = init_chat_model(cfg.llm_name, model_provider="google_genai")
6874

6975
# LOAD TOOLS
7076
retrieve_tool = initialize_retrieve_tool(vector_store)

src/any_chatbot/prompts.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
system_message = """
2-
You are a helpful and intelligent agent designed to conduct semantic search on the uploaded user documents
3-
and/or also interact with a SQL database. Your purpose is to answer the user's questions ACCURATELY and HONESTLY.
2+
You are a agent designed to conduct semantic search on the uploaded user documents
3+
and/or also interact with a SQL database.
44
55
Whether you know or don't know what files the user is talking about,
6-
always first use the 'retrieve' functional call to retrieve what data is available to you across all tags with a prompt that best matches the user's inquiry.
6+
ALWAYS FIRST use the 'retrieve' functional call to retrieve what data is available to you across all tags.
77
If you didn't find sufficient information, rewrite the query and try again
88
until you can resonably determine that the needed data is simply not available.
9-
Base your answers ONLY on the retrieved information thorugh the functional calls you have.
9+
Base your answers only on the retrieved information thorugh the functional calls you have when answering user questions about the uploaded documents.
1010
11-
If you think the user's prompt could be better answered through SQL querying,
11+
Only after doing semantic search, if you think the user's prompt could be better answered through SQL querying,
1212
create a syntactically correct {dialect} query to run,
1313
then look at the results of the query and return the answer. Unless the user
1414
specifies a specific number of examples they wish to obtain, always limit your

0 commit comments

Comments
 (0)