fix: agent recognize data type of age and height for people wrong
This commit is contained in:
@@ -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})"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user