fix for GET /v1/batches{batch_id:path}

This commit is contained in:
Ishaan Jaff 2024-07-26 18:23:15 -07:00
parent 12729ceece
commit f627fa9b40

View file

@ -4891,12 +4891,12 @@ async def create_batch(
@router.get(
"/v1/batches{batch_id}",
"/v1/batches{batch_id:path}",
dependencies=[Depends(user_api_key_auth)],
tags=["batch"],
)
@router.get(
"/batches{batch_id}",
"/batches{batch_id:path}",
dependencies=[Depends(user_api_key_auth)],
tags=["batch"],
)
@ -4923,29 +4923,7 @@ async def retrieve_batch(
"""
global proxy_logging_obj
data: Dict = {}
data = {}
try:
body = await request.body()
body_str = body.decode()
try:
data = ast.literal_eval(body_str)
except:
data = json.loads(body_str)
verbose_proxy_logger.debug(
"Request received by LiteLLM:\n{}".format(json.dumps(data, indent=4)),
)
# Include original request and headers in the data
data = await add_litellm_data_to_request(
data=data,
request=request,
general_settings=general_settings,
user_api_key_dict=user_api_key_dict,
version=version,
proxy_config=proxy_config,
)
_retrieve_batch_request = RetrieveBatchRequest(
batch_id=batch_id,
)