import streamlit as st from langchain.llms import OpenAI def get_response_from_openai(question): llm = OpenAI(model_name="gpt-3.5-turbo-instruct",temperature=0.1) answer=llm(question) return answer st.set_page_config(page_title="Ask GPT", page_icon=":robot:") st.header("Ask GPT") def get_user_text(): text = st.text_input("Ask: ", key="input") return text user_input = get_user_text() response = get_response_from_openai(user_input) submit = st.button('Ask') if submit: st.subheader("Answer:") st.write(response)