vectara / create-ui

Generate a working React codebase for a range of generative and semantic search UIs
https://vectara.github.io/create-ui
Apache License 2.0
69 stars 12 forks source link

Restrict languages to selective ones + Possibility of using Romanized languages #42

Open hello007world opened 3 months ago

hello007world commented 3 months ago

A spin-off from this issue: https://github.com/vectara/create-ui/issues/40

How does one make their chatbot to only respond to queries in English and French, and when given a question in a language that isn't either, say something like "Please ask the question in English or French only".

EDIT: The first issue has a partial solution:

generation: {
      responseLanguage: "eng",
 },

However I can't set the value to something like

generation: {
      responseLanguage: "eng", "fr"
OR responseLanguage: ["eng", "fr"]
OR responseLanguage: {"eng", "fr"}
OR responseLanguage: ("eng", "fr")
OR responseLanguage: "eng" && "fr",
 },

The first four cause an error in the code, while the last one just only outputs the responses in French; Is it possible to have be in both English & French (depending on the query language)?

Small note: MockingBird doesn't seem to be compatible with non-English languages at the moment: all outputs are in English.

Plus a semi-related question; are Romanized versions of languages (such as Urdu, Japanese, Arabic, Hebrew, Greek etc) supported with the chatbots? If not, are there plans for such support in the future? Or possibly ways to implement them yourself manually?

If anyone has a solution to either issues, I would appreciate your help.