tackhwa commited on
Commit
caa8fa4
·
1 Parent(s): c5f093a

Fix conflict content in readme.md and change environment variable name from `'BING_API_KEY'` to `WEB_SEARCH_API_KEY` as mutiple search engine is supported (#178)

Browse files
Files changed (3) hide show
  1. README.md +4 -19
  2. README_zh-CN.md +6 -1
  3. mindsearch/agent/__init__.py +2 -2
README.md CHANGED
@@ -64,6 +64,10 @@ python -m mindsearch.app --lang en --model_format internlm_server --search_engin
64
  - `--search_engine`: Search engine.
65
  - `DuckDuckGoSearch` for search engine for DuckDuckGo.
66
  - `BingSearch` for Bing search engine.
 
 
 
 
67
 
68
  ### Step3: Setup MindSearch Frontend
69
 
@@ -100,25 +104,6 @@ python frontend/mindsearch_gradio.py
100
  streamlit run frontend/mindsearch_streamlit.py
101
  ```
102
 
103
- ## 🌐 Change Web Search API
104
-
105
- To use a different type of web search API, modify the `searcher_type` attribute in the `searcher_cfg` located in `mindsearch/agent/__init__.py`. Currently supported web search APIs include:
106
-
107
- - `GoogleSearch`
108
- - `DuckDuckGoSearch`
109
- - `BraveSearch`
110
- - `BingSearch`
111
-
112
- For example, to change to the Brave Search API, you would configure it as follows:
113
-
114
- ```python
115
- BingBrowser(
116
- searcher_type='BraveSearch',
117
- topk=2,
118
- api_key=os.environ.get('BRAVE_API_KEY', 'YOUR BRAVE API')
119
- )
120
- ```
121
-
122
  ## 🐞 Debug Locally
123
 
124
  ```bash
 
64
  - `--search_engine`: Search engine.
65
  - `DuckDuckGoSearch` for search engine for DuckDuckGo.
66
  - `BingSearch` for Bing search engine.
67
+ - `BraveSearch` for Brave search web api engine.
68
+ - `GoogleSearch` for Google Serper web search api engine.
69
+
70
+ Please set your Web Search engine API key as the `WEB_SEARCH_API_KEY` environment variable unless you are using `DuckDuckGo`.
71
 
72
  ### Step3: Setup MindSearch Frontend
73
 
 
104
  streamlit run frontend/mindsearch_streamlit.py
105
  ```
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  ## 🐞 Debug Locally
108
 
109
  ```bash
README_zh-CN.md CHANGED
@@ -61,7 +61,12 @@ python -m mindsearch.app --lang en --model_format internlm_server --search_engin
61
  如果您想使用其他模型,请修改 [models](./mindsearch/agent/models.py)
62
  - `--search_engine`: 搜索引擎。
63
  - `DuckDuckGoSearch` 为 DuckDuckGo 搜索引擎。
64
- - `BingSearch` 为 Bing搜索引擎。
 
 
 
 
 
65
  ### 步骤3: 启动 MindSearch 前端
66
 
67
  提供以下几种前端界面:
 
61
  如果您想使用其他模型,请修改 [models](./mindsearch/agent/models.py)
62
  - `--search_engine`: 搜索引擎。
63
  - `DuckDuckGoSearch` 为 DuckDuckGo 搜索引擎。
64
+ - `BingSearch` 为 Bing 搜索引擎。
65
+ - `BraveSearch` 为 Brave 搜索引擎。
66
+ - `GoogleSearch` 为 Google Serper 搜索引擎。
67
+
68
+ 请将网页搜索引擎 API 密钥设置为 `WEB_SEARCH_API_KEY` 环境变量,如果使用的是 `DuckDuckGo`,则无需设置。
69
+
70
  ### 步骤3: 启动 MindSearch 前端
71
 
72
  提供以下几种前端界面:
mindsearch/agent/__init__.py CHANGED
@@ -45,8 +45,8 @@ def init_agent(lang='cn', model_format='internlm_server',search_engine='DuckDuck
45
  plugin_executor=ActionExecutor(
46
  BingBrowser(searcher_type=search_engine,
47
  topk=6,
48
- api_key=os.environ.get('BING_API_KEY',
49
- 'YOUR BING API'))),
50
  protocol=MindSearchProtocol(
51
  meta_prompt=datetime.now().strftime(
52
  'The current date is %Y-%m-%d.'),
 
45
  plugin_executor=ActionExecutor(
46
  BingBrowser(searcher_type=search_engine,
47
  topk=6,
48
+ api_key=os.environ.get('WEB_SEARCH_API_KEY',
49
+ 'YOUR WEB SEARCH ENGINE API'))),
50
  protocol=MindSearchProtocol(
51
  meta_prompt=datetime.now().strftime(
52
  'The current date is %Y-%m-%d.'),