mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Siliconflow Model Provider: TypeError - Missing 'self' argument in validate_credentials() during credential submission #717
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @guorenn on GitHub (Oct 14, 2025).
Self Checks
Dify version
v1.91
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
After entering valid Siliconflow credentials and clicking "Submit", the credentials should be validated successfully, and the Siliconflow model provider should be added to the workspace without errors.
❌ Actual Behavior
When submitting Siliconflow credentials, the submission fails immediately. The browser shows a generic "Error" message("Internal Server Error"), and Docker container logs reveal a TypeError: SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'. This indicates the validate_credentials() method of the SiliconflowLargeLanguageModel class is being called directly via the class name (instead of an instance), causing Python to fail to inject the self parameter automatically. The Siliconflow model provider cannot be added as a result.
Bug Report Log
2025-10-15 01:37:50.696 ERROR [Dummy-7] [base.py:211] - Error in stream reponse for plugin {'code': -500, 'message': '{"message":"{\\"args\\":{},\\"error_type\\":\\"TypeError\\",\\"message\\":\\"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: \'self\'\\"}","error_type":"PluginInvokeError","args":null}', 'data': None} 2025-10-15 01:37:50.697 ERROR [Dummy-7] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow/credentials [POST] Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/api.py", line 402, in wrapper resp = resource(*args, **kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/resource.py", line 41, in dispatch_request resp = meth(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 215, in decorated return view(*args, **kwargs) File "/app/api/libs/login.py", line 62, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 37, in decorated return view(*args, **kwargs) File "/app/api/controllers/console/workspace/model_providers.py", line 89, in post model_provider_service.create_provider_credential( File "/app/api/services/model_provider_service.py", line 166, in create_provider_credential provider_configuration.create_provider_credential(credentials, credential_name) File "/app/api/core/entities/provider_configuration.py", line 444, in create_provider_credential credentials = self.validate_provider_credentials(credentials=credentials, session=session) File "/app/api/core/entities/provider_configuration.py", line 357, in validate_provider_credentials return _validate(session) File "/app/api/core/entities/provider_configuration.py", line 346, in _validate validated_credentials = model_provider_factory.provider_credentials_validate( File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 123, in provider_credentials_validate self.plugin_model_manager.validate_provider_credentials( File "/app/api/core/plugin/impl/model.py", line 97, in validate_provider_credentials for resp in response: File "/app/api/core/plugin/impl/base.py", line 212, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/impl/base.py", line 246, in _handle_plugin_daemon_error raise PluginInvokeError(description=message) core.plugin.impl.exc.PluginInvokeError: req_id: 8e3d597e64 PluginInvokeError: {"args":{},"error_type":"TypeError","message":"SiliconflowLargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'"}@susan-0729 commented on GitHub (Oct 19, 2025):
I also encountered this issue.
I modified the
validate_credentialsfunction definition indify_plugin/interfaces/model/openai_compatible/llm.pyto:Then, in
models/llm.py, I changed thevalidate_credentialsfunction definition to:After making these changes, I was able to solve the problem, and the SiliconFlow API now works properly.