BriefGPT icon indicating copy to clipboard operation
BriefGPT copied to clipboard

Feature/chinese

Open HardSoft2023 opened this issue 1 year ago • 2 comments

1、add chinese documents spport;

2、update the chat_prompt fit to chinese task.

回答的非常好

HardSoft2023 avatar May 20 '23 14:05 HardSoft2023

I like this, I'd love for the project to be more inclusive of additional languages.

A few notes:

  1. English is used by the majority of users, so the default settings should probably still be english, with a clearly outlined way to change to chinese.
  2. Instead of editing the current prompt, I think a separate prompt entirely would be best. We don't need the message about speaking Chinese to be sent to the LLM in cases where it isn't relevant.

e-johnstonn avatar May 20 '23 21:05 e-johnstonn

I've toyed around with it and I think the best solution for the prompt is to check the environmental variable that specifies language in qa_from_db() <-- located in the "chat_utils.py" file.

We can then write a custom prompt for Chinese in the "my_prompts.py" file - I'll leave that up to you.

In qa_from_db(), you should also see that if a local LLM is being used, the prompt is significantly shorter than if the OpenAI API is being used (to speed up inference). So we need two sets of prompts per language.

e-johnstonn avatar May 23 '23 01:05 e-johnstonn