Spaces:
Running
Running
| from api.client import GaiaApiClient | |
| from config import get_settings | |
| ATTACHMENT_TASK_IDS = { | |
| "cca530fc-4052-43b2-b130-b30968d8aa44", | |
| "99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3", | |
| "f918266a-b3e0-4914-865d-4faa564f1aef", | |
| "1f975693-876d-457b-a649-393859e79bf3", | |
| "7bd855d8-463d-4ed5-93ca-5fe35145f733", | |
| } | |
| def main() -> None: | |
| client = GaiaApiClient(get_settings()) | |
| questions = client.get_questions() | |
| for question in questions: | |
| if question.task_id not in ATTACHMENT_TASK_IDS: | |
| continue | |
| try: | |
| path = client.download_file(question) | |
| print( | |
| f"{question.task_id}\n" | |
| f" file: {question.file_name}\n" | |
| f" path: {path}\n" | |
| ) | |
| except Exception as exc: | |
| print( | |
| f"{question.task_id}\n" | |
| f" ERROR: {exc}\n" | |
| ) | |
| if __name__ == "__main__": | |
| main() |