mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 00:23:17 +00:00
(refactor) remove redundant source validation in CreateAgent
This commit is contained in:
@@ -1660,18 +1660,6 @@ class CreateAgent(Resource):
|
|||||||
"prompt_id",
|
"prompt_id",
|
||||||
"agent_type",
|
"agent_type",
|
||||||
]
|
]
|
||||||
# Require either source or sources (but not both)
|
|
||||||
|
|
||||||
if not data.get("source") and not data.get("sources"):
|
|
||||||
return make_response(
|
|
||||||
jsonify(
|
|
||||||
{
|
|
||||||
"success": False,
|
|
||||||
"message": "Either 'source' or 'sources' field is required for published agents",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
400,
|
|
||||||
)
|
|
||||||
validate_fields = ["name", "description", "prompt_id", "agent_type"]
|
validate_fields = ["name", "description", "prompt_id", "agent_type"]
|
||||||
else:
|
else:
|
||||||
required_fields = ["name"]
|
required_fields = ["name"]
|
||||||
|
|||||||
Reference in New Issue
Block a user