mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
OpenAI-API-compatible plugin cannot use Gemini model #512
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 @loveFeng on GitHub (Aug 4, 2025).
Self Checks
Dify version
1.7.1
Plugin version
0.0.19
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
In the plugin, both gpt-4.1-mini and gemini-2.5-flash, which are managed by the same newapi, have been added. The gpt-4.1-mini works properly when used, but an error occurs when switching to gemini-2.5-flash.
✔️ Error log
2025-08-04 16:29:50.130 DEBUG [Thread-74 (_generate_worker)] [connectionpool.py:241] - Starting new HTTP connection (1): plugin_daemon:5002
2025-08-04 16:29:50.132 DEBUG [Thread-74 (_generate_worker)] [connectionpool.py:544] - http://plugin_daemon:5002 "POST /plugin/6881db2a-41e3-4976-999f-c7ec0eca2f0e/dispatch/model/schema HTTP/1.1" 200 None
[on_llm_before_invoke]
Model: gemini-2.5-flash
Parameters:
temperature: 0.7
Stream: True
User: 1c600e9e-4c2e-41ef-baaf-7631b5ad96c4
Prompt messages:
role: system
content: Tell a joke in Chinese
[on_llm_new_chunk]2025-08-04 16:29:50.141 DEBUG [Thread-74 (_generate_worker)] [connectionpool.py:241] - Starting new HTTP connection (1): plugin_daemon:5002
2025-08-04 16:30:01.760 DEBUG [Thread-74 (_generate_worker)] [connectionpool.py:544] - http://plugin_daemon:5002 "POST /plugin/6881db2a-41e3-4976-999f-c7ec0eca2f0e/dispatch/llm/invoke HTTP/1.1" 200 None
[NodeRunFailedEvent]
Node ID: 1754296072936
Node Title: LLM
Type: llm
Error: [openai_api_compatible] Error: PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {"error":{"message":"* GenerateContentRequest.contents: contents is not specified\n (request id: 20250804163001363975841eYwm7ouf)","type":"openai_error","param":"","code":"400"}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {"error":{"message":"* GenerateContentRequest.contents: contents is not specified\n (request id: 20250804163001363975841eYwm7ouf)","type":"openai_error","param":"","code":"400"}}"}
Inputs:
Process Data:
Outputs:
[GraphRunFailedEvent] reason: [openai_api_compatible] Error: PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {"error":{"message":"* GenerateContentRequest.contents: contents is not specified\n (request id: 20250804163001363975841eYwm7ouf)","type":"openai_error","param":"","code":"400"}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {"error":{"message":"* GenerateContentRequest.contents: contents is not specified\n (request id: 20250804163001363975841eYwm7ouf)","type":"openai_error","param":"","code":"400"}}"}
2025-08-04 16:30:01.769 DEBUG [Thread-72 (process_request_thread)] [sqlalchemy_workflow_node_execution_repository.py:218] - Updating cache for node_execution_id: 81f6e946-5c47-4030-a86f-c872823c91fc
@issac2e commented on GitHub (Aug 20, 2025):
The gemini model must have user content, not only system content
@loveFeng commented on GitHub (Aug 21, 2025):
Thanks, useful
@dosubot[bot] commented on GitHub (Sep 6, 2025):
Hi, @loveFeng. 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!