binqiangliu commited on
Commit
2acf609
·
1 Parent(s): 87ca47e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -17,6 +17,11 @@ HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
17
 
18
  # 用户输入
19
  url = st.text_input("Enter the URL to chat with:")
 
 
 
 
 
20
  print(f"URL Entered: "+url)
21
  print()
22
  question = st.text_input("Enter your question:")
 
17
 
18
  # 用户输入
19
  url = st.text_input("Enter the URL to chat with:")
20
+ # 检查 URL 是否以 "https://mp.weixin.qq.com" 开始
21
+ if not url.startswith("https://mp.weixin.qq.com"):
22
+ # 如果不是,则显示错误信息并终止程序
23
+ st.error("URL is incorrect. Please enter a URL that starts with 'https://mp.weixin.qq.com'.")
24
+ st.stop()
25
  print(f"URL Entered: "+url)
26
  print()
27
  question = st.text_input("Enter your question:")