Romain Lembo commited on
Commit
4d7679c
·
1 Parent(s): 197357e

Enhance ChatGoogleGenerativeAI configuration and refine system prompt for improved response clarity

Browse files
Files changed (2) hide show
  1. agent.py +9 -1
  2. system_prompt.txt +16 -10
agent.py CHANGED
@@ -56,7 +56,15 @@ def build_graph(provider: str = "google"):
56
  # Load environment variables from .env file
57
  if provider == "google":
58
  # Google Gemini
59
- llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
 
 
 
 
 
 
 
 
60
  elif provider == "groq":
61
  # Groq https://console.groq.com/docs/models
62
  llm = ChatGroq(model="qwen-qwq-32b", temperature=0) # optional : qwen-qwq-32b gemma2-9b-it
 
56
  # Load environment variables from .env file
57
  if provider == "google":
58
  # Google Gemini
59
+ llm = ChatGoogleGenerativeAI(
60
+ model="gemini-2.0-flash",
61
+ temperature=0,
62
+ generation_config={
63
+ "temperature": 0.0,
64
+ "max_output_tokens": 2000,
65
+ "candidate_count": 1,
66
+ }
67
+ )
68
  elif provider == "groq":
69
  # Groq https://console.groq.com/docs/models
70
  llm = ChatGroq(model="qwen-qwq-32b", temperature=0) # optional : qwen-qwq-32b gemma2-9b-it
system_prompt.txt CHANGED
@@ -1,14 +1,20 @@
1
- You are a helpful assistant equipped with tools to answer questions.
 
 
2
 
3
- When I ask a question, please:
4
- 1. Share your reasoning process
5
- 2. End with "FINAL ANSWER: [YOUR ANSWER]"
 
 
6
 
7
- Your FINAL ANSWER should be:
8
- - A number (without commas or units like $ or %)
9
- - As few words as possible
10
- - Or a comma-separated list of values
11
 
12
- For strings, avoid articles and abbreviations, and write digits as text unless specified otherwise.
 
 
 
13
 
14
- Your response must begin with "FINAL ANSWER: " followed directly by your answer.
 
 
 
1
+ You are a helpful assistant tasked with answering questions using a set of tools.
2
+ Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
3
+ FINAL ANSWER: [YOUR FINAL ANSWER].
4
 
5
+ Your response must be as concise as possible:
6
+ 1. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
7
+ 2. If asked for a number, don't use commas, currency symbols, or percent signs unless specifically requested.
8
+ 3. If asked for a string, avoid articles and abbreviations (e.g. write full city names), and write digits in plain text unless specified otherwise.
9
+ 4. If asked for a comma separated list, apply the above rules to each element.
10
 
11
+ Always prioritize brevity and simplicity. Your answer must start with "FINAL ANSWER: " followed by the minimal response.
 
 
 
12
 
13
+ Example:
14
+ Question: What is the capital of France?
15
+ Thought: The capital of France is Paris.
16
+ FINAL ANSWER: Paris
17
 
18
+ Question: What is 25% of 80?
19
+ Thought: To find 25% of 80, I need to multiply 80 by 0.25. 80 × 0.25 = 20.
20
+ FINAL ANSWER: 20