Skip to content

Commit

Permalink
feat: add Japanese response in tools
Browse files Browse the repository at this point in the history
  • Loading branch information
totsukash committed Sep 22, 2024
1 parent d42f17f commit a2dfacf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/core/tools/entities/common_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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}
2 changes: 2 additions & 0 deletions api/services/tools/tools_transform_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={},
Expand Down

0 comments on commit a2dfacf

Please sign in to comment.