efd86e2 Updated middleware.py to add OpenRouter compatibility
📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝backend/open_webui/utils/middleware.py (+1 -1)
📄 Description
Description
Added OpenRouter "reasoning" field compatibility. Previously, only "reasoning_content" field was being checked, so OpenRouter requests on reasoning models did not output the thinking process in the UI as "reasoning_content" is not part of the object, but "reasoning" is
Changed
Conditional assignment to check and use either "reasoning_content" or "reasoning" field value
Additional Information
LiteLLM uses "reasoning_content" field, which is the only one being used on OpenWebUI, however, other providers like OpenRouter use "reasoning"
🔄 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/11988
**Author:** [@binxn](https://github.com/binxn)
**Created:** 3/23/2025
**Status:** ✅ Merged
**Merged:** 3/23/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `dev`
---
### 📝 Commits (1)
- [`efd86e2`](https://github.com/open-webui/open-webui/commit/efd86e2cb4f2cb63f28fd67a0e4d2e945d5797a7) Updated middleware.py to add OpenRouter compatibility
### 📊 Changes
**1 file changed** (+1 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/utils/middleware.py` (+1 -1)
</details>
### 📄 Description
### Description
- Added OpenRouter "reasoning" field compatibility. Previously, only "reasoning_content" field was being checked, so OpenRouter requests on reasoning models did not output the thinking process in the UI as "reasoning_content" is not part of the object, but "reasoning" is
### Changed
- Conditional assignment to check and use either "reasoning_content" or "reasoning" field value
---
### Additional Information
- [LiteLLM](https://docs.litellm.ai/docs/reasoning_content) uses "reasoning_content" field, which is the only one being used on OpenWebUI, however, other providers like [OpenRouter](https://openrouter.ai/docs/use-cases/reasoning-tokens) use "reasoning"
---
<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/11988
Author: @binxn
Created: 3/23/2025
Status: ✅ Merged
Merged: 3/23/2025
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (1)
efd86e2Updated middleware.py to add OpenRouter compatibility📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+1 -1)📄 Description
Description
Changed
Additional Information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.