From a2dfacfe0d993409db01cb4db6abdc7e220e20f5 Mon Sep 17 00:00:00 2001 From: ShotaTotsuka Date: Mon, 23 Sep 2024 03:04:37 +0900 Subject: [PATCH] feat: add Japanese response in tools --- api/core/tools/entities/common_entities.py | 5 ++++- api/services/tools/tools_transform_service.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/core/tools/entities/common_entities.py b/api/core/tools/entities/common_entities.py index 37a926697bb432..b52119fdc4759b 100644 --- a/api/core/tools/entities/common_entities.py +++ b/api/core/tools/entities/common_entities.py @@ -10,6 +10,7 @@ class I18nObject(BaseModel): zh_Hans: Optional[str] = None pt_BR: Optional[str] = None + ja_JP: Optional[str] = None en_US: str def __init__(self, **data): @@ -18,6 +19,8 @@ def __init__(self, **data): self.zh_Hans = self.en_US if not self.pt_BR: self.pt_BR = self.en_US + if not self.ja_JP: + self.ja_JP = self.en_US def to_dict(self) -> dict: - return {"zh_Hans": self.zh_Hans, "en_US": self.en_US, "pt_BR": self.pt_BR} + return {"zh_Hans": self.zh_Hans, "en_US": self.en_US, "pt_BR": self.pt_BR, "ja_JP": self.ja_JP} diff --git a/api/services/tools/tools_transform_service.py b/api/services/tools/tools_transform_service.py index 7ae1b9f23173ee..2bc48c41850de5 100644 --- a/api/services/tools/tools_transform_service.py +++ b/api/services/tools/tools_transform_service.py @@ -74,12 +74,14 @@ def builtin_provider_to_user_provider( en_US=provider_controller.identity.description.en_US, zh_Hans=provider_controller.identity.description.zh_Hans, pt_BR=provider_controller.identity.description.pt_BR, + ja_JP=provider_controller.identity.description.ja_JP, ), icon=provider_controller.identity.icon, label=I18nObject( en_US=provider_controller.identity.label.en_US, zh_Hans=provider_controller.identity.label.zh_Hans, pt_BR=provider_controller.identity.label.pt_BR, + ja_JP=provider_controller.identity.label.ja_JP, ), type=ToolProviderType.BUILT_IN, masked_credentials={},