E-commerce Customer Behavior Dataset
from pandasai.llm.local_llm import LocalLLM
import streamlit as st
from pandasai.connectors import MySQLConnector
from pandasai import SmartDataframe
model = LocalLLM(
api_base="<http://localhost:11434/v1>",
model="llama3"
)
my_connector = MySQLConnector(
config={
"host": "localhost",
"port":3306,
"database":"EComUsr",
"username":"root",
"password":"****!",
"table": "customer"
}
)
df_connector = SmartDataframe(my_connector, config={"llm":model})
#st.UI-타이틀
st.title("MySQL with Llama3")
prompt = st.text_input("Enter your prompt:")
if st.button("Generate"):
if prompt :
with st.spinner("Generate response.."):
st.write(df_connector.chat(prompt))