refactor: tool response to generator

This commit is contained in:
Yeuoly
2024-07-09 15:37:56 +08:00
parent 364df36ac4
commit 563d81277b
15 changed files with 177 additions and 110 deletions

View File

@ -3,12 +3,13 @@ from typing import Any, Literal, Union
from pydantic import BaseModel, field_validator
from pydantic_core.core_schema import ValidationInfo
from core.tools.entities.tool_entities import ToolProviderType
from core.workflow.entities.base_node_data_entities import BaseNodeData
class ToolEntity(BaseModel):
provider_id: str
provider_type: Literal['builtin', 'api', 'workflow']
provider_type: ToolProviderType
provider_name: str # redundancy
tool_name: str
tool_label: str # redundancy

View File

@ -32,7 +32,7 @@ class ToolNode(BaseNode):
# fetch tool icon
tool_info = {
'provider_type': node_data.provider_type,
'provider_type': node_data.provider_type.value,
'provider_id': node_data.provider_id
}