Skip to content

Commit 83f53ca

Browse files
committed
add bocha web search tool
1 parent 2bb6833 commit 83f53ca

File tree

13 files changed

+575
-0
lines changed

13 files changed

+575
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: BoCha
3+
description: Websuche mit BoCha
4+
---
5+
6+
[BoCha](https://bocha.cn/) ist eine KI-gestützte Such-API, die speziell für LLM-Anwendungen entwickelt wurde. Sie bietet zuverlässige Echtzeit-Informationsabfragen und ist für KI-Anwendungsfälle optimiert.
7+
8+
Mit BoCha in Sim können Sie:
9+
10+
- **Webseiten durchsuchen**: Sofort Antworten, Fakten und Übersichten zu Suchanfragen finden
11+
- **Direkte Antworten erhalten**: Konkrete Ergebnisse für Berechnungen, Umrechnungen oder Faktenabfragen abrufen
12+
- **Zusammenfassungen erhalten**: Kurze Zusammenfassungen oder Beschreibungen zu Suchthemen bekommen
13+
- **Verwandte Themen entdecken**: Links und Referenzen zu verwandten Suchthemen finden
14+
15+
Diese Funktionen ermöglichen es Sim-Agenten, automatisch auf aktuelles Webwissen zuzugreifen – von der Darstellung von Fakten in Workflows bis hin zur Anreicherung von Dokumenten und Analysen mit neuesten Informationen.
16+
17+
## Verwendung
18+
19+
Verwenden Sie die BoCha Instant Answer API, um das Web zu durchsuchen. Sie gibt direkte Antworten, Zusammenfassungen und verwandte Themen zurück.
20+
21+
## Tool
22+
23+
### `bocha_search`
24+
25+
Durchsucht das Web mit der BoCha Instant Answer API und gibt direkte Antworten, Zusammenfassungen und verwandte Themen zurück.
26+
27+
#### Eingaben
28+
29+
| Parameter | Typ | Erforderlich | Beschreibung |
30+
| --------- | ---- | ---- | ----------- |
31+
| `query` | string | Ja | Die auszuführende Suchanfrage (z. B. „latest AI research papers 2024“) |
32+
| `freshness` | string | Nein | Zeitbereich der Suchergebnisse (noLimit / oneDay / oneWeek / oneMonth / oneYear / YYYY-MM-DD / YYYY-MM-DD..YYYY-MM-DD) |
33+
| `summary` | boolean | Nein | Ob eine Textzusammenfassung zurückgegeben werden soll |
34+
| `count` | number | Nein | Maximale Anzahl der Ergebnisse (1–50, z. B. 5) |
35+
| `include` | string | Nein | Eingeschränkte Domains für die Suche, getrennt durch `|` oder `,` (max. 100) |
36+
| `exclude` | string | Nein | Ausgeschlossene Domains, getrennt durch `|` oder `,` (max. 100) |
37+
38+
#### Ausgaben
39+
40+
| Parameter | Typ | Beschreibung |
41+
| --------- | ---- | ----------- |
42+
| `query` | string | Die ausgeführte Suchanfrage |
43+
| `results` | array | Suchergebnisse des Tools |
44+
45+
## Hinweise
46+
47+
- Kategorie: `tools`
48+
- Typ: `bocha`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: BoCha
3+
description: Search the web using BoCha
4+
---
5+
6+
[BoCha](https://bocha.cn/) is an AI-powered search API designed specifically for LLM applications. It provides reliable real-time information retrieval and is optimized for AI-driven use cases.
7+
8+
With BoCha in Sim, you can:
9+
10+
- **Search the web**: Instantly find answers, facts, and overviews for search queries
11+
- **Get direct answers**: Retrieve precise responses for calculations, conversions, or factual queries
12+
- **Access summaries**: Receive concise summaries or descriptions of search topics
13+
- **Discover related topics**: Explore links and references related to your search
14+
15+
These capabilities allow Sim agents to automatically access up-to-date web knowledge—from presenting facts in workflows to enriching documents and analyses with the latest information.
16+
17+
## Usage
18+
19+
Use the BoCha Instant Answer API to search the web. It returns direct answers, summaries, and related topics.
20+
21+
## Tool
22+
23+
### `bocha_search`
24+
25+
Searches the web using the BoCha Instant Answer API and returns direct answers, summaries, and related topics.
26+
27+
#### Inputs
28+
29+
| Parameter | Type | Required | Description |
30+
| --------- | ---- | ---- | ----------- |
31+
| `query` | string | Yes | The search query to execute (e.g., "latest AI research papers 2024") |
32+
| `freshness` | string | No | Time range for search results (noLimit / oneDay / oneWeek / oneMonth / oneYear / YYYY-MM-DD / YYYY-MM-DD..YYYY-MM-DD) |
33+
| `summary` | boolean | No | Whether to return a text summary |
34+
| `count` | number | No | Maximum number of results (1–50, e.g., 5) |
35+
| `include` | string | No | Domains to include in the search, separated by `|` or `,` (max 100) |
36+
| `exclude` | string | No | Domains to exclude from the search, separated by `|` or `,` (max 100) |
37+
38+
#### Outputs
39+
40+
| Parameter | Type | Description |
41+
| --------- | ---- | ----------- |
42+
| `query` | string | The executed search query |
43+
| `results` | array | Results returned by the tool |
44+
45+
## Notes
46+
47+
- Category: `tools`
48+
- Type: `bocha`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: BoCha
3+
description: Buscar en la web con BoCha
4+
---
5+
6+
[BoCha](https://bocha.cn/) es una API de búsqueda impulsada por IA diseñada específicamente para aplicaciones LLM. Proporciona recuperación de información en tiempo real y está optimizada para casos de uso con IA.
7+
8+
Con BoCha en Sim, puedes:
9+
10+
- **Buscar en la web**: Encontrar instantáneamente respuestas, hechos y resúmenes
11+
- **Obtener respuestas directas**: Recuperar resultados precisos para cálculos, conversiones o consultas factuales
12+
- **Acceder a resúmenes**: Recibir descripciones breves de temas de búsqueda
13+
- **Descubrir temas relacionados**: Explorar enlaces y referencias relacionadas
14+
15+
Estas capacidades permiten a los agentes de Sim acceder automáticamente a conocimiento web actualizado, enriqueciendo flujos de trabajo, documentos y análisis.
16+
17+
## Uso
18+
19+
Utiliza la API de respuestas instantáneas de BoCha para buscar en la web. Devuelve respuestas directas, resúmenes y temas relacionados.
20+
21+
## Herramienta
22+
23+
### `bocha_search`
24+
25+
Busca en la web utilizando la API de respuestas instantáneas de BoCha.
26+
27+
#### Entradas
28+
29+
| Parámetro | Tipo | Requerido | Descripción |
30+
| --------- | ---- | ---- | ----------- |
31+
| `query` | string || Consulta de búsqueda (ej.: "latest AI research papers 2024") |
32+
| `freshness` | string | No | Rango de tiempo de los resultados |
33+
| `summary` | boolean | No | Si se debe devolver un resumen |
34+
| `count` | number | No | Número máximo de resultados |
35+
| `include` | string | No | Dominios incluidos |
36+
| `exclude` | string | No | Dominios excluidos |
37+
38+
#### Salidas
39+
40+
| Parámetro | Tipo | Descripción |
41+
| --------- | ---- | ----------- |
42+
| `query` | string | Consulta ejecutada |
43+
| `results` | array | Resultados devueltos |
44+
45+
## Notas
46+
47+
- Categoría: `tools`
48+
- Tipo: `bocha`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: BoCha
3+
description: Recherche web avec BoCha
4+
---
5+
6+
[BoCha](https://bocha.cn/) est une API de recherche alimentée par l’IA, conçue pour les applications LLM. Elle fournit un accès fiable à des informations en temps réel, optimisées pour les usages IA.
7+
8+
Avec BoCha dans Sim, vous pouvez :
9+
10+
- **Rechercher sur le web** : Obtenir instantanément des réponses et des faits
11+
- **Recevoir des réponses directes** : Pour des calculs, conversions ou requêtes factuelles
12+
- **Accéder à des résumés** : Descriptions concises de sujets de recherche
13+
- **Découvrir des sujets connexes** : Liens et références associés
14+
15+
Ces fonctionnalités permettent aux agents Sim d’accéder automatiquement aux connaissances web les plus récentes.
16+
17+
## Utilisation
18+
19+
Utilisez l’API Instant Answer de BoCha pour effectuer des recherches web.
20+
21+
## Outil
22+
23+
### `bocha_search`
24+
25+
Recherche sur le web via l’API Instant Answer de BoCha.
26+
27+
#### Entrées
28+
29+
| Paramètre | Type | Requis | Description |
30+
| --------- | ---- | ---- | ----------- |
31+
| `query` | string | Oui | Requête de recherche |
32+
| `freshness` | string | Non | Période temporelle |
33+
| `summary` | boolean | Non | Retourner un résumé |
34+
| `count` | number | Non | Nombre maximal de résultats |
35+
| `include` | string | Non | Domaines inclus |
36+
| `exclude` | string | Non | Domaines exclus |
37+
38+
#### Sorties
39+
40+
| Paramètre | Type | Description |
41+
| --------- | ---- | ----------- |
42+
| `query` | string | Requête exécutée |
43+
| `results` | array | Résultats retournés |
44+
45+
## Remarques
46+
47+
- Catégorie : `tools`
48+
- Type : `bocha`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: BoCha
3+
description: BoCha を使用した Web 検索
4+
---
5+
6+
[BoCha](https://bocha.cn/) は、LLM アプリケーション向けに設計された AI 駆動の検索 API です。信頼性の高いリアルタイム情報検索を提供し、AI 利用シナリオに最適化されています。
7+
8+
Sim で BoCha を使用すると、次のことが可能です:
9+
10+
- **Web 検索**:検索クエリに対する回答・事実・概要を即座に取得
11+
- **直接回答の取得**:計算、変換、事実ベースの質問への正確な回答
12+
- **要約の取得**:検索トピックの簡潔な要約
13+
- **関連トピックの発見**:関連リンクや参考資料の探索
14+
15+
これらの機能により、Sim エージェントは最新の Web 知識に自動的にアクセスできます。
16+
17+
## 使用方法
18+
19+
BoCha の Instant Answer API を使用して Web を検索します。
20+
21+
## ツール
22+
23+
### `bocha_search`
24+
25+
BoCha Instant Answer API を使用して Web を検索します。
26+
27+
#### 入力
28+
29+
| パラメータ || 必須 | 説明 |
30+
| --------- | ---- | ---- | ----------- |
31+
| `query` | string | はい | 実行する検索クエリ |
32+
| `freshness` | string | いいえ | 検索結果の期間 |
33+
| `summary` | boolean | いいえ | 要約を返すかどうか |
34+
| `count` | number | いいえ | 最大結果数 |
35+
| `include` | string | いいえ | 含めるドメイン |
36+
| `exclude` | string | いいえ | 除外するドメイン |
37+
38+
#### 出力
39+
40+
| パラメータ || 説明 |
41+
| --------- | ---- | ----------- |
42+
| `query` | string | 実行された検索クエリ |
43+
| `results` | array | 検索結果 |
44+
45+
## 注意事項
46+
47+
- カテゴリ:`tools`
48+
- タイプ:`bocha`
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: BoCha
3+
description: 使用 BoCha 搜索
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="bocha"
10+
color="#FFFFFF"
11+
/>
12+
13+
{/* MANUAL-CONTENT-START:intro */}
14+
[BoCha](https://bocha.cn/) 是一款专为 LLM 应用设计的 AI 驱动搜索 API。它提供可靠的实时信息检索功能,并针对 AI 使用场景优化了功能.
15+
16+
在 Sim 中使用 BoCha,您可以:
17+
18+
- **搜索网页**:即时找到答案、事实和搜索查询的概述
19+
- **获取直接答案**:检索计算、转换或事实查询的具体响应
20+
- **访问摘要**:接收搜索主题的简短总结或描述
21+
- **获取相关主题**:发现与搜索相关的链接和参考资料
22+
23+
这些功能使您的 Sim 代理能够自动访问最新的网络知识——从在工作流程中呈现事实,到通过最新信息丰富文档和分析。。
24+
{/* MANUAL-CONTENT-END */}
25+
26+
## 使用说明
27+
28+
使用 BoCha 即时答案 API 搜索网页。返回即时答案、摘要、相关主题等。
29+
30+
## 工具
31+
32+
### `bocha_search`
33+
34+
使用 BoCha 即时答案 API 搜索网页。返回查询的即时答案、摘要和相关主题。
35+
36+
#### 输入
37+
38+
| 参数 | 类型 | 必需 | 描述 |
39+
| --------- | ---- | ---- | ----------- |
40+
| `query` | string || 要执行的搜索查询(例如:"latest AI research papers 2024") |
41+
| `freshness` | string || 指定搜索结果的时间范围(noLimit / oneDay / oneWeek / oneMonth / oneYear / YYYY-MM-DD / YYYY-MM-DD..YYYY-MM-DD) |
42+
| `summary` | boolean || 是否返回文本摘要 |
43+
| `count` | number || 返回结果的最大数量(1–50,例如:5) |
44+
| `include` | string || 限定搜索的网站域名范围,多个域名用 `|``,` 分隔,最多 100 个 |
45+
| `exclude` | string || 从搜索结果中排除指定网站域名,多个域名用 `|``,` 分隔,最多 100 个 |
46+
47+
48+
#### 输出
49+
50+
| 参数 | 类型 | 描述 |
51+
| --------- | ---- | ----------- |
52+
| `query` | 字符串 | 已执行的搜索查询 |
53+
| `results` | 数组 | 工具输出的结果 |
54+
55+
## 注意事项
56+
57+
- 类别:`tools`
58+
- 类型:`bocha`

apps/sim/blocks/blocks/bocha.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { BoChaIcon } from '@/components/icons'
2+
import type { BlockConfig } from '@/blocks/types'
3+
import type { BoChaSearchResponse } from '@/tools/bocha/types'
4+
5+
export const BoChaBlock: BlockConfig<BoChaSearchResponse> = {
6+
type: 'bocha',
7+
name: 'BoCha',
8+
description: 'Search with BoCha',
9+
longDescription:
10+
'Search the web using BoCha Instant Answers API. Returns instant answers, abstracts, related topics, and more.',
11+
docsLink: 'https://docs.sim.ai/tools/bocha',
12+
category: 'tools',
13+
bgColor: '#FFFFFF',
14+
icon: BoChaIcon,
15+
subBlocks: [
16+
{
17+
id: 'query',
18+
title: 'Search Query',
19+
type: 'long-input',
20+
placeholder: 'Enter your search query',
21+
required: true,
22+
},
23+
{
24+
id: 'freshness',
25+
title: 'Freshness',
26+
type: 'long-input',
27+
placeholder: 'noLimit',
28+
description: 'Search for web pages within a specified time range(noLimit/oneDay/oneWeek/oneMonth/oneYear/YYYY-MM-DD/YYYY-MM-DD/YYYY-MM-DD..YYYY-MM-DD)',
29+
},
30+
{
31+
id: 'summary',
32+
title: 'Show Summary',
33+
type: 'switch',
34+
defaultValue: false,
35+
},
36+
{
37+
id: 'count',
38+
title: 'Result Count',
39+
type: 'short-input',
40+
min: 1,
41+
max: 50,
42+
placeholder: 'e.g. 5',
43+
},
44+
{
45+
id: 'include',
46+
title: 'Include Domains',
47+
type: 'long-input',
48+
placeholder: 'example.com | arxiv.org',
49+
description: 'Limit search to specific domains (separate by | or ,)',
50+
},
51+
{
52+
id: 'exclude',
53+
title: 'Exclude Domains',
54+
type: 'long-input',
55+
placeholder: 'spam.com | ads.example',
56+
description: 'Exclude specific domains from search results',
57+
},
58+
{
59+
id: 'apiKey',
60+
title: 'API Key',
61+
type: 'short-input',
62+
placeholder: 'Enter your BoCha API key',
63+
password: true,
64+
required: true,
65+
},
66+
],
67+
tools: {
68+
access: ['bocha_search'],
69+
config: {
70+
tool: () => 'bocha_search',
71+
},
72+
},
73+
inputs: {
74+
query: { type: 'string', description: 'Search query terms' },
75+
freshness: { type: 'string', description: 'Time range filter for search results' },
76+
summary: { type: 'boolean', description: 'Whether to return a text summary' },
77+
count: { type: 'number', description: 'Maximum number of search results to return' },
78+
include: { type: 'string', description: 'Domains to include in search results' },
79+
exclude: { type: 'string', description: 'Domains to exclude from search results' },
80+
apiKey: { type: 'string', description: 'BoCha API key' },
81+
},
82+
outputs: {
83+
query: { type: 'string', description: 'Search query used' },
84+
results: { type: 'json', description: 'Array of external link results' },
85+
},
86+
}

0 commit comments

Comments
 (0)