[BUG]VertexAI Plugin is broken in Cloud.
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.1.1
Cloud or Self Hosted
Cloud
Steps to reproduce
After installing the VertexAI plugin (version 0.0.8) from the marketplace and configuring Vertex AI in the model provider, an error occurred stating that the module 'google.cloud.aiplatform_v1' has no attribute 'GenerativeModel'.
Additionally, when installing version 0.0.7, although normal conversations work, the agent becomes unusable due to the following error: Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}"}
✔️ Expected Behavior
The system should operate without errors, allowing normal conversations and proper agent functionality without encountering issues such as missing attributes like 'GenerativeModel' or 'Schema'.
❌ Actual Behavior
version: 0.0.8: Could not set up VertexAI. Error message is "module 'google.cloud.aiplatform_v1' has no attribute 'GenerativeModel'. " version: 0.0.7: Could not use Gemini 2.0 flash in Agent. Error message is "Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}"}" version: 0.0.6: is same as 0.0.7.
@Sanuki-073 Hello there! 👋 I'm here to help you with bug fixes and any questions you might have while waiting for a human maintainer. Let's squash those bugs together!
A similar issue was reported and closed in the past: Error when using VertexAI Gemini 1.5 Pro model for conversation. This issue was resolved by a pull request that fixed the agent's operation with Vertex AI Gemini models [1]. You might want to check if the changes from that pull request are applicable to your situation or if there have been any updates since then that could address the current 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
Based on Dosubot advice, I investigated the issue and found that this GitHub issue appears to be related to the cause of the problem in version 0.0.7.
Also, when forcibly upgrading to version 0.0.8 after setting up with version 0.0.7, the following error occurs: Run failed: [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: type object 'Part' has no attribute 'from_text'"},"error_type":"InvokeError","message":"[models] Error: type object 'Part' has no attribute 'from_text'"}
It seems that this change is a major mistake... VertexAI Models: replace vertexai library into google-cloud-aiplatform
I noticed that you used 0.0.6 and 0.0.7, they both have some problems right?
@crazywoola
I noticed that you used 0.0.6 and 0.0.7, they both have some problems right?
Yes. If I use version 0.0.7, I got a error messages in Agent block: Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}"}
version 1.1.0 ~ 1.1.2 All errors reported : module 'google.cloud.aiplatform v1 hasno attribute 'GenerativeModel
@kangjianhua This probably isn't an issue with Dify's version, but rather a bug in the VertexAI plugin version 0.0.8. If it's just a simple chat (not involving usage within Tool or Agent blocks), version 0.0.7 should work.
I'm having the same issue on a self-hosted instance. I cannot even configure the plugin. The version is 0.0.8
{
"code": "invalid_param",
"message": "module 'google.cloud.aiplatform_v1' has no attribute 'GenerativeModel'",
"status": 400
}
Downgrading to 0.0.6 helped
also just ran into this with the following logs running on a local setup:
e9d-4bc7-44c5-8923-0367ea63debf/dispatch/llm/invoke"
2025-03-25 16:24:01 api-1 | 2025-03-25 16:24:01.475 DEBUG [Thread-1491 (_generate_worker)] [connectionpool.py:544] - http://plugin_daemon:5002 "POST /plugin/f808fe9d-4bc7-44c5-8923-0367ea63debf/dispatch/llm/invoke HTTP/1.1" 200 None
2025-03-25 16:24:01 api-1 | 2025-03-25 16:24:01.493 DEBUG [Dummy-1492] [based_generate_task_pipeline.py:45] - error: Run failed: [vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: type object 'Part' has no attribute 'from_text'"},"error_type":"InvokeError","message":"[models] Error: type object 'Part' has no attribute 'from_text'"}
2025-03-25 16:24:01 nginx-1 | 192.168.65.1 - - [25/Mar/2025:16:24:01 +0000] "POST /console/api/apps/c83ea2c1-4c1a-421f-bb07-8b5845c11169/advanced-chat/workflows/draft/run HTTP/1.1" 200 11752 "http://localhost/app/c83ea2c1-4c1a-421f-bb07-8b5845c11169/workflow" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" "-"
This was when trying to use the Google Vertex Cloud provider from the studio prompt setup.
I can configure the plugin correctly it seems - but just unable to use it.
To downgrade the VertexAI plugin to version 0.0.6, you can follow these steps:
-
Uninstall the Current Version: First, remove the existing version of the VertexAI plugin. This can typically be done through your package manager or by manually deleting the plugin files, depending on how it was installed.
-
Install Version 0.0.6: You can install the specific version by specifying it in your package manager. For example, if you're using pip, you can run:
pip install vertexai==0.0.6Make sure to replace
vertexaiwith the correct package name if it's different. -
Verify Installation: After installation, verify that the correct version is installed by checking the plugin version. You can do this by running:
pip show vertexaiThis should display version
0.0.6. -
Restart Your Application: Once the correct version is installed, restart your application or service to ensure the changes take effect.
If you encounter any issues during the downgrade process, please let me know!
Additionally, could you provide more details about your current setup, such as the environment you're using (e.g., operating system, cloud provider), and any specific configurations or settings you have applied? This information might help in understanding the issue better and finding a solution.
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
I'm having the same issue on a self-hosted instance. I cannot even configure the plugin. The version is 1.1.3 error:AttributeError: module 'google.cloud.aiplatform_v1' has no attribute 'GenerativeModel'
I discovered that AgentBlock's agentic strategy encounters an error when using function calling, but works without error with ReAct in version 0.0.7.
I started seeing this after upgrading from 0.15.3 to 1.1.x, will likely have to downgrade back to 0.15.5 because of this issue. Makes the app unusable because all embeddings are done with Vertex AI.
Edit: Downloading 0.0.6 from dify marketplace, then uploading that to hosted instance resolved this issue.
FYI
- https://github.com/langgenius/dify-official-plugins/pull/651
Still broken for me. Self-hosted, Dify 1.2.0, plugin 0.0.9. . This is for agent; simple chat works fone.
None of the Gemini models work. Claude 3.5. Sonnect v2 works fine
[vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}
have the same issue, Self-hosted, Dify 1.1.3, plugin 0.0.9
Still broken for me. Self-hosted, Dify 1.2.0, plugin 0.0.9. . This is for agent; simple chat works fone.
None of the Gemini models work. Claude 3.5. Sonnect v2 works fine
[vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}
Same here, using Cloud. Really blocking some of our projects.
Even with the latest Vertex AI plugin (v0.0.14), Dify 1.3.1 . I’m still running into errors and the newest models don’t appear. Is anyone actually able to get it working?
Can you paste the error messages here?
I'm using self-hosted with 1.2.0.
VertexAI plugin 0.0.14 still cannot use tools. I get the error with any Gemini 2.0 or 2.5 variant
[vertex_ai] Error: PluginInvokeError: {"args":{"description":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"},"error_type":"InvokeError","message":"[models] Error: module 'vertexai.generative_models' has no attribute 'Schema'"}
@crazywoola I'm very satisfied with the excellent features of the community edition. Although I'm mainly using Azure OpenAI and thus not directly affected, I would still like to be able to use Gemini if possible.
I've consulted several times about the plugin error with VertexAI, but it seems that the issue might not be with VertexAI itself. Rather, I suspect that updates to the plugin are not being properly reflected in the configuration database.
Even after updating the VertexAI plugin to the latest version 0.0.14, the model list doesn't get updated, and models like Gemini 2.5 are not displayed. It seems like this configuration update issue is happening only in my environment.
My setup is hosted on AWS EC2, but the PostgreDB is on AWS RDS rather than directly on EC2. Currently, my Dify version is 1.3.1, but the original database was created back when the version was below 0.15.0 and has been updated repeatedly since then. I suspect that this update history might be affecting the behavior.
I have already aligned the app/.env and web/.env.local files with the latest versions.
I’m considering starting completely fresh by rebuilding everything from the database up, using the latest version.
If that resolves the issue, then it’s likely not a problem with the plugin itself — and I’ll report back accordingly.
Here is the error I'm encountering: if I assign any tool to an agent using Gemini and send a request, I receive an error like the one below.
I sincerely appreciate this wonderful product.
reference Issue #12545 https://github.com/langgenius/dify/issues/12545
@crazywoola I'm very satisfied with the excellent features of the community edition. Although I'm mainly using Azure OpenAI and thus not directly affected, I would still like to be able to use Gemini if possible.
I've consulted several times about the plugin error with VertexAI, but it seems that the issue might not be with VertexAI itself. Rather, I suspect that updates to the plugin are not being properly reflected in the configuration database.
Even after updating the VertexAI plugin to the latest version 0.0.14, the model list doesn't get updated, and models like Gemini 2.5 are not displayed. It seems like this configuration update issue is happening only in my environment.
My setup is hosted on AWS EC2, but the PostgreDB is on AWS RDS rather than directly on EC2. Currently, my Dify version is 1.3.1, but the original database was created back when the version was below 0.15.0 and has been updated repeatedly since then. I suspect that this update history might be affecting the behavior.
I have already aligned the app/.env and web/.env.local files with the latest versions.
I’m considering starting completely fresh by rebuilding everything from the database up, using the latest version. If that resolves the issue, then it’s likely not a problem with the plugin itself — and I’ll report back accordingly.
Here is the error I'm encountering: if I assign any tool to an agent using Gemini and send a request, I receive an error like the one below.
I sincerely appreciate this wonderful product.
reference Issue #12545 https://github.com/langgenius/dify/issues/12545
Its a known issue. The plugin became buggy since a couples of versions ago. I was trying to reconstruct the code but got overload error frequently then I decided to stop. https://github.com/langgenius/dify-official-plugins/pull/726
Finally, Dify ver 1.4.1 and vertexAI plugin 0.0.18 , I find this error completely solved! Thank you very much!
Today I encountered similar issue with Dify 1.2.0 and Vertex AI Plugin 0.0.19. And I downgraded Vertex AI Plugin as 0.0.16, then I got dify works well.