@Hongyi Shi That's a really good idea. Unfortunately I tried that and it didn't work. Look:
TEMPLATE_STR = (
"Se presenta a continuación el siguiente contexto:\n"
"---------------------\n"
"{context_str}"
"\n---------------------\n"
"Dada esta información, por favor responde la siguiente pregunta exclusivamente en español: {query_str}\n"
)
QA_TEMPLATE = Prompt(TEMPLATE_STR)
tools = [
IndexToolConfig(
query_engine=index.as_query_engine(text_qa_template=QA_TEMPLATE),
name = "FAQ",
description="Primera fuente de consulta. Base de datos de preguntas y respuestas frecuentes de la compañía",
tool_kwargs={"return_direct": True}
),
]
toolkit = LlamaToolkit(index_configs=tools)
Yeah, the QA template is exactly a direct translation to Spanish of the English default, but adding that it should answer only in Spanish and it didn't work. The rest is just text that I don't think it's relevant to the issue at hand.
Any other ideas?
Thanks @Hongyi Shi