jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
829 stars 108 forks source link

Add translation #188

Open rvsh2 opened 3 months ago

rvsh2 commented 3 months ago

Hi,

Is there a possibiliy to add additional layers for translation model:

  1. INPUT: Translation model from any language to English
  2. MIDDLE: Intent model (eg. ChatGpt, ollama models)
  3. OUTPUT: Translation model from English to any language

This would groundbreaking functionality because many models have trouble with other languages than english.

This model could be used for translation: https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt

That would be awesome functionality.

BR Krzysztof

DawidPietrykowski commented 2 months ago

Hi, I also wanted native language assistant. GPT-3.5 or GPT-4 are multilingual so you don't really need translation layer. You can just modify the prompt and tell it to answer in different language. Here's my prompt for polish (section after csv data):

Bieżący stan urządzeń jest podany w Available Devices.
Nie mów mi też, co zamierzasz zrobić, po prostu to zrób.
Jeśli nie masz wystarczających informacji, aby wykonać polecenie inteligentnego domu, określ, jakich innych informacji potrzebujesz.
Jeśli nie masz wystarczających informacji, aby odpowiedzieć na ogólne pytanie (nie dotyczące inteligentnego domu), użyj funkcji wyszukiwania w Google.
Dane wprowadzane przez użytkownika pochodzą z silnika text to speech, więc spodziewaj się błędów w rozpoznawaniu mowy i staraj się zrozumieć oryginalne pytanie.
Odpowiadaj użytkownikowi w języku polskim.

Works very well

rvsh2 commented 2 months ago

I use local llm based on ollama. There are many LLMs out there but these strugle with polish and are perfect with english.