How to delete the box behind the chat message input

I’m building a chatbot app and I wanted to make the box behind the chat input invisible, so that it doesn’t cover my background image. I tried searching for it in the devtools, because that’s how I did it for the header, but it didn’t work. Can I do that?

I’m currently running Streamlit 1.49.1 and Python 3.13.5

This is the code currently:

#import packages
from dotenv import load_dotenv
import openai
import streamlit as st

@st.cache_data
def get_response(user_prompt):
    response = client.responses.create(
            model = "gpt-4o", #Selects the model that you want to use (use the cheap one)
            input = [ #List that keeps track of convo history as a list
            {"role" : "user", "content": user_prompt} #Prompt
            ],
            temperature = 0.7, #How creative the answer will get
            max_output_tokens = 100  #Limit response length 
        )   
    return response
#Load enviroment variables from the .env file
load_dotenv()

#Initialize the OpenAI Client
client = openai.OpenAI()
title = st.empty()
subtitle = st.empty()
title.markdown("<h1 style='text-align: center;'>Hello There!</h1>", unsafe_allow_html=True)
subtitle.markdown("<h2 style='text-align: center; '>How can we help you?</h2>", unsafe_allow_html=True)
page_bg_image = """
<style>
[data-testid="stAppViewContainer"] {
    background-image: url('https://snu.edu.in/site/assets/files/18543/gears-technological-elements-digital-blue-background-symbolizing-network-innovation-communication-3d-rendering.1600x0.webp');
    background-size: cover;
}
[data-testid="stHeader"]{
background-color: rgba(0,0,0,0);
}
[data-testid="stBottomBlockContainer"] {
    background: rgba(0,0,0,0);
}
</style>
"""
st.markdown(page_bg_image, unsafe_allow_html=True)
#Add a text input box for the user prompt
user_prompt = st.chat_input("Enter your prompt: ")
if user_prompt:
        title.empty()
        subtitle.empty()
        st.chat_message("user").write(user_prompt)
        with st.spinner("Generating response..."):
            response = get_response(user_prompt)
#Print the response
        st.chat_message("assistant").write(response.output[0].content[0].text)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.