|
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 |
|
|
|
|
|
gr.Interface( |
|
answer_question, |
|
[ |
|
gr.inputs.Textbox(lines=2, label="Query"), |
|
], |
|
gr.outputs.Textbox(label="Response"), |
|
title="Ask Harry Potter", |
|
description=""" Ask Harry Potter is a tool that let's you ask a question with |
|
the books' text as reference""" |
|
).launch() |