feat: tool output schema
This commit is contained in:
parent
7c83d5ce76
commit
0dd05d7b6d
@ -16,6 +16,7 @@ class ToolApiEntity(BaseModel):
|
|||||||
description: I18nObject
|
description: I18nObject
|
||||||
parameters: Optional[list[ToolParameter]] = None
|
parameters: Optional[list[ToolParameter]] = None
|
||||||
labels: list[str] = Field(default_factory=list)
|
labels: list[str] = Field(default_factory=list)
|
||||||
|
output_schema: Optional[dict] = None
|
||||||
|
|
||||||
|
|
||||||
ToolProviderTypeApiLiteral = Optional[Literal["builtin", "api", "workflow"]]
|
ToolProviderTypeApiLiteral = Optional[Literal["builtin", "api", "workflow"]]
|
||||||
|
@ -298,7 +298,7 @@ class ToolEntity(BaseModel):
|
|||||||
identity: ToolIdentity
|
identity: ToolIdentity
|
||||||
parameters: list[ToolParameter] = Field(default_factory=list)
|
parameters: list[ToolParameter] = Field(default_factory=list)
|
||||||
description: Optional[ToolDescription] = None
|
description: Optional[ToolDescription] = None
|
||||||
# TODO: output schema
|
output_schema: Optional[dict] = None
|
||||||
has_runtime_parameters: bool = Field(default=False, description="Whether the tool has runtime parameters")
|
has_runtime_parameters: bool = Field(default=False, description="Whether the tool has runtime parameters")
|
||||||
|
|
||||||
# pydantic configs
|
# pydantic configs
|
||||||
|
@ -262,6 +262,7 @@ class ToolTransformService:
|
|||||||
name=tool.entity.identity.name,
|
name=tool.entity.identity.name,
|
||||||
label=tool.entity.identity.label,
|
label=tool.entity.identity.label,
|
||||||
description=tool.entity.description.human if tool.entity.description else I18nObject(en_US=""),
|
description=tool.entity.description.human if tool.entity.description else I18nObject(en_US=""),
|
||||||
|
output_schema=tool.entity.output_schema,
|
||||||
parameters=current_parameters,
|
parameters=current_parameters,
|
||||||
labels=labels or [],
|
labels=labels or [],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user