Add supported OpenWebUI Thinking toggle for Athena Qwen profiles
This commit is contained in:
1 parent
8c10ccc8ec
commit
2902e47df5
5 files changed
+134
No files matched your search
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
title: Athena Thinking Control
|
||||
version: 1.0.0
|
||||
description: Send the Thinking switch state to Athena on every provider call.
|
||||
"""
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class Filter:
|
||||
class Valves(BaseModel):
|
||||
priority: int = Field(default=100)
|
||||
|
||||
def __init__(self):
|
||||
self.valves = self.Valves()
|
||||
|
||||
async def request(self, body: dict, __metadata__: dict = None) -> dict:
|
||||
metadata = __metadata__ or {}
|
||||
selected = metadata.get("filter_ids", []) or []
|
||||
enabled = "athena_thinking" in selected
|
||||
options = dict(body.get("chat_template_kwargs") or {})
|
||||
options["enable_thinking"] = enabled
|
||||
body["chat_template_kwargs"] = options
|
||||
# Avoid a chat/model effort setting contradicting the explicit switch.
|
||||
body.pop("reasoning_effort", None)
|
||||
return body
|
||||
Reference in new issue
Block a user