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)