feat: support define tags in tool yaml (#4763)

This commit is contained in:
Yeuoly 2024-05-29 15:19:14 +08:00 committed by GitHub
parent b189faca52
commit 74f38eacda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
82 changed files with 187 additions and 255 deletions

View File

@ -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

View File

@ -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. 准备供应商凭据

View File

@ -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")

View File

@ -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: '''<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">

View File

@ -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,
]

View File

@ -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

View File

@ -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,
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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,
]

View File

@ -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

View File

@ -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
]

View File

@ -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:

View File

@ -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
]

View File

@ -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:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -8,3 +8,6 @@ identity:
en_US: Get official developer documentations on DevDocs.
zh_Hans: 从DevDocs获取官方开发者文档。
icon: icon.svg
tags:
- search
- productivity

View File

@ -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
]

View File

@ -10,4 +10,7 @@ identity:
zh_Hans: 钉钉群机器人
pt_BR: DingTalk group robot
icon: icon.svg
tags:
- social
- productivity
credentials_for_provider:

View File

@ -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
]

View File

@ -8,3 +8,5 @@ identity:
en_US: A privacy-focused search engine.
zh_Hans: 一个注重隐私的搜索引擎。
icon: icon.svg
tags:
- search

View File

@ -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
]

View File

@ -10,4 +10,7 @@ identity:
zh_Hans: 飞书群机器人
pt_BR: Feishu group bot
icon: icon.svg
tags:
- social
- productivity
credentials_for_provider:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -10,3 +10,6 @@ identity:
zh_Hans: 一个用于数学计算的工具。
pt_BR: A tool for maths.
icon: icon.svg
tags:
- utilities
- productivity

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -8,3 +8,6 @@ identity:
en_US: A search engine for biomedical literature.
zh_Hans: 一款生物医学文献搜索引擎。
icon: icon.svg
tags:
- medical
- search

View File

@ -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
]

View File

@ -10,3 +10,5 @@ identity:
zh_Hans: 一个二维码工具
pt_BR: A tool for generating QR code (quick-response code) image.
icon: icon.svg
tags:
- utilities

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -10,4 +10,7 @@ identity:
zh_Hans: Slack Webhook
pt_BR: Slack Webhook
icon: icon.svg
tags:
- social
- productivity
credentials_for_provider:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -10,4 +10,6 @@ identity:
zh_Hans: 一个用于获取当前时间的工具。
pt_BR: A tool for getting the current time.
icon: icon.svg
tags:
- utilities
credentials_for_provider:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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:

View File

@ -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
]

View File

@ -10,4 +10,6 @@ identity:
zh_Hans: 企业微信群机器人
pt_BR: Wecom group bot
icon: icon.png
tags:
- social
credentials_for_provider:

View File

@ -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
]

View File

@ -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:

View File

@ -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
]

View File

@ -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

View File

@ -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
]

View File

@ -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:

View File

@ -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
]

View File

@ -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

View File

@ -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:
"""