better failure reason (#1066)

This commit is contained in:
LawyZheng
2024-10-28 09:42:55 +08:00
committed by GitHub
parent e42aabfc2e
commit d2b79ab5de
4 changed files with 104 additions and 11 deletions

View File

@@ -53,6 +53,9 @@ class UserDefinedError(BaseModel):
reasoning: str
confidence_float: float = Field(..., ge=0, le=1)
def __repr__(self) -> str:
return f"{self.reasoning}(error_code={self.error_code}, confidence_float={self.confidence_float})"
class SelectOption(BaseModel):
label: str | None = None