Spaces:
Runtime error
Runtime error
"""Struct store schema.""" | |
from dataclasses import dataclass, field | |
from typing import Any, Dict | |
from dataclasses_json import DataClassJsonMixin | |
from gpt_index.data_structs.data_structs import IndexStruct | |
class StructDatapoint(DataClassJsonMixin): | |
"""Struct outputs.""" | |
# map from field name to StructValue | |
fields: Dict[str, Any] | |
class BaseStructTable(IndexStruct): | |
"""Struct outputs.""" | |
class SQLStructTable(BaseStructTable): | |
"""SQL struct outputs.""" | |
context_dict: Dict[str, str] = field(default_factory=dict) | |
def get_type(cls) -> str: | |
"""Get type.""" | |
# TODO: consolidate with IndexStructType | |
return "sql" | |