fix: workflow loads tool provider icon

This commit is contained in:
Yeuoly
2024-12-02 21:08:36 +08:00
parent b10d6051ba
commit ad899844a1
24 changed files with 217 additions and 55 deletions

View File

@ -109,6 +109,7 @@ class ApiToolProviderController(ToolProviderController):
"""
return ApiTool(
api_bundle=tool_bundle,
provider_id=self.provider_id,
entity=ToolEntity(
identity=ToolIdentity(
author=tool_bundle.author,

View File

@ -22,14 +22,16 @@ API_TOOL_DEFAULT_TIMEOUT = (
class ApiTool(Tool):
api_bundle: ApiToolBundle
provider_id: str
"""
Api tool
"""
def __init__(self, entity: ToolEntity, api_bundle: ApiToolBundle, runtime: ToolRuntime):
def __init__(self, entity: ToolEntity, api_bundle: ApiToolBundle, runtime: ToolRuntime, provider_id: str):
super().__init__(entity, runtime)
self.api_bundle = api_bundle
self.provider_id = provider_id
def fork_tool_runtime(self, runtime: ToolRuntime):
"""
@ -42,6 +44,7 @@ class ApiTool(Tool):
entity=self.entity,
api_bundle=self.api_bundle.model_copy(),
runtime=runtime,
provider_id=self.provider_id,
)
def validate_credentials(