docs(plugin): restore list_pipeline_knowledge_bases in Request API section (zh/en/ja)

This commit is contained in:
Junyan Qin
2026-03-23 21:23:53 +08:00
parent 04d7bb1436
commit 932dd36abf
3 changed files with 69 additions and 0 deletions
+23
View File
@@ -82,6 +82,29 @@ async def get_query_vars(self) -> dict[str, Any]:
query_vars = await event_context.get_query_vars()
```
### List Pipeline Knowledge Bases
Get the list of knowledge bases configured for the pipeline used by the current request.
```python
async def list_pipeline_knowledge_bases(self) -> list[dict[str, Any]]:
"""List knowledge bases configured for the current pipeline"""
# Usage example
knowledge_bases = await event_context.list_pipeline_knowledge_bases()
# Return example
[
{
"uuid": "kb_uuid",
"name": "Product Docs",
"description": "Internal product documentation",
}
]
```
Only returns knowledge bases bound in the `Local Agent` configuration of the pipeline corresponding to the current request. If the current pipeline has no knowledge bases configured, or does not use `Local Agent`, an empty list is returned.
## LangBot API
These APIs can be called in any plugin component. Access methods:
+23
View File
@@ -82,6 +82,29 @@ async def get_query_vars(self) -> dict[str, Any]:
query_vars = await event_context.get_query_vars()
```
### 現在のパイプラインに設定されたナレッジベース一覧の取得
現在のリクエストが使用するパイプラインに設定されたナレッジベースの一覧を取得します。
```python
async def list_pipeline_knowledge_bases(self) -> list[dict[str, Any]]:
"""List knowledge bases configured for the current pipeline"""
# 使用例
knowledge_bases = await event_context.list_pipeline_knowledge_bases()
# 返り値の例
[
{
"uuid": "kb_uuid",
"name": "Product Docs",
"description": "社内製品ドキュメント",
}
]
```
現在のリクエストに対応するパイプラインの `Local Agent` 設定にバインドされたナレッジベースのみを返します。現在のパイプラインにナレッジベースが設定されていない場合、または `Local Agent` を使用していない場合は、空のリストが返されます。
## LangBot API
これらのAPIは、任意のプラグインコンポーネントで呼び出すことができます。アクセス方法:
+23
View File
@@ -82,6 +82,29 @@ async def get_query_vars(self) -> dict[str, Any]:
query_vars = await event_context.get_query_vars()
```
### 获取当前流水线配置的知识库列表
获取当前请求所使用流水线中配置的知识库列表。
```python
async def list_pipeline_knowledge_bases(self) -> list[dict[str, Any]]:
"""List knowledge bases configured for the current pipeline"""
# 调用示例
knowledge_bases = await event_context.list_pipeline_knowledge_bases()
# 返回示例
[
{
"uuid": "kb_uuid",
"name": "Product Docs",
"description": "内部产品文档",
}
]
```
仅返回当前请求对应流水线在 `Local Agent` 配置中绑定的知识库。若当前流水线未配置知识库,或未使用 `Local Agent`,则返回空列表。
## LangBot API
这些 API 可在插件任何组件中调用。访问方式如下: