Merge pull request #2945 from ushuz/hotfix

Fix image generation pre call hook call type
This commit is contained in:
Krish Dholakia 2024-04-10 21:53:00 -07:00 committed by GitHub
commit 6749306239
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3255,8 +3255,6 @@ async def completion(
user_api_key_dict=user_api_key_dict, data=data, call_type="completion" user_api_key_dict=user_api_key_dict, data=data, call_type="completion"
) )
start_time = time.time()
### ROUTE THE REQUESTs ### ### ROUTE THE REQUESTs ###
router_model_names = llm_router.model_names if llm_router is not None else [] router_model_names = llm_router.model_names if llm_router is not None else []
# skip router if user passed their key # skip router if user passed their key
@ -3853,11 +3851,9 @@ async def image_generation(
### CALL HOOKS ### - modify incoming data / reject request before calling the model ### CALL HOOKS ### - modify incoming data / reject request before calling the model
data = await proxy_logging_obj.pre_call_hook( data = await proxy_logging_obj.pre_call_hook(
user_api_key_dict=user_api_key_dict, data=data, call_type="embeddings" user_api_key_dict=user_api_key_dict, data=data, call_type="image_generation"
) )
start_time = time.time()
## ROUTE TO CORRECT ENDPOINT ## ## ROUTE TO CORRECT ENDPOINT ##
# skip router if user passed their key # skip router if user passed their key
if "api_key" in data: if "api_key" in data: