[Feat] Add Responses API - Routing Affinity logic for sessions (#10193)

* test for test_responses_api_routing_with_previous_response_id

* test_responses_api_routing_with_previous_response_id

* add ResponsesApiDeploymentCheck

* ResponsesApiDeploymentCheck

* ResponsesApiDeploymentCheck

* fix ResponsesApiDeploymentCheck

* test_responses_api_routing_with_previous_response_id

* ResponsesApiDeploymentCheck

* test_responses_api_deployment_check.py

* docs routing affinity

* simplify ResponsesApiDeploymentCheck

* test response id

* fix code quality check
This commit is contained in:
Ishaan Jaff 2025-04-21 20:00:27 -07:00 committed by GitHub
parent 4eac0f64f3
commit 0c2f705417
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 862 additions and 29 deletions

View file

@ -116,6 +116,13 @@ async def aresponses(
response = await init_response
else:
response = init_response
# Update the responses_api_response_id with the model_id
if isinstance(response, ResponsesAPIResponse):
response = ResponsesAPIRequestUtils._update_responses_api_response_id_with_model_id(
responses_api_response=response,
kwargs=kwargs,
)
return response
except Exception as e:
raise litellm.exception_type(
@ -248,6 +255,13 @@ def responses(
),
)
# Update the responses_api_response_id with the model_id
if isinstance(response, ResponsesAPIResponse):
response = ResponsesAPIRequestUtils._update_responses_api_response_id_with_model_id(
responses_api_response=response,
kwargs=kwargs,
)
return response
except Exception as e:
raise litellm.exception_type(