Selaa lähdekoodia

Set the language default value of the language based on the LANG envi… (#853)

…ronment variable at the initial creation.

1. Set the User's default language based on LANG;
2. Set the Knowledgebase's default language based on LANG; 
3. Set the default language of the Dialog based on LANG;

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
tags/v0.6.0
dashi6174 1 vuosi sitten
vanhempi
commit
7e74546b73
No account linked to committer's email address
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3
    3
      api/db/db_models.py

+ 3
- 3
api/db/db_models.py Näytä tiedosto

max_length=32, max_length=32,
null=True, null=True,
help_text="English|Chinese", help_text="English|Chinese",
default="English")
default="Chinese" if "zh_CN" in os.getenv("LANG", "") else "English")     
color_schema = CharField( color_schema = CharField(
max_length=32, max_length=32,
null=True, null=True,
language = CharField( language = CharField(
max_length=32, max_length=32,
null=True, null=True,
default="English",
default="Chinese" if "zh_CN" in os.getenv("LANG", "") else "English",
help_text="English|Chinese") help_text="English|Chinese")
description = TextField(null=True, help_text="KB description") description = TextField(null=True, help_text="KB description")
embd_id = CharField( embd_id = CharField(
language = CharField( language = CharField(
max_length=32, max_length=32,
null=True, null=True,
default="Chinese",
default="Chinese" if "zh_CN" in os.getenv("LANG", "") else "English",
help_text="English|Chinese") help_text="English|Chinese")
llm_id = CharField(max_length=128, null=False, help_text="default llm ID") llm_id = CharField(max_length=128, null=False, help_text="default llm ID")
llm_setting = JSONField(null=False, default={"temperature": 0.1, "top_p": 0.3, "frequency_penalty": 0.7, llm_setting = JSONField(null=False, default={"temperature": 0.1, "top_p": 0.3, "frequency_penalty": 0.7,

Loading…
Peruuta
Tallenna