-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[router] web_search_preview tool basic implementation #12290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+493
−134
Merged
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
905bd16
initial implementation
key4ng 594ce0d
add utils change
key4ng 7a1f1b6
resolve merge conflict
key4ng 9aa372a
fix compile error
key4ng 3158a6e
refactoring
key4ng 757582a
clean code
key4ng 09168c8
refactoring the code for better readability
key4ng 3ddb5bb
clean code
key4ng b36c82c
fix clippy
key4ng 54da291
remove unrelated changes
key4ng 8286c9a
update error message
key4ng a16911a
add query field for web search
key4ng f9e8a03
fix streaming format
key4ng 33819ae
fix fmt
key4ng 2b089e1
resolve comments
key4ng 951853f
fix format
key4ng faa2ce7
Merge branch 'main' into web-search
key4ng 6acfd88
Merge branch 'main' into web-search
key4ng ac06018
Merge branch 'main' of https://github.com/sgl-project/sglang into web…
key4ng ddc709e
Merge branch 'main' of https://github.com/sgl-project/sglang into web…
key4ng a7e4e65
Merge branch 'web-search' of https://github.com/key4ng/sglang into we…
key4ng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Example MCP Configuration with Web Search Preview | ||
| # | ||
| # This configuration demonstrates how to set up the web_search_preview tool | ||
| # for the OpenAI router. | ||
| # | ||
| # Usage: | ||
| # export SGLANG_MCP_CONFIG=/path/to/this/mcp_config_web_search.yaml | ||
| # export WEB_SEARCH_MCP_URL="https://your-search-server.com/sse" | ||
| # export WEB_SEARCH_MCP_TOKEN="your-token" | ||
|
|
||
| # Global proxy configuration (optional) | ||
| # proxy: | ||
| # http: "http://proxy:8080" | ||
| # https: "http://proxy:8080" | ||
| # no_proxy: "localhost,127.0.0.1,*.internal" | ||
|
|
||
| # Connection pool settings | ||
| pool: | ||
| max_connections: 100 | ||
| idle_timeout: 300 | ||
|
|
||
| # Tool inventory settings | ||
| inventory: | ||
| enable_refresh: true | ||
| tool_ttl: 300 # 5 minutes | ||
| refresh_interval: 60 # 1 minute | ||
| refresh_on_error: true | ||
|
|
||
| # MCP Servers | ||
| servers: | ||
| # Web Search Preview Server | ||
| # This server provides web search capabilities to the LLM | ||
| - name: "web_search_preview" | ||
| protocol: sse | ||
| url: http://localhost:8001/sse | ||
| # token: "${WEB_SEARCH_MCP_TOKEN}" | ||
| required: true # Don't fail startup if unavailable | ||
|
|
||
| # Example: Additional MCP server | ||
| # - name: "another-mcp-server" | ||
| # protocol: stdio | ||
| # command: "node" | ||
| # args: ["./mcp-server.js"] | ||
| # required: false | ||
|
|
||
| # Pre-warm connections at startup (optional) | ||
| # warmup: | ||
| # - url: "${WEB_SEARCH_MCP_URL}" | ||
| # label: "web_search_preview" | ||
| # token: "${WEB_SEARCH_MCP_TOKEN}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.