add completion call id

This commit is contained in:
Krrish Dholakia 2023-08-31 12:54:34 -07:00
parent ef947bf144
commit 66bfd70253
3 changed files with 5 additions and 1 deletions

View file

@ -94,6 +94,7 @@ def completion(
custom_api_base=None, custom_api_base=None,
litellm_call_id=None, litellm_call_id=None,
litellm_logging_obj=None, litellm_logging_obj=None,
completion_call_id=None, # this is an optional param to tag individual completion calls
# model specific optional params # model specific optional params
# used by text-bison only # used by text-bison only
top_k=40, top_k=40,
@ -153,6 +154,7 @@ def completion(
custom_api_base=custom_api_base, custom_api_base=custom_api_base,
litellm_call_id=litellm_call_id, litellm_call_id=litellm_call_id,
model_alias_map=litellm.model_alias_map, model_alias_map=litellm.model_alias_map,
completion_call_id=completion_call_id
) )
logging.update_environment_variables(optional_params=optional_params, litellm_params=litellm_params) logging.update_environment_variables(optional_params=optional_params, litellm_params=litellm_params)
if custom_llm_provider == "azure": if custom_llm_provider == "azure":

View file

@ -646,6 +646,7 @@ def get_litellm_params(
custom_api_base=None, custom_api_base=None,
litellm_call_id=None, litellm_call_id=None,
model_alias_map=None, model_alias_map=None,
completion_call_id=None
): ):
litellm_params = { litellm_params = {
"return_async": return_async, "return_async": return_async,
@ -657,6 +658,7 @@ def get_litellm_params(
"custom_api_base": custom_api_base, "custom_api_base": custom_api_base,
"litellm_call_id": litellm_call_id, "litellm_call_id": litellm_call_id,
"model_alias_map": model_alias_map, "model_alias_map": model_alias_map,
"completion_call_id": completion_call_id,
"stream_response": {} # litellm_call_id: ModelResponse Dict "stream_response": {} # litellm_call_id: ModelResponse Dict
} }

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "litellm" name = "litellm"
version = "0.1.510" version = "0.1.511"
description = "Library to easily interface with LLM API providers" description = "Library to easily interface with LLM API providers"
authors = ["BerriAI"] authors = ["BerriAI"]
license = "MIT License" license = "MIT License"