code: import sqlite3
  import pandas as pd
  import llama_index
  import os
  import openai
  from IPython.display import Markdown, display
  from sqlalchemy import (
      create_engine,
      MetaData,
      Table,
      Column,
      String,
      Integer,
      select,
      text
  )
  from llama_index import SQLDatabase, ServiceContext
  from llama_index.llms import OpenAI
  from llama_index.indices.struct_store.sql_query import NLSQLTableQueryEngine
  
  # Create a new SQLite database (or connect to an existing one)
  def create_and_load_db():
      # Connect to the SQLite database (or create a new one)
      conn = sqlite3.connect('company_info.db')
  
      # Read the CSV file into a Pandas DataFrame
      df = pd.read_csv('C:\\Users\\Nsahni\\Downloads\\Github\\Bynd\\company_information_db.csv')
  
      # Write the data to a SQLite table
      df.to_sql('company_table', conn, if_exists='replace', index=False)
      return conn
  
  def execute_query(conn, query):
      # Query the table
      query_result = pd.read_sql_query(query, conn)
      print(query_result)
  
  conn = create_and_load_db()
  with open('config.txt', 'r') as f:
      openai.api_key = f.read().strip()
  
  llm = OpenAI(temperature=0, model="gpt-4")
  engine = create_engine('sqlite:///company_info.db')
  metadata_obj = MetaData()
  metadata_obj.create_all(engine)
  service_context = ServiceContext.from_defaults(llm=llm)
  sql_database = SQLDatabase(engine, include_tables=['company_table'])
  metadata_obj = MetaData()
  
  # with engine.connect() as con:
  #     rows = con.execute(text("SELECT * FROM company_table where market_cap > 10000000"))
  #     for row in rows:
  #         print(row)
  
  
  query_engine = NLSQLTableQueryEngine(
      sql_database=sql_database,
      tables=["company_table"],
  )
  query_str = input("Please enter the query you are looking for: ")
  response = query_engine.query(query_str)
  # response_df = pd.DataFrame(response)
  print(response)
  # print(response)
  
  # execute_query(conn, "SELECT * FROM company_table limit 10")
  # Close the connection
  conn.close()
apis: llama_index.llms.OpenAI llama_index.ServiceContext.from_defaults llama_index.SQLDatabase llama_index.indices.struct_store.sql_query.NLSQLTableQueryEngine
extract_api: [((1122, 1158), 'llama_index.llms.OpenAI', 'OpenAI', ([], {'temperature': '(0)', 'model': '"""gpt-4"""'}), "(temperature=0, model='gpt-4')\n", (1128, 1158), False, 'from llama_index.llms import OpenAI\n'), ((1168, 1210), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///company_info.db"""'], {}), "('sqlite:///company_info.db')\n", (1181, 1210), False, 'from sqlalchemy import create_engine, MetaData, Table, Column, String, Integer, select, text\n'), ((1226, 1236), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (1234, 1236), False, 'from sqlalchemy import create_engine, MetaData, Table, Column, String, Integer, select, text\n'), ((1287, 1324), 'llama_index.ServiceContext.from_defaults', 'ServiceContext.from_defaults', ([], {'llm': 'llm'}), '(llm=llm)\n', (1315, 1324), False, 'from llama_index import SQLDatabase, ServiceContext\n'), ((1340, 1393), 'llama_index.SQLDatabase', 'SQLDatabase', (['engine'], {'include_tables': "['company_table']"}), "(engine, include_tables=['company_table'])\n", (1351, 1393), False, 'from llama_index import SQLDatabase, ServiceContext\n'), ((1409, 1419), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (1417, 1419), False, 'from sqlalchemy import create_engine, MetaData, Table, Column, String, Integer, select, text\n'), ((1604, 1678), 'llama_index.indices.struct_store.sql_query.NLSQLTableQueryEngine', 'NLSQLTableQueryEngine', ([], {'sql_database': 'sql_database', 'tables': "['company_table']"}), "(sql_database=sql_database, tables=['company_table'])\n", (1625, 1678), False, 'from llama_index.indices.struct_store.sql_query import NLSQLTableQueryEngine\n'), ((578, 612), 'sqlite3.connect', 'sqlite3.connect', (['"""company_info.db"""'], {}), "('company_info.db')\n", (593, 612), False, 'import sqlite3\n'), ((671, 761), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\Nsahni\\\\Downloads\\\\Github\\\\Bynd\\\\company_information_db.csv"""'], {}), "(\n    'C:\\\\Users\\\\Nsahni\\\\Downloads\\\\Github\\\\Bynd\\\\company_information_db.csv')\n", (682, 761), True, 'import pandas as pd\n'), ((958, 988), 'pandas.read_sql_query', 'pd.read_sql_query', (['query', 'conn'], {}), '(query, conn)\n', (975, 988), True, 'import pandas as pd\n')]