Spaces:
Sleeping
Sleeping
Download src/gaia/utils/formatting.py from jm-vis/Final_Assignment_GAIAAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/utils/formatting.py
- Command line
-
hf download hf://spaces/jm-vis/Final_Assignment_GAIAAgent/src/gaia/utils/formatting.py
-
curl -L -o formatting.py https://huggingface.co/spaces/jm-vis/Final_Assignment_GAIAAgent/resolve/main/src/gaia/utils/formatting.py
1.2 kB
| """ | |
| Answer formatting utilities for GAIA implementation. | |
| This module provides functions for extracting, formatting, and validating answers | |
| to ensure they match the expected format (number, few words, comma-separated list, etc.). | |
| This module is a compatibility layer for backward compatibility with code | |
| using the old formatting API. It imports and re-exports the consolidated | |
| implementations from formatting_utils.py. | |
| """ | |
| import logging | |
| from typing import Dict, Any, Optional | |
| # Import the consolidated implementations | |
| from src.gaia.utils.formatting_utils import ( | |
| FORMAT_TYPES, | |
| extract_answer, | |
| extract_number, | |
| extract_date, | |
| extract_boolean, | |
| extract_list, | |
| extract_entity, | |
| extract_structured_data, | |
| format_answer, | |
| validate_answer_format, | |
| process_answer | |
| ) | |
| logger = logging.getLogger("gaia_agent.utils.formatting") | |
| # Re-export all the formatting functions to maintain backward compatibility | |
| __all__ = [ | |
| "FORMAT_TYPES", | |
| "extract_answer", | |
| "extract_number", | |
| "extract_date", | |
| "extract_boolean", | |
| "extract_list", | |
| "extract_entity", | |
| "extract_structured_data", | |
| "format_answer", | |
| "validate_answer_format", | |
| "process_answer" | |
| ] |