OpenAI-API-compatible plugin cannot use Gemini model #512

Closed
opened 2026-02-16 10:19:37 -05:00 by yindo · 3 comments
Owner

Originally created by @loveFeng on GitHub (Aug 4, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

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.

Image Image

✔️ 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

Originally created by @loveFeng on GitHub (Aug 4, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 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. <img width="757" height="180" alt="Image" src="https://github.com/user-attachments/assets/ef379ba0-fc04-4638-9d83-11e7b394c216" /> <img width="793" height="461" alt="Image" src="https://github.com/user-attachments/assets/b114965a-025d-4857-88fe-5beedcb662fc" /> ### ✔️ 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
yindo added the bug label 2026-02-16 10:19:37 -05:00
yindo closed this issue 2026-02-16 10:19:37 -05:00
Author
Owner

@issac2e commented on GitHub (Aug 20, 2025):

The gemini model must have user content, not only system content

@issac2e commented on GitHub (Aug 20, 2025): The gemini model must have user content, not only system content
Author
Owner

@loveFeng commented on GitHub (Aug 21, 2025):

The gemini model must have user content, not only system content

Thanks, useful

@loveFeng commented on GitHub (Aug 21, 2025): > The gemini model must have user content, not only system content Thanks, useful
Author
Owner

@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:

  • You reported that the OpenAI-API-compatible plugin works with the gpt-4.1-mini model but fails with gemini-2.5-flash.
  • It was clarified that the gemini-2.5-flash model requires user content and cannot operate with only system content.
  • You acknowledged that the input formatting advice was useful and related to the issue.
  • The problem was resolved by adjusting the input to include user content for the gemini model.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If no further updates are provided, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 6, 2025): Hi, @loveFeng. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the OpenAI-API-compatible plugin works with the gpt-4.1-mini model but fails with gemini-2.5-flash. - It was clarified that the gemini-2.5-flash model requires user content and cannot operate with only system content. - You acknowledged that the input formatting advice was useful and related to the issue. - The problem was resolved by adjusting the input to include user content for the gemini model. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If no further updates are provided, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#512