Koomemartin commited on
Commit
f34e472
·
verified ·
1 Parent(s): d9d414b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,14 +24,14 @@ api_key = os.getenv('GROQ_API_KEY')
24
  client = Groq(api_key=api_key)
25
 
26
  # Streamlit UI
27
- st.title("Welcome to WebBot")
28
  st.write("Enter a website URL and ask questions about its content!")
29
 
30
  # Input fields
31
  url = st.text_input("Website URL:", "https://example.com or .ac.ke " )
32
  user_query = st.text_area("What would you like to know about this website")
33
 
34
- if st.button("Submit"):
35
  # Scrape website content
36
  with st.spinner("Scraping website..."):
37
  website = Website(url)
@@ -57,7 +57,7 @@ if st.button("Submit"):
57
  top_p=1,
58
  stream=True,
59
  )
60
- st.write('Passed model')
61
 
62
  except Exception as e:
63
  st.error(f"Failed to process query: {e}")
@@ -67,7 +67,7 @@ if st.button("Submit"):
67
  content = chunk.choices[0].delta.content
68
  if content: # Ensure content is not None
69
  response += content
70
- st.write("### Response:")
71
  st.write(response)
72
  except Exception as e:
73
  st.error(f"Failed to process query: {e}")
 
24
  client = Groq(api_key=api_key)
25
 
26
  # Streamlit UI
27
+ st.title("Welcome to WebBot🌍")
28
  st.write("Enter a website URL and ask questions about its content!")
29
 
30
  # Input fields
31
  url = st.text_input("Website URL:", "https://example.com or .ac.ke " )
32
  user_query = st.text_area("What would you like to know about this website")
33
 
34
+ if user_query:
35
  # Scrape website content
36
  with st.spinner("Scraping website..."):
37
  website = Website(url)
 
57
  top_p=1,
58
  stream=True,
59
  )
60
+ # st.write('Passed model')
61
 
62
  except Exception as e:
63
  st.error(f"Failed to process query: {e}")
 
67
  content = chunk.choices[0].delta.content
68
  if content: # Ensure content is not None
69
  response += content
70
+ st.write("🤖:")
71
  st.write(response)
72
  except Exception as e:
73
  st.error(f"Failed to process query: {e}")