File size: 1,201 Bytes
c922f8b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
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"
]