openchatai / OpenChat

LLMs custom-chatbots console ⚡
https://open.cx
MIT License
5.17k stars 642 forks source link

Supported langue: spanish #69

Closed nicolasmaldonadoj closed 1 year ago

nicolasmaldonadoj commented 1 year ago

Hi Id like the chatbot to reply always in spanish. Is it possible?

Woahai321 commented 1 year ago

You can edit the code / prompt to always respond in spanish as shown below

/llm-server/utils/makechain.ts

function getInitalPrmoptByMode(mode: string) { switch (mode) { case 'assistant': return { condense_prompt:Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.

Chat History: {chat_history} Follow Up Input: {question} Standalone question:, qa_prompt:You are a helpful AI customer support agent. Use the following pieces of context to answer the question at the end. If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context. ALWAYS RESPOND IN SPANISH.

{context}

Question: {question} Helpful answer in markdown:`