diff --git a/docs/devel_doc/openapi.json b/docs/devel_doc/openapi.json index e08a4b73c..b0f9e4f72 100644 --- a/docs/devel_doc/openapi.json +++ b/docs/devel_doc/openapi.json @@ -14449,6 +14449,12 @@ "type": "null" } ] + }, + "responses_request_max_size": { + "type": "integer", + "title": "Maximum character length for the serialized responses request body", + "description": "Maximum character length for the serialized /v1/response responses request body", + "default": 65536 } }, "additionalProperties": false, diff --git a/docs/models/requests.json b/docs/models/requests.json index cea912e65..d6826e607 100644 --- a/docs/models/requests.json +++ b/docs/models/requests.json @@ -3165,4 +3165,4 @@ } }, "paths": {} -} +} \ No newline at end of file diff --git a/docs/models/successful_responses.json b/docs/models/successful_responses.json index 6dfbbc952..7bac00cd7 100644 --- a/docs/models/successful_responses.json +++ b/docs/models/successful_responses.json @@ -1789,6 +1789,12 @@ } ], "default": null + }, + "responses_request_max_size": { + "default": 65536, + "description": "Maximum character length for the serialized /v1/response responses request body", + "title": "Maximum character length for the serialized responses request body", + "type": "integer" } }, "title": "Customization", diff --git a/docs/models/successful_responses.md b/docs/models/successful_responses.md index e8ee4cb3a..425f54bc6 100644 --- a/docs/models/successful_responses.md +++ b/docs/models/successful_responses.md @@ -684,6 +684,7 @@ Service customization. | agent_card_path | string | | | agent_card_config | object | | | custom_profile | | | +| responses_request_max_size | integer | Maximum character length for the serialized /v1/response responses request body | ## DatabaseConfiguration diff --git a/src/models/config.py b/src/models/config.py index 7fae4a9c8..da2b734c1 100644 --- a/src/models/config.py +++ b/src/models/config.py @@ -1963,6 +1963,12 @@ class Customization(ConfigurationBase): agent_card_path: Optional[FilePath] = None agent_card_config: Optional[dict[str, Any]] = None custom_profile: Optional[CustomProfile] = Field(default=None, init=False) + responses_request_max_size: int = Field( + default=constants.RESPONSES_REQUEST_MAX_SIZE, + title="Maximum character length for the serialized responses request body", + description="Maximum character length for the serialized /v1/response responses " + "request body", + ) @model_validator(mode="after") def check_customization_model(self) -> Self: diff --git a/tests/unit/models/config/test_customization.py b/tests/unit/models/config/test_customization.py index daca3206e..ad2f72e6b 100644 --- a/tests/unit/models/config/test_customization.py +++ b/tests/unit/models/config/test_customization.py @@ -6,6 +6,7 @@ from pydantic import ValidationError from pytest_subtests import SubTests +from constants import RESPONSES_REQUEST_MAX_SIZE from models.config import Customization @@ -58,6 +59,21 @@ def test_service_customization(subtests: SubTests) -> None: assert c.disable_query_system_prompt is True +def test_service_customization_max_response_request_size(subtests: SubTests) -> None: + """Check the service customization class.""" + with subtests.test(msg="Default response request size should be used"): + c = Customization() + assert c is not None + # default value should not be used now + assert c.responses_request_max_size == RESPONSES_REQUEST_MAX_SIZE + + with subtests.test(msg="Max response request size is specified"): + c = Customization(responses_request_max_size=42) + assert c is not None + # default value should not be used now + assert c.responses_request_max_size == 42 + + def test_service_customization_wrong_system_prompt_path() -> None: """Check the service customization class.