Merge pull request #4065 from BerriAI/litellm_use_common_func

[Refactor] - Refactor proxy_server.py to use common function for `add_litellm_data_to_request`
This commit is contained in:
Ishaan Jaff 2024-06-07 14:02:17 -07:00 committed by GitHub
commit d9dacc1f43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 264 additions and 806 deletions

View file

@ -73,7 +73,8 @@ def print_verbose(print_statement):
def safe_deep_copy(data):
if isinstance(data, dict):
# remove litellm_parent_otel_span since this is not picklable
data.pop("litellm_parent_otel_span", None)
if "metadata" in data and "litellm_parent_otel_span" in data["metadata"]:
data["metadata"].pop("litellm_parent_otel_span")
new_data = copy.deepcopy(data)
return new_data