language models updated

This commit is contained in:
2025-01-27 13:00:21 +03:00
parent bc300f727a
commit e403993d24
9 changed files with 124 additions and 123 deletions

View File

@@ -1,3 +1,6 @@
from Services.Redis.Actions.actions import RedisActions
class HTTPExceptionApi(Exception):
def __init__(self, error_code: str, lang: str, loc: str = "", sys_msg: str = ""):
@@ -5,3 +8,11 @@ class HTTPExceptionApi(Exception):
self.lang = lang
self.loc = loc
self.sys_msg = sys_msg
def retrieve_error_message_by_code_at_redis(self):
"""
Retrieve the error message from the redis by the error code.
"""
error_msg = RedisActions.get_json(list_keys=["LANGUAGE_MODELS", "ERRORCODES", self.lang])
if error_msg.status:
return error_msg.first