mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Gemini Plugin with "JSON Schema" fail 'NoneType' object has no attribute 'upper' #250
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 @tanreinama on GitHub (May 6, 2025).
Self Checks
Dify version
1.3.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
When using LLM with the Gemini plugin, if you set a JSON Schema, the error 'NoneType' object has no attribute 'upper' occurs. If you do not set a JSON Schema, the error does not occur.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (May 6, 2025):
Hello @tanreinama! I'm Dosu, here to help you with any bugs, questions, or contributions you might have. While we wait for a human maintainer, feel free to share more details or ask away!
The error you're encountering,
'NoneType' object has no attribute 'upper', typically occurs when a variable expected to be a string (or another type with anuppermethod) is actuallyNone. In the context of the Dify platform, this issue might be related to how the JSON Schema is being processed or how the Gemini plugin interacts with it.Here are a few steps you can take to troubleshoot and potentially resolve this issue:
Check JSON Schema Configuration: Ensure that the JSON Schema is correctly defined and that all required fields are present. An improperly configured schema might lead to unexpected
Nonevalues.Review Plugin Code: If you have access to the plugin code, look for any operations that call
.upper()on variables that might not be strings. This could help identify where theNonevalue is being introduced.Update to Latest Version: Ensure that you are using the latest version of the Dify platform and the Gemini plugin. There might be bug fixes or improvements that address this issue.
Error Handling: Implement error handling around the code that processes the JSON Schema to catch and manage
NoneTypeerrors gracefully.If the issue persists, consider checking the Dify issue tracker for any similar reports or updates related to this problem.
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
@fdb02983rhy commented on GitHub (Jun 21, 2025):
Please input a valid json schema.
@tanreinama commented on GitHub (Jun 21, 2025):
Thank you @fdb02983rhy
Is there any documentation somewhere that explains this schema?
@fdb02983rhy commented on GitHub (Jun 21, 2025):
https://docs.dify.ai/en/learn-more/extended-reading/how-to-use-json-schema-in-dify
@tanreinama commented on GitHub (Jun 21, 2025):
Thanks.
I hope that Gemini will be added to the list of Models Supporting JSON Schema Functionality.
@fdb02983rhy commented on GitHub (Jun 21, 2025):
Those models in the docs are just examples. All models with json schema option should support the feature.