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

@ -607,7 +607,6 @@ def completion(
client = kwargs.get("client", None)
### Admin Controls ###
no_log = kwargs.get("no-log", False)
litellm_parent_otel_span = kwargs.get("litellm_parent_otel_span", None)
######## end of unpacking kwargs ###########
openai_params = [
"functions",
@ -697,7 +696,6 @@ def completion(
"allowed_model_region",
"model_config",
"fastest_response",
"litellm_parent_otel_span",
]
default_params = openai_params + litellm_params
@ -882,7 +880,6 @@ def completion(
input_cost_per_token=input_cost_per_token,
output_cost_per_second=output_cost_per_second,
output_cost_per_token=output_cost_per_token,
litellm_parent_otel_span=litellm_parent_otel_span,
)
logging.update_environment_variables(
model=model,