Skip to content

Commit

Permalink
fix: skip dataset icon (langgenius#3696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly authored Apr 23, 2024
1 parent 9525cca commit 2c50fab
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions api/services/agent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,22 @@ def find_agent_tool(tool_name: str):
tool_output = tool_outputs.get(tool_name, {})
tool_meta_data = tool_meta.get(tool_name, {})
tool_config = tool_meta_data.get('tool_config', {})
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', ''),
)
if not tool_icon:
tool_entity = find_agent_tool(tool_name)
if tool_entity:
tool_icon = ToolManager.get_tool_icon(
tenant_id=app_model.tenant_id,
provider_type=tool_entity.provider_type,
provider_id=tool_entity.provider_id,
)
if tool_config.get('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', ''),
)
if not tool_icon:
tool_entity = find_agent_tool(tool_name)
if tool_entity:
tool_icon = ToolManager.get_tool_icon(
tenant_id=app_model.tenant_id,
provider_type=tool_entity.provider_type,
provider_id=tool_entity.provider_id,
)
else:
tool_icon = ''

tool_calls.append({
'status': 'success' if not tool_meta_data.get('error') else 'error',
Expand Down

0 comments on commit 2c50fab

Please sign in to comment.