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

Adjust chat completion request to fit capabilities of a selected model #1718

Open adubovik opened 3 days ago

adubovik commented 3 days ago

Description

When a new conversation is created, DIAL Chat properly keeps track of the types of attachments which are allowed to be attached in new conversation messages send to the model.

However, these constraints aren't inforced for the past conversation messages.

Consider the example:

  1. A new conversation is started with a vision model, which supports image/png attachments
  2. A few requests are sent to the model along with image attachments
  3. Then a model is changed to a pure text-to-text model, which doesn't support any attachments
  4. The DIAL Chat will correctly limit ability of the user to attach files to the follow-up message, however, it will send attachments which has already been attached in previous messages.
  5. Therefore, the request to text-to-text model will very likely fail

I propose to filter out attachments in all messages according to the input-file capabilities of the given model.

Use case/motivation

No response

Related issues

No response

Confidential information