mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 10:17:43 -05:00
refac
This commit is contained in:
1 parent
89716ea880
commit
2daa610cba
2 files changed
+94
-8
No files matched your search
@@ -100,6 +100,14 @@ class Filter:
|
||||
|
||||
return body
|
||||
|
||||
def request(self, body: dict, __user__: Optional[dict] = None) -> dict:
|
||||
# Modify the request body before each model/provider call.
|
||||
print(f"request:{__name__}")
|
||||
print(f"request:body:{body}")
|
||||
print(f"request:user:{__user__}")
|
||||
|
||||
return body
|
||||
|
||||
def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
|
||||
# Modify or analyze the response body after processing by the API.
|
||||
# This function is the post-processor for the API, which can be used to modify the response
|
||||
@@ -201,6 +209,14 @@ class Filter:
|
||||
|
||||
return body
|
||||
|
||||
def request(self, body: dict, user: Optional[dict] = None) -> dict:
|
||||
# Modify the request body before each model/provider call.
|
||||
print(f"request:{__name__}")
|
||||
print(f"request:body:{body}")
|
||||
print(f"request:user:{user}")
|
||||
|
||||
return body
|
||||
|
||||
def outlet(self, body: dict, user: Optional[dict] = None) -> dict:
|
||||
# Modify or analyze the response body after processing by the API.
|
||||
# This function is the post-processor for the API, which can be used to modify the response
|
||||
|
||||
Reference in new issue
Block a user