agent_task / utilities.py
llamasrock's picture
Update utilities.py
94183c0 verified
raw
history blame contribute delete
525 Bytes
from smolagents import tool
from typing import IO
@tool
def get_file(task_id: str) -> IO:
'''
Downloads the file associated with the given task_id, if one exists and is mapped.
If the question mentions an attachment, use this function.
Args:
task_id: Id of the question.
Returns:
The file associated with the question.
'''
file_request = requests.get(url=f'https://agents-course-unit4-scoring.hf.space/files/{task_id}')
file_request.raise_for_status()
return file_request