Update app.py
Browse filesupdated the doc string of get_file
app.py
CHANGED
|
@@ -58,10 +58,15 @@ class BasicAgent:
|
|
| 58 |
# return answer.text
|
| 59 |
|
| 60 |
@tool
|
| 61 |
-
def get_file(self
|
| 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 |
'''
|
| 66 |
file_request = requests.get(url=f'https://agents-course-unit4-scoring.hf.space/files/{task_id}')
|
| 67 |
file_request.raise_for_status()
|
|
|
|
| 58 |
# return answer.text
|
| 59 |
|
| 60 |
@tool
|
| 61 |
+
def get_file(self, task_id: str) -> IO:
|
| 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.
|
| 70 |
'''
|
| 71 |
file_request = requests.get(url=f'https://agents-course-unit4-scoring.hf.space/files/{task_id}')
|
| 72 |
file_request.raise_for_status()
|