mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(langfuse.py): use clean metadata instead of deepcopy
This commit is contained in:
parent
45c748475b
commit
b4c8af771d
1 changed files with 11 additions and 16 deletions
|
@ -311,22 +311,17 @@ class LangFuseLogger:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tags = []
|
tags = []
|
||||||
try:
|
new_metadata = {}
|
||||||
metadata = copy.deepcopy(
|
for key, value in metadata.items():
|
||||||
metadata
|
if (
|
||||||
) # Avoid modifying the original metadata
|
isinstance(value, list)
|
||||||
except:
|
or isinstance(value, dict)
|
||||||
new_metadata = {}
|
or isinstance(value, str)
|
||||||
for key, value in metadata.items():
|
or isinstance(value, int)
|
||||||
if (
|
or isinstance(value, float)
|
||||||
isinstance(value, list)
|
):
|
||||||
or isinstance(value, dict)
|
new_metadata[key] = copy.deepcopy(value)
|
||||||
or isinstance(value, str)
|
metadata = new_metadata
|
||||||
or isinstance(value, int)
|
|
||||||
or isinstance(value, float)
|
|
||||||
):
|
|
||||||
new_metadata[key] = copy.deepcopy(value)
|
|
||||||
metadata = new_metadata
|
|
||||||
|
|
||||||
supports_tags = Version(langfuse.version.__version__) >= Version("2.6.3")
|
supports_tags = Version(langfuse.version.__version__) >= Version("2.6.3")
|
||||||
supports_prompt = Version(langfuse.version.__version__) >= Version("2.7.3")
|
supports_prompt = Version(langfuse.version.__version__) >= Version("2.7.3")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue