feat: implement council v3 round-table mode
This commit is contained in:
parent
e90d42ac7b
commit
84b01a07a2
40
app.py
40
app.py
@ -107,17 +107,35 @@ if "research_steps_output" not in st.session_state:
|
|||||||
with st.sidebar:
|
with st.sidebar:
|
||||||
st.header("⚙️ 设置")
|
st.header("⚙️ 设置")
|
||||||
|
|
||||||
# 全局 API Key 设置
|
# 全局 API Key & Provider 设置
|
||||||
with st.expander("🔑 API Key 设置", expanded=True):
|
with st.expander("🔑 API / Provider 设置", expanded=True):
|
||||||
use_custom_key = st.checkbox("使用自定义 API Key")
|
# Provider Selection
|
||||||
if use_custom_key:
|
selected_provider_label = st.selectbox(
|
||||||
api_key = st.text_input(
|
"选择 API 提供商",
|
||||||
"API Key",
|
options=list(config.LLM_PROVIDERS.keys()),
|
||||||
type="password",
|
index=0
|
||||||
help="留空则使用环境变量中的 Key"
|
)
|
||||||
)
|
|
||||||
else:
|
provider_config = config.LLM_PROVIDERS[selected_provider_label]
|
||||||
api_key = DEFAULT_API_KEY
|
provider_id = selected_provider_label.lower()
|
||||||
|
|
||||||
|
# API Key Input
|
||||||
|
default_key = os.getenv(provider_config["api_key_var"], "")
|
||||||
|
api_key = st.text_input(
|
||||||
|
f"{selected_provider_label} API Key",
|
||||||
|
type="password",
|
||||||
|
value=default_key,
|
||||||
|
help=f"环境变量: {provider_config['api_key_var']}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Base URL
|
||||||
|
base_url = st.text_input(
|
||||||
|
"API Base URL",
|
||||||
|
value=provider_config["base_url"]
|
||||||
|
)
|
||||||
|
|
||||||
|
if not api_key:
|
||||||
|
st.warning("请配置 API Key 以继续")
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user