mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
Compare commits
2 Commits
38be53cf31
...
a1f848bfe0
| Author | SHA1 | Date | |
|---|---|---|---|
| a1f848bfe0 | |||
| f2309ff93e |
@ -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:
|
||||
|
||||
@ -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',
|
||||
|
||||
Reference in New Issue
Block a user