fix: enhance web search functionality with proxy support (#1823)

* fix: enhance web search functionality with proxy support

- Remove unnecessary blank line in README.md
- Add missing closing details tag in both README.md and README_zh.md
- Add proxy support to the web search engine configuration in config.lua
- Ensure the web search function uses the proxy setting when available in init.lua
- Fix a potential nil access in the response body format check in config.lua

Signed-off-by: 范立洲 <fanlizhou@yunqilaohe.com>

* [pre-commit.ci lite] apply automatic fixes

---------

Signed-off-by: 范立洲 <fanlizhou@yunqilaohe.com>
Co-authored-by: 范立洲 <fanlizhou@yunqilaohe.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
doodleEsc
2025-04-07 15:05:22 +08:00
committed by GitHub
parent 40ffc0f5fa
commit 1c36cfc812
4 changed files with 101 additions and 80 deletions

View File

@@ -28,7 +28,6 @@
[查看中文版](README_zh.md)
> [!NOTE]
>
> 🥰 This project is undergoing rapid iterations, and many exciting features will be added successively. Stay tuned!
@@ -436,6 +435,7 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_
},
}
```
</details>
## Blink.cmp users
@@ -641,6 +641,7 @@ The following key bindings are available for use with `avante.nvim`:
### Neotree shortcut
In the neotree sidebar, you can also add a new keyboard shortcut to quickly add `file/folder` to `Avante Selected Files`.
<details>
<summary>Neotree configuration</summary>
@@ -685,6 +686,7 @@ return {
},
}
```
</details>
## Commands
@@ -692,17 +694,17 @@ return {
| Command | Description | Examples |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `:AvanteAsk [question] [position]` | Ask AI about your code. Optional `position` set window position and `ask` enable/disable direct asking mode | `:AvanteAsk position=right Refactor this code here` |
| `:AvanteBuild` | Build dependencies for the project | |
| `:AvanteChat` | Start a chat session with AI about your codebase. Default is `ask`=false | |
| `:AvanteClear` | Clear the chat history | |
| `:AvanteEdit` | Edit the selected code blocks | |
| `:AvanteFocus` | Switch focus to/from the sidebar | |
| `:AvanteRefresh` | Refresh all Avante windows | |
| `:AvanteStop` | Stop the current AI request | |
| `:AvanteSwitchProvider` | Switch AI provider (e.g. openai) | |
| `:AvanteShowRepoMap` | Show repo map for project's structure | |
| `:AvanteToggle` | Toggle the Avante sidebar | |
| `:AvanteModels` | Show model list | |
| `:AvanteBuild` | Build dependencies for the project | |
| `:AvanteChat` | Start a chat session with AI about your codebase. Default is `ask`=false | |
| `:AvanteClear` | Clear the chat history | |
| `:AvanteEdit` | Edit the selected code blocks | |
| `:AvanteFocus` | Switch focus to/from the sidebar | |
| `:AvanteRefresh` | Refresh all Avante windows | |
| `:AvanteStop` | Stop the current AI request | |
| `:AvanteSwitchProvider` | Switch AI provider (e.g. openai) | |
| `:AvanteShowRepoMap` | Show repo map for project's structure | |
| `:AvanteToggle` | Toggle the Avante sidebar | |
| `:AvanteModels` | Show model list | |
## Highlight Groups
@@ -814,6 +816,7 @@ The default is Tavily, and can be changed through configuring `Config.web_search
```lua
web_search_engine = {
provider = "tavily", -- tavily, serpapi, searchapi, google or kagi
proxy = nil, -- proxy support, e.g., http://127.0.0.1:7890
}
```
@@ -906,6 +909,7 @@ Avante allows you to define custom tools that can be used by the AI during code
},
}
```
</details>
## MCP
@@ -927,7 +931,6 @@ Avante leverages [Claude Text Editor Tool](https://docs.anthropic.com/en/docs/bu
> [!NOTE]
> To enable **Claude Text Editor Tool Mode**, you must use the `claude-3-5-sonnet-*` or `claude-3-7-sonnet-*` model with the `claude` provider! This feature is not supported by any other models!
## Custom prompts
By default, `avante.nvim` provides three different modes to interact with: `planning`, `editing`, and `suggesting`, followed with three different prompts per mode.