File size: 776 Bytes
35b22df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Common structures for structured indices."""
from dataclasses import dataclass
from typing import Dict, Optional

from dataclasses_json import DataClassJsonMixin


# TODO: migrate this to be a data_struct
@dataclass
class SQLContextContainer(DataClassJsonMixin):
    """SQLContextContainer.

    A container interface to store context for a given table.
    Context can be built from unstructured documents (e.g. using SQLContextBuilder).
    Context can also be dumped to an underlying LlamaIndex data structure.

    Contains both the raw context_dict as well as any index_structure.

    Should be not be used directly - build one from SQLContextContainerBuilder instead.

    """

    context_dict: Optional[Dict[str, str]] = None
    context_str: Optional[str] = None