mirror of
https://github.com/langgenius/dify.git
synced 2026-08-01 01:49:30 +08:00
fix: fix when tool execute in progress tool_meta miss tool_provider_type (#39513)
This commit is contained in:
parent
a877e1bd7e
commit
5277e4b375
@ -9,6 +9,7 @@ import contexts
|
||||
from core.app.app_config.easy_ui_based_app.agent.manager import AgentConfigManager
|
||||
from core.plugin.impl.agent import PluginAgentClient
|
||||
from core.plugin.impl.exc import PluginDaemonClientSideError
|
||||
from core.tools.entities.tool_entities import EmojiIconDict
|
||||
from core.tools.tool_manager import ToolManager
|
||||
from libs.login import current_user
|
||||
from models import Account
|
||||
@ -105,11 +106,22 @@ class AgentService:
|
||||
tool_output = tool_outputs.get(tool_name, {})
|
||||
tool_meta_data = tool_meta.get(tool_name, {})
|
||||
tool_config = tool_meta_data.get("tool_config", {})
|
||||
if tool_config.get("tool_provider_type", "") != "dataset-retrieval":
|
||||
tool_provider_type = tool_config.get("tool_provider_type", "")
|
||||
tool_provider_id = tool_config.get("tool_provider", "")
|
||||
|
||||
if not tool_provider_type:
|
||||
tool_entity = find_agent_tool(tool_name)
|
||||
if tool_entity:
|
||||
tool_provider_type = tool_entity.provider_type
|
||||
tool_provider_id = tool_provider_id or tool_entity.provider_id
|
||||
|
||||
tool_icon: str | EmojiIconDict = ""
|
||||
|
||||
if tool_provider_type and tool_provider_type != "dataset-retrieval":
|
||||
tool_icon = ToolManager.get_tool_icon(
|
||||
tenant_id=app_model.tenant_id,
|
||||
provider_type=tool_config.get("tool_provider_type", ""),
|
||||
provider_id=tool_config.get("tool_provider", ""),
|
||||
provider_type=tool_provider_type,
|
||||
provider_id=tool_provider_id,
|
||||
)
|
||||
if not tool_icon:
|
||||
tool_entity = find_agent_tool(tool_name)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user