Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,30 +1,20 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import os
|
| 3 |
import runpy
|
|
|
|
|
|
|
| 4 |
st.set_page_config(layout="wide", page_title="My Multi-Page App")
|
| 5 |
-
|
| 6 |
-
os.environ[key] = value
|
| 7 |
def home_page():
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
st.session_state.token_entered = False
|
| 22 |
-
if not st.session_state.token_entered:
|
| 23 |
-
home_page()
|
| 24 |
-
else:
|
| 25 |
-
# 动态加载子页面
|
| 26 |
-
page = st.sidebar.radio("选择页面", ["天气查询助手", "博客写作助手"])
|
| 27 |
-
if page == "天气查询助手":
|
| 28 |
-
runpy.run_path("agent_api_web_demo.py", run_name="__main__")
|
| 29 |
-
elif page == "博客写作助手":
|
| 30 |
-
runpy.run_path("multi_agents_api_web_demo.py", run_name="__main__")
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import runpy
|
| 3 |
+
|
| 4 |
+
# 设置页面配置
|
| 5 |
st.set_page_config(layout="wide", page_title="My Multi-Page App")
|
| 6 |
+
|
|
|
|
| 7 |
def home_page():
|
| 8 |
+
st.header("欢迎来到首页")
|
| 9 |
+
|
| 10 |
+
# 选择页面
|
| 11 |
+
page = st.sidebar.radio("选择页面", ["天气查询助手", "博客写作助手"])
|
| 12 |
+
|
| 13 |
+
# 根据选择加载子页面
|
| 14 |
+
if page == "天气查询助手":
|
| 15 |
+
runpy.run_path("agent_api_web_demo.py", run_name="__main__")
|
| 16 |
+
elif page == "博客写作助手":
|
| 17 |
+
runpy.run_path("multi_agents_api_web_demo.py", run_name="__main__")
|
| 18 |
+
|
| 19 |
+
# 加载页面
|
| 20 |
+
home_page()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|