Spaces:
Sleeping
Sleeping
File size: 502 Bytes
c4c9996 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from langchain.llms import OpenAI
from dotenv import load_dotenv
load_dotenv()
import os
import streamlit as st
def get_openai_response(question):
llm = OpenAI(temperature=0.5)
response=llm(question)
return response
st.set_page_config(page_title="QnA Demo")
st.header("Langchain App")
input_text = st.text_input("Input: ", key="input")
response = get_openai_response(input_text)
submit=st.button("Ask the question")
if submit:
st.subheader("The Response is")
st.write(response) |