import streamlit as st import os from langchain.llms import OpenAI ### Function to load OpenAI model and get responses def get_openai_responses(question): llm=OpenAI(model_name='text-davinci-003',temperature=0.6) response = llm.predict(question) return response st.set_page_config(page_title='LLM CHATBOT') st.header('Langchain Application') input = st.text_input('Input:',key='input') submit = st.button('Ask the question') response = get_openai_responses(input) ## If ask button is clicked if submit: st.subheader('The Reader is:') st.write(response)