mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Vertex AI integration throws "contents must not be empty" error in v1.2.0+ despite non-empty prompts #298
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 @ukyonagata0105 on GitHub (May 20, 2025).
Self Checks
Dify version
1.4.0/1.3.1/1.3.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Configure Dify with Vertex AI (Gemini 2.0 Flash) as the LLM provider
Create a simple workflow with a system prompt containing any text (e.g., "Hello, nice weather today")
Try to execute the workflow
The following error occurs:
{
"model_mode": "chat",
"prompts": [
{
"role": "system",
"text": "Hello, nice weather today",
"files": []
}
],
"model_provider": "langgenius/vertex_ai/vertex_ai",
"model_name": "gemini-2.0-flash-001"
}
Run failed: [vertex_ai] Error: PluginInvokeError: {"args":{},"error_type":"TypeError","message":"contents must not be empty"}
✔️ Expected Behavior
The workflow should execute successfully and return a response from Vertex AI/Gemini, regardless of the prompt content.
❌ Actual Behavior
Workflow fails with "contents must not be empty" error when using Vertex AI as the LLM provider, even though the prompt content is clearly not empty.
@dosubot[bot] commented on GitHub (May 20, 2025):
The "contents must not be empty" error you're encountering with Vertex AI integration in Dify versions 1.4.0, 1.3.1, and 1.3.0 is likely due to the Gemini plugin version 0.2.0, which introduced breaking changes. To resolve this issue, you should downgrade the Gemini plugin version from 0.2.0 to 0.1.5. Additionally, ensure that you include a user prompt message in your LLM node, as relying solely on system prompts can trigger this error [1].
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
@ajaypushparaj5 commented on GitHub (May 29, 2025):
i would like to contribute on this issue as part of IEEE summer of Code. #ieeesoc
@ttsujino commented on GitHub (Jun 18, 2025):
This seems to be because, when using Gemini on Dify, you need to set up not only the system prompt but also the user prompt.
@dosubot[bot] commented on GitHub (Aug 21, 2025):
Hi, @ukyonagata0105. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary
Next Steps
Thank you for your understanding and contribution!