Spaces:
Sleeping
Sleeping
Jesus Sanchez commited on
Commit ·
787b5cd
1
Parent(s): 54cda27
cleanup
Browse files
app.py
CHANGED
|
@@ -1,14 +1,11 @@
|
|
| 1 |
-
from os import write
|
| 2 |
-
from langchain.llms.base import LLM
|
| 3 |
import streamlit as st
|
| 4 |
import numpy as np
|
| 5 |
import pandas as pd
|
| 6 |
import altair as alt
|
| 7 |
import chat as idf_chat
|
| 8 |
-
# import sqlite3
|
| 9 |
from langchain.sql_database import SQLDatabase
|
| 10 |
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
|
| 11 |
-
from langchain.agents import
|
| 12 |
from langchain import OpenAI
|
| 13 |
from langchain import PromptTemplate, OpenAI, LLMChain
|
| 14 |
from langchain.chains import SimpleSequentialChain
|
|
@@ -27,9 +24,6 @@ if DB_CHAIN not in st.session_state:
|
|
| 27 |
st.session_state[DB_CHAIN] = {}
|
| 28 |
|
| 29 |
def get_sql_agent():
|
| 30 |
-
# db = SQLDatabase.from_uri("sqlite:///switrs.sqlite")
|
| 31 |
-
db = SQLDatabase.from_uri("sqlite:///FXTrades.db")
|
| 32 |
-
|
| 33 |
toolkit = SQLDatabaseToolkit(llm=llm,db=db)
|
| 34 |
|
| 35 |
return create_sql_agent(
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import numpy as np
|
| 3 |
import pandas as pd
|
| 4 |
import altair as alt
|
| 5 |
import chat as idf_chat
|
|
|
|
| 6 |
from langchain.sql_database import SQLDatabase
|
| 7 |
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
|
| 8 |
+
from langchain.agents import create_sql_agent
|
| 9 |
from langchain import OpenAI
|
| 10 |
from langchain import PromptTemplate, OpenAI, LLMChain
|
| 11 |
from langchain.chains import SimpleSequentialChain
|
|
|
|
| 24 |
st.session_state[DB_CHAIN] = {}
|
| 25 |
|
| 26 |
def get_sql_agent():
|
|
|
|
|
|
|
|
|
|
| 27 |
toolkit = SQLDatabaseToolkit(llm=llm,db=db)
|
| 28 |
|
| 29 |
return create_sql_agent(
|