feat: Run AWEL flow in CLI (#1341)

This commit is contained in:
Fangyin Cheng
2024-03-27 12:50:05 +08:00
committed by GitHub
parent 340a9fbc35
commit 3a7a2cbbb8
42 changed files with 1454 additions and 422 deletions

View File

@@ -161,6 +161,7 @@ class ModelOutput:
error_code: int
"""The error code of the model inference. If the model inference is successful,
the error code is 0."""
incremental: bool = False
model_context: Optional[Dict] = None
finish_reason: Optional[str] = None
usage: Optional[Dict[str, Any]] = None
@@ -171,6 +172,11 @@ class ModelOutput:
"""Convert the model output to dict."""
return asdict(self)
@property
def success(self) -> bool:
"""Check if the model inference is successful."""
return self.error_code == 0
_ModelMessageType = Union[List[ModelMessage], List[Dict[str, Any]]]