diff --git a/api/core/tools/docs/en_US/tool_scale_out.md b/api/core/tools/docs/en_US/tool_scale_out.md index e0269e0209..a6aa3b669d 100644 --- a/api/core/tools/docs/en_US/tool_scale_out.md +++ b/api/core/tools/docs/en_US/tool_scale_out.md @@ -24,10 +24,32 @@ identity: # Basic information of the tool provider en_US: Google # English description zh_Hans: Google # Chinese description icon: icon.svg # Icon, needs to be placed in the _assets folder of the current module + tags: + - search ``` - The `identity` field is mandatory, it contains the basic information of the tool provider, including author, name, label, description, icon, etc. - The icon needs to be placed in the `_assets` folder of the current module, you can refer to [here](../../provider/builtin/google/_assets/icon.svg). + - The `tags` field is optional, it is used to classify the provider, and the frontend can filter the provider according to the tag, for all tags, they have been listed below: + ```python + class ToolLabelEnum(Enum): + SEARCH = 'search' + IMAGE = 'image' + VIDEOS = 'videos' + WEATHER = 'weather' + FINANCE = 'finance' + DESIGN = 'design' + TRAVEL = 'travel' + SOCIAL = 'social' + NEWS = 'news' + MEDICAL = 'medical' + PRODUCTIVITY = 'productivity' + EDUCATION = 'education' + BUSINESS = 'business' + ENTERTAINMENT = 'entertainment' + UTILITIES = 'utilities' + OTHER = 'other' + ``` ## 2. Prepare Provider Credentials diff --git a/api/core/tools/docs/zh_Hans/tool_scale_out.md b/api/core/tools/docs/zh_Hans/tool_scale_out.md index 20bb5e6dbc..20f0f935e8 100644 --- a/api/core/tools/docs/zh_Hans/tool_scale_out.md +++ b/api/core/tools/docs/zh_Hans/tool_scale_out.md @@ -24,10 +24,32 @@ identity: # 工具供应商的基本信息 en_US: Google # 英文描述 zh_Hans: Google # 中文描述 icon: icon.svg # 图标,需要放置在当前模块的_assets文件夹下 + tags: # 标签,用于前端展示 + - search ``` - `identity` 字段是必须的,它包含了工具供应商的基本信息,包括作者、名称、标签、描述、图标等 - 图标需要放置在当前模块的`_assets`文件夹下,可以参考[这里](../../provider/builtin/google/_assets/icon.svg)。 + - 标签用于前端展示,可以帮助用户快速找到这个工具供应商,下面列出了目前所支持的所有标签 + ```python + class ToolLabelEnum(Enum): + SEARCH = 'search' + IMAGE = 'image' + VIDEOS = 'videos' + WEATHER = 'weather' + FINANCE = 'finance' + DESIGN = 'design' + TRAVEL = 'travel' + SOCIAL = 'social' + NEWS = 'news' + MEDICAL = 'medical' + PRODUCTIVITY = 'productivity' + EDUCATION = 'education' + BUSINESS = 'business' + ENTERTAINMENT = 'entertainment' + UTILITIES = 'utilities' + OTHER = 'other' + ``` ## 2. 准备供应商凭据 diff --git a/api/core/tools/entities/tool_entities.py b/api/core/tools/entities/tool_entities.py index 03ce44b219..b7917fca7f 100644 --- a/api/core/tools/entities/tool_entities.py +++ b/api/core/tools/entities/tool_entities.py @@ -6,6 +6,24 @@ from pydantic import BaseModel, Field from core.tools.entities.common_entities import I18nObject +class ToolLabelEnum(Enum): + SEARCH = 'search' + IMAGE = 'image' + VIDEOS = 'videos' + WEATHER = 'weather' + FINANCE = 'finance' + DESIGN = 'design' + TRAVEL = 'travel' + SOCIAL = 'social' + NEWS = 'news' + MEDICAL = 'medical' + PRODUCTIVITY = 'productivity' + EDUCATION = 'education' + BUSINESS = 'business' + ENTERTAINMENT = 'entertainment' + UTILITIES = 'utilities' + OTHER = 'other' + class ToolProviderType(Enum): """ Enum class for tool provider @@ -157,6 +175,7 @@ class ToolProviderIdentity(BaseModel): description: I18nObject = Field(..., description="The description of the tool") icon: str = Field(..., description="The icon of the tool") label: I18nObject = Field(..., description="The label of the tool") + tags: Optional[list[ToolLabelEnum]] = Field(default=[], description="The tags of the tool", ) class ToolDescription(BaseModel): human: I18nObject = Field(..., description="The description presented to the user") diff --git a/api/core/tools/entities/values.py b/api/core/tools/entities/values.py index 5ca50a3ed3..d0be5e9355 100644 --- a/api/core/tools/entities/values.py +++ b/api/core/tools/entities/values.py @@ -1,26 +1,5 @@ -from enum import Enum - from core.tools.entities.common_entities import I18nObject -from core.tools.entities.tool_entities import ToolLabel - - -class ToolLabelEnum(Enum): - SEARCH = 'search' - IMAGE = 'image' - VIDEOS = 'videos' - WEATHER = 'weather' - FINANCE = 'finance' - DESIGN = 'design' - TRAVEL = 'travel' - SOCIAL = 'social' - NEWS = 'news' - MEDICAL = 'medical' - PRODUCTIVITY = 'productivity' - EDUCATION = 'education' - BUSINESS = 'business' - ENTERTAINMENT = 'entertainment' - UTILITIES = 'utilities' - OTHER = 'other' +from core.tools.entities.tool_entities import ToolLabel, ToolLabelEnum ICONS = { ToolLabelEnum.SEARCH: ''' diff --git a/api/core/tools/provider/builtin/aippt/aippt.py b/api/core/tools/provider/builtin/aippt/aippt.py index b156520e49..25133c51df 100644 --- a/api/core/tools/provider/builtin/aippt/aippt.py +++ b/api/core/tools/provider/builtin/aippt/aippt.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.aippt.tools.aippt import AIPPTGenerateTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -10,9 +9,3 @@ class AIPPTProvider(BuiltinToolProviderController): AIPPTGenerateTool._get_api_token(credentials, user_id='__dify_system__') except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY, - ToolLabelEnum.DESIGN, - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/aippt/aippt.yaml b/api/core/tools/provider/builtin/aippt/aippt.yaml index b3ff1f6d98..9b1b45d0f2 100644 --- a/api/core/tools/provider/builtin/aippt/aippt.yaml +++ b/api/core/tools/provider/builtin/aippt/aippt.yaml @@ -8,6 +8,9 @@ identity: en_US: AI-generated PPT with one click, input your content topic, and let AI serve you one-stop zh_Hans: AI一键生成PPT,输入你的内容主题,让AI为你一站式服务到底 icon: icon.png + tags: + - productivity + - design credentials_for_provider: aippt_access_key: type: secret-input diff --git a/api/core/tools/provider/builtin/arxiv/arxiv.py b/api/core/tools/provider/builtin/arxiv/arxiv.py index f8613bbc78..707fc69be3 100644 --- a/api/core/tools/provider/builtin/arxiv/arxiv.py +++ b/api/core/tools/provider/builtin/arxiv/arxiv.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.arxiv.tools.arxiv_search import ArxivSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -19,8 +18,4 @@ class ArxivProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/arxiv/arxiv.yaml b/api/core/tools/provider/builtin/arxiv/arxiv.yaml index 78c5c161af..d26993b336 100644 --- a/api/core/tools/provider/builtin/arxiv/arxiv.yaml +++ b/api/core/tools/provider/builtin/arxiv/arxiv.yaml @@ -8,3 +8,5 @@ identity: en_US: Access to a vast repository of scientific papers and articles in various fields of research. zh_Hans: 访问各个研究领域大量科学论文和文章的存储库。 icon: icon.svg + tags: + - search diff --git a/api/core/tools/provider/builtin/azuredalle/azuredalle.py b/api/core/tools/provider/builtin/azuredalle/azuredalle.py index ea4789d479..2981a54d3c 100644 --- a/api/core/tools/provider/builtin/azuredalle/azuredalle.py +++ b/api/core/tools/provider/builtin/azuredalle/azuredalle.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.azuredalle.tools.dalle3 import DallE3Tool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -23,8 +22,3 @@ class AzureDALLEProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.IMAGE - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/azuredalle/azuredalle.yaml b/api/core/tools/provider/builtin/azuredalle/azuredalle.yaml index 62ce2c21fe..4353e0c486 100644 --- a/api/core/tools/provider/builtin/azuredalle/azuredalle.yaml +++ b/api/core/tools/provider/builtin/azuredalle/azuredalle.yaml @@ -10,6 +10,9 @@ identity: zh_Hans: Azure DALL-E 绘画 pt_BR: Azure DALL-E art icon: icon.png + tags: + - image + - productivity credentials_for_provider: azure_openai_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/bing/bing.py b/api/core/tools/provider/builtin/bing/bing.py index f64460c3f2..c71128be4a 100644 --- a/api/core/tools/provider/builtin/bing/bing.py +++ b/api/core/tools/provider/builtin/bing/bing.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.bing.tools.bing_web_search import BingSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,3 @@ class BingProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/bing/bing.yaml b/api/core/tools/provider/builtin/bing/bing.yaml index 35cd729208..1ab17d5294 100644 --- a/api/core/tools/provider/builtin/bing/bing.yaml +++ b/api/core/tools/provider/builtin/bing/bing.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: Bing 搜索 pt_BR: Bing Search icon: icon.svg + tags: + - search credentials_for_provider: subscription_key: type: secret-input diff --git a/api/core/tools/provider/builtin/brave/brave.py b/api/core/tools/provider/builtin/brave/brave.py index a1c3101418..e5eada80ee 100644 --- a/api/core/tools/provider/builtin/brave/brave.py +++ b/api/core/tools/provider/builtin/brave/brave.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.brave.tools.brave_search import BraveSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -21,8 +20,4 @@ class BraveProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/brave/brave.yaml b/api/core/tools/provider/builtin/brave/brave.yaml index d1b7ff1086..93d315f839 100644 --- a/api/core/tools/provider/builtin/brave/brave.yaml +++ b/api/core/tools/provider/builtin/brave/brave.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: Brave pt_BR: Brave icon: icon.svg + tags: + - search credentials_for_provider: brave_search_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/chart/chart.py b/api/core/tools/provider/builtin/chart/chart.py index aed475155c..0865bc700a 100644 --- a/api/core/tools/provider/builtin/chart/chart.py +++ b/api/core/tools/provider/builtin/chart/chart.py @@ -2,7 +2,6 @@ import matplotlib.pyplot as plt from fontTools.ttLib import TTFont from matplotlib.font_manager import findSystemFonts -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.chart.tools.line import LinearChartTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -56,8 +55,4 @@ class ChartProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.DESIGN, ToolLabelEnum.PRODUCTIVITY, ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/chart/chart.yaml b/api/core/tools/provider/builtin/chart/chart.yaml index 7aac32b3bb..ad0d9a6cd6 100644 --- a/api/core/tools/provider/builtin/chart/chart.yaml +++ b/api/core/tools/provider/builtin/chart/chart.yaml @@ -10,4 +10,8 @@ identity: zh_Hans: 图表生成是一个用于生成可视化图表的工具,你可以通过它来生成柱状图、折线图、饼图等各类图表 pt_BR: O Gerador de gráficos é uma ferramenta para gerar gráficos estatísticos como gráfico de barras, gráfico de linhas, gráfico de pizza, etc. icon: icon.png + tags: + - design + - productivity + - utilities credentials_for_provider: diff --git a/api/core/tools/provider/builtin/code/code.py b/api/core/tools/provider/builtin/code/code.py index 93a4f2b6d2..211417c9a4 100644 --- a/api/core/tools/provider/builtin/code/code.py +++ b/api/core/tools/provider/builtin/code/code.py @@ -1,14 +1,8 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController class CodeToolProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict[str, Any]) -> None: pass - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/code/code.yaml b/api/core/tools/provider/builtin/code/code.yaml index b0fd0dd587..2640a7087e 100644 --- a/api/core/tools/provider/builtin/code/code.yaml +++ b/api/core/tools/provider/builtin/code/code.yaml @@ -10,4 +10,6 @@ identity: zh_Hans: 运行一段代码并返回结果。 pt_BR: Execute um trecho de código e obtenha o resultado de volta. icon: icon.svg + tags: + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/dalle/dalle.py b/api/core/tools/provider/builtin/dalle/dalle.py index 1c249cf440..1c8019364d 100644 --- a/api/core/tools/provider/builtin/dalle/dalle.py +++ b/api/core/tools/provider/builtin/dalle/dalle.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.dalle.tools.dalle2 import DallE2Tool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -23,8 +22,4 @@ class DALLEProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.IMAGE, ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/dalle/dalle.yaml b/api/core/tools/provider/builtin/dalle/dalle.yaml index a99401d82d..f09a9177f2 100644 --- a/api/core/tools/provider/builtin/dalle/dalle.yaml +++ b/api/core/tools/provider/builtin/dalle/dalle.yaml @@ -10,6 +10,9 @@ identity: zh_Hans: DALL-E 绘画 pt_BR: DALL-E art icon: icon.png + tags: + - image + - productivity credentials_for_provider: openai_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/devdocs/devdocs.py b/api/core/tools/provider/builtin/devdocs/devdocs.py index eda05626d5..95d7939d0d 100644 --- a/api/core/tools/provider/builtin/devdocs/devdocs.py +++ b/api/core/tools/provider/builtin/devdocs/devdocs.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.devdocs.tools.searchDevDocs import SearchDevDocsTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -20,8 +19,4 @@ class DevDocsProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/devdocs/devdocs.yaml b/api/core/tools/provider/builtin/devdocs/devdocs.yaml index 1db226fc4b..7552f5a497 100644 --- a/api/core/tools/provider/builtin/devdocs/devdocs.yaml +++ b/api/core/tools/provider/builtin/devdocs/devdocs.yaml @@ -8,3 +8,6 @@ identity: en_US: Get official developer documentations on DevDocs. zh_Hans: 从DevDocs获取官方开发者文档。 icon: icon.svg + tags: + - search + - productivity diff --git a/api/core/tools/provider/builtin/dingtalk/dingtalk.py b/api/core/tools/provider/builtin/dingtalk/dingtalk.py index d42f8c5bbf..be1d5e099c 100644 --- a/api/core/tools/provider/builtin/dingtalk/dingtalk.py +++ b/api/core/tools/provider/builtin/dingtalk/dingtalk.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin.dingtalk.tools.dingtalk_group_bot import DingTalkGroupBotTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -7,8 +6,3 @@ class DingTalkProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict) -> None: DingTalkGroupBotTool() pass - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SOCIAL - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/dingtalk/dingtalk.yaml b/api/core/tools/provider/builtin/dingtalk/dingtalk.yaml index ebe2e4fbaf..c922c140a8 100644 --- a/api/core/tools/provider/builtin/dingtalk/dingtalk.yaml +++ b/api/core/tools/provider/builtin/dingtalk/dingtalk.yaml @@ -10,4 +10,7 @@ identity: zh_Hans: 钉钉群机器人 pt_BR: DingTalk group robot icon: icon.svg + tags: + - social + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/duckduckgo/duckduckgo.py b/api/core/tools/provider/builtin/duckduckgo/duckduckgo.py index 53d0e90d42..6df8678d30 100644 --- a/api/core/tools/provider/builtin/duckduckgo/duckduckgo.py +++ b/api/core/tools/provider/builtin/duckduckgo/duckduckgo.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.duckduckgo.tools.duckduckgo_search import DuckDuckGoSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -19,8 +18,4 @@ class DuckDuckGoProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/duckduckgo/duckduckgo.yaml b/api/core/tools/provider/builtin/duckduckgo/duckduckgo.yaml index 8778dde625..f3faa06045 100644 --- a/api/core/tools/provider/builtin/duckduckgo/duckduckgo.yaml +++ b/api/core/tools/provider/builtin/duckduckgo/duckduckgo.yaml @@ -8,3 +8,5 @@ identity: en_US: A privacy-focused search engine. zh_Hans: 一个注重隐私的搜索引擎。 icon: icon.svg + tags: + - search diff --git a/api/core/tools/provider/builtin/feishu/feishu.py b/api/core/tools/provider/builtin/feishu/feishu.py index 4f455b093b..72a9333619 100644 --- a/api/core/tools/provider/builtin/feishu/feishu.py +++ b/api/core/tools/provider/builtin/feishu/feishu.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin.feishu.tools.feishu_group_bot import FeishuGroupBotTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -6,9 +5,3 @@ from core.tools.provider.builtin_tool_provider import BuiltinToolProviderControl class FeishuProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict) -> None: FeishuGroupBotTool() - pass - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SOCIAL - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/feishu/feishu.yaml b/api/core/tools/provider/builtin/feishu/feishu.yaml index a1fcd38047..a029c7edb8 100644 --- a/api/core/tools/provider/builtin/feishu/feishu.yaml +++ b/api/core/tools/provider/builtin/feishu/feishu.yaml @@ -10,4 +10,7 @@ identity: zh_Hans: 飞书群机器人 pt_BR: Feishu group bot icon: icon.svg + tags: + - social + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/firecrawl/firecrawl.py b/api/core/tools/provider/builtin/firecrawl/firecrawl.py index cc8fcb1006..adcb7ebdd6 100644 --- a/api/core/tools/provider/builtin/firecrawl/firecrawl.py +++ b/api/core/tools/provider/builtin/firecrawl/firecrawl.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.firecrawl.tools.crawl import CrawlTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,4 @@ class FirecrawlProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/firecrawl/firecrawl.yaml b/api/core/tools/provider/builtin/firecrawl/firecrawl.yaml index 67fad19159..311283dcb5 100644 --- a/api/core/tools/provider/builtin/firecrawl/firecrawl.yaml +++ b/api/core/tools/provider/builtin/firecrawl/firecrawl.yaml @@ -8,6 +8,9 @@ identity: en_US: Firecrawl API integration for web crawling and scraping. zh_CN: Firecrawl API 集成,用于网页爬取和数据抓取。 icon: icon.svg + tags: + - search + - utilities credentials_for_provider: firecrawl_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/gaode/gaode.py b/api/core/tools/provider/builtin/gaode/gaode.py index e6a992ff87..b55d93e07b 100644 --- a/api/core/tools/provider/builtin/gaode/gaode.py +++ b/api/core/tools/provider/builtin/gaode/gaode.py @@ -2,7 +2,6 @@ import urllib.parse import requests -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -25,9 +24,3 @@ class GaodeProvider(BuiltinToolProviderController): raise ToolProviderCredentialValidationError("Gaode API Key is invalid. {}".format(e)) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.UTILITIES, ToolLabelEnum.PRODUCTIVITY, - ToolLabelEnum.WEATHER, ToolLabelEnum.TRAVEL - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/gaode/gaode.yaml b/api/core/tools/provider/builtin/gaode/gaode.yaml index bca53b22e9..2eb3b161a2 100644 --- a/api/core/tools/provider/builtin/gaode/gaode.yaml +++ b/api/core/tools/provider/builtin/gaode/gaode.yaml @@ -10,6 +10,11 @@ identity: zh_Hans: 高德开放平台服务工具包。 pt_BR: Kit de ferramentas de serviço Autonavi Open Platform. icon: icon.svg + tags: + - utilities + - productivity + - travel + - weather credentials_for_provider: api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/github/github.py b/api/core/tools/provider/builtin/github/github.py index fa22761206..9275504208 100644 --- a/api/core/tools/provider/builtin/github/github.py +++ b/api/core/tools/provider/builtin/github/github.py @@ -1,6 +1,5 @@ import requests -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -31,8 +30,3 @@ class GihubProvider(BuiltinToolProviderController): raise ToolProviderCredentialValidationError("Github API Key and Api Version is invalid. {}".format(e)) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.UTILITIES - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/github/github.yaml b/api/core/tools/provider/builtin/github/github.yaml index d529e639cc..c3d85fc3f6 100644 --- a/api/core/tools/provider/builtin/github/github.yaml +++ b/api/core/tools/provider/builtin/github/github.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: GitHub是一个在线软件源代码托管服务平台。 pt_BR: GitHub é uma plataforma online para serviços de hospedagem de código fonte de software. icon: icon.svg + tags: + - utilities credentials_for_provider: access_tokens: type: secret-input diff --git a/api/core/tools/provider/builtin/google/google.py b/api/core/tools/provider/builtin/google/google.py index 0ec5baef26..8f4b9a4a4e 100644 --- a/api/core/tools/provider/builtin/google/google.py +++ b/api/core/tools/provider/builtin/google/google.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.google.tools.google_search import GoogleSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,4 @@ class GoogleProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/google/google.yaml b/api/core/tools/provider/builtin/google/google.yaml index 43b75b51cd..afb4d5b214 100644 --- a/api/core/tools/provider/builtin/google/google.yaml +++ b/api/core/tools/provider/builtin/google/google.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: GoogleSearch pt_BR: Google icon: icon.svg + tags: + - search credentials_for_provider: serpapi_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/jina/jina.yaml b/api/core/tools/provider/builtin/jina/jina.yaml index 6fdeeaa40a..d8e7038755 100644 --- a/api/core/tools/provider/builtin/jina/jina.yaml +++ b/api/core/tools/provider/builtin/jina/jina.yaml @@ -10,4 +10,7 @@ identity: zh_Hans: 将任何URL转换为LLM易读的输入或在网页上搜索引擎上搜索引擎。 pt_BR: Converte qualquer URL em uma entrada LLm-fácil de ler ou realize pesquisas na web para obter informação de grounding. Tenha uma experiência melhor para seu agente e sistemas RAG sem custo. icon: icon.svg + tags: + - search + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/judge0ce/judge0ce.py b/api/core/tools/provider/builtin/judge0ce/judge0ce.py index c378b64759..bac6576797 100644 --- a/api/core/tools/provider/builtin/judge0ce/judge0ce.py +++ b/api/core/tools/provider/builtin/judge0ce/judge0ce.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.judge0ce.tools.executeCode import ExecuteCodeTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,4 @@ class Judge0CEProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.OTHER, ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/judge0ce/judge0ce.yaml b/api/core/tools/provider/builtin/judge0ce/judge0ce.yaml index 5f0a471827..9ff8aaac6d 100644 --- a/api/core/tools/provider/builtin/judge0ce/judge0ce.yaml +++ b/api/core/tools/provider/builtin/judge0ce/judge0ce.yaml @@ -10,6 +10,9 @@ identity: zh_Hans: Judge0 CE 是一个开源的代码执行系统。支持多种语言,包括 C、C++、Java、Python、Ruby 等。 pt_BR: Judge0 CE é um sistema de execução de código de código aberto. Suporta várias linguagens, incluindo C, C++, Java, Python, Ruby, etc. icon: icon.svg + tags: + - utilities + - other credentials_for_provider: X-RapidAPI-Key: type: secret-input diff --git a/api/core/tools/provider/builtin/maths/maths.py b/api/core/tools/provider/builtin/maths/maths.py index 1471de503e..7226a5c168 100644 --- a/api/core/tools/provider/builtin/maths/maths.py +++ b/api/core/tools/provider/builtin/maths/maths.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.maths.tools.eval_expression import EvaluateExpressionTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -17,8 +16,3 @@ class MathsProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.UTILITIES, ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/maths/maths.yaml b/api/core/tools/provider/builtin/maths/maths.yaml index 5bd892a927..35c2380e29 100644 --- a/api/core/tools/provider/builtin/maths/maths.yaml +++ b/api/core/tools/provider/builtin/maths/maths.yaml @@ -10,3 +10,6 @@ identity: zh_Hans: 一个用于数学计算的工具。 pt_BR: A tool for maths. icon: icon.svg + tags: + - utilities + - productivity diff --git a/api/core/tools/provider/builtin/openweather/openweather.py b/api/core/tools/provider/builtin/openweather/openweather.py index dd0649f1aa..a2827177a3 100644 --- a/api/core/tools/provider/builtin/openweather/openweather.py +++ b/api/core/tools/provider/builtin/openweather/openweather.py @@ -1,6 +1,5 @@ import requests -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -35,8 +34,3 @@ class OpenweatherProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.WEATHER - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/openweather/openweather.yaml b/api/core/tools/provider/builtin/openweather/openweather.yaml index 60bb33c36d..d4b66f87f9 100644 --- a/api/core/tools/provider/builtin/openweather/openweather.yaml +++ b/api/core/tools/provider/builtin/openweather/openweather.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: 基于open weather的天气查询工具包 pt_BR: Kit de consulta de clima baseado no Open Weather icon: icon.svg + tags: + - weather credentials_for_provider: api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/pubmed/pubmed.py b/api/core/tools/provider/builtin/pubmed/pubmed.py index 9f4087abd7..05cd171b87 100644 --- a/api/core/tools/provider/builtin/pubmed/pubmed.py +++ b/api/core/tools/provider/builtin/pubmed/pubmed.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.pubmed.tools.pubmed_search import PubMedSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -19,8 +18,4 @@ class PubMedProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.MEDICAL, ToolLabelEnum.SEARCH - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/pubmed/pubmed.yaml b/api/core/tools/provider/builtin/pubmed/pubmed.yaml index 971a6fb204..5f8303147c 100644 --- a/api/core/tools/provider/builtin/pubmed/pubmed.yaml +++ b/api/core/tools/provider/builtin/pubmed/pubmed.yaml @@ -8,3 +8,6 @@ identity: en_US: A search engine for biomedical literature. zh_Hans: 一款生物医学文献搜索引擎。 icon: icon.svg + tags: + - medical + - search diff --git a/api/core/tools/provider/builtin/qrcode/qrcode.py b/api/core/tools/provider/builtin/qrcode/qrcode.py index 615e4ff6e6..9fa7d01265 100644 --- a/api/core/tools/provider/builtin/qrcode/qrcode.py +++ b/api/core/tools/provider/builtin/qrcode/qrcode.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.qrcode.tools.qrcode_generator import QRCodeGeneratorTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -15,8 +14,3 @@ class QRCodeProvider(BuiltinToolProviderController): }) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.UTILITIES - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/qrcode/qrcode.yaml b/api/core/tools/provider/builtin/qrcode/qrcode.yaml index c117c3de74..82e2a06e15 100644 --- a/api/core/tools/provider/builtin/qrcode/qrcode.yaml +++ b/api/core/tools/provider/builtin/qrcode/qrcode.yaml @@ -10,3 +10,5 @@ identity: zh_Hans: 一个二维码工具 pt_BR: A tool for generating QR code (quick-response code) image. icon: icon.svg + tags: + - utilities diff --git a/api/core/tools/provider/builtin/searxng/searxng.py b/api/core/tools/provider/builtin/searxng/searxng.py index 5f1b05135d..24b94b5ca4 100644 --- a/api/core/tools/provider/builtin/searxng/searxng.py +++ b/api/core/tools/provider/builtin/searxng/searxng.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.searxng.tools.searxng_search import SearXNGSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -24,8 +23,3 @@ class SearXNGProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/searxng/searxng.yaml b/api/core/tools/provider/builtin/searxng/searxng.yaml index c8c713cf04..64bd428280 100644 --- a/api/core/tools/provider/builtin/searxng/searxng.yaml +++ b/api/core/tools/provider/builtin/searxng/searxng.yaml @@ -8,6 +8,9 @@ identity: en_US: A free internet metasearch engine. zh_Hans: 开源互联网元搜索引擎 icon: icon.svg + tags: + - search + - productivity credentials_for_provider: searxng_base_url: type: secret-input diff --git a/api/core/tools/provider/builtin/slack/slack.py b/api/core/tools/provider/builtin/slack/slack.py index b8843392c7..2de7911f63 100644 --- a/api/core/tools/provider/builtin/slack/slack.py +++ b/api/core/tools/provider/builtin/slack/slack.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin.slack.tools.slack_webhook import SlackWebhookTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -7,8 +6,3 @@ class SlackProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict) -> None: SlackWebhookTool() pass - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SOCIAL - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/slack/slack.yaml b/api/core/tools/provider/builtin/slack/slack.yaml index 7278793900..1070ffbf03 100644 --- a/api/core/tools/provider/builtin/slack/slack.yaml +++ b/api/core/tools/provider/builtin/slack/slack.yaml @@ -10,4 +10,7 @@ identity: zh_Hans: Slack Webhook pt_BR: Slack Webhook icon: icon.svg + tags: + - social + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/spark/spark.py b/api/core/tools/provider/builtin/spark/spark.py index b4727912c3..cb8e69a59f 100644 --- a/api/core/tools/provider/builtin/spark/spark.py +++ b/api/core/tools/provider/builtin/spark/spark.py @@ -1,6 +1,5 @@ import json -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.spark.tools.spark_img_generation import spark_response from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -39,8 +38,3 @@ class SparkProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.IMAGE - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/spark/spark.yaml b/api/core/tools/provider/builtin/spark/spark.yaml index f2b9c89e96..fa1543443a 100644 --- a/api/core/tools/provider/builtin/spark/spark.yaml +++ b/api/core/tools/provider/builtin/spark/spark.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: 讯飞星火平台工具 pt_BR: Pacote de Ferramentas da Plataforma Spark icon: icon.svg + tags: + - image credentials_for_provider: APPID: type: secret-input diff --git a/api/core/tools/provider/builtin/stability/stability.py b/api/core/tools/provider/builtin/stability/stability.py index 9706f17468..b31d786178 100644 --- a/api/core/tools/provider/builtin/stability/stability.py +++ b/api/core/tools/provider/builtin/stability/stability.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin.stability.tools.base import BaseStabilityAuthorization from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -14,8 +13,3 @@ class StabilityToolProvider(BuiltinToolProviderController, BaseStabilityAuthoriz This method is responsible for validating the credentials. """ self.sd_validate_credentials(credentials) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.IMAGE - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/stability/stability.yaml b/api/core/tools/provider/builtin/stability/stability.yaml index d8369a4c03..c3e01c1e31 100644 --- a/api/core/tools/provider/builtin/stability/stability.yaml +++ b/api/core/tools/provider/builtin/stability/stability.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: 通过生成式 AI 激活人类的潜力 pt_BR: Activating humanity's potential through generative AI icon: icon.svg + tags: + - image credentials_for_provider: api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/stablediffusion/stablediffusion.py b/api/core/tools/provider/builtin/stablediffusion/stablediffusion.py index 2389e9c141..317d705f7c 100644 --- a/api/core/tools/provider/builtin/stablediffusion/stablediffusion.py +++ b/api/core/tools/provider/builtin/stablediffusion/stablediffusion.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.stablediffusion.tools.stable_diffusion import StableDiffusionTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -16,8 +15,4 @@ class StableDiffusionProvider(BuiltinToolProviderController): ).validate_models() except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.IMAGE - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/stablediffusion/stablediffusion.yaml b/api/core/tools/provider/builtin/stablediffusion/stablediffusion.yaml index e1161da5bb..9b3c804f72 100644 --- a/api/core/tools/provider/builtin/stablediffusion/stablediffusion.yaml +++ b/api/core/tools/provider/builtin/stablediffusion/stablediffusion.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: Stable Diffusion 是一个可以在本地部署的图片生成的工具。 pt_BR: Stable Diffusion is a tool for generating images which can be deployed locally. icon: icon.png + tags: + - image credentials_for_provider: base_url: type: secret-input diff --git a/api/core/tools/provider/builtin/stackexchange/stackexchange.py b/api/core/tools/provider/builtin/stackexchange/stackexchange.py index 34e2a47b86..de64c84997 100644 --- a/api/core/tools/provider/builtin/stackexchange/stackexchange.py +++ b/api/core/tools/provider/builtin/stackexchange/stackexchange.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.stackexchange.tools.searchStackExQuestions import SearchStackExQuestionsTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -24,8 +23,4 @@ class StackExchangeProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH, ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/stackexchange/stackexchange.yaml b/api/core/tools/provider/builtin/stackexchange/stackexchange.yaml index b2c8fe296f..ad64b9595a 100644 --- a/api/core/tools/provider/builtin/stackexchange/stackexchange.yaml +++ b/api/core/tools/provider/builtin/stackexchange/stackexchange.yaml @@ -8,3 +8,6 @@ identity: en_US: Access questions and answers from the Stack Exchange and its sub-sites. zh_Hans: 从Stack Exchange和其子论坛获取问题和答案。 icon: icon.svg + tags: + - search + - utilities diff --git a/api/core/tools/provider/builtin/tavily/tavily.py b/api/core/tools/provider/builtin/tavily/tavily.py index b4e7e78ed3..e376d99d6b 100644 --- a/api/core/tools/provider/builtin/tavily/tavily.py +++ b/api/core/tools/provider/builtin/tavily/tavily.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.tavily.tools.tavily_search import TavilySearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -28,8 +27,4 @@ class TavilyProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/tavily/tavily.yaml b/api/core/tools/provider/builtin/tavily/tavily.yaml index 50826e37b3..7b25a81848 100644 --- a/api/core/tools/provider/builtin/tavily/tavily.yaml +++ b/api/core/tools/provider/builtin/tavily/tavily.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: Tavily pt_BR: Tavily icon: icon.png + tags: + - search credentials_for_provider: tavily_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/time/time.py b/api/core/tools/provider/builtin/time/time.py index ce6e67a759..833ae194ef 100644 --- a/api/core/tools/provider/builtin/time/time.py +++ b/api/core/tools/provider/builtin/time/time.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.time.tools.current_time import CurrentTimeTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -15,8 +14,4 @@ class WikiPediaProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/time/time.yaml b/api/core/tools/provider/builtin/time/time.yaml index 8ea67cded5..1278939df5 100644 --- a/api/core/tools/provider/builtin/time/time.yaml +++ b/api/core/tools/provider/builtin/time/time.yaml @@ -10,4 +10,6 @@ identity: zh_Hans: 一个用于获取当前时间的工具。 pt_BR: A tool for getting the current time. icon: icon.svg + tags: + - utilities credentials_for_provider: diff --git a/api/core/tools/provider/builtin/trello/trello.py b/api/core/tools/provider/builtin/trello/trello.py index eb64714d14..84ecd20803 100644 --- a/api/core/tools/provider/builtin/trello/trello.py +++ b/api/core/tools/provider/builtin/trello/trello.py @@ -2,7 +2,6 @@ from typing import Any import requests -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -33,8 +32,4 @@ class TrelloProvider(BuiltinToolProviderController): except requests.exceptions.RequestException as e: # Handle other exceptions, such as connection errors raise ToolProviderCredentialValidationError("Error validating Trello credentials") - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/trello/trello.yaml b/api/core/tools/provider/builtin/trello/trello.yaml index e1228c16be..49c9f4f9a1 100644 --- a/api/core/tools/provider/builtin/trello/trello.yaml +++ b/api/core/tools/provider/builtin/trello/trello.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: "Trello: 一个用于组织工作和生活的视觉工具。" pt_BR: "Trello: Uma ferramenta visual para organizar seu trabalho e vida." icon: icon.svg + tags: + - productivity credentials_for_provider: trello_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin/twilio/twilio.py b/api/core/tools/provider/builtin/twilio/twilio.py index a881efb940..06f276053a 100644 --- a/api/core/tools/provider/builtin/twilio/twilio.py +++ b/api/core/tools/provider/builtin/twilio/twilio.py @@ -3,7 +3,6 @@ from typing import Any from twilio.base.exceptions import TwilioRestException from twilio.rest import Client -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -28,8 +27,4 @@ class TwilioProvider(BuiltinToolProviderController): raise ToolProviderCredentialValidationError(f"Missing required credential: {e}") from e except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SOCIAL - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/twilio/twilio.yaml b/api/core/tools/provider/builtin/twilio/twilio.yaml index b5143c8736..21867c1da5 100644 --- a/api/core/tools/provider/builtin/twilio/twilio.yaml +++ b/api/core/tools/provider/builtin/twilio/twilio.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: 通过SMS或Twilio消息通道发送消息。 pt_BR: Send messages through SMS or Twilio Messaging Channels. icon: icon.svg + tags: + - social credentials_for_provider: account_sid: type: secret-input diff --git a/api/core/tools/provider/builtin/vectorizer/vectorizer.py b/api/core/tools/provider/builtin/vectorizer/vectorizer.py index 73ddc14bff..3f89a83500 100644 --- a/api/core/tools/provider/builtin/vectorizer/vectorizer.py +++ b/api/core/tools/provider/builtin/vectorizer/vectorizer.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.vectorizer.tools.vectorizer import VectorizerTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,4 @@ class VectorizerProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY, ToolLabelEnum.IMAGE - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/vectorizer/vectorizer.yaml b/api/core/tools/provider/builtin/vectorizer/vectorizer.yaml index 07a20380e9..1257f8d285 100644 --- a/api/core/tools/provider/builtin/vectorizer/vectorizer.yaml +++ b/api/core/tools/provider/builtin/vectorizer/vectorizer.yaml @@ -10,6 +10,9 @@ identity: zh_Hans: 一个将 PNG 和 JPG 图像快速轻松地转换为 SVG 矢量图的工具。 pt_BR: Convert your PNG and JPG images to SVG vectors quickly and easily. Fully automatically. Using AI. icon: icon.png + tags: + - productivity + - image credentials_for_provider: api_key_name: type: secret-input diff --git a/api/core/tools/provider/builtin/webscraper/webscraper.py b/api/core/tools/provider/builtin/webscraper/webscraper.py index df7d0fd549..1e60fdb293 100644 --- a/api/core/tools/provider/builtin/webscraper/webscraper.py +++ b/api/core/tools/provider/builtin/webscraper/webscraper.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.webscraper.tools.webscraper import WebscraperTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -22,8 +21,4 @@ class WebscraperProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/webscraper/webscraper.yaml b/api/core/tools/provider/builtin/webscraper/webscraper.yaml index 056108f036..6c2eb97784 100644 --- a/api/core/tools/provider/builtin/webscraper/webscraper.yaml +++ b/api/core/tools/provider/builtin/webscraper/webscraper.yaml @@ -10,4 +10,6 @@ identity: zh_Hans: 一个用于抓取网页的工具。 pt_BR: Web Scrapper tool kit is used to scrape web icon: icon.svg + tags: + - productivity credentials_for_provider: diff --git a/api/core/tools/provider/builtin/wecom/wecom.py b/api/core/tools/provider/builtin/wecom/wecom.py index e60b64f21c..573f76ee56 100644 --- a/api/core/tools/provider/builtin/wecom/wecom.py +++ b/api/core/tools/provider/builtin/wecom/wecom.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.provider.builtin.wecom.tools.wecom_group_bot import WecomGroupBotTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -6,9 +5,3 @@ from core.tools.provider.builtin_tool_provider import BuiltinToolProviderControl class WecomProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict) -> None: WecomGroupBotTool() - pass - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SOCIAL - ] \ No newline at end of file diff --git a/api/core/tools/provider/builtin/wecom/wecom.yaml b/api/core/tools/provider/builtin/wecom/wecom.yaml index 39d00032a0..a544055ba4 100644 --- a/api/core/tools/provider/builtin/wecom/wecom.yaml +++ b/api/core/tools/provider/builtin/wecom/wecom.yaml @@ -10,4 +10,6 @@ identity: zh_Hans: 企业微信群机器人 pt_BR: Wecom group bot icon: icon.png + tags: + - social credentials_for_provider: diff --git a/api/core/tools/provider/builtin/wikipedia/wikipedia.py b/api/core/tools/provider/builtin/wikipedia/wikipedia.py index 4153a6871c..f8038714a5 100644 --- a/api/core/tools/provider/builtin/wikipedia/wikipedia.py +++ b/api/core/tools/provider/builtin/wikipedia/wikipedia.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.wikipedia.tools.wikipedia_search import WikiPediaSearchTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -19,8 +18,4 @@ class WikiPediaProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.SEARCH - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/wikipedia/wikipedia.yaml b/api/core/tools/provider/builtin/wikipedia/wikipedia.yaml index f4b5da8947..c582824022 100644 --- a/api/core/tools/provider/builtin/wikipedia/wikipedia.yaml +++ b/api/core/tools/provider/builtin/wikipedia/wikipedia.yaml @@ -10,4 +10,6 @@ identity: zh_Hans: 维基百科是一个由全世界的志愿者创建和编辑的免费在线百科全书。 pt_BR: Wikipedia is a free online encyclopedia, created and edited by volunteers around the world. icon: icon.svg + tags: + - social credentials_for_provider: diff --git a/api/core/tools/provider/builtin/wolframalpha/wolframalpha.py b/api/core/tools/provider/builtin/wolframalpha/wolframalpha.py index 86b0b65d27..ef1aac7ff2 100644 --- a/api/core/tools/provider/builtin/wolframalpha/wolframalpha.py +++ b/api/core/tools/provider/builtin/wolframalpha/wolframalpha.py @@ -1,6 +1,5 @@ from typing import Any -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.wolframalpha.tools.wolframalpha import WolframAlphaTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -21,8 +20,4 @@ class GoogleProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.PRODUCTIVITY, ToolLabelEnum.UTILITIES - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/wolframalpha/wolframalpha.yaml b/api/core/tools/provider/builtin/wolframalpha/wolframalpha.yaml index e4cc465712..91265eb3c0 100644 --- a/api/core/tools/provider/builtin/wolframalpha/wolframalpha.yaml +++ b/api/core/tools/provider/builtin/wolframalpha/wolframalpha.yaml @@ -10,6 +10,9 @@ identity: zh_Hans: WolframAlpha 是一个强大的计算知识引擎。 pt_BR: WolframAlpha is a powerful computational knowledge engine. icon: icon.svg + tags: + - productivity + - utilities credentials_for_provider: appid: type: secret-input diff --git a/api/core/tools/provider/builtin/yahoo/yahoo.py b/api/core/tools/provider/builtin/yahoo/yahoo.py index 7b5bf7f307..96dbc6c3d0 100644 --- a/api/core/tools/provider/builtin/yahoo/yahoo.py +++ b/api/core/tools/provider/builtin/yahoo/yahoo.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.yahoo.tools.ticker import YahooFinanceSearchTickerTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -19,8 +18,4 @@ class YahooFinanceProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.BUSINESS, ToolLabelEnum.FINANCE - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/yahoo/yahoo.yaml b/api/core/tools/provider/builtin/yahoo/yahoo.yaml index b16517eaf9..f1e82952c0 100644 --- a/api/core/tools/provider/builtin/yahoo/yahoo.yaml +++ b/api/core/tools/provider/builtin/yahoo/yahoo.yaml @@ -10,4 +10,7 @@ identity: zh_Hans: 雅虎财经,获取并整理出最新的新闻、股票报价等一切你想要的财经信息。 pt_BR: Finance, and Yahoo! get the latest news, stock quotes, and interactive chart with Yahoo! icon: icon.png + tags: + - business + - finance credentials_for_provider: diff --git a/api/core/tools/provider/builtin/youtube/youtube.py b/api/core/tools/provider/builtin/youtube/youtube.py index 37d24b87eb..83a4fccb32 100644 --- a/api/core/tools/provider/builtin/youtube/youtube.py +++ b/api/core/tools/provider/builtin/youtube/youtube.py @@ -1,4 +1,3 @@ -from core.tools.entities.values import ToolLabelEnum from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin.youtube.tools.videos import YoutubeVideosAnalyticsTool from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -21,8 +20,4 @@ class YahooFinanceProvider(BuiltinToolProviderController): ) except Exception as e: raise ToolProviderCredentialValidationError(str(e)) - - def _get_tool_labels(self) -> list[ToolLabelEnum]: - return [ - ToolLabelEnum.VIDEOS - ] \ No newline at end of file + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/youtube/youtube.yaml b/api/core/tools/provider/builtin/youtube/youtube.yaml index 2f83ae43ee..d6915b9a32 100644 --- a/api/core/tools/provider/builtin/youtube/youtube.yaml +++ b/api/core/tools/provider/builtin/youtube/youtube.yaml @@ -10,6 +10,8 @@ identity: zh_Hans: YouTube(油管)是全球最大的视频分享网站,用户可以在上面上传、观看和分享视频。 pt_BR: YouTube é o maior site de compartilhamento de vídeos do mundo, onde os usuários podem fazer upload, assistir e compartilhar vídeos. icon: icon.svg + tags: + - videos credentials_for_provider: google_api_key: type: secret-input diff --git a/api/core/tools/provider/builtin_tool_provider.py b/api/core/tools/provider/builtin_tool_provider.py index 3dc2a65de3..a2e7475fe7 100644 --- a/api/core/tools/provider/builtin_tool_provider.py +++ b/api/core/tools/provider/builtin_tool_provider.py @@ -152,7 +152,7 @@ class BuiltinToolProviderController(ToolProviderController): """ returns the labels of the provider """ - return [] + return self.identity.tags or [] def validate_parameters(self, tool_id: int, tool_name: str, tool_parameters: dict[str, Any]) -> None: """