Chatbot wont work after I deploy it. I have put in the API key in the main script, into my secrets, and into my environment.
You can access
st.secrets via attribute notation (e.g.
st.secrets.key ), in addition to key notation (e.g.
# Get the OpenAI API key from Streamlit secrets OPENAI_API_KEY = st.secrets["OPENAI_API_KEY"] # Initialize the OpenAI instance openai = OpenAI(api_key=OPENAI_API_KEY)