(fix) langfuse logging - dont fail when casting optional params
This commit is contained in:
parent
e6aafb50dc
commit
4aa95f9d43
@ -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…
Reference in New Issue
Block a user