Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
c8418da8
Unverified
Commit
c8418da8
authored
Jun 16, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jun 16, 2024
Browse files
Merge pull request #3217 from theasp/better-body-logging
chore: Log API request bodies at debug level
parents
9928114c
c0c875ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+1
-2
backend/apps/openai/main.py
backend/apps/openai/main.py
+1
-3
backend/main.py
backend/main.py
+2
-2
No files found.
backend/apps/ollama/main.py
View file @
c8418da8
...
...
@@ -850,8 +850,7 @@ async def generate_chat_completion(
url
=
app
.
state
.
config
.
OLLAMA_BASE_URLS
[
url_idx
]
log
.
info
(
f
"url:
{
url
}
"
)
print
(
payload
)
log
.
debug
(
payload
)
return
await
post_streaming_url
(
f
"
{
url
}
/api/chat"
,
json
.
dumps
(
payload
))
...
...
backend/apps/openai/main.py
View file @
c8418da8
...
...
@@ -430,13 +430,11 @@ async def generate_chat_completion(
# Convert the modified body back to JSON
payload
=
json
.
dumps
(
payload
)
print
(
payload
)
log
.
debug
(
payload
)
url
=
app
.
state
.
config
.
OPENAI_API_BASE_URLS
[
idx
]
key
=
app
.
state
.
config
.
OPENAI_API_KEYS
[
idx
]
print
(
payload
)
headers
=
{}
headers
[
"Authorization"
]
=
f
"Bearer
{
key
}
"
headers
[
"Content-Type"
]
=
"application/json"
...
...
backend/main.py
View file @
c8418da8
...
...
@@ -776,7 +776,7 @@ async def generate_title(form_data: dict, user=Depends(get_verified_user)):
"title"
:
True
,
}
print
(
payload
)
log
.
debug
(
payload
)
try
:
payload
=
filter_pipeline
(
payload
,
user
)
...
...
@@ -905,7 +905,7 @@ Message: """{{prompt}}"""
"task"
:
True
,
}
print
(
payload
)
log
.
debug
(
payload
)
try
:
payload
=
filter_pipeline
(
payload
,
user
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment