Fix finish reason (#2013)
This commit is contained in:
@@ -107,12 +107,14 @@ class FINISH_LENGTH(BaseFinishReason):
|
|||||||
|
|
||||||
|
|
||||||
class FINISH_ABORT(BaseFinishReason):
|
class FINISH_ABORT(BaseFinishReason):
|
||||||
def __init__(self):
|
def __init__(self, message="Unknown error"):
|
||||||
super().__init__(is_error=True)
|
super().__init__(is_error=True)
|
||||||
|
self.message = message
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return {
|
return {
|
||||||
"type": "abort",
|
"type": "abort",
|
||||||
|
"message": self.message,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user