mattermost / mattermost-plugin-ai

Mattermost Copilot plugin supporting multiple LLMs
https://mattermost.com/copilot
Apache License 2.0
136 stars 30 forks source link

💡 idea: Take into account the user locale for AI actions #167

Closed muratbayan closed 5 months ago

muratbayan commented 7 months ago

Description

Users having a non-english locale in their Mattermost profile profile would greatly benefit from having the answers in their chosen language.

AI Copilot responds in the language of the user input when using the RHS to chat, however action buttons (Summarize Thread, Open Questions, Actions Items etc.) in the UI will by default return a response in English from my testing.

These actions' answers being only available to the user triggering them, I would love to see them match the user locale, which is available to the AI Copilot already (checked by asking "who am I" to get my locale)

image

A valuable use case that I use often is conversations with our customers across multiple regions. Multiple languages are spoken in threads as there is often a language barrier. AI Copilot helps me get a summary in English of threads. Follow ups with AI copilot also help me draft responses in the appropriate language.

jprusch commented 7 months ago

That would lead to translatable plugins. +1 from my side.

jespino commented 5 months ago

@muratbayan I think this is relatively easy to implement, but I see some problems. Maybe the user doesn't want the reply in its own language, maybe he prefer to keep the context in the original language, second, we expect that in the future you can post the summary of something back to the channel, so... if it is in your local language you need to ask the AI to translate it back to the original language. I'm not sure if we would like this to be optional or not.

jespino commented 5 months ago

@esethna do you have any strong opinions about the previous comment?

jprusch commented 5 months ago

I see some areas of work here:

jespino commented 5 months ago

Thanks @jprusch, I have already some initial work on this.

esethna commented 5 months ago

Agree with not forcing the locale in a response. The end user always has the option to contextually interrogate to translate any responses into a specific language. Agree that when interacting in a different language the response should follow the language of the prompt

jespino commented 5 months ago

I added 2 PRs here, one for the locale aware AI, making the AI aware of your locale and asking for the preference of answering in your own language unless you ask something directly to the AI, in that case the AI will answer in the language that you asked. The second PR is adding localization to the interface, making the interface translatable, and in fact I added the Spanish translation for that :)

muratbayan commented 5 months ago

Thanks a lot, forcing the locale is something we should steer away from I agree. In terms of user experience, would there be a use case where the AI might want to stick to the input language of the thread/call transcription when summarising? e.g. I have a Mattermost Call recording with French speakers, or a thread with only German replies?

Another thought: would it make sense to allow some persistent bits of context based on our conversations with Copilot? i.e. can I tell Copilot that I only want it to reply to me in French from now on for all my future direct chats with it?