Spaces:
Sleeping
Sleeping
File size: 525 Bytes
5752cb2 1fe42a6 5752cb2 1fe42a6 5752cb2 1fe42a6 5752cb2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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) |