DrishtiSharma commited on
Commit
8a4396c
Β·
verified Β·
1 Parent(s): 466344f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -101,8 +101,8 @@ def orchestrate_workflow(client, url):
101
  st.markdown(
102
  """
103
  <style>
104
- .title { text-align: center; font-size: 2.8rem; font-weight: bold; margin-bottom: 20px; }
105
- .description { text-align: center; font-size: 1.1rem; color: #555; margin-bottom: 30px; }
106
  .section { margin-top: 30px; margin-bottom: 30px; }
107
  .ack { font-size: 0.95rem; color: #888; text-align: center; margin-top: 50px; }
108
  </style>
@@ -110,14 +110,16 @@ st.markdown(
110
  unsafe_allow_html=True,
111
  )
112
 
113
- # Add cover image
114
- st.image("./image-4.png", use_column_width=True)
115
-
116
- # Title and description
117
  st.markdown('<div class="title">Swarm-based Web Content Analyzer 🧐</div>', unsafe_allow_html=True)
 
 
 
 
 
118
  st.markdown('<div class="description">Effortlessly extract, analyze, and summarize web content using multi-agents.</div>', unsafe_allow_html=True)
119
 
120
- # Add some spacing
121
  st.markdown('<div class="section"></div>', unsafe_allow_html=True)
122
 
123
  fetch_openai_api_key()
@@ -125,14 +127,14 @@ fetch_openai_api_key()
125
  if 'OPENAI_API_KEY' in os.environ and os.environ['OPENAI_API_KEY']:
126
  client = initialize_swarm_client()
127
 
128
- # Input field for the website URL
129
  st.subheader("🌍 Enter the Website URL")
130
  url = st.text_input("Enter the URL of the website you want to scrape", placeholder="https://example.com")
131
 
132
  # Add some spacing
133
  st.markdown('<div class="section"></div>', unsafe_allow_html=True)
134
 
135
- # Run the workflow logic
136
  if st.button("πŸš€ Run Workflow", key="run"):
137
  if url:
138
  with st.spinner("Running the multi-agent workflow... This may take a moment."):
@@ -150,11 +152,8 @@ st.divider()
150
  st.markdown(
151
  """
152
  <div class="ack">
153
- Acknowledgment: This app is based on <a href="https://github.com/jadouse5/openai-swarm-webscraper" target="_blank">Jad Tounsi El Azzoiani's</a> work.
154
  </div>
155
  """,
156
  unsafe_allow_html=True
157
  )
158
-
159
-
160
-
 
101
  st.markdown(
102
  """
103
  <style>
104
+ .title { text-align: center; font-size: 2.4rem; font-weight: bold; margin-bottom: 20px; }
105
+ .description { text-align: center; font-size: 1.0rem; color: #555; margin-bottom: 30px; }
106
  .section { margin-top: 30px; margin-bottom: 30px; }
107
  .ack { font-size: 0.95rem; color: #888; text-align: center; margin-top: 50px; }
108
  </style>
 
110
  unsafe_allow_html=True,
111
  )
112
 
113
+ # 1. Add the title at the top
 
 
 
114
  st.markdown('<div class="title">Swarm-based Web Content Analyzer 🧐</div>', unsafe_allow_html=True)
115
+
116
+ # 2. Add the image below the title
117
+ st.image("/image-4.png", use_column_width=True)
118
+
119
+ # 3. Add the description below the image
120
  st.markdown('<div class="description">Effortlessly extract, analyze, and summarize web content using multi-agents.</div>', unsafe_allow_html=True)
121
 
122
+ # Add some spacing between sections
123
  st.markdown('<div class="section"></div>', unsafe_allow_html=True)
124
 
125
  fetch_openai_api_key()
 
127
  if 'OPENAI_API_KEY' in os.environ and os.environ['OPENAI_API_KEY']:
128
  client = initialize_swarm_client()
129
 
130
+ # 4. Add interface for URL input
131
  st.subheader("🌍 Enter the Website URL")
132
  url = st.text_input("Enter the URL of the website you want to scrape", placeholder="https://example.com")
133
 
134
  # Add some spacing
135
  st.markdown('<div class="section"></div>', unsafe_allow_html=True)
136
 
137
+ # Add the "Run Workflow" button
138
  if st.button("πŸš€ Run Workflow", key="run"):
139
  if url:
140
  with st.spinner("Running the multi-agent workflow... This may take a moment."):
 
152
  st.markdown(
153
  """
154
  <div class="ack">
155
+ Acknowledgment: This app is based on <a href="https://github.com/jadouse5/openai-swarm-webscraper" target="_blank">Jad Tounsi El Azzoiani's work</a>.
156
  </div>
157
  """,
158
  unsafe_allow_html=True
159
  )