dimagi / open-chat-studio

A web based platform for building Chatbots backed by Large Language Models
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

Enable send button when there is an attachment #904

Open bderenzi opened 12 hours ago

bderenzi commented 12 hours ago

Right now the send button on the web interface is disabled until we type something into the input box. This is good. We should also enable it if there's an attachment. I think we should be able to send a blank user message with the attachment and/or spoof something like "attachment"

snopoke commented 10 hours ago

@bderenzi I tried this here but it didn't work very well.

With no input I got an error from OpenAI: Message content must be non-empty.. If I used a ' ' (space) for the message the Assistant replied It seems like your message didn't come through. Could you please try sending it again?

The OpenAI docs to confirm that message content is required: https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-content

bderenzi commented 9 hours ago

Interesting. I wonder if a better approach is to pre-fill the input box with "attachment" if the input box is empty when the user adds an attachment. that way they can see / edit it if necessary and hopefully that's enough to kick off the prompt.

The alternative is to send that message without the user knowing. I.e., if they attach and send when the input is empty we send "attachment" to OpenAI. This feels somewhat better from a UX perspective, but a bit worse because then we're sending input the user never gets a chance to see.

Also, it might be that something more complete like "Please look at the attached file(s) and respond appropriately" would be better.

On Fri, Nov 22, 2024 at 3:02 PM Simon Kelly @.***> wrote:

@bderenzi https://github.com/bderenzi I tried this here https://github.com/dimagi/open-chat-studio/compare/sk/chat-attachment-tweaks?expand=1 but it didn't work very well.

With no input I got an error from OpenAI: Message content must be non-empty.. If I used a ' ' (space) for the message the Assistant replied It seems like your message didn't come through. Could you please try sending it again?

— Reply to this email directly, view it on GitHub https://github.com/dimagi/open-chat-studio/issues/904#issuecomment-2493960231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXDWX7FVTXGUHSYGACFYD2B5BQVAVCNFSM6AAAAABSJG3XXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTHE3DAMRTGE . You are receiving this because you were mentioned.Message ID: @.***>