populate_metadata
langroid/agent/special/sql/utils/populate_metadata.py
populate_metadata_with_schema_tools(metadata, info)
¶
Extracts information from an SQLAlchemy database's metadata and combines it with another dictionary with context descriptions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata |
MetaData
|
SQLAlchemy metadata object of the database. |
required |
info |
Dict[str, Dict[str, Any]]
|
A dictionary with table and column descriptions. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, Union[str, Dict[str, str]]]]
|
Dict[str, Dict[str, Any]]: A dictionary with table and context information. |
Source code in langroid/agent/special/sql/utils/populate_metadata.py
populate_metadata(metadata, info)
¶
Populate metadata based on the provided database metadata and additional info.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata |
MetaData
|
Metadata object from SQLAlchemy. |
required |
info |
Dict
|
Additional information for database tables and columns. |
required |
Returns:
Name | Type | Description |
---|---|---|
Dict |
Dict[str, Dict[str, Union[str, Dict[str, str]]]]
|
A dictionary containing populated metadata information. |