Kann ich die große Schachtel hinter einem Chat -Eingang am unteren Rand einer streamlitischen Website entfernen?CSS

CSS verstehen
Anonymous
 Kann ich die große Schachtel hinter einem Chat -Eingang am unteren Rand einer streamlitischen Website entfernen?

Post by Anonymous »

Ich erstelle gerade eine Website, die einen Chatbot betrifft, und in der Chat -Nachrichteneingabe steckt ein schwarzes Box dahinter, das einen Teil meines Hintergrundbildes abdeckt. Gibt es eine Möglichkeit, es zu entfernen? Ich habe versucht, es bei den Devtools zu finden, aber es hat einfach nicht funktioniert.

Code: Select all

#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("Hello There!", unsafe_allow_html=True)
subtitle.markdown("How can we help you?", unsafe_allow_html=True)
page_bg_image = """

[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);
}

"""
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)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post