Lanchain_QA_chatbot / chatbot.py
EswarP's picture
Upload chatbot.py
efdbd4b verified
raw
history blame contribute delete
No virus
505 Bytes
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))