datascientist22 commited on
Commit
4741c15
·
verified ·
1 Parent(s): 3e311fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -34,6 +34,8 @@ if url_input:
34
  st.sidebar.markdown('<p style="color:green; font-weight:bold;">URL is correctly entered</p>', unsafe_allow_html=True)
35
  else:
36
  st.sidebar.markdown('<p style="color:red; font-weight:bold;">Invalid URL, please enter a valid one</p>', unsafe_allow_html=True)
 
 
37
 
38
  # Input fields for API keys with placeholders and helper text
39
  api_key_1 = st.sidebar.text_input("Enter LangChain API Key", type="password", placeholder="Enter your LangChain API Key", help="Please enter a valid LangChain API key here")
@@ -48,11 +50,15 @@ if st.sidebar.button("Submit API Keys"):
48
  else:
49
  st.sidebar.markdown('<p style="color:red; font-weight:bold;">Please fill in both API keys</p>', unsafe_allow_html=True)
50
 
51
- # Main Section with Multicolored Background and Chatbot Title
52
  main_bg_style = """
53
  <style>
54
  body {
55
  background: linear-gradient(135deg, #ff9a9e, #fad0c4, #fbc2eb, #a18cd1);
 
 
 
 
56
  }
57
  </style>
58
  """
@@ -125,6 +131,8 @@ if st.button("Submit Query"):
125
 
126
  # Store query and response in session for chat history
127
  st.session_state['chat_history'].append((query, result))
 
 
128
 
129
  # Display chat history
130
  for q, r in st.session_state['chat_history']:
 
34
  st.sidebar.markdown('<p style="color:green; font-weight:bold;">URL is correctly entered</p>', unsafe_allow_html=True)
35
  else:
36
  st.sidebar.markdown('<p style="color:red; font-weight:bold;">Invalid URL, please enter a valid one</p>', unsafe_allow_html=True)
37
+ else:
38
+ st.sidebar.markdown('<p style="color:red; font-weight:bold;">URL is required</p>', unsafe_allow_html=True)
39
 
40
  # Input fields for API keys with placeholders and helper text
41
  api_key_1 = st.sidebar.text_input("Enter LangChain API Key", type="password", placeholder="Enter your LangChain API Key", help="Please enter a valid LangChain API key here")
 
50
  else:
51
  st.sidebar.markdown('<p style="color:red; font-weight:bold;">Please fill in both API keys</p>', unsafe_allow_html=True)
52
 
53
+ # Main Section with Multicolored Background
54
  main_bg_style = """
55
  <style>
56
  body {
57
  background: linear-gradient(135deg, #ff9a9e, #fad0c4, #fbc2eb, #a18cd1);
58
+ color: #333; /* Ensures text visibility */
59
+ }
60
+ .stTextInput input {
61
+ color: #333; /* Ensures text color in inputs */
62
  }
63
  </style>
64
  """
 
131
 
132
  # Store query and response in session for chat history
133
  st.session_state['chat_history'].append((query, result))
134
+ else:
135
+ st.warning("Both URL and query are required")
136
 
137
  # Display chat history
138
  for q, r in st.session_state['chat_history']: