Updated Jina's search function in order to use POST and make use of the result count passed by the user, as well as adding a header to not return the images possibly found on the search reducing token usage.
Added
"Content-Type": "application/json" header
"X-Retain-Images": "none" header
Added a payload variable containing the query and result count (capped at 10)
Changed
Replaced GET request by a POST request
Removed
[:count] cap on the data["data"] loop because we are already asking Jina to return the result count specified by the user
Additional Information
Jina supports a max of 10 result count
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/9505
**Author:** [@binxn](https://github.com/binxn)
**Created:** 2/6/2025
**Status:** ✅ Merged
**Merged:** 2/7/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `patch-1`
---
### 📝 Commits (1)
- [`88db4ca`](https://github.com/open-webui/open-webui/commit/88db4ca7babc232f9bbb2962bb078178deb038b6) Update jina_search.py
### 📊 Changes
**1 file changed** (+16 additions, -4 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/retrieval/web/jina_search.py` (+16 -4)
</details>
### 📄 Description
### Description
Updated Jina's search function in order to use POST and make use of the result count passed by the user, as well as adding a header to not return the images possibly found on the search reducing token usage.
### Added
- `"Content-Type": "application/json"` header
- `"X-Retain-Images": "none"` header
- Added a `payload `variable containing the query and result count (capped at 10)
### Changed
- Replaced GET request by a POST request
### Removed
- `[:count]` cap on the `data["data"]` loop because we are already asking Jina to return the result count specified by the user
---
### Additional Information
- Jina supports a max of 10 result count
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/9505
Author: @binxn
Created: 2/6/2025
Status: ✅ Merged
Merged: 2/7/2025
Merged by: @tjbck
Base:
dev← Head:patch-1📝 Commits (1)
88db4caUpdate jina_search.py📊 Changes
1 file changed (+16 additions, -4 deletions)
View changed files
📝
backend/open_webui/retrieval/web/jina_search.py(+16 -4)📄 Description
Description
Updated Jina's search function in order to use POST and make use of the result count passed by the user, as well as adding a header to not return the images possibly found on the search reducing token usage.
Added
"Content-Type": "application/json"header"X-Retain-Images": "none"headerpayloadvariable containing the query and result count (capped at 10)Changed
Removed
[:count]cap on thedata["data"]loop because we are already asking Jina to return the result count specified by the userAdditional Information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.