You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error you're encountering seems to be related to the ToolParameter object not having a get attribute. This might be due to changes in how the ToolParameter class is expected to be used in version 0.15.0 compared to 0.11.0. The parse_openapi_to_tool_bundle function is likely trying to access a parameter attribute incorrectly.
To address this issue, you might want to check the ToolParameter class definition in the current version to ensure that the attributes are being accessed correctly. The ToolParameter class has specific attributes like name, label, human_description, etc., but it does not have a get method or attribute [2][3].
Reviewing the changes in the parse_openapi_to_tool_bundle function between versions 0.11.0 and 0.15.0 might also provide insights into what might be causing this issue, although specific changes were not found in the available data.
Self Checks
Dify version
0.15.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Cannot import openapi.json as external tool in v0.15.0, works fine in v0.11.0
the service is fastapi auto generate openapi.json, stanard
2025-01-13 10:02:22,077.077 INFO [Thread-3464 (_generate_worker)] [_client.py:1038] - HTTP Request: POST http://sandbox:8194/v1/sandbox/run "HTTP/1.1 200 OK"
2025-01-13 10:02:43,685.685 INFO [ThreadPoolExecutor-512_0] [_client.py:1038] - HTTP Request: POST http://sandbox:8194/v1/sandbox/run "HTTP/1.1 200 OK"
2025-01-13 11:25:54,958.958 INFO [Dummy-3479] [_client.py:1038] - HTTP Request: GET http://10.101.3.59:8202/openapi.json "HTTP/1.1 200 OK"
2025-01-13 11:25:54,961.961 ERROR [Dummy-3479] [api_tools_manage_service.py:202] - parse api schema error
Traceback (most recent call last):
File "/app/api/services/tools/api_tools_manage_service.py", line 39, in parser_api_schema
tool_bundles, schema_type = ApiBasedToolSchemaParser.auto_parse_to_tool_bundle(schema, warning=warnings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/tools/utils/parser.py", line 341, in auto_parse_to_tool_bundle
openapi = ApiBasedToolSchemaParser.parse_openapi_to_tool_bundle(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/tools/utils/parser.py", line 115, in parse_openapi_to_tool_bundle
en_US=parameter.get("description", ""), zh_Hans=parameter.get("description", "")
^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 856, in getattr
raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')
AttributeError: 'ToolParameter' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/api/services/tools/api_tools_manage_service.py", line 41, in parser_api_schema
raise ValueError(f"invalid schema: {str(e)}")
ValueError: invalid schema: 'ToolParameter' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/api/services/tools/api_tools_manage_service.py", line 200, in get_api_tool_provider_remote_schema
ApiToolManageService.parser_api_schema(schema)
File "/app/api/services/tools/api_tools_manage_service.py", line 84, in parser_api_schema
raise ValueError(f"invalid schema: {str(e)}")
ValueError: invalid schema: invalid schema: 'ToolParameter' object has no attribute 'get'
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: