mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Dify Cloud – Google AI Studio provider cannot validate credentials #776
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 @nhinguyen120499 on GitHub (Nov 4, 2025).
Self Checks
Dify version
1.9.2
Cloud or Self Hosted
Cloud
Steps to reproduce
Expected: Validate success
Actual: PluginInvokeError
Yesterday it worked normally, today fails.
✔️ Expected Behavior
Adding new Google AI Studio API key successfully
❌ Actual Behavior
Error: Google LargeLanguageModel.validate_credentials() missing 1 required positional argument: 'self'
Req_id: d5a182f118
@dosubot[bot] commented on GitHub (Nov 4, 2025):
Hi @nhinguyen120499! I'm Dosu and I’m helping the dify team.
The error happens because the
validate_credentialsmethod inGoogleLargeLanguageModelis defined as an instance method (expectsself), but it's called as a class/static method during provider credential validation. This mismatch causes Python to throw the "missing 1 required positional argument: 'self'" TypeError.To fix this, the method should be decorated with
@classmethod(usingclsinstead ofself) or@staticmethodif it doesn't need instance or class state. This pattern has resolved similar issues for other providers like Siliconflow and Anthropic in Dify. You can see a working example of the fix for Siliconflow here and for Anthropic here.If you have access to the code, update the method definition to:
This should resolve the credential validation error for Google AI Studio in Dify Cloud v1.9.2.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@dosubot[bot] commented on GitHub (Nov 4, 2025):
This error happens because the
validate_credentialsmethod in the Google AI Studio provider is defined as an instance method (it expectsself), but somewhere in the plugin system it's being called as if it were a static or class method, so Python doesn't pass theselfargument, resulting in the "missing 1 required positional argument: 'self'" TypeError. This is a recurring bug pattern seen in other Dify plugins like Anthropic, Siliconflow, and Bedrock as well (example, example, example).The root cause is that the plugin system or daemon is not instantiating the model class before calling its instance methods. Other plugins have fixed this by either making
validate_credentialsa@classmethodor by adding a_validate_credentialsmethod that matches the expected interface.There is not yet a merged fix or workaround specifically for the Google AI Studio provider, but based on how similar issues were resolved, the maintainers will likely need to update the plugin to ensure credential validation is called on an instance, or refactor the method to be a classmethod. If you have control over the plugin code, you can try changing
validate_credentialsto a@classmethodand update its signature to useclsinstead ofself(see workaround for Siliconflow). Otherwise, you may need to wait for an official patch.This is not a configuration or credential issue on your end—it's a bug in the plugin's method definition or how it's invoked by the platform.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@nhinguyen120499 commented on GitHub (Nov 4, 2025):
Thanks for the clarification. Since this issue completely blocks adding or rotating Google AI Studio credentials on Dify Cloud, could you please provide an estimated timeline for the fix (ETA)?
We need to know whether the patch will be applied within hours/days so that we can plan whether to wait or switch provider temporarily.
Is the fix already under development or scheduled for an upcoming Cloud deployment?
Looking forward to your update — this is production-blocking for us.