fix: agent recognize data type of age and height for people wrong

This commit is contained in:
2025-11-12 17:12:34 +08:00
parent e74279ca5e
commit 4c48d11bfa
4 changed files with 49 additions and 11 deletions

View File

@@ -1,14 +1,21 @@
from enum import Enum
import logging
from typing import Protocol
class ErrorCode(Enum):
SUCCESS = 0
MODEL_ERROR = 1000
RLDB_ERROR = 2100
class error(Protocol):
_error_code: int = 0
_error_info: str = ""
def __init__(self, error_code: int, error_info: str):
self._error_code = error_code
def __init__(self, error_code: ErrorCode, error_info: str):
self._error_code = int(error_code.value)
self._error_info = error_info
logging.info(f"errorcode: {type(self._error_code)}")
def __str__(self) -> str:
return f"{self.__class__.__name__}({self._error_code}, {self._error_info})"