mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Merge pull request #3983 from BerriAI/litellm_log_request_boddy_langfuse
[Feat] Log Raw Request from LiteLLM on Langfuse - when `"log_raw_request": true`
This commit is contained in:
commit
dd7d0a2895
5 changed files with 303 additions and 195 deletions
|
@ -1305,6 +1305,13 @@ class Logging:
|
|||
)
|
||||
else:
|
||||
verbose_logger.info(f"\033[92m{curl_command}\033[0m\n")
|
||||
|
||||
# check if user wants the raw request logged to their logging provider (like LangFuse)
|
||||
_litellm_params = self.model_call_details.get("litellm_params", {})
|
||||
_metadata = _litellm_params.get("metadata", {}) or {}
|
||||
if _metadata.get("log_raw_request", False) is True:
|
||||
_metadata["raw_request"] = curl_command
|
||||
|
||||
if self.logger_fn and callable(self.logger_fn):
|
||||
try:
|
||||
self.logger_fn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue