-
Notifications
You must be signed in to change notification settings - Fork 56
Feat/websearch #253
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
Merged
Feat/websearch #253
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2e7a47d
feat: add web search integration with pluggable provider
paultranvan 768a4ea
feat(websearch): add content fetching for search results
paultranvan 2ba0415
docs: add web search feature documentation
paultranvan b8d6e48
docs: clarify that extra options go in metadata field
paultranvan f7f9892
feat(websearch): add SSRF protection and configurable SSL verification
paultranvan d490b96
fix(websearch): sanitize web result URLs with scheme check
paultranvan 89264ea
fix(websearch): guard against null metadata in payload
paultranvan d6c2fe7
refactor(websearch): provider config and factory pattern
paultranvan e6759c7
feat(websearch): global token budget for web sources
paultranvan ad422b5
feat(websearch): add chainlit WebSearch command and sources
paultranvan 3bdfe51
refactor(websearch): deduplicate defaults and separators
paultranvan 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| provider: '' | ||
| api_token: ${oc.env:WEBSEARCH_API_TOKEN, ""} | ||
| base_url: '' | ||
| top_k: ${oc.decode:${oc.env:WEBSEARCH_TOP_K, 5}} | ||
| lang: ${oc.env:WEBSEARCH_LANG, fr-FR} | ||
| max_tokens: ${oc.decode:${oc.env:WEBSEARCH_MAX_TOKENS, 2000}} | ||
| fetch_content: ${oc.decode:${oc.env:WEBSEARCH_FETCH_CONTENT, true}} | ||
| fetch_max_results: ${oc.decode:${oc.env:WEBSEARCH_FETCH_MAX_RESULTS, 3}} | ||
| fetch_timeout: ${oc.decode:${oc.env:WEBSEARCH_FETCH_TIMEOUT, 1.0}} | ||
| fetch_max_tokens: ${oc.decode:${oc.env:WEBSEARCH_FETCH_MAX_TOKENS, 500}} | ||
| fetch_verify_ssl: ${oc.decode:${oc.env:WEBSEARCH_FETCH_VERIFY_SSL, false}} |
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,5 @@ | ||
| defaults: | ||
| - base | ||
|
|
||
| provider: staan | ||
| base_url: ${oc.env:WEBSEARCH_BASE_URL, "https://api.staan.ai/search/web"} |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would nice to add the
websearchmetadata here like use_map_reduceopenrag/openrag/models/openai.py
Lines 18 to 34 in 6e99244
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in the chainlit frontend we can also provide the websearch functionality following what's been done here:
openrag/openrag/app_front.py
Lines 27 to 39 in 6e99244
openrag/openrag/app_front.py
Lines 219 to 221 in 6e99244
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in ad422b5