Spaces:
Sleeping
Sleeping
from langchain_openai import OpenAI | |
#from dotenv import load_dotenv | |
import streamlit as st | |
import os | |
#load_dotenv() | |
def get_openai_response(question): | |
llm = OpenAI(temperature=0.6) | |
response = llm.invoke(question) | |
return response | |
st.set_page_config(page_title='Q&A Demo') | |
st.header('Langchain Application') | |
question = st.text_input('Enter a question:', key=input) | |
response = get_openai_response(question) | |
submit = st.button('Generate') | |
if submit: | |
st.subheader('The response is: ') | |
st.write(response) |