Skip to content

fix: i18n error #12052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading