mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 01:17:04 +08:00
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: zyssyz123 <916125788@qq.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: 林玮 (Jade Lin) <linw1995@icloud.com> Co-authored-by: 盐粒 Yanli <mail@yanli.one>
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
from werkzeug.exceptions import BadRequest, Conflict, NotFound
|
|
|
|
from libs.exception import BaseHTTPException
|
|
|
|
|
|
class AgentNotFoundError(NotFound):
|
|
description = "Agent not found."
|
|
|
|
|
|
class AgentVersionNotFoundError(NotFound):
|
|
description = "Agent config version not found."
|
|
|
|
|
|
class AgentNameConflictError(Conflict):
|
|
description = "Agent name already exists."
|
|
|
|
|
|
class AgentArchivedError(Conflict):
|
|
description = "Archived agent cannot be modified."
|
|
|
|
|
|
class AgentVersionConflictError(Conflict):
|
|
description = "Agent config version changed. Please reload and try again."
|
|
|
|
|
|
class AgentModelNotConfiguredError(BaseHTTPException):
|
|
error_code = "agent_model_not_configured"
|
|
description = "Agent App requires the Agent Soul model to be configured."
|
|
code = 400
|
|
|
|
|
|
class AgentSoulLockedError(BadRequest):
|
|
description = "Agent Soul is locked for this workflow node."
|
|
|
|
|
|
class InvalidComposerConfigError(BadRequest):
|
|
description = "Invalid agent composer config."
|
|
|
|
|
|
class PlaintextSecretNotAllowedError(BadRequest):
|
|
description = "Plaintext secret values are not allowed in Agent config."
|