asemxin commited on
Commit
4fcaec0
·
1 Parent(s): 988607c

feat: add Brave Search support

Browse files
Files changed (1) hide show
  1. entrypoint.sh +12 -0
entrypoint.sh CHANGED
@@ -11,6 +11,7 @@ FEISHU_APP_SECRET="${FEISHU_APP_SECRET:-}"
11
  API_BASE_URL="${API_BASE_URL:-https://asem12345-cliproxyapi.hf.space/v1}"
12
  API_KEY="${API_KEY:-}"
13
  MODEL_NAME="${MODEL_NAME:-gemini-3-flash}"
 
14
 
15
  if [ -z "$FEISHU_APP_ID" ] || [ -z "$FEISHU_APP_SECRET" ]; then
16
  echo "❌ 错误: 请设置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量"
@@ -123,6 +124,17 @@ config["channels"]["feishu"] = {
123
  "appSecret": "${FEISHU_APP_SECRET}"
124
  }
125
 
 
 
 
 
 
 
 
 
 
 
 
126
  with open(config_path, "w") as f:
127
  json.dump(config, f, indent=2)
128
 
 
11
  API_BASE_URL="${API_BASE_URL:-https://asem12345-cliproxyapi.hf.space/v1}"
12
  API_KEY="${API_KEY:-}"
13
  MODEL_NAME="${MODEL_NAME:-gemini-3-flash}"
14
+ BRAVE_API_KEY="${BRAVE_API_KEY:-}"
15
 
16
  if [ -z "$FEISHU_APP_ID" ] || [ -z "$FEISHU_APP_SECRET" ]; then
17
  echo "❌ 错误: 请设置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量"
 
124
  "appSecret": "${FEISHU_APP_SECRET}"
125
  }
126
 
127
+ # 配置 Brave Search(上网搜索)
128
+ brave_key = os.environ.get("BRAVE_API_KEY", "${BRAVE_API_KEY}")
129
+ if brave_key:
130
+ config.setdefault("tools", {}).setdefault("web", {})
131
+ config["tools"]["web"]["search"] = {
132
+ "enabled": True,
133
+ "provider": "brave",
134
+ "maxResults": 10
135
+ }
136
+ print(f"✅ Brave Search 已启用")
137
+
138
  with open(config_path, "w") as f:
139
  json.dump(config, f, indent=2)
140