"...targets/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "0e6ee3f7ff7880e9e65b84fbceed8686e426bc8a"
Unverified Commit c8418da8 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3217 from theasp/better-body-logging

chore: Log API request bodies at debug level
parents 9928114c c0c875ea
...@@ -850,8 +850,7 @@ async def generate_chat_completion( ...@@ -850,8 +850,7 @@ async def generate_chat_completion(
url = app.state.config.OLLAMA_BASE_URLS[url_idx] url = app.state.config.OLLAMA_BASE_URLS[url_idx]
log.info(f"url: {url}") log.info(f"url: {url}")
log.debug(payload)
print(payload)
return await post_streaming_url(f"{url}/api/chat", json.dumps(payload)) return await post_streaming_url(f"{url}/api/chat", json.dumps(payload))
......
...@@ -430,13 +430,11 @@ async def generate_chat_completion( ...@@ -430,13 +430,11 @@ async def generate_chat_completion(
# Convert the modified body back to JSON # Convert the modified body back to JSON
payload = json.dumps(payload) payload = json.dumps(payload)
print(payload) log.debug(payload)
url = app.state.config.OPENAI_API_BASE_URLS[idx] url = app.state.config.OPENAI_API_BASE_URLS[idx]
key = app.state.config.OPENAI_API_KEYS[idx] key = app.state.config.OPENAI_API_KEYS[idx]
print(payload)
headers = {} headers = {}
headers["Authorization"] = f"Bearer {key}" headers["Authorization"] = f"Bearer {key}"
headers["Content-Type"] = "application/json" headers["Content-Type"] = "application/json"
......
...@@ -776,7 +776,7 @@ async def generate_title(form_data: dict, user=Depends(get_verified_user)): ...@@ -776,7 +776,7 @@ async def generate_title(form_data: dict, user=Depends(get_verified_user)):
"title": True, "title": True,
} }
print(payload) log.debug(payload)
try: try:
payload = filter_pipeline(payload, user) payload = filter_pipeline(payload, user)
...@@ -905,7 +905,7 @@ Message: """{{prompt}}""" ...@@ -905,7 +905,7 @@ Message: """{{prompt}}"""
"task": True, "task": True,
} }
print(payload) log.debug(payload)
try: try:
payload = filter_pipeline(payload, user) payload = filter_pipeline(payload, user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment