Error when using azure openai gpt4o with tool usage #3738

Closed
opened 2026-02-21 18:01:25 -05:00 by yindo · 0 comments
Owner

Originally created by @AlexSu1108 on GitHub (May 27, 2024).

Originally assigned to: @laipz8200 on GitHub.

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 search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Cloud

Steps to reproduce

Preparation:

  1. set up the Azure openai gpt4o model in the model provider.
  2. create an agent with a tool enabled (in my case, I use the 'current time' tool)

Reproduce:
chat with the agent using the function tool first, then upload a photo and ask about it.

✔️ Expected Behavior

The gpt4o model should be able to answer my question about this photo

Actual Behavior

error message: [azure_openai] Bad Request Error, Error code: 400-{error:{'code: BadRequest, message: 'function' is not an allowed role. The allowed roles are [system, user, assistant], 'param':None, 'type': None}
WechatIMG630

Originally created by @AlexSu1108 on GitHub (May 27, 2024). Originally assigned to: @laipz8200 on GitHub. ### 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 [search for existing issues](https://github.com/langgenius/dify/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] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.8 ### Cloud or Self Hosted Cloud ### Steps to reproduce Preparation: 1. set up the Azure openai gpt4o model in the model provider. 2. create an agent with a tool enabled (in my case, I use the 'current time' tool) Reproduce: chat with the agent using the function tool first, then upload a photo and ask about it. ### ✔️ Expected Behavior The gpt4o model should be able to answer my question about this photo ### ❌ Actual Behavior error message: [azure_openai] Bad Request Error, Error code: 400-{error:{'code: BadRequest, message: 'function' is not an allowed role. The allowed roles are [system, user, assistant], 'param':None, 'type': None} ![WechatIMG630](https://github.com/langgenius/dify/assets/143173584/1169c591-9428-4981-9750-682111f215d8)
yindo added the 🤖 feat:agent label 2026-02-21 18:01:25 -05:00
yindo closed this issue 2026-02-21 18:01:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3738