Compare commits

...

2 Commits

Author SHA1 Message Date
a1f848bfe0 Fix:max_tokens must be at least 1, got -950, BadRequestError (#10252)
### What problem does this PR solve?
https://github.com/infiniflow/ragflow/issues/10235

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring
2025-09-24 10:49:34 +08:00
f2309ff93e UI: Add Russian language (#10249)
Add Russian language

### 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


- [x] New Feature (non-breaking change which adds functionality)
2025-09-24 10:18:47 +08:00
2 changed files with 7 additions and 3 deletions

View File

@ -870,6 +870,7 @@ class MistralChat(Base):
return gen_conf
def _chat(self, history, gen_conf={}, **kwargs):
gen_conf = self._clean_conf(gen_conf)
response = self.client.chat(model=self.model_name, messages=history, **gen_conf)
ans = response.choices[0].message.content
if response.choices[0].finish_reason == "length":
@ -882,9 +883,7 @@ class MistralChat(Base):
def chat_streamly(self, system, history, gen_conf={}, **kwargs):
if system and history and history[0].get("role") != "system":
history.insert(0, {"role": "system", "content": system})
for k in list(gen_conf.keys()):
if k not in ["temperature", "top_p", "max_tokens"]:
del gen_conf[k]
gen_conf = self._clean_conf(gen_conf)
ans = ""
total_tokens = 0
try:

View File

@ -43,6 +43,7 @@ export const LanguageList = [
'English',
'Chinese',
'Traditional Chinese',
'Russian',
'Indonesia',
'Spanish',
'Vietnamese',
@ -55,6 +56,7 @@ export const LanguageMap = {
English: 'English',
Chinese: '简体中文',
'Traditional Chinese': '繁體中文',
Russian: 'Русский',
Indonesia: 'Indonesia',
Spanish: 'Español',
Vietnamese: 'Tiếng việt',
@ -68,6 +70,7 @@ export enum LanguageAbbreviation {
En = 'en',
Zh = 'zh',
ZhTraditional = 'zh-TRADITIONAL',
Ru = 'ru',
Id = 'id',
Ja = 'ja',
Es = 'es',
@ -81,6 +84,7 @@ export const LanguageAbbreviationMap = {
[LanguageAbbreviation.En]: 'English',
[LanguageAbbreviation.Zh]: '简体中文',
[LanguageAbbreviation.ZhTraditional]: '繁體中文',
[LanguageAbbreviation.Ru]: 'Русский',
[LanguageAbbreviation.Id]: 'Indonesia',
[LanguageAbbreviation.Es]: 'Español',
[LanguageAbbreviation.Vi]: 'Tiếng việt',
@ -94,6 +98,7 @@ export const LanguageTranslationMap = {
English: 'en',
Chinese: 'zh',
'Traditional Chinese': 'zh-TRADITIONAL',
Russian: 'ru',
Indonesia: 'id',
Spanish: 'es',
Vietnamese: 'vi',