Skip to content

Commit

Permalink
fix: i18n error (#12052)
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 authored Dec 24, 2024
1 parent 0ea6a92 commit 7a24c95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 5 additions & 3 deletions api/core/tools/entities/tool_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ def get_simple_instance(
:param options: the options of the parameter
"""
# convert options to ToolParameterOption
# FIXME fix the type error
if options:
options_tool_parametor = [
ToolParameterOption(value=option, label=I18nObject(en_US=option, zh_Hans=option)) for option in options
options = [
ToolParameterOption(value=option, label=I18nObject(en_US=option, zh_Hans=option)) # type: ignore
for option in options # type: ignore
]
return cls(
name=name,
Expand All @@ -256,7 +258,7 @@ def get_simple_instance(
form=cls.ToolParameterForm.LLM,
llm_description=llm_description,
required=required,
options=options_tool_parametor,
options=options, # type: ignore
)


Expand Down
5 changes: 1 addition & 4 deletions api/services/tools/tools_transform_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,7 @@ def tool_to_user_tool(
author=tool.identity.author,
name=tool.identity.name,
label=tool.identity.label,
description=I18nObject(
en_US=tool.description.human if tool.description else "",
zh_Hans=tool.description.human if tool.description else "",
),
description=tool.description.human if tool.description else "", # type: ignore
parameters=current_parameters,
labels=labels,
)
Expand Down

0 comments on commit 7a24c95

Please sign in to comment.