NBA-Stats / app.py
Khachatur Mirijanyan
fix title
22c6298
raw
history blame
1.13 kB
from langchain import SQLDatabaseChain
from langchain.sql_database import SQLDatabase
from langchain.llms.openai import OpenAI
from langchain.chat_models import ChatOpenAI
from langchain.prompts.prompt import PromptTemplate
def answer_question(query):
return("DONE: " + query)
if __name__ == "__main__":
import gradio as gr
# print(answer_question("Who is Harry's Father"))
gr.Interface(
answer_question,
[
gr.inputs.Textbox(lines=2, label="Query"),
],
gr.outputs.Textbox(label="Response"),
title="Ask NBA Stats",
description=""" Ask NBA Stats is a tool that let's you ask a question with
the NBA SQL tables as a reference
If you would like to access the large DB use format
### Query
single line query
### Tables
tables to access line by line
table1
table2"""
).launch()