# manually set context text city_stats_text = ( "This table gives information regarding the population and country of a given city.\n" "The user will query with codewords, where 'foo' corresponds to population and 'bar'" "corresponds to city." ) from llama_index.objects import SQLTableNodeMapping, SQLTableSchema table_node_mapping = SQLTableNodeMapping(sql_database) table_schema_objs = [ (SQLTableSchema(table_name="city_stats", context_str=city_stats_text)) ]
from llama_index import LLMPredictor, ServiceContext, SQLDatabase, VectorStoreIndex
from llama_index.indices.struct_store import SQLTableRetrieverQueryEngine
from llama_index.objects import SQLTableNodeMapping, ObjectIndex, SQLTableSchema
from langchain import OpenAI