mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
AttributeError: 'NoneType' object has no attribute 'model_properties' when using Ollama model with specific configuration in ReAct mode on Agent node #107
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 @fwls on GitHub (Mar 21, 2025).
Originally assigned to: @Nov1c444 on GitHub.
Self Checks
Dify version
1.0.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
In the Dify model configuration, add the qwen2.5:32b model with the Ollama driver. Enable the "Support Function Call" option and set the maximum token number to 4096.
In the Chatflow, select the Agent node and choose the ReAct mode. Select the qwen2.5:32b model and configure the temperature to 0.4 and the maximum token number for prediction to 4096.
Click the "Preview" button to reproduce the issue.
✔️ Expected Behavior
how to fix this error
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (Mar 21, 2025):
@fwls Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing.
The
AttributeError: 'NoneType' object has no attribute 'model_properties'typically occurs when the code attempts to access an attribute on aNoneTypeobject. This can happen if a configuration or model property is expected but not properly initialized or returned asNone.Here are some steps you can take to troubleshoot and potentially resolve this issue:
Check Model Configuration: Ensure that the model configuration for the qwen2.5:32b model with the Ollama driver is correctly set up. Verify that all required fields are filled and that the model is properly initialized.
Review Function Call Support: Since the error occurs when the "Support Function Call" option is enabled, double-check the implementation and compatibility of this feature with the qwen2.5:32b model. There might be specific requirements or limitations.
Inspect ReAct Mode Setup: Ensure that the ReAct mode in the Agent node is correctly configured. Verify that all dependencies, such as tools and instructions, are properly set up.
Error Handling: Implement error handling to catch and log any
NoneTypeissues before they cause an exception. This can help identify where theNonevalue is originating from.Update to Latest Version: If the issue persists, consider updating to the latest version of Dify, as there might be bug fixes or improvements related to this problem.
If these steps do not resolve the issue, you may need to look into the specific implementation details of the model and driver in the Dify codebase to identify any potential mismatches or missing configurations.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@fwls commented on GitHub (Mar 21, 2025):
@dosu However, the system runs normally when the temperature and maximum tokens are not configured.
@dosubot[bot] commented on GitHub (Mar 21, 2025):
The issue you're experiencing might be related to how the temperature and maximum token settings interact with the model configuration. Since the system runs normally without these configurations, it suggests that there might be constraints or specific requirements for these parameters with the qwen2.5:32b model or the Ollama driver.
Temperature Range: Ensure that the temperature setting is within the acceptable range for the model. Some models have specific limits, and setting a value outside this range can cause errors.
Maximum Tokens: Check if the maximum token setting exceeds the model's limit. If the model has a lower token limit than what you're configuring, it could lead to issues. Try reducing the maximum token number to see if it resolves the problem.
Model-Specific Constraints: Review any documentation or notes regarding the qwen2.5:32b model and the Ollama driver to ensure there are no specific constraints or incompatibilities with these settings.
Adjusting these configurations to align with the model's requirements might help resolve the error.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@fwls commented on GitHub (Mar 21, 2025):
@dosu
These parameters will trigger the error regardless of the values set, even when the values are set to be very small.
@dosubot[bot] commented on GitHub (Mar 21, 2025):
The persistent error you're encountering, regardless of the parameter values, suggests a deeper issue with how the temperature and maximum token settings are being handled in the configuration. Here are a few steps to consider:
Configuration Validation: Double-check the YAML configuration for the qwen2.5:32b model to ensure that the parameters are correctly defined and that there are no syntax errors. The parameters should match the expected types and ranges specified in the configuration file.
Driver Compatibility: Verify that the Ollama driver is fully compatible with the qwen2.5:32b model and supports the configuration parameters you're trying to set. There might be a mismatch or missing implementation detail causing the error.
Debugging: Add logging or debugging statements in the code where the model is initialized and configured. This can help identify if and where the parameters are being set to
Noneor if there's an issue with the model properties.Review Known Issues: Check if there are any known issues or updates related to the Ollama driver or the qwen2.5:32b model in the Dify repository that might address this problem.
If these steps don't resolve the issue, it might be necessary to delve into the specific implementation details of the model and driver to identify any potential mismatches or missing configurations.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@lordk911 commented on GitHub (Mar 23, 2025):
The same error occur when use Xinference:
ref to : https://github.com/langgenius/dify-plugin-sdks/pull/45
it make AgentModelConfig.entity could be none. But It will still be use :
https://github.com/langgenius/dify-official-plugins/blob/5436a6a06c92c28b02d90a585c65a0c112e9150b/agent-strategies/cot_agent/strategies/function_calling.py#L123C1-L126C18
https://github.com/langgenius/dify-official-plugins/blob/5436a6a06c92c28b02d90a585c65a0c112e9150b/agent-strategies/cot_agent/strategies/ReAct.py#L150C1-L153C18
https://github.com/langgenius/dify-plugin-sdks/blob/064985386745c6f4553f180d07e459778a78a61b/python/dify_plugin/interfaces/agent/__init__.py#L156C1-L161C96
@crazywoola @Yeuoly
@crazywoola commented on GitHub (Mar 25, 2025):
@Nov1c444 Please take a look at this.
@Nov1c444 commented on GitHub (Mar 27, 2025):
Please update the plugin version to 0.0.12 and try it. If there are no problems, I will close the issue.
@fwls commented on GitHub (Mar 27, 2025):
Please tell me how to upgrade the plugin to version 0.0.12. My Dify version is 1.0.1.
Thanks.
@fwls commented on GitHub (Mar 27, 2025):
@Nov1c444 The problem has been resolved. Thank you.