mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 20:35:22 +08:00
137 lines
4.5 KiB
YAML
137 lines
4.5 KiB
YAML
apiVersion: v1
|
|
kind: KnowledgeEngine
|
|
metadata:
|
|
name: dify-connector
|
|
label:
|
|
en_US: Dify Knowledge Base
|
|
zh_Hans: Dify 知识库
|
|
ja_JP: Dify 知識ベース
|
|
description:
|
|
en_US: Retrieve knowledge from or store files into Dify knowledge bases
|
|
zh_Hans: 从 Dify 知识库中检索知识或向其中存入文件
|
|
ja_JP: Dify 知識ベースから知識を検索または保存
|
|
spec:
|
|
creation_schema:
|
|
- name: api_base_url
|
|
label:
|
|
en_US: API Base URL
|
|
zh_Hans: API 基础地址
|
|
description:
|
|
en_US: 'Base URL for Dify API (e.g., https://api.dify.ai/v1 for cloud, or your self-hosted URL)'
|
|
zh_Hans: 'Dify API 基础地址(云端版本使用 https://api.dify.ai/v1,自托管版本使用您的服务器地址)'
|
|
ja_JP: 'Dify API ベース URL(クラウド版は https://api.dify.ai/v1、セルフホストの場合はサーバーの URL)'
|
|
type: string
|
|
default: https://api.dify.ai/v1
|
|
required: true
|
|
- name: dify_apikey
|
|
label:
|
|
en_US: API Key
|
|
zh_Hans: API 密钥
|
|
description:
|
|
en_US: 'API key from your Dify instance'
|
|
zh_Hans: '从您的 Dify 实例获取的 API Key'
|
|
ja_JP: 'Dify インスタンスから取得した API Key'
|
|
type: password
|
|
required: true
|
|
- name: dataset_id
|
|
label:
|
|
en_US: Dataset ID
|
|
zh_Hans: 数据集 ID
|
|
ja_JP: データセット ID
|
|
description:
|
|
en_US: 'The UUID of the Dify Dataset to retrieve from'
|
|
zh_Hans: '要检索的 Dify 数据集 UUID'
|
|
ja_JP: 'Dify ナレッジベース/データセットの ID'
|
|
type: string
|
|
required: true
|
|
retrieval_schema:
|
|
- name: search_method
|
|
label:
|
|
en_US: Search Method
|
|
zh_Hans: 检索模式
|
|
ja_JP: 検索方法
|
|
description:
|
|
en_US: 'The search method to use'
|
|
zh_Hans: '使用的搜索方法'
|
|
ja_JP: '使用する検索方法'
|
|
type: select
|
|
default: semantic_search
|
|
options:
|
|
- name: keyword_search
|
|
label:
|
|
en_US: Keyword Search
|
|
zh_Hans: 关键词检索
|
|
ja_JP: キーワード検索
|
|
- name: semantic_search
|
|
label:
|
|
en_US: Semantic Search
|
|
zh_Hans: 语义检索
|
|
ja_JP: セマンティック検索
|
|
- name: full_text_search
|
|
label:
|
|
en_US: Full Text Search
|
|
zh_Hans: 全文检索
|
|
ja_JP: 全文検索
|
|
- name: hybrid_search
|
|
label:
|
|
en_US: Hybrid Search
|
|
zh_Hans: 混合检索
|
|
ja_JP: ハイブリッド検索
|
|
required: false
|
|
- name: top_k
|
|
label:
|
|
en_US: Top K
|
|
zh_Hans: 返回数量
|
|
ja_JP: 取得件数
|
|
description:
|
|
en_US: 'Maximum number of results to return'
|
|
zh_Hans: '返回的最大结果数量'
|
|
ja_JP: '返す結果の最大数'
|
|
type: integer
|
|
default: 5
|
|
required: false
|
|
- name: score_threshold_enabled
|
|
label:
|
|
en_US: Enable Score Threshold
|
|
zh_Hans: 启用分数阈值
|
|
ja_JP: スコア閾値を有効化
|
|
description:
|
|
en_US: 'Filter results below the minimum score'
|
|
zh_Hans: '过滤低于最低分数的结果'
|
|
ja_JP: '最小スコア以下の結果をフィルタリング'
|
|
type: boolean
|
|
default: false
|
|
required: false
|
|
- name: score_threshold
|
|
label:
|
|
en_US: Score Threshold
|
|
zh_Hans: 分数阈值
|
|
ja_JP: スコア閾値
|
|
description:
|
|
en_US: 'Minimum relevance score (0-1)'
|
|
zh_Hans: '最小相关性分数 (0-1)'
|
|
ja_JP: '最小関連性スコア (0-1)'
|
|
type: float
|
|
default: 0.5
|
|
required: false
|
|
show_if:
|
|
field: score_threshold_enabled
|
|
operator: eq
|
|
value: true
|
|
- name: reranking_enable
|
|
label:
|
|
en_US: Enable Reranking
|
|
zh_Hans: 启用重排序
|
|
ja_JP: リランキングを有効化
|
|
description:
|
|
en_US: 'Enable reranking using the model configured in your Dify dataset settings (configure it in Dify console first)'
|
|
zh_Hans: '启用重排序,将自动使用 Dify 数据集中配置的重排序模型(请先在 Dify 控制台配置)'
|
|
ja_JP: 'Dify データセット設定で構成されたリランキングモデルを使用(先に Dify コンソールで設定してください)'
|
|
type: boolean
|
|
default: false
|
|
required: false
|
|
execution:
|
|
python:
|
|
path: engine.py
|
|
attr: DifyDatasetsConnector
|