Update app.py
Browse files
app.py
CHANGED
@@ -21,30 +21,13 @@ class BasicAgent:
|
|
21 |
api_key=os.getenv("GOOGLE_API_KEY"),
|
22 |
streaming=False # Set to True if you want streaming output
|
23 |
)
|
24 |
-
self.instructions =
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
- **Use the search tool and all available resources to gather the most current, accurate information.**
|
32 |
-
- **Present solutions with clarity, logical structure, and a results-driven mindset.**
|
33 |
-
- **Structure your responses in clear sections:**
|
34 |
-
- Task Overview
|
35 |
-
- Step-by-step Execution Plan
|
36 |
-
- Key Details, Data, or Code Snippets
|
37 |
-
- Impact Analysis or Next Steps
|
38 |
-
- **Keep responses concise but comprehensive (2-3 paragraphs or bullet points max).**
|
39 |
-
- **Apply best practices for UI stability and code formatting to ensure all outputs are organized, visible, and maintainable.**
|
40 |
-
- **End with a motivating sign-off or call to action, such as:**
|
41 |
-
- "Task completed—ready for the next challenge!"
|
42 |
-
- "Gaia task executed with precision. What’s next?"
|
43 |
-
- "Mission accomplished. Awaiting further instructions!"
|
44 |
-
|
45 |
-
_Remember: Always verify facts, optimize for efficiency, and maintain a focus on clear, actionable results!_
|
46 |
-
'''
|
47 |
-
print("BasicAgent (Gemini via LangChain) initialized.")
|
48 |
|
49 |
def __call__(self, question: str) -> str:
|
50 |
prompt = f"{self.instructions}\n\n{question}"
|
|
|
21 |
api_key=os.getenv("GOOGLE_API_KEY"),
|
22 |
streaming=False # Set to True if you want streaming output
|
23 |
)
|
24 |
+
self.instructions = """You are a helpful assistant tasked with answering questions using a set of tools.
|
25 |
+
Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
|
26 |
+
FINAL ANSWER: [YOUR FINAL ANSWER].
|
27 |
+
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
28 |
+
Your answer should only start with "FINAL ANSWER: ", then follows with the answer."""
|
29 |
+
|
30 |
+
print("BasicAgent initialized.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
def __call__(self, question: str) -> str:
|
33 |
prompt = f"{self.instructions}\n\n{question}"
|