Update app.py
Browse filesadded @staticmethod to get_file to remove self in arguments
app.py
CHANGED
|
@@ -31,7 +31,7 @@ class BasicAgent:
|
|
| 31 |
)
|
| 32 |
# self.google_search_tool = Tool(google_search = GoogleSearch())
|
| 33 |
self.google_search_tool = GoogleSearchTool()
|
| 34 |
-
self.agent = CodeAgent(model = self.llm_model, tools = [self.google_search_tool,
|
| 35 |
# # Define Google API client with GoogleSearch tool
|
| 36 |
# self.client = genai.Client(api_key=GEMINI_API_KEY)
|
| 37 |
|
|
@@ -58,12 +58,12 @@ class BasicAgent:
|
|
| 58 |
# return answer.text
|
| 59 |
|
| 60 |
@tool
|
| 61 |
-
|
|
|
|
| 62 |
'''
|
| 63 |
Downloads the file associated with the given task_id, if one exists and is mapped.
|
| 64 |
If the question mentions an attachment, use this function.
|
| 65 |
Args:
|
| 66 |
-
self: The class instance.
|
| 67 |
task_id: Id of the question.
|
| 68 |
Returns:
|
| 69 |
The file associated with the question.
|
|
|
|
| 31 |
)
|
| 32 |
# self.google_search_tool = Tool(google_search = GoogleSearch())
|
| 33 |
self.google_search_tool = GoogleSearchTool()
|
| 34 |
+
self.agent = CodeAgent(model = self.llm_model, tools = [self.google_search_tool, get_file])
|
| 35 |
# # Define Google API client with GoogleSearch tool
|
| 36 |
# self.client = genai.Client(api_key=GEMINI_API_KEY)
|
| 37 |
|
|
|
|
| 58 |
# return answer.text
|
| 59 |
|
| 60 |
@tool
|
| 61 |
+
@staticmethod
|
| 62 |
+
def get_file(task_id: str) -> IO:
|
| 63 |
'''
|
| 64 |
Downloads the file associated with the given task_id, if one exists and is mapped.
|
| 65 |
If the question mentions an attachment, use this function.
|
| 66 |
Args:
|
|
|
|
| 67 |
task_id: Id of the question.
|
| 68 |
Returns:
|
| 69 |
The file associated with the question.
|