mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
(fix) langfuse logging - dont fail when casting optional params
This commit is contained in:
parent
e6aafb50dc
commit
4aa95f9d43
1 changed files with 5 additions and 1 deletions
|
|
@ -43,7 +43,11 @@ class LangFuseLogger:
|
|||
# langfuse only accepts str, int, bool, float for logging
|
||||
for param, value in optional_params.items():
|
||||
if not isinstance(value, (str, int, bool, float)):
|
||||
optional_params[param] = str(value)
|
||||
try:
|
||||
optional_params[param] = str(value)
|
||||
except:
|
||||
# if casting value to str fails don't block logging
|
||||
pass
|
||||
|
||||
# end of processing langfuse ########################
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue