Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Messages on the message tab (`/messages`) should be filtered by language

Open andreaskoepf opened this issue 2 years ago • 5 comments

Currently the messages show in on the message tab (/messages) are not filtered by the currently active language. I think it would be helpful to add this filtering because this view allows quick and simple message feedback (e.g. emojis & reporting). When many messages are shown in foreign languages which the current user does not understand we lose potential message-review capacity...

The queries for the messages should send the lang-tag of the currently active language as query param to the backend. When the user switches the language (via language selector drop down) the message result lists should be refreshed.

andreaskoepf avatar Jan 27 '23 22:01 andreaskoepf

Hey, I'm a research engineer currently working on a mix of ml research and software engineering with a focus on language modelling. I'd like to get involved and take this issue if it's still free?

ghost avatar Jan 31 '23 14:01 ghost

Hi @jebbbbb have you worked with NextAuth localization? I'm happy to let you take a look at this if you want although I setup this part and I think I know the quick fix to it.

fozziethebeat avatar Feb 01 '23 06:02 fozziethebeat

Hey @fozziethebeat, I've changed GitHub accounts to my personal username. No, I haven't worked with NextAuth localization before. In that case it probably makes more sense for you to take it. I'd be happy to take up another ticket like #990 if you could assign me to it?

jackapbutler avatar Feb 01 '23 11:02 jackapbutler

I'll get to this shortly

fozziethebeat avatar Feb 03 '23 08:02 fozziethebeat

@andreaskoepf to make this work, method query_messages_ordered_by_created_date in prompt_repository.py has to be updated. The lang filtering has to happen before ordering (I just tested locally and it currently fails when you fetch recent messages with the lang field set).

I tried to make this in my local PR but for some reason the check python ast pre-commit is flagging this file because it uses match (which I guess isn't supported in CPython 3.9.13 that's being run).

Can you fix the backend side? I have a web side fix that'll request it in the user's language for the short term.

fozziethebeat avatar Feb 07 '23 07:02 fozziethebeat