epam / ai-dial-chat

A default UI for AI DIAL
https://chat.lab.epam.com
Apache License 2.0
42 stars 15 forks source link

custom_content.attachments isn't removed when all attachments in a message are removed #1717

Open adubovik opened 4 days ago

adubovik commented 4 days ago

EPAM AI DIAL chat version

staging

What happened?

How to reproduce:

  1. Select a model which supports attachments and send a single request to it (e.g. ask a vision model to describe an image)
  2. Change the model to GPT-4, which doesn't support attachments
  3. Edit first user message - remove all attachments and send it again
  4. An internal error will be thrown, because DIAL Chat sends an empty list of attachments to a GPT-4 model which doesn't support those:
{ "custom_content": { "attachments": [] }

The error message throw by Azure OpenAI is the following:

Additional properties are not allowed ('custom_content' was unexpected) - 'messages.0'

Confidential information