From 4544967a99dbb0aff469002190339f3ce76a0f90 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 23 Apr 2026 09:34:28 +0200 Subject: [PATCH] LCORE-1891: All identifiers in constants.py are real constants --- src/constants.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/constants.py b/src/constants.py index f40f60bdf..f5d90747a 100644 --- a/src/constants.py +++ b/src/constants.py @@ -18,7 +18,7 @@ TOPIC_SUMMARY_INTERRUPT_TIMEOUT_SECONDS: Final[float] = 30.0 # Supported attachment types -ATTACHMENT_TYPES = frozenset( +ATTACHMENT_TYPES: Final[frozenset] = frozenset( { "alert", "api object", @@ -31,7 +31,7 @@ ) # Supported attachment content types -ATTACHMENT_CONTENT_TYPES = frozenset( +ATTACHMENT_CONTENT_TYPES: Final[frozenset] = frozenset( {"text/plain", "application/json", "application/yaml", "application/xml"} ) @@ -120,7 +120,7 @@ AUTH_MOD_JWK_TOKEN: Final[str] = "jwk-token" AUTH_MOD_RH_IDENTITY: Final[str] = "rh-identity" # Supported authentication modules -SUPPORTED_AUTHENTICATION_MODULES = frozenset( +SUPPORTED_AUTHENTICATION_MODULES: Final[frozenset] = frozenset( { AUTH_MOD_K8S, AUTH_MOD_NOOP, @@ -130,7 +130,7 @@ AUTH_MOD_RH_IDENTITY, } ) -DEFAULT_AUTHENTICATION_MODULE = AUTH_MOD_NOOP +DEFAULT_AUTHENTICATION_MODULE: Final[str] = AUTH_MOD_NOOP # Maximum allowed size for base64-encoded x-rh-identity header (bytes) DEFAULT_RH_IDENTITY_MAX_HEADER_SIZE: Final[int] = 8192 @@ -216,7 +216,7 @@ SOLR_DEFAULT_EMBEDDING_DIMENSION: Final[int] = 384 # Default score multiplier for BYOK RAG vector stores -DEFAULT_SCORE_MULTIPLIER = 1.0 +DEFAULT_SCORE_MULTIPLIER: Final[float] = 1.0 # Special RAG ID that activates the OKP provider when listed in rag.inline or rag.tool OKP_RAG_ID: Final[str] = "okp" @@ -243,7 +243,7 @@ # Placeholder slug used in responses when the server substituted its own # system prompt for the client's instructions. Avoids leaking the actual # server prompt back to the client. -SUBSTITUTED_INSTRUCTIONS_PLACEHOLDER = "" +SUBSTITUTED_INSTRUCTIONS_PLACEHOLDER: Final[str] = "" # Input size limits for API request validation # Maximum character length for the question field in /v1/infer requests (32 KiB) RLSAPI_V1_QUESTION_MAX_LENGTH: Final[int] = 32_768