Browse Source

fix: get tool provider (#13958)

tags/1.0.0
Yeuoly 8 months ago
parent
commit
15a56f705f
No account linked to committer's email address
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      api/core/plugin/entities/plugin.py
  2. 2
    2
      api/core/plugin/manager/tool.py

+ 1
- 1
api/core/plugin/entities/plugin.py View File

def __init__(self, value: str, is_hardcoded: bool = False) -> None: def __init__(self, value: str, is_hardcoded: bool = False) -> None:
super().__init__(value, is_hardcoded) super().__init__(value, is_hardcoded)
if self.organization == "langgenius": if self.organization == "langgenius":
if self.provider_name in ["jina", "siliconflow"]:
if self.provider_name in ["jina", "siliconflow", "stepfun"]:
self.plugin_name = f"{self.provider_name}_tool" self.plugin_name = f"{self.provider_name}_tool"





+ 2
- 2
api/core/plugin/manager/tool.py View File



from pydantic import BaseModel from pydantic import BaseModel


from core.plugin.entities.plugin import GenericProviderID
from core.plugin.entities.plugin import GenericProviderID, ToolProviderID
from core.plugin.entities.plugin_daemon import PluginBasicBooleanResponse, PluginToolProviderEntity from core.plugin.entities.plugin_daemon import PluginBasicBooleanResponse, PluginToolProviderEntity
from core.plugin.manager.base import BasePluginManager from core.plugin.manager.base import BasePluginManager
from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter
""" """
Fetch tool provider for the given tenant and plugin. Fetch tool provider for the given tenant and plugin.
""" """
tool_provider_id = GenericProviderID(provider)
tool_provider_id = ToolProviderID(provider)


def transformer(json_response: dict[str, Any]) -> dict: def transformer(json_response: dict[str, Any]) -> dict:
data = json_response.get("data") data = json_response.get("data")

Loading…
Cancel
Save