mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 02:45:53 +08:00
fix: i18n error (#12052)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
0ea6a926c5
commit
7a24c957bd
@ -243,9 +243,11 @@ class ToolParameter(BaseModel):
|
|||||||
:param options: the options of the parameter
|
:param options: the options of the parameter
|
||||||
"""
|
"""
|
||||||
# convert options to ToolParameterOption
|
# convert options to ToolParameterOption
|
||||||
|
# FIXME fix the type error
|
||||||
if options:
|
if options:
|
||||||
options_tool_parametor = [
|
options = [
|
||||||
ToolParameterOption(value=option, label=I18nObject(en_US=option, zh_Hans=option)) for option in options
|
ToolParameterOption(value=option, label=I18nObject(en_US=option, zh_Hans=option)) # type: ignore
|
||||||
|
for option in options # type: ignore
|
||||||
]
|
]
|
||||||
return cls(
|
return cls(
|
||||||
name=name,
|
name=name,
|
||||||
@ -256,7 +258,7 @@ class ToolParameter(BaseModel):
|
|||||||
form=cls.ToolParameterForm.LLM,
|
form=cls.ToolParameterForm.LLM,
|
||||||
llm_description=llm_description,
|
llm_description=llm_description,
|
||||||
required=required,
|
required=required,
|
||||||
options=options_tool_parametor,
|
options=options, # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -275,10 +275,7 @@ class ToolTransformService:
|
|||||||
author=tool.identity.author,
|
author=tool.identity.author,
|
||||||
name=tool.identity.name,
|
name=tool.identity.name,
|
||||||
label=tool.identity.label,
|
label=tool.identity.label,
|
||||||
description=I18nObject(
|
description=tool.description.human if tool.description else "", # type: ignore
|
||||||
en_US=tool.description.human if tool.description else "",
|
|
||||||
zh_Hans=tool.description.human if tool.description else "",
|
|
||||||
),
|
|
||||||
parameters=current_parameters,
|
parameters=current_parameters,
|
||||||
labels=labels,
|
labels=labels,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user