fix: move hardcoded text to language settings (#16990) (#17133)

This commit is contained in:
Perfecto
2025-04-02 22:35:51 +08:00
committed by GitHub
parent 5cffcd6336
commit 16c722d1d8
12 changed files with 40 additions and 14 deletions

View File

@@ -21,6 +21,7 @@ from core.plugin.entities.plugin import ModelProviderID
from core.rag.index_processor.constant.built_in_field import BuiltInField
from core.rag.index_processor.constant.index_type import IndexType
from core.rag.retrieval.retrieval_methods import RetrievalMethod
from core.tools.entities.common_entities import I18nObject
from events.dataset_event import dataset_was_deleted
from events.document_event import document_was_deleted
from extensions.ext_database import db
@@ -1378,7 +1379,10 @@ class DocumentService:
cut_length = 18
cut_name = documents[0].name[:cut_length]
dataset.name = cut_name + "..."
dataset.description = "useful for when you want to answer queries about the " + documents[0].name
dataset.description = I18nObject(
en_US="useful for when you want to answer queries about the " + documents[0].name,
zh_Hans="用于回答关于 " + documents[0].name + " 的查询",
)
db.session.commit()
return dataset, documents, batch