mirror of
https://github.com/open-webui/open-webui
synced 2025-01-31 06:49:03 +00:00
fix
This commit is contained in:
parent
dfcc314283
commit
9f58ed5afa
@ -61,13 +61,11 @@ async def on_startup():
|
|||||||
|
|
||||||
class RAGMiddleware(BaseHTTPMiddleware):
|
class RAGMiddleware(BaseHTTPMiddleware):
|
||||||
async def dispatch(self, request: Request, call_next):
|
async def dispatch(self, request: Request, call_next):
|
||||||
|
|
||||||
"chat/completions" in request.url.path
|
|
||||||
|
|
||||||
print(request.url.path)
|
|
||||||
if request.method == "POST" and (
|
if request.method == "POST" and (
|
||||||
"/api/chat" in request.url.path or "/chat/completions" in request.url.path
|
"/api/chat" in request.url.path or "/chat/completions" in request.url.path
|
||||||
):
|
):
|
||||||
|
print(request.url.path)
|
||||||
|
|
||||||
# Read the original request body
|
# Read the original request body
|
||||||
body = await request.body()
|
body = await request.body()
|
||||||
# Decode body to string
|
# Decode body to string
|
||||||
|
Loading…
Reference in New Issue
Block a user