Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix:#9222 create or update custum tools error (#9228)

AkisAyad7b8e071dd0f
diff --git a/api/core/tools/utils/parser.py b/api/core/tools/utils/parser.py
index 0d801d36c4d..5867a11bb39 100644
--- a/api/core/tools/utils/parser.py
+++ b/api/core/tools/utils/parser.py
@@ -288,7 +288,7 @@ class ApiBasedToolSchemaParser:
@staticmethod
def auto_parse_to_tool_bundle(
- content: str, extra_info: Optional[dict], warning: Optional[dict]
+ content: str, extra_info: Optional[dict] = None, warning: Optional[dict] = None
) -> tuple[list[ApiToolBundle], str]:
"""
auto parse to tool bundle
diff --git a/api/services/tools/api_tools_manage_service.py b/api/services/tools/api_tools_manage_service.py
index 9f5298a5067..257c6cf52bb 100644
--- a/api/services/tools/api_tools_manage_service.py
+++ b/api/services/tools/api_tools_manage_service.py
@@ -80,7 +80,9 @@ class ApiToolManageService:
raise ValueError(f"invalid schema: {str(e)}")
@staticmethod
- def convert_schema_to_tool_bundles(schema: str, extra_info: Optional[dict] = None) -> list[ApiToolBundle]:
+ def convert_schema_to_tool_bundles(
+ schema: str, extra_info: Optional[dict] = None
+ ) -> tuple[list[ApiToolBundle], str]:
"""
convert schema to tool bundles