fix(main.py): log user for embedding calls

This commit is contained in:
Krrish Dholakia 2023-12-14 15:14:37 -08:00
parent 03dd7bff13
commit e45b491985
2 changed files with 2 additions and 2 deletions

View file

@ -1827,7 +1827,7 @@ def embedding(
try:
response = None
logging = litellm_logging_obj
logging.update_environment_variables(model=model, user="", optional_params=optional_params, litellm_params={"timeout": timeout, "azure": azure, "litellm_call_id": litellm_call_id, "logger_fn": logger_fn, "proxy_server_request": proxy_server_request, "model_info": model_info, "metadata": metadata, "aembedding": aembedding, "preset_cache_key": None, "stream_response": {}})
logging.update_environment_variables(model=model, user=user, optional_params=optional_params, litellm_params={"timeout": timeout, "azure": azure, "litellm_call_id": litellm_call_id, "logger_fn": logger_fn, "proxy_server_request": proxy_server_request, "model_info": model_info, "metadata": metadata, "aembedding": aembedding, "preset_cache_key": None, "stream_response": {}})
if azure == True or custom_llm_provider == "azure":
# azure configs
api_type = get_secret("AZURE_API_TYPE") or "azure"

View file

@ -323,7 +323,7 @@ async def test_async_custom_handler_embedding_optional_param_bedrock():
customHandler_optional_params = MyCustomHandler()
litellm.callbacks = [customHandler_optional_params]
response = await litellm.aembedding(
model="bedrock/cohere.embed-multilingual-v3",
model="bedrock/amazon.titan-embed-text-v1",
input = ["hello world"],
user = "John"
)