Spaces:
Sleeping
Sleeping
from langchain.llms import OpenAI | |
from dotenv import load_dotenv | |
import os | |
load_dotenv() #to load the enviroment variables | |
import streamlit as st | |
def get_opeanai_response(question): | |
llm=OpenAI(openai_api_key=os.environ['OPEN_API_KEY'],temperature=0.6) | |
response=llm(question) | |
return response | |
st.title('Q&A Chatbot') | |
input=st.text_input('Input: ',key=input) | |
submit=st.button('Ask the Question:') | |
if submit: | |
st.subheader('The response is: ') | |
st.write(get_opeanai_response(input)) |