Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

chore(release): v0.5.0

wizardchenb587844d0660
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 281aaceda..65a6b967b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,31 @@
All notable changes to this project will be documented in this file.
+## [0.5.0] - 2026-04-27
+
+### 🚀 New Features
+- **NEW**: Wiki Mode — a brand-new agent-driven Wiki knowledge system that automatically distills raw documents into interlinked markdown pages. It ships with a dedicated WikiBrowser, an interactive knowledge graph visualizing references and relationships between pages, and specialized agent tools, empowering teams to grow a structured, continuously evolving knowledge base from their own materials.
+- **NEW**: Observability — integrated Langfuse for agent ReAct loop, LLM token tracking, tool calls, and asynq pipeline tracing, providing deep visibility into agent reasoning, tool execution, and system performance.
+- **NEW**: Customizable Indexing Strategy — users can now independently toggle Vector Search, Keyword Search, Wiki, and Knowledge Graph indexing on a per-knowledge-base level.
+- **NEW**: Vector Store UI & Per-KB Binding — full frontend management interface for Vector Stores, allowing users to configure connections, test connectivity, and assign specific vector stores to different knowledge bases.
+- **NEW**: Yuque Connector — Yuque data source integration with API client, full and incremental fetch, and resource mapping, enabling seamless synchronization of Yuque documents into the knowledge base.
+- **NEW**: Built-in Agent Skills — added a preloaded `OpenMAIC Classroom` agent skill.
+- **NEW**: Agent Tools — added `json_repair` tool for agents to automatically fix and parse malformed JSON outputs.
+- **NEW**: Frontend — added copy action for model cards in settings.
+- **NEW**: Agent — added support to load all sheets from Excel files for DuckDB data analysis.
+
+### ⚡ Improvements
+- **IMPROVED**: Agent — improved tenant context handling and error reporting.
+- **IMPROVED**: Agent — updated synthesis and issue flagging instructions in system prompt.
+- **IMPROVED**: Debugging — enhanced LLM request logging and debug output (`llm_debug`) across all model providers.
+
+### 🐛 Bug Fixes
+- **FIXED**: Agent — materialized knowledge files to temp path for DuckDB to fix access issues
+- **FIXED**: Agent — removed rerank model requirement for wiki-only agents
+- **FIXED**: Docreader — whitelisted offline protoc zip packages in dockerignore
+- **FIXED**: System — changed hardcoded version to `*` comparison for new Linux version compatibility
+- **FIXED**: Setup — added output if offline protoc install package already exists
+
## [0.4.0] - 2026-04-14
### 🚀 New Features
@@ -897,6 +922,8 @@ All notable changes to this project will be documented in this file.
- Docker Compose for quick startup and service orchestration.
- MCP server support for integrating with MCP-compatible clients.
+[0.5.0]: https://github.com/Tencent/WeKnora/tree/v0.5.0
+[0.4.0]: https://github.com/Tencent/WeKnora/tree/v0.4.0
[0.3.6]: https://github.com/Tencent/WeKnora/tree/v0.3.6
[0.3.5]: https://github.com/Tencent/WeKnora/tree/v0.3.5
[0.3.4]: https://github.com/Tencent/WeKnora/tree/v0.3.4
diff --git a/README.md b/README.md
index 134cc424a..4024dc8b8 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
<img src="https://img.shields.io/badge/License-MIT-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="License">
</a>
<a href="./CHANGELOG.md">
- <img alt="Version" src="https://img.shields.io/badge/version-0.4.0-2e6cc4?labelColor=d4eaf7">
+ <img alt="Version" src="https://img.shields.io/badge/version-0.5.0-2e6cc4?labelColor=d4eaf7">
</a>
</p>
@@ -44,13 +44,27 @@
[**WeKnora**](https://weknora.weixin.qq.com) is an LLM-powered intelligent knowledge management and Q&A framework built for enterprise-grade document understanding and semantic retrieval.
-WeKnora offers two Q&A modes — **Quick Q&A** and **Intelligent Reasoning**. Quick Q&A uses a **RAG (Retrieval-Augmented Generation)** pipeline to rapidly retrieve relevant chunks and generate answers, ideal for everyday knowledge queries. Intelligent Reasoning is powered by a **ReACT Agent** engine that employs a **progressive strategy** to autonomously orchestrate knowledge retrieval, MCP tools, and web search, iteratively reasoning and reflecting to arrive at a final conclusion — suited for multi-source synthesis and complex tasks. Custom agents are also supported, allowing flexible configuration of dedicated knowledge bases, tool sets, and system prompts. Choose the right mode for the task, balancing response speed with reasoning depth.
+WeKnora offers two Q&A modes — **Quick Q&A** and **Intelligent Reasoning**, alongside an autonomous **Wiki Mode**. Quick Q&A uses a **RAG (Retrieval-Augmented Generation)** pipeline to rapidly retrieve relevant chunks and generate answers, ideal for everyday knowledge queries. Intelligent Reasoning is powered by a **ReACT Agent** engine that employs a **progressive strategy** to autonomously orchestrate knowledge retrieval, MCP tools, and web search, iteratively reasoning and reflecting to arrive at a final conclusion — suited for multi-source synthesis and complex tasks. The new **Wiki Mode** allows agents to autonomously generate and maintain a structured, interlinked markdown knowledge base from raw documents. Custom agents are also supported, allowing flexible configuration of dedicated knowledge bases, tool sets, and system prompts. Choose the right mode for the task, balancing response speed with reasoning depth.
-The framework supports auto-syncing knowledge from Feishu (more data sources coming soon), handles 10+ document formats including PDF, Word, images, and Excel, and can serve Q&A directly through IM channels like WeCom, Feishu, Slack, and Telegram. It is compatible with major LLM providers including OpenAI, DeepSeek, Qwen (Alibaba Cloud), Zhipu, Hunyuan, Gemini, MiniMax, NVIDIA, and Ollama. Its fully modular design allows swapping LLMs, vector databases, and storage backends, with support for local and private cloud deployment ensuring complete data sovereignty.
+The framework supports auto-syncing knowledge from Feishu, Notion, and Yuque (more data sources coming soon), handles 10+ document formats including PDF, Word, images, and Excel, and can serve Q&A directly through IM channels like WeCom, Feishu, Slack, and Telegram. It is compatible with major LLM providers including OpenAI, DeepSeek, Qwen (Alibaba Cloud), Zhipu, Hunyuan, Gemini, MiniMax, NVIDIA, and Ollama. Its fully modular design allows swapping LLMs, vector databases, and storage backends, with support for local and private cloud deployment ensuring complete data sovereignty. WeKnora also integrates with **Langfuse** for comprehensive observability into agent reasoning, token usage, and pipeline tracing.
## ✨ Latest Updates
+**v0.5.0 Highlights:**
+
+- **Wiki Mode**: A brand-new agent-driven Wiki knowledge system that automatically distills raw documents into interlinked markdown pages. It ships with a dedicated WikiBrowser and an interactive knowledge graph that visualizes references and relationships between pages, helping teams grow a structured, continuously evolving knowledge base from their own materials.
+- **Observability**: Integrated Langfuse for agent ReAct loop, LLM token tracking, tool calls, and asynq pipeline tracing, providing deep visibility into agent reasoning and system performance.
+- **Customizable Indexing Strategy**: Users can now independently configure and toggle Vector Search, Keyword Search (Hybrid), Wiki, and Knowledge Graph indexing per knowledge base.
+- **Vector Store UI & Per-KB Binding**: Full frontend management for Vector Stores with connectivity testing, plus the ability to bind distinct vector databases to specific knowledge bases.
+- **Yuque Connector**: Yuque data source integration with API client, full and incremental fetch, enabling seamless synchronization of Yuque documents.
+- **Agent Capabilities**: Added `json_repair` tool for automatic JSON fixing, preloaded `OpenMAIC Classroom` skill, and DuckDB multi-sheet Excel data analysis.
+- **Frontend & Debugging**: Added copy action for model cards in settings, and enhanced LLM request debugging and logging across all model providers.
+- **Bug Fixes**: Fixed DuckDB access issues by materializing knowledge files to temp path, removed rerank model requirement for wiki-only agents, and whitelisted offline protoc zip packages in dockerignore.
+
+<details>
+<summary><b>Earlier Releases</b></summary>
+
**v0.4.0 Highlights:**
- **[Knowledge Assistant](https://weknora.weixin.qq.com/platform)**: Cloud-hosted knowledge assistant service for quick onboarding without local deployment
@@ -175,6 +189,7 @@ Fully modular pipeline from document parsing, vectorization, and retrieval to LL
|------------|---------|
| Intelligent Reasoning | ReACT progressive multi-step reasoning, autonomously orchestrating knowledge retrieval, MCP tools, and web search; custom agent support |
| Quick Q&A | RAG-based Q&A over knowledge bases for fast and accurate answers |
+| Wiki Mode | Agent-driven auto-generation of structured, interlinked markdown Wiki pages from raw documents |
| Tool Calling | Built-in tools, MCP tools, web search |
| Conversation Strategy | Online Prompt editing, retrieval threshold tuning, multi-turn context awareness |
| Suggested Questions | Auto-generated question suggestions based on knowledge base content |
@@ -183,8 +198,8 @@ Fully modular pipeline from document parsing, vectorization, and retrieval to LL
| Capability | Details |
|------------|---------|
-| Knowledge Base Types | FAQ / Document with folder import, URL import, tag management, and online entry |
-| Data Source Import | Auto-sync from Feishu / Notion (more data sources coming soon); incremental and full sync |
+| Knowledge Base Types | FAQ / Document / Wiki with folder import, URL import, tag management, and online entry |
+| Data Source Import | Auto-sync from Feishu / Notion / Yuque (more data sources coming soon); incremental and full sync |
| Document Formats | PDF / Word / Txt / Markdown / HTML / Images / CSV / Excel / PPT / JSON |
| Retrieval Strategies | BM25 sparse / Dense retrieval / GraphRAG / parent-child chunking / multi-dimensional indexing |
| E2E Testing | Full-pipeline visualization with recall hit rate, BLEU / ROUGE metric evaluation |
@@ -206,6 +221,7 @@ Fully modular pipeline from document parsing, vectorization, and retrieval to LL
|------------|---------|
| Deployment | Local / Docker / Kubernetes (Helm) with private and offline support |
| UI | Web UI / RESTful API / Chrome Extension |
+| Observability | Integrated Langfuse for ReAct loops, token tracking, tool calls, and pipeline tracing |
| Task Management | MQ async tasks, automatic database migration on version upgrade |
| Model Management | Centralized config, per-knowledge-base model selection, multi-tenant built-in model sharing, WeKnora Cloud hosted models and parsing |
@@ -276,7 +292,11 @@ Stop services: `docker compose down`
<tr>
<td colspan="2"><b>Agent Mode Tool Call Process</b><br/><img src="./docs/images/agent-qa.png" alt="Agent Mode Tool Call Process"></td>
</tr>
- <tr>
+ <tr>
+ <td><b>Wiki Browser</b><br/><img src="./docs/images/wiki-browser.png" alt="Wiki Browser"></td>
+ <td><b>Wiki Knowledge Graph</b><br/><img src="./docs/images/wiki-graph.png" alt="Wiki Knowledge Graph"></td>
+ </tr>
+ <tr>
<td><b>Knowledge Base Management</b><br/><img src="./docs/images/knowledgebases.png" alt="Knowledge Base Management"></td>
<td><b>Conversation Settings</b><br/><img src="./docs/images/settings.png" alt="Conversation Settings"></td>
</tr>
diff --git a/README_CN.md b/README_CN.md
index 268405fa6..3ed5deeb4 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -22,7 +22,7 @@
<img src="https://img.shields.io/badge/License-MIT-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="License">
</a>
<a href="./CHANGELOG.md">
- <img alt="版本" src="https://img.shields.io/badge/version-0.4.0-2e6cc4?labelColor=d4eaf7">
+ <img alt="版本" src="https://img.shields.io/badge/version-0.5.0-2e6cc4?labelColor=d4eaf7">
</a>
</p>
@@ -44,12 +44,26 @@
**[WeKnora(维娜拉)](https://weknora.weixin.qq.com)** 是一款基于大语言模型(LLM)的智能知识管理与问答框架,专为企业级文档理解与语义检索场景打造。
-WeKnora 提供**快速问答**与**智能推理**两种问答模式。快速问答基于 **RAG(Retrieval-Augmented Generation)** 流水线,快速召回相关片段并生成回答,适合日常知识查询。智能推理基于 **ReACT Agent** 引擎,采用**渐进式策略**自主编排知识检索、MCP 工具和网络搜索,经过多轮迭代与反思逐步推导最终结论,适合多源信息整合与复杂任务。同时支持自定义智能体,灵活配置专属的知识库、工具集与系统提示词。两种模式按需选用,兼顾响应速度与推理深度。
+WeKnora 提供**快速问答**与**智能推理**两种问答模式,并新增了支持自治化内容构建的 **Wiki 模式**。快速问答基于 **RAG(Retrieval-Augmented Generation)** 流水线,快速召回相关片段并生成回答,适合日常知识查询。智能推理基于 **ReACT Agent** 引擎,采用**渐进式策略**自主编排知识检索、MCP 工具和网络搜索,经过多轮迭代与反思逐步推导最终结论,适合多源信息整合与复杂任务。全新的 **Wiki 模式** 允许 Agent 从原始文档中自主生成并维护一套结构化、相互链接的 Markdown Wiki 知识库。同时支持自定义智能体,灵活配置专属的知识库、工具集与系统提示词。两种模式按需选用,兼顾响应速度与推理深度。
-框架支持从飞书等外部平台自动同步知识(更多数据源持续接入中),覆盖 PDF、Word、图片、Excel 等十余种文档格式,并可通过企业微信、飞书、Slack、Telegram 等 IM 频道直接提供问答服务。模型层面兼容 OpenAI、DeepSeek、Qwen(阿里云)、智谱、混元、Gemini、MiniMax、NVIDIA、Ollama 等主流厂商。全流程模块化设计,大模型、向量数据库、存储等组件均可灵活替换,支持本地与私有云部署,数据完全自主可控。
+框架支持从飞书、Notion 及语雀等外部平台自动同步知识(更多数据源持续接入中),覆盖 PDF、Word、图片、Excel 等十余种文档格式,并可通过企业微信、飞书、Slack、Telegram 等 IM 频道直接提供问答服务。模型层面兼容 OpenAI、DeepSeek、Qwen(阿里云)、智谱、混元、Gemini、MiniMax、NVIDIA、Ollama 等主流厂商。全流程模块化设计,大模型、向量数据库、存储等组件均可灵活替换,支持本地与私有云部署,数据完全自主可控。WeKnora 还无缝集成了 **Langfuse**,为 Agent 运行、Token 使用及任务流水线提供了全面的可观测性追踪。
## ✨ 最新更新
+**v0.5.0 版本亮点:**
+
+- **Wiki 模式**:全新推出 Agent 驱动的 Wiki 知识体系,可从原始文档中自动梳理并生成相互关联的 Markdown 页面,内置独立的 Wiki 浏览器与可视化知识图谱,直观呈现页面之间的引用与关联关系,帮助团队沉淀结构化、可迭代演进的专属知识库
+- **可观测性**:集成 Langfuse 以深入跟踪 Agent ReAct 循环、LLM Token 消耗、工具调用以及 asynq 任务流水线,全面掌控 Agent 推理和系统性能
+- **自定义索引策略**:用户现在可以在知识库级别,独立开启或关闭 向量检索、关键词检索(混合检索)、Wiki 模式 以及 知识图谱 构建
+- **向量数据库 UI 与知识库绑定**:新增前端 Vector Store 管理界面与连通性测试功能,并支持为不同知识库绑定专属的向量数据库实例
+- **语雀数据源**:新增语雀连接器,提供完整的 API 客户端,支持文档的全量与增量同步,实现语雀知识的无缝接入
+- **Agent 能力增强**:新增 `json_repair` 工具以自动修复和解析异常 JSON 输出,预置了 `OpenMAIC Classroom` 智能体技能,并支持在 DuckDB 数据分析中加载 Excel 的所有工作表
+- **前端与调试优化**:设置页面模型卡片新增快速复制功能,全面增强了所有模型厂商的 LLM 请求调试(`llm_debug`)和日志记录机制
+- **问题修复**:修复 DuckDB 访问文件问题(将知识文件物化到临时目录)、移除纯 Wiki 模式 Agent 对 Rerank 模型的依赖,以及在 dockerignore 中将离线 protoc 压缩包加入白名单
+
+<details>
+<summary><b>更早版本</b></summary>
+
**v0.4.0 版本亮点:**
- **[知识助理](https://weknora.weixin.qq.com/platform)**:云端托管的知识助理服务,无需本地部署即可快速体验
@@ -173,6 +187,7 @@ WeKnora 提供**快速问答**与**智能推理**两种问答模式。快速问
|------|------|
| 智能推理 | ReACT 渐进式多步推理,自主编排知识检索、MCP 工具与网络搜索,支持自定义智能体 |
| 快速问答 | 基于知识库的 RAG 问答,快速准确地回答问题 |
+| Wiki 模式 | Agent 驱动从原始文档中自动生成并维护结构化、相互链接的 Markdown Wiki 知识页面 |
| 工具调用 | 内置工具、MCP 工具、网络搜索 |
| 对话策略 | 在线 Prompt 编辑、检索阈值调节、多轮上下文感知 |
| 推荐问题 | 基于知识库内容自动生成推荐问题 |
@@ -181,8 +196,8 @@ WeKnora 提供**快速问答**与**智能推理**两种问答模式。快速问
| 能力 | 详情 |
|------|------|
-| 知识库类型 | FAQ / 文档,支持文件夹导入、URL 导入、标签管理、在线录入 |
-| 数据源导入 | 飞书 / Notion 知识库自动同步(更多数据源开发中),支持增量与全量同步 |
+| 知识库类型 | FAQ / 文档 / Wiki,支持文件夹导入、URL 导入、标签管理、在线录入 |
+| 数据源导入 | 飞书 / Notion / 语雀 知识库自动同步(更多数据源开发中),支持增量与全量同步 |
| 文档格式 | PDF / Word / Txt / Markdown / HTML / 图片 / CSV / Excel / PPT / JSON |
| 检索策略 | BM25 稀疏召回 / Dense 稠密召回 / GraphRAG 图谱增强 / 父子分块 / 多维度索引 |
| 端到端测试 | 检索+生成全链路可视化,评估召回命中率、BLEU / ROUGE 等指标 |
@@ -204,6 +219,7 @@ WeKnora 提供**快速问答**与**智能推理**两种问答模式。快速问
|------|------|
| 部署 | 本地 / Docker / Kubernetes (Helm),支持私有化离线部署 |
| 界面 | Web UI / RESTful API / Chrome Extension|
+| 可观测性 | 集成 Langfuse 以追踪 ReAct 循环、Token 消耗、工具调用和任务流水线 |
| 任务管理 | MQ 异步任务,版本升级自动数据库迁移 |
| 模型管理 | 集中配置,知识库级别模型选择,多租户共享内置模型,WeKnora Cloud 托管模型与文档解析 |
@@ -274,6 +290,10 @@ docker compose up -d # 启动核心服务
<tr>
<td colspan="2"><b>Agent模式工具调用过程</b><br/><img src="./docs/images/agent-qa.png" alt="Agent模式工具调用过程"></td>
</tr>
+ <tr>
+ <td><b>Wiki 浏览器</b><br/><img src="./docs/images/wiki-browser.png" alt="Wiki 浏览器"></td>
+ <td><b>Wiki 知识图谱</b><br/><img src="./docs/images/wiki-graph.png" alt="Wiki 知识图谱"></td>
+ </tr>
<tr>
<td><b>知识库管理</b><br/><img src="./docs/images/knowledgebases.png" alt="知识库管理"></td>
<td><b>对话设置</b><br/><img src="./docs/images/settings.png" alt="对话设置"></td>
diff --git a/README_JA.md b/README_JA.md
index 0704850bb..64d05a2e8 100644
--- a/README_JA.md
+++ b/README_JA.md
@@ -22,7 +22,7 @@
<img src="https://img.shields.io/badge/License-MIT-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="License">
</a>
<a href="./CHANGELOG.md">
- <img alt="バージョン" src="https://img.shields.io/badge/version-0.4.0-2e6cc4?labelColor=d4eaf7">
+ <img alt="バージョン" src="https://img.shields.io/badge/version-0.5.0-2e6cc4?labelColor=d4eaf7">
</a>
</p>
@@ -44,12 +44,26 @@
[**WeKnora(ウィーノラ)**](https://weknora.weixin.qq.com) は、大規模言語モデル(LLM)をベースとしたインテリジェントなナレッジ管理・Q&Aフレームワークで、エンタープライズ向けの文書理解と意味検索シナリオに特化して設計されています。
-WeKnora は**クイック Q&A** と**インテリジェント推論**の 2 つの Q&A モードを提供します。クイック Q&A は **RAG(Retrieval-Augmented Generation)** パイプラインで関連フラグメントを素早く検索・回答を生成し、日常的なナレッジ検索に最適です。インテリジェント推論は **ReACT Agent** エンジンにより、**プログレッシブ戦略**でナレッジ検索、MCP ツール、Web 検索を自律的にオーケストレーションし、反復推論とリフレクションで段階的に結論を導きます。複数情報源の統合や複雑なタスクに最適です。カスタムエージェントにも対応し、専用のナレッジベース、ツールセット、システムプロンプトを柔軟に設定できます。用途に応じてモードを選択し、応答速度と推論の深さを両立します。
+WeKnora は**クイック Q&A** と**インテリジェント推論**の 2 つの Q&A モードを提供し、さらに自律的なコンテンツ構築をサポートする**Wiki モード**を追加しました。クイック Q&A は **RAG(Retrieval-Augmented Generation)** パイプラインで関連フラグメントを素早く検索・回答を生成し、日常的なナレッジ検索に最適です。インテリジェント推論は **ReACT Agent** エンジンにより、**プログレッシブ戦略**でナレッジ検索、MCP ツール、Web 検索を自律的にオーケストレーションし、反復推論とリフレクションで段階的に結論を導きます。新しい**Wiki モード**により、Agent は生のドキュメントから構造化され、相互にリンクされたMarkdown Wikiナレッジベースを自律的に生成・維持できます。カスタムエージェントにも対応し、専用のナレッジベース、ツールセット、システムプロンプトを柔軟に設定できます。用途に応じてモードを選択し、応答速度と推論の深さを両立します。
-Feishuなどの外部プラットフォームからのナレッジ自動同期(他のデータソースも順次対応中)に対応し、PDF、Word、画像、Excelなど10以上の文書フォーマットをサポート。WeChat Work、Feishu、Slack、TelegramなどのIMチャネルから直接Q&Aサービスを提供できます。モデル層ではOpenAI、DeepSeek、Qwen(Alibaba Cloud)、Zhipu、Hunyuan、Gemini、MiniMax、NVIDIA、Ollamaなど主要プロバイダーに対応。全プロセスをモジュラー設計し、大規模モデル、ベクトルデータベース、ストレージなどのコンポーネントを柔軟に差し替え可能。ローカルおよびプライベートクラウドデプロイに対応し、データは完全に自己管理可能です。
+Feishu、Notion、Yuqueなどの外部プラットフォームからのナレッジ自動同期(他のデータソースも順次対応中)に対応し、PDF、Word、画像、Excelなど10以上の文書フォーマットをサポート。WeChat Work、Feishu、Slack、TelegramなどのIMチャネルから直接Q&Aサービスを提供できます。モデル層ではOpenAI、DeepSeek、Qwen(Alibaba Cloud)、Zhipu、Hunyuan、Gemini、MiniMax、NVIDIA、Ollamaなど主要プロバイダーに対応。全プロセスをモジュラー設計し、大規模モデル、ベクトルデータベース、ストレージなどのコンポーネントを柔軟に差し替え可能。ローカルおよびプライベートクラウドデプロイに対応し、データは完全に自己管理可能です。さらにWeKnoraは **Langfuse** とシームレスに統合され、Agentの推論、トークン消費、パイプラインに対する包括的な可観測性(オブザーバビリティ)を提供します。
## ✨ 最新アップデート
+**v0.5.0 バージョンのハイライト:**
+
+- **Wiki モード**:Agent 主導の Wiki ナレッジシステムを新たに提供。生のドキュメントから相互リンクされた Markdown ページを自動的に整理・生成し、専用の Wiki ブラウザに加えて、ページ間の参照や関連性を可視化するインタラクティブなナレッジグラフを備え、構造化され継続的に進化するチーム専用ナレッジベースの構築を支援します。
+- **可観測性**:Langfuseを統合し、AgentのReActループ、LLMトークントラッキング、ツール呼び出し、asynqパイプラインを詳細に追跡。Agentの推論とシステムパフォーマンスを包括的に把握できます。
+- **カスタマイズ可能なインデックス戦略**:ユーザーはナレッジベースごとに、ベクトル検索、キーワード検索(ハイブリッド)、Wiki、およびナレッジグラフのインデックス付けを個別に有効化/無効化できるようになりました。
+- **ベクトルデータベースUIとナレッジベースのバインド**:接続テストを含むVector Store管理用の完全なフロントエンドUIが追加され、特定のナレッジベースに専用のベクトルデータベースインスタンスをバインドする機能がサポートされました。
+- **Yuque コネクタ**:APIクライアントを通じたYuqueデータソース統合。フルおよび増分同期をサポートし、Yuqueドキュメントのシームレスな取り込みを実現します。
+- **Agent機能の強化**:不正なJSON出力を自動的に修正および解析する`json_repair`ツールが追加され、`OpenMAIC Classroom`スキルがプリロードされ、DuckDBデータ分析でExcelのすべてのシートを読み込むサポートが強化されました。
+- **フロントエンドとデバッグの最適化**:設定のモデルカードにクイックコピー機能が追加され、すべてのモデルプロバイダーにおいてLLMリクエストのデバッグ(`llm_debug`)およびログ記録メカニズムが包括的に強化されました。
+- **バグ修正**:DuckDBのアクセス問題(ナレッジファイルを一時パスに実体化)の修正、Wiki専用AgentのRerankモデル要件の削除、およびdockerignore内のオフラインprotoc zipパッケージのホワイトリスト化。
+
+<details>
+<summary><b>過去のリリース</b></summary>
+
**v0.4.0 バージョンのハイライト:**
- **[知識アシスタント](https://weknora.weixin.qq.com/platform)**:クラウドホスティング型知識アシスタントサービス、ローカルデプロイ不要で即座に利用可能
@@ -175,6 +189,7 @@ Feishuなどの外部プラットフォームからのナレッジ自動同期
|------|------|
| インテリジェント推論 | ReACT プログレッシブ・マルチステップ推論、ナレッジ検索・MCP ツール・Web 検索を自律的にオーケストレーション、カスタムエージェント対応 |
| クイック Q&A | ナレッジベースベースの RAG Q&A、迅速かつ正確な回答 |
+| Wiki モード | Agent主導で生のドキュメントから構造化された相互リンク済みMarkdown Wikiページを自動生成・保守 |
| ツール呼び出し | 組み込みツール、MCP ツール、Web 検索 |
| 対話戦略 | オンライン Prompt 編集、検索閾値チューニング、マルチターン文脈認識 |
| 推奨質問 | ナレッジベースの内容に基づく質問の自動生成 |
@@ -183,8 +198,8 @@ Feishuなどの外部プラットフォームからのナレッジ自動同期
| 機能 | 詳細 |
|------|------|
-| ナレッジベースタイプ | FAQ / ドキュメント、フォルダーインポート・URL インポート・タグ管理・オンライン入力 |
-| データソースインポート | Feishu / Notion ナレッジベースの自動同期(他のデータソースも開発中)、増分・全量同期対応 |
+| ナレッジベースタイプ | FAQ / ドキュメント / Wiki、フォルダーインポート・URL インポート・タグ管理・オンライン入力 |
+| データソースインポート | Feishu / Notion / Yuque ナレッジベースの自動同期(他のデータソースも開発中)、増分・全量同期対応 |
| 文書フォーマット | PDF / Word / Txt / Markdown / HTML / 画像 / CSV / Excel / PPT / JSON |
| 検索戦略 | BM25 疎検索 / Dense 密検索 / GraphRAG グラフ強化 / 親子チャンキング / 多次元インデックス |
| E2E テスト | 検索+生成の全パイプライン可視化、リコール的中率・BLEU / ROUGE 指標評価 |
@@ -206,6 +221,7 @@ Feishuなどの外部プラットフォームからのナレッジ自動同期
|------|------|
| デプロイ | ローカル / Docker / Kubernetes (Helm)、プライベート化・オフラインデプロイ対応 |
| UI | Web UI / RESTful API / Chrome Extension |
+| 可観測性 | ReActループ、トークン消費、ツール呼び出し、パイプライン追跡のためのLangfuse統合 |
| タスク管理 | MQ 非同期タスク、バージョンアップ時の DB 自動マイグレーション |
| モデル管理 | 集中設定、ナレッジベース単位のモデル選択、マルチテナント組み込みモデル共有、WeKnora Cloud ホスティングモデルとドキュメント解析 |
@@ -275,7 +291,11 @@ docker compose up -d # コアサービスを起動
<tr>
<td colspan="2"><b>Agentモードツール呼び出しプロセス</b><br/><img src="./docs/images/agent-qa.png" alt="Agentモードツール呼び出しプロセス"></td>
</tr>
- <tr>
+ <tr>
+ <td><b>Wikiブラウザ</b><br/><img src="./docs/images/wiki-browser.png" alt="Wikiブラウザ"></td>
+ <td><b>Wikiナレッジグラフ</b><br/><img src="./docs/images/wiki-graph.png" alt="Wikiナレッジグラフ"></td>
+ </tr>
+ <tr>
<td><b>ナレッジベース管理</b><br/><img src="./docs/images/knowledgebases.png" alt="ナレッジベース管理"></td>
<td><b>対話設定</b><br/><img src="./docs/images/settings.png" alt="対話設定"></td>
</tr>
diff --git a/README_KO.md b/README_KO.md
index 32d4571d5..d2c1e1ed8 100644
--- a/README_KO.md
+++ b/README_KO.md
@@ -22,7 +22,7 @@
<img src="https://img.shields.io/badge/License-MIT-ffffff?labelColor=d4eaf7&color=2e6cc4" alt="License">
</a>
<a href="./CHANGELOG.md">
- <img alt="버전" src="https://img.shields.io/badge/version-0.4.0-2e6cc4?labelColor=d4eaf7">
+ <img alt="버전" src="https://img.shields.io/badge/version-0.5.0-2e6cc4?labelColor=d4eaf7">
</a>
</p>
@@ -44,12 +44,26 @@
[**WeKnora**](https://weknora.weixin.qq.com)는 엔터프라이즈급 문서 이해와 시맨틱 검색을 위해 설계된, LLM 기반의 지능형 지식 관리 및 Q&A 프레임워크입니다.
-WeKnora는 **빠른 Q&A**와 **지능형 추론** 두 가지 Q&A 모드를 제공합니다. 빠른 Q&A는 **RAG(Retrieval-Augmented Generation)** 파이프라인으로 관련 조각을 빠르게 검색하여 답변을 생성하며, 일상적인 지식 검색에 적합합니다. 지능형 추론은 **ReACT Agent** 엔진이 **점진적 전략**으로 지식 검색, MCP 도구, 웹 검색을 자율적으로 오케스트레이션하며, 반복 추론과 리플렉션을 통해 단계적으로 결론을 도출합니다. 다중 소스 통합과 복잡한 작업에 적합합니다. 커스텀 에이전트도 지원하여 전용 지식베이스, 도구 세트, 시스템 프롬프트를 유연하게 구성할 수 있습니다. 용도에 맞게 모드를 선택하여 응답 속도와 추론 깊이를 동시에 달성합니다.
+WeKnora는 **빠른 Q&A**와 **지능형 추론** 두 가지 Q&A 모드와 더불어, 자율적인 콘텐츠 구성을 지원하는 **Wiki 모드**를 제공합니다. 빠른 Q&A는 **RAG(Retrieval-Augmented Generation)** 파이프라인으로 관련 조각을 빠르게 검색하여 답변을 생성하며, 일상적인 지식 검색에 적합합니다. 지능형 추론은 **ReACT Agent** 엔진이 **점진적 전략**으로 지식 검색, MCP 도구, 웹 검색을 자율적으로 오케스트레이션하며, 반복 추론과 리플렉션을 통해 단계적으로 결론을 도출합니다. 새로운 **Wiki 모드**를 통해 Agent는 원본 문서에서 구조화되고 상호 연결된 마크다운 Wiki 지식베이스를 자율적으로 생성하고 유지할 수 있습니다. 커스텀 에이전트도 지원하여 전용 지식베이스, 도구 세트, 시스템 프롬프트를 유연하게 구성할 수 있습니다. 용도에 맞게 모드를 선택하여 응답 속도와 추론 깊이를 동시에 달성합니다.
-Feishu 등 외부 플랫폼에서 지식 자동 동기화를 지원하며(추가 데이터 소스 개발 중), PDF, Word, 이미지, Excel 등 10가지 이상의 문서 포맷을 처리합니다. WeChat Work, Feishu, Slack, Telegram 등의 IM 채널을 통해 Q&A 서비스를 직접 제공할 수 있습니다. 모델 레이어에서 OpenAI, DeepSeek, Qwen(Alibaba Cloud), Zhipu, Hunyuan, Gemini, MiniMax, NVIDIA, Ollama 등 주요 프로바이더를 지원합니다. 전체 프로세스가 모듈화 설계되어 LLM, 벡터 DB, 스토리지 등 구성 요소를 유연하게 교체 가능하며, 로컬 및 프라이빗 클라우드 배포를 지원하여 데이터 완전 자체 관리가 가능합니다.
+Feishu, Notion, Yuque 등 외부 플랫폼에서 지식 자동 동기화를 지원하며(추가 데이터 소스 개발 중), PDF, Word, 이미지, Excel 등 10가지 이상의 문서 포맷을 처리합니다. WeChat Work, Feishu, Slack, Telegram 등의 IM 채널을 통해 Q&A 서비스를 직접 제공할 수 있습니다. 모델 레이어에서 OpenAI, DeepSeek, Qwen(Alibaba Cloud), Zhipu, Hunyuan, Gemini, MiniMax, NVIDIA, Ollama 등 주요 프로바이더를 지원합니다. 전체 프로세스가 모듈화 설계되어 LLM, 벡터 DB, 스토리지 등 구성 요소를 유연하게 교체 가능하며, 로컬 및 프라이빗 클라우드 배포를 지원하여 데이터 완전 자체 관리가 가능합니다. 또한 WeKnora는 **Langfuse**와 원활하게 통합되어 Agent 추론, 토큰 사용량 및 파이프라인에 대한 포괄적인 관측 가능성(Observability)을 제공합니다.
## ✨ 최신 업데이트
+**v0.5.0 하이라이트:**
+
+- **Wiki 모드**: Agent 기반의 새로운 Wiki 지식 체계를 도입했습니다. 원본 문서에서 상호 연결된 마크다운 페이지를 자동으로 정리·생성하고, 전용 Wiki 브라우저와 함께 페이지 간 참조 및 연관 관계를 시각화하는 인터랙티브 지식 그래프를 제공하여, 팀 전용으로 구조화되고 지속적으로 진화하는 지식 베이스를 구축할 수 있도록 돕습니다.
+- **관측 가능성(Observability)**: Langfuse를 통합하여 Agent의 ReAct 루프, LLM 토큰 추적, 도구 호출 및 asynq 파이프라인을 심층적으로 추적하여 Agent 추론 및 시스템 성능을 완벽하게 파악할 수 있습니다.
+- **사용자 정의 인덱싱 전략**: 사용자는 이제 지식베이스 수준에서 벡터 검색, 키워드 검색(하이브리드), Wiki 및 지식 그래프(Knowledge Graph) 인덱싱을 독립적으로 설정하고 전환할 수 있습니다.
+- **벡터 데이터베이스 UI 및 지식베이스 바인딩**: 연결 테스트가 포함된 벡터 데이터베이스 관리를 위한 프론트엔드 UI가 추가되었으며, 특정 지식베이스에 고유한 벡터 데이터베이스를 바인딩할 수 있는 기능이 지원됩니다.
+- **Yuque 커넥터**: API 클라이언트를 통한 Yuque 데이터 소스 통합으로 전체 및 증분 동기화를 지원하여 Yuque 문서를 원활하게 가져옵니다.
+- **Agent 기능 강화**: 잘못된 JSON 출력을 자동으로 수정하는 `json_repair` 도구가 추가되었으며, `OpenMAIC Classroom` 스킬이 사전 탑재되고, DuckDB 데이터 분석에서 Excel의 모든 시트를 로드하도록 지원이 강화되었습니다.
+- **프론트엔드 및 디버깅**: 설정의 모델 카드에 복사 작업이 추가되었으며, 모든 모델 프로바이더에 걸쳐 LLM 요청 디버깅(`llm_debug`) 및 로깅 메커니즘이 크게 향상되었습니다.
+- **버그 수정**: DuckDB 액세스 문제 수정(지식 파일을 임시 경로에 구체화), Wiki 전용 Agent의 Rerank 모델 요구 사항 제거, dockerignore에 오프라인 protoc zip 패키지 허용 목록 추가.
+
+<details>
+<summary><b>이전 릴리스</b></summary>
+
**v0.4.0 하이라이트:**
- **[지식 어시스턴트](https://weknora.weixin.qq.com/platform)**: 클라우드 호스팅 지식 어시스턴트 서비스, 로컬 배포 없이 빠르게 시작 가능
@@ -184,6 +198,7 @@ Feishu 등 외부 플랫폼에서 지식 자동 동기화를 지원하며(추가
|------|------|
| 지능형 추론 | ReACT 점진적 멀티스텝 추론, 지식 검색·MCP 도구·웹 검색을 자율 오케스트레이션, 커스텀 에이전트 지원 |
| 빠른 Q&A | 지식베이스 기반 RAG Q&A, 빠르고 정확한 답변 |
+| Wiki 모드 | Agent가 주도하여 원본 문서에서 구조화된 마크다운 Wiki 페이지를 자동 생성 및 유지 관리 |
| 도구 호출 | 내장 도구, MCP 도구, 웹 검색 |
| 대화 전략 | 온라인 프롬프트 편집, 검색 임계값 조정, 멀티턴 문맥 인식 |
| 추천 질문 | 지식베이스 콘텐츠 기반 질문 자동 생성 |
@@ -192,8 +207,8 @@ Feishu 등 외부 플랫폼에서 지식 자동 동기화를 지원하며(추가
| 기능 | 상세 |
|------|------|
-| 지식베이스 타입 | FAQ / 문서, 폴더 임포트·URL 임포트·태그 관리·온라인 입력 |
-| 데이터 소스 임포트 | Feishu / Notion 지식베이스 자동 동기화(추가 데이터 소스 개발 중), 증분·전체 동기화 지원 |
+| 지식베이스 타입 | FAQ / 문서 / Wiki, 폴더 임포트·URL 임포트·태그 관리·온라인 입력 |
+| 데이터 소스 임포트 | Feishu / Notion / Yuque 지식베이스 자동 동기화(추가 데이터 소스 개발 중), 증분·전체 동기화 지원 |
| 문서 포맷 | PDF / Word / Txt / Markdown / HTML / 이미지 / CSV / Excel / PPT / JSON |
| 검색 전략 | BM25 희소 / Dense 밀집 / GraphRAG 그래프 강화 / 부모-자식 청킹 / 다차원 인덱싱 |
| E2E 테스트 | 전체 파이프라인 시각화, 리콜 적중률·BLEU / ROUGE 지표 평가 |
@@ -215,6 +230,7 @@ Feishu 등 외부 플랫폼에서 지식 자동 동기화를 지원하며(추가
|------|------|
| 배포 | 로컬 / Docker / Kubernetes (Helm), 프라이빗/오프라인 배포 지원 |
| UI | Web UI / RESTful API / Chrome Extension |
+| 관측 가능성 | ReAct 루프, 토큰 소비, 도구 호출, 파이프라인 추적을 위한 Langfuse 통합 |
| 작업 관리 | MQ 비동기 작업, 버전 업그레이드 시 자동 DB 마이그레이션 |
| 모델 관리 | 중앙 설정, 지식베이스별 모델 선택, 멀티테넌트 내장 모델 공유, WeKnora Cloud 호스팅 모델 및 문서 파싱 |
@@ -276,7 +292,7 @@ docker compose up -d # 코어 서비스 시작
| 백엔드 API | `http://localhost:8080` |
| Jaeger 트레이싱 | `http://localhost:16686` |
-## 📱 인터페이스 소개
+## 📱 기능 데모
<table>
<tr>
@@ -285,6 +301,10 @@ docker compose up -d # 코어 서비스 시작
<tr>
<td colspan="2"><b>Agent 모드 도구 호출 과정</b><br/><img src="./docs/images/agent-qa.png" alt="Agent 모드 도구 호출 과정"></td>
</tr>
+ <tr>
+ <td><b>Wiki 브라우저</b><br/><img src="./docs/images/wiki-browser.png" alt="Wiki 브라우저"></td>
+ <td><b>Wiki 지식 그래프</b><br/><img src="./docs/images/wiki-graph.png" alt="Wiki 지식 그래프"></td>
+ </tr>
<tr>
<td><b>지식베이스 관리</b><br/><img src="./docs/images/knowledgebases.png" alt="지식베이스 관리"></td>
<td><b>대화 설정</b><br/><img src="./docs/images/settings.png" alt="대화 설정"></td>
diff --git a/VERSION b/VERSION
index 1d0ba9ea1..8f0916f76 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.4.0
+0.5.0
diff --git a/docs/QA.md b/docs/QA.md
index 96279f937..7fb417aa0 100644
--- a/docs/QA.md
+++ b/docs/QA.md
@@ -179,5 +179,29 @@ docker compose restart app
```
+## 9. 如何开启和查看 Langfuse 可观测性追踪?
+
+WeKnora 支持通过 Langfuse 对 Agent 的 ReAct 循环、大模型 Token 消耗、工具调用以及异步任务流水线进行全链路追踪。
+
+**开启步骤**:
+1. 准备一个可用的 Langfuse 实例(支持云端版或私有部署版)。
+2. 在 `.env` 文件中配置以下环境变量:
+```bash
+LANGFUSE_PUBLIC_KEY=pk-lf-...
+LANGFUSE_SECRET_KEY=sk-lf-...
+LANGFUSE_HOST=https://cloud.langfuse.com # 或你的私有部署地址
+```
+3. 重启服务后,系统会自动对所有支持的模型调用和 Agent 运行轨迹进行追踪,你可以在 Langfuse 的 Traces 面板中直观地看到每次对话和后台任务的详细执行瀑布图与 Token 统计。
+
+## 10. 什么是 Wiki 模式?如何使用?
+
+Wiki 模式允许 Agent 根据原始文档自动生成并维护一套结构化、相互链接的 Markdown Wiki 知识库,从而实现复杂知识的体系化沉淀和图谱化。
+
+**使用方法**:
+1. 进入指定**知识库的设置** -> **索引策略 (Indexing Strategy)**。
+2. 开启 **Wiki** 索引功能(可同时结合开启**知识图谱**)。
+3. 当你向该知识库上传文档时,系统会自动触发异步任务,通过大模型提取文档中的实体与核心概念,并自动生成结构化的 Wiki 页面及页面间的知识图谱链接。
+4. 你可以在该知识库的“Wiki”标签页中,使用专用的 Wiki 浏览器查阅、管理页面,并通过可视化的知识图谱查看不同内容之间的关联关系。
+
## P.S.
如果以上方式未解决问题,请在issue中描述您的问题,并提供必要的日志信息辅助我们进行问题排查
diff --git a/docs/docs.go b/docs/docs.go
index 8e7bae98c..a050168f9 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -51,7 +51,7 @@ const docTemplate = `{
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -83,7 +83,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateAgentRequest"
+ "$ref": "#/definitions/internal_handler.CreateAgentRequest"
}
}
],
@@ -98,7 +98,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -136,6 +136,38 @@ const docTemplate = `{
}
}
},
+ "/agents/type-presets": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有 smart-reasoning 下可用的智能体类型预设(RAG/Wiki/Hybrid/Custom),用于编辑器自动填充系统提示词、工具和 KB 兼容性",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "智能体"
+ ],
+ "summary": "获取智能体类型预设列表",
+ "responses": {
+ "200": {
+ "description": "预设列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/agents/{id}": {
"get": {
"security": [
@@ -177,13 +209,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -222,7 +254,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.UpdateAgentRequest"
+ "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
}
}
],
@@ -237,13 +269,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"403": {
"description": "无法修改内置智能体",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -288,19 +320,19 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"403": {
"description": "无法删除内置智能体",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -347,13 +379,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -418,13 +450,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -455,7 +487,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
},
@@ -489,7 +521,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
],
@@ -497,7 +529,7 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"400": {
@@ -535,7 +567,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
},
"404": {
@@ -566,7 +598,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/datasource.ConnectorMetadata"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata"
}
}
}
@@ -642,7 +674,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"404": {
@@ -682,7 +714,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
],
@@ -690,7 +722,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"400": {
@@ -772,7 +804,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
}
},
@@ -851,7 +883,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.Resource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Resource"
}
}
},
@@ -925,7 +957,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
},
"400": {
@@ -978,172 +1010,166 @@ const docTemplate = `{
}
}
},
- "/auth/auto-setup": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/auto-fix": {
"post": {
- "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Automatically fix fixable wiki issues (broken links, etc.)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Auto-fix wiki issues",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "自动初始化(Lite 桌面版)",
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.LoginResponse"
- }
- },
- "403": {
- "description": "非 Lite 版本",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/auth/change-password": {
- "post": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/graph": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "修改当前用户的登录密码",
- "consumes": [
- "application/json"
- ],
+ "description": "Returns the wiki link graph data for visualization",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "修改密码",
+ "summary": "Get wiki link graph",
"parameters": [
{
- "description": "密码修改请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "new_password": {
- "type": "string"
- },
- "old_password": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "修改成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphData"
}
}
}
}
},
- "/auth/login": {
- "post": {
- "description": "用户登录并获取访问令牌",
- "consumes": [
- "application/json"
+ "/api/v1/knowledgebase/{kb_id}/wiki/index": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Returns the wiki index page (creates default if not exists)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "用户登录",
+ "summary": "Get wiki index page",
"parameters": [
{
- "description": "登录请求参数",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.LoginRequest"
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.LoginResponse"
- }
- },
- "401": {
- "description": "认证失败",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
}
}
},
- "/auth/logout": {
- "post": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/issues": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "撤销当前访问令牌并登出",
- "consumes": [
- "application/json"
- ],
+ "description": "List issues flagged on wiki pages with optional filtering",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "List wiki page issues",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Filter by page slug",
+ "name": "slug",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Filter by status (pending, ignored, resolved)",
+ "name": "status",
+ "in": "query"
+ }
],
- "summary": "用户登出",
"responses": {
"200": {
- "description": "登出成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue"
+ }
}
}
}
}
},
- "/auth/me": {
- "get": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/issues/{issue_id}/status": {
+ "put": {
"security": [
{
"Bearer": []
}
],
- "description": "获取当前登录用户的详细信息",
+ "description": "Update the status of a flagged wiki page issue",
"consumes": [
"application/json"
],
@@ -1151,108 +1177,108 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Update wiki page issue status",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Issue ID",
+ "name": "issue_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "New status {'status': 'ignored'}",
+ "name": "status",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
],
- "summary": "获取当前用户信息",
"responses": {
"200": {
- "description": "用户信息",
+ "description": "OK",
"schema": {
"type": "object",
- "additionalProperties": true
+ "additionalProperties": {
+ "type": "string"
+ }
}
},
- "401": {
- "description": "未授权",
+ "400": {
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/auth/oidc/callback": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/lint": {
"get": {
- "description": "接收OIDC provider回调并由后端完成code交换,随后重定向回前端登录页",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Perform a comprehensive health check on the wiki",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "OIDC登录重定向回调",
+ "summary": "Run wiki lint",
"parameters": [
{
"type": "string",
- "description": "OIDC授权码",
- "name": "code",
- "in": "query"
- },
- {
- "type": "string",
- "description": "OIDC状态",
- "name": "state",
- "in": "query"
- },
- {
- "type": "string",
- "description": "OIDC错误码",
- "name": "error",
- "in": "query"
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "302": {
- "description": "Found"
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport"
+ }
}
}
}
},
- "/auth/oidc/config": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/log": {
"get": {
- "description": "返回OIDC是否启用以及provider展示名称,供前端决定是否展示OIDC登录入口",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Returns the wiki operation log page (creates default if not exists)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "获取OIDC登录配置",
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/types.OIDCConfigResponse"
- }
- }
- }
- }
- },
- "/auth/oidc/url": {
- "get": {
- "description": "根据后端OIDC配置生成第三方登录跳转地址",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "认证"
- ],
- "summary": "获取OIDC授权地址",
+ "summary": "Get wiki operation log",
"parameters": [
{
"type": "string",
- "description": "OIDC回调地址",
- "name": "redirect_uri",
- "in": "query",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
"required": true
}
],
@@ -1260,73 +1286,100 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.OIDCAuthURLResponse"
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "OIDC未启用",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
}
}
},
- "/auth/refresh": {
- "post": {
- "description": "使用刷新令牌获取新的访问令牌",
- "consumes": [
- "application/json"
+ "/api/v1/knowledgebase/{kb_id}/wiki/pages": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "List wiki pages with optional filtering and pagination",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "刷新令牌",
+ "summary": "List wiki pages",
"parameters": [
{
- "description": "刷新令牌",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "refreshToken": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Filter by page type",
+ "name": "page_type",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Filter by status",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Full-text search",
+ "name": "query",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page number",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page size",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Sort field",
+ "name": "sort_by",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Sort order (asc/desc)",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "新令牌",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageListResponse"
}
},
- "401": {
- "description": "令牌无效",
+ "400": {
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/register": {
+ },
"post": {
- "description": "注册新用户账号",
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "Create a new wiki page in the knowledge base",
"consumes": [
"application/json"
],
@@ -1334,17 +1387,24 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "用户注册",
+ "summary": "Create a wiki page",
"parameters": [
{
- "description": "注册请求参数",
- "name": "request",
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Wiki page data",
+ "name": "page",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.RegisterRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
],
@@ -1352,70 +1412,71 @@ const docTemplate = `{
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/types.RegisterResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
"400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "注册功能已禁用",
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/auth/validate": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/pages/{slug}": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "验证访问令牌是否有效",
- "consumes": [
- "application/json"
- ],
+ "description": "Retrieve a wiki page by its slug",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Get a wiki page by slug",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "验证令牌",
"responses": {
"200": {
- "description": "令牌有效",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
- "401": {
- "description": "令牌无效",
+ "404": {
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/chunks/by-id/{id}": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
+ "description": "Update an existing wiki page by slug",
"consumes": [
"application/json"
],
@@ -1423,292 +1484,210 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "通过ID获取分块",
+ "summary": "Update a wiki page",
"parameters": [
{
"type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
"in": "path",
"required": true
+ },
+ {
+ "description": "Updated wiki page data",
+ "name": "page",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
}
],
"responses": {
"200": {
- "description": "分块详情",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
"404": {
- "description": "分块不存在",
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/chunks/by-id/{id}/questions": {
+ },
"delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除分块中生成的问题",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "Soft-delete a wiki page by slug",
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "删除生成的问题",
+ "summary": "Delete a wiki page",
"parameters": [
{
"type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
},
{
- "description": "问题ID",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "question_id": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "204": {
+ "description": "No Content"
},
"404": {
- "description": "分块不存在",
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/chunks/{knowledge_id}": {
- "get": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/rebuild-links": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "Re-parse all pages and rebuild bidirectional link references",
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "获取知识分块列表",
+ "summary": "Rebuild wiki links",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
- },
- {
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 10,
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
}
],
"responses": {
"200": {
- "description": "分块列表",
+ "description": "OK",
"schema": {
"type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "additionalProperties": {
+ "type": "string"
+ }
}
}
}
- },
- "delete": {
+ }
+ },
+ "/api/v1/knowledgebase/{kb_id}/wiki/search": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定知识下的所有分块",
- "consumes": [
- "application/json"
- ],
+ "description": "Full-text search over wiki pages",
"produces": [
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "删除知识下所有分块",
+ "summary": "Search wiki pages",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Search query",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "Max results (default 10)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
}
}
}
}
},
- "/chunks/{knowledge_id}/{id}": {
- "put": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/stats": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新指定分块的内容和属性",
- "consumes": [
- "application/json"
- ],
+ "description": "Returns aggregate statistics about the wiki",
"produces": [
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "更新分块",
+ "summary": "Get wiki statistics",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
- },
- {
- "description": "更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateChunkRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的分块",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "分块不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
}
}
}
- },
- "delete": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除指定的分块",
+ }
+ },
+ "/auth/auto-setup": {
+ "post": {
+ "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
"consumes": [
"application/json"
],
@@ -1716,59 +1695,33 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "分块管理"
- ],
- "summary": "删除分块",
- "parameters": [
- {
- "type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "自动初始化(Lite 桌面版)",
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
}
},
- "404": {
- "description": "分块不存在",
+ "403": {
+ "description": "非 Lite 版本",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/evaluation/": {
- "get": {
+ "/auth/change-password": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据任务ID获取评估结果",
+ "description": "修改当前用户的登录密码",
"consumes": [
"application/json"
],
@@ -1776,21 +1729,31 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "评估"
+ "认证"
],
- "summary": "获取评估结果",
+ "summary": "修改密码",
"parameters": [
{
- "type": "string",
- "description": "评估任务ID",
- "name": "task_id",
- "in": "query",
- "required": true
+ "description": "密码修改请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "new_password": {
+ "type": "string"
+ },
+ "old_password": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "评估结果",
+ "description": "修改成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1799,21 +1762,15 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/auth/login": {
"post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "对知识库进行评估测试",
+ "description": "用户登录并获取访问令牌",
"consumes": [
"application/json"
],
@@ -1821,48 +1778,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "评估"
+ "认证"
],
- "summary": "执行评估",
+ "summary": "用户登录",
"parameters": [
{
- "description": "评估请求参数",
+ "description": "登录请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.EvaluationRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
}
}
],
"responses": {
"200": {
- "description": "评估任务",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "认证失败",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/faq/import/progress/{task_id}": {
- "get": {
+ "/auth/logout": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取FAQ导入任务的进度",
+ "description": "撤销当前访问令牌并登出",
"consumes": [
"application/json"
],
@@ -1870,46 +1823,34 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "获取FAQ导入进度",
- "parameters": [
- {
- "type": "string",
- "description": "任务ID",
- "name": "task_id",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "用户登出",
"responses": {
"200": {
- "description": "导入进度",
+ "description": "登出成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/auth/me": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "获取当前登录用户的详细信息",
"consumes": [
"application/json"
],
@@ -1917,40 +1858,29 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
- ],
- "summary": "提取文本关系",
- "parameters": [
- {
- "description": "提取请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.TextRelationExtractionRequest"
- }
- }
+ "认证"
],
+ "summary": "获取当前用户信息",
"responses": {
"200": {
- "description": "提取结果",
+ "description": "用户信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "未授权",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/fabri/tag": {
+ "/auth/oidc/callback": {
"get": {
- "description": "随机生成一组标签",
+ "description": "接收OIDC provider回调并由后端完成code交换,随后重定向回前端登录页",
"consumes": [
"application/json"
],
@@ -1958,31 +1888,106 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "生成随机标签",
+ "summary": "OIDC登录重定向回调",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "OIDC授权码",
+ "name": "code",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "OIDC状态",
+ "name": "state",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "OIDC错误码",
+ "name": "error",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "302": {
+ "description": "Found"
+ }
+ }
+ }
+ },
+ "/auth/oidc/config": {
+ "get": {
+ "description": "返回OIDC是否启用以及provider展示名称,供前端决定是否展示OIDC登录入口",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取OIDC登录配置",
"responses": {
"200": {
- "description": "生成的标签",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse"
}
}
}
}
},
- "/initialization/fabri/text": {
- "post": {
- "security": [
- {
- "Bearer": []
- },
+ "/auth/oidc/url": {
+ "get": {
+ "description": "根据后端OIDC配置生成第三方登录跳转地址",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取OIDC授权地址",
+ "parameters": [
{
- "ApiKeyAuth": []
+ "type": "string",
+ "description": "OIDC回调地址",
+ "name": "redirect_uri",
+ "in": "query",
+ "required": true
}
],
- "description": "根据标签生成示例文本",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "OIDC未启用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/refresh": {
+ "post": {
+ "description": "使用刷新令牌获取新的访问令牌",
"consumes": [
"application/json"
],
@@ -1990,48 +1995,45 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "生成示例文本",
+ "summary": "刷新令牌",
"parameters": [
{
- "description": "生成请求",
+ "description": "刷新令牌",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.FabriTextRequest"
+ "type": "object",
+ "properties": {
+ "refreshToken": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "新令牌",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "令牌无效",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/kb/{kbId}": {
+ "/auth/register": {
"post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "注册新用户账号",
"consumes": [
"application/json"
],
@@ -2039,55 +2041,50 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "初始化知识库配置",
+ "summary": "用户注册",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "kbId",
- "in": "path",
- "required": true
- },
- {
- "description": "初始化请求",
+ "description": "注册请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
}
}
],
"responses": {
- "200": {
- "description": "初始化成功",
+ "201": {
+ "description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "注册功能已禁用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/kb/{kbId}/config": {
+ "/auth/validate": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据知识库ID获取当前配置信息",
+ "description": "验证访问令牌是否有效",
"consumes": [
"application/json"
],
@@ -2095,35 +2092,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
- ],
- "summary": "获取知识库配置",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "kbId",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "验证令牌",
"responses": {
"200": {
- "description": "配置信息",
+ "description": "令牌有效",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "401": {
+ "description": "令牌无效",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/chunks/by-id/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2132,7 +2122,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID更新模型和分块配置",
+ "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
"consumes": [
"application/json"
],
@@ -2140,30 +2130,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "更新知识库配置",
+ "summary": "通过ID获取分块",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "kbId",
+ "description": "分块ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "description": "配置请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.KBModelConfigRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "分块详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2172,20 +2153,20 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
- "description": "知识库不存在",
+ "description": "分块不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/asr/check": {
- "post": {
+ "/chunks/by-id/{id}/questions": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -2194,7 +2175,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "description": "删除分块中生成的问题",
"consumes": [
"application/json"
],
@@ -2202,23 +2183,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查ASR模型",
+ "summary": "删除生成的问题",
"parameters": [
{
- "description": "ASR检查请求",
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问题ID",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2227,14 +2220,20 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/embedding/test": {
- "post": {
+ "/chunks/{knowledge_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2243,7 +2242,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "获取指定知识下的所有分块列表,支持分页",
"consumes": [
"application/json"
],
@@ -2251,23 +2250,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "测试Embedding模型",
+ "summary": "获取知识分块列表",
"parameters": [
{
- "description": "Embedding测试请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "分块列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2276,14 +2287,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/models/remote/check": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2292,7 +2301,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "删除指定知识下的所有分块",
"consumes": [
"application/json"
],
@@ -2300,23 +2309,21 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查远程模型",
+ "summary": "删除知识下所有分块",
"parameters": [
{
- "description": "模型检查请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.RemoteModelCheckRequest"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2325,14 +2332,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/rerank/check": {
- "post": {
+ "/chunks/{knowledge_id}/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2341,7 +2348,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "更新指定分块的内容和属性",
"consumes": [
"application/json"
],
@@ -2349,23 +2356,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查Rerank模型",
+ "summary": "更新分块",
"parameters": [
{
- "description": "Rerank检查请求",
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "更新后的分块",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2374,14 +2395,18 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/multimodal/test": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2390,62 +2415,36 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "上传图片测试多模态处理功能",
+ "description": "删除指定的分块",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "测试多模态功能",
+ "summary": "删除分块",
"parameters": [
- {
- "type": "file",
- "description": "测试图片",
- "name": "image",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "VLM模型名称",
- "name": "vlm_model",
- "in": "formData",
- "required": true
- },
{
"type": "string",
- "description": "VLM Base URL",
- "name": "vlm_base_url",
- "in": "formData",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
"required": true
},
{
"type": "string",
- "description": "VLM API Key",
- "name": "vlm_api_key",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "VLM接口类型",
- "name": "vlm_interface_type",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "存储类型(cos/minio)",
- "name": "storage_type",
- "in": "formData",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2454,13 +2453,19 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/download/tasks": {
+ "/evaluation/": {
"get": {
"security": [
{
@@ -2470,7 +2475,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "根据任务ID获取评估结果",
"consumes": [
"application/json"
],
@@ -2478,22 +2483,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "评估"
+ ],
+ "summary": "获取评估结果",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "评估任务ID",
+ "name": "task_id",
+ "in": "query",
+ "required": true
+ }
],
- "summary": "列出下载任务",
"responses": {
"200": {
- "description": "任务列表",
+ "description": "评估结果",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/initialization/ollama/download/{taskId}": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -2502,7 +2520,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "对知识库进行评估测试",
"consumes": [
"application/json"
],
@@ -2510,36 +2528,38 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "评估"
],
- "summary": "获取下载进度",
+ "summary": "执行评估",
"parameters": [
{
- "type": "string",
- "description": "任务ID",
- "name": "taskId",
- "in": "path",
- "required": true
+ "description": "评估请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ }
}
],
"responses": {
"200": {
- "description": "下载进度",
+ "description": "评估任务",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models": {
+ "/faq/import/progress/{task_id}": {
"get": {
"security": [
{
@@ -2549,7 +2569,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "列出已安装的Ollama模型",
+ "description": "获取FAQ导入任务的进度",
"consumes": [
"application/json"
],
@@ -2557,27 +2577,36 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ导入进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "导入进度",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models/check": {
+ "/initialization/extract/relations": {
"post": {
"security": [
{
@@ -2587,7 +2616,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "检查指定的Ollama模型是否已安装",
+ "description": "从文本中提取实体和关系",
"consumes": [
"application/json"
],
@@ -2597,29 +2626,21 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "检查Ollama模型状态",
+ "summary": "提取文本关系",
"parameters": [
{
- "description": "模型名称列表",
+ "description": "提取请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "models": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
}
}
],
"responses": {
"200": {
- "description": "模型状态",
+ "description": "提取结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2628,13 +2649,37 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models/download": {
+ "/initialization/fabri/tag": {
+ "get": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/text": {
"post": {
"security": [
{
@@ -2644,7 +2689,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "异步下载指定的Ollama模型",
+ "description": "根据标签生成示例文本",
"consumes": [
"application/json"
],
@@ -2654,26 +2699,21 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "下载Ollama模型",
+ "summary": "生成示例文本",
"parameters": [
{
- "description": "模型名称",
+ "description": "生成请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "modelName": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
}
}
],
"responses": {
"200": {
- "description": "下载任务信息",
+ "description": "生成的文本",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2682,15 +2722,23 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/status": {
- "get": {
- "description": "检查Ollama服务是否可用",
+ "/initialization/kb/{kbId}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID执行完整配置更新",
"consumes": [
"application/json"
],
@@ -2700,19 +2748,43 @@ const docTemplate = `{
"tags": [
"初始化"
],
- "summary": "检查Ollama服务状态",
+ "summary": "初始化知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
"responses": {
"200": {
- "description": "Ollama状态",
+ "description": "初始化成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/knowledge-bases": {
+ "/initialization/kb/{kbId}/config": {
"get": {
"security": [
{
@@ -2722,7 +2794,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "description": "根据知识库ID获取当前配置信息",
"consumes": [
"application/json"
],
@@ -2730,34 +2802,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库列表",
+ "summary": "获取知识库配置",
"parameters": [
{
"type": "string",
- "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
- "name": "agent_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "知识库列表",
+ "description": "配置信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "404": {
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "post": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2766,7 +2839,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "创建新的知识库",
+ "description": "根据知识库ID更新模型和分块配置",
"consumes": [
"application/json"
],
@@ -2774,23 +2847,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "创建知识库",
+ "summary": "更新知识库配置",
"parameters": [
{
- "description": "知识库信息",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "配置请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.KnowledgeBase"
+ "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的知识库",
+ "200": {
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2799,13 +2879,19 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/copy": {
+ "/initialization/models/asr/check": {
"post": {
"security": [
{
@@ -2815,7 +2901,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
"consumes": [
"application/json"
],
@@ -2823,23 +2909,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "复制知识库",
+ "summary": "检查ASR模型",
"parameters": [
{
- "description": "复制请求",
+ "description": "ASR检查请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CopyKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2848,14 +2934,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/copy/progress/{task_id}": {
- "get": {
+ "/initialization/models/embedding/test": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2864,7 +2950,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库复制任务的进度",
+ "description": "测试Embedding接口是否可用并返回向量维度",
"consumes": [
"application/json"
],
@@ -2872,37 +2958,39 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库复制进度",
+ "summary": "测试Embedding模型",
"parameters": [
{
- "type": "string",
- "description": "任务ID",
- "name": "task_id",
- "in": "path",
- "required": true
+ "description": "Embedding测试请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "进度信息",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}": {
- "get": {
+ "/initialization/models/remote/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2911,7 +2999,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
+ "description": "检查远程API模型连接是否正常",
"consumes": [
"application/json"
],
@@ -2919,27 +3007,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库详情",
+ "summary": "检查远程模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
- "name": "agent_id",
- "in": "query"
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识库详情",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2948,18 +3032,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识库不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/initialization/models/rerank/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2968,7 +3048,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新知识库的名称、描述和配置",
+ "description": "检查Rerank模型连接和功能是否正常",
"consumes": [
"application/json"
],
@@ -2976,30 +3056,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "更新知识库",
+ "summary": "检查Rerank模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "更新请求",
+ "description": "Rerank检查请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.UpdateKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3008,12 +3081,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/initialization/multimodal/test": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3022,29 +3097,62 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除指定的知识库及其所有内容",
+ "description": "上传图片测试多模态处理功能",
"consumes": [
- "application/json"
+ "multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "删除知识库",
+ "summary": "测试多模态功能",
"parameters": [
+ {
+ "type": "file",
+ "description": "测试图片",
+ "name": "image",
+ "in": "formData",
+ "required": true
+ },
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
+ "description": "VLM模型名称",
+ "name": "vlm_model",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM Base URL",
+ "name": "vlm_base_url",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM API Key",
+ "name": "vlm_api_key",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "VLM接口类型",
+ "name": "vlm_interface_type",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "存储类型(cos/minio)",
+ "name": "storage_type",
+ "in": "formData",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3053,13 +3161,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries": {
+ "/initialization/ollama/download/tasks": {
"get": {
"security": [
{
@@ -3069,7 +3177,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "description": "列出所有Ollama模型下载任务",
"consumes": [
"application/json"
],
@@ -3077,71 +3185,22 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "获取FAQ条目列表",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "标签ID筛选(seq_id)",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
- "name": "search_field",
- "in": "query"
- },
- {
- "type": "string",
- "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
- "name": "sort_order",
- "in": "query"
- }
+ "初始化"
],
+ "summary": "列出下载任务",
"responses": {
"200": {
- "description": "FAQ列表",
+ "description": "任务列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
- },
- "post": {
+ }
+ },
+ "/initialization/ollama/download/{taskId}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3150,7 +3209,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
+ "description": "获取Ollama模型下载任务的进度",
"consumes": [
"application/json"
],
@@ -3158,44 +3217,75 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "批量更新/插入FAQ条目",
+ "summary": "获取下载进度",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "任务ID",
+ "name": "taskId",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
},
- {
- "description": "批量操作请求",
- "name": "request",
- "in": "body",
- "required": true,
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/types.FAQBatchUpsertPayload"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
+ }
+ }
+ },
+ "/initialization/ollama/models": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出已安装的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
],
+ "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "任务ID",
+ "description": "模型列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/initialization/ollama/models/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3204,7 +3294,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量删除指定的FAQ条目",
+ "description": "检查指定的Ollama模型是否已安装",
"consumes": [
"application/json"
],
@@ -3212,29 +3302,22 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "批量删除FAQ条目",
+ "summary": "检查Ollama模型状态",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "要删除的FAQ ID列表(seq_id)",
+ "description": "模型名称列表",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "ids": {
+ "models": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
@@ -3243,7 +3326,7 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "模型状态",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3252,14 +3335,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/export": {
- "get": {
+ "/initialization/ollama/models/download": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3268,44 +3351,76 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "将所有FAQ条目导出为CSV文件",
+ "description": "异步下载指定的Ollama模型",
"consumes": [
"application/json"
],
"produces": [
- "text/csv"
+ "application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "导出FAQ条目",
+ "summary": "下载Ollama模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- }
- ],
+ "description": "模型名称",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
"responses": {
"200": {
- "description": "CSV文件",
+ "description": "下载任务信息",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/fields": {
- "put": {
+ "/initialization/ollama/status": {
+ "get": {
+ "description": "检查Ollama服务是否可用",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama服务状态",
+ "responses": {
+ "200": {
+ "description": "Ollama状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3314,7 +3429,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
"consumes": [
"application/json"
],
@@ -3322,46 +3437,34 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "批量更新FAQ字段",
+ "summary": "获取知识库列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "字段更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQEntryFieldsBatchUpdate"
- }
+ "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "知识库列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/tags": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -3370,7 +3473,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的标签",
+ "description": "创建新的知识库",
"consumes": [
"application/json"
],
@@ -3378,30 +3481,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "批量更新FAQ标签",
+ "summary": "创建知识库",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "标签更新请求",
+ "description": "知识库信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
}
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "创建的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3410,14 +3506,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}": {
- "get": {
+ "/knowledge-bases/copy": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3426,7 +3522,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取单个FAQ条目的详情",
+ "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
"consumes": [
"application/json"
],
@@ -3434,28 +3530,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "获取FAQ条目详情",
+ "summary": "复制知识库",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
- "in": "path",
- "required": true
+ "description": "复制请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ }
}
],
"responses": {
"200": {
- "description": "FAQ条目详情",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3464,18 +3555,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "条目不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/knowledge-bases/copy/progress/{task_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3484,7 +3571,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新指定的FAQ条目",
+ "description": "获取知识库复制任务的进度",
"consumes": [
"application/json"
],
@@ -3492,53 +3579,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "更新FAQ条目",
+ "summary": "获取知识库复制进度",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
+ "description": "任务ID",
+ "name": "task_id",
"in": "path",
"required": true
- },
- {
- "description": "FAQ条目",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQEntryPayload"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "进度信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
- "post": {
+ "/knowledge-bases/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3547,7 +3618,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "向指定的FAQ条目添加相似问题",
+ "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
"consumes": [
"application/json"
],
@@ -3555,9 +3626,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "添加相似问",
+ "summary": "获取知识库详情",
"parameters": [
{
"type": "string",
@@ -3567,25 +3638,15 @@ const docTemplate = `{
"required": true
},
{
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
- "in": "path",
- "required": true
- },
- {
- "description": "相似问列表",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.addSimilarQuestionsRequest"
- }
+ "type": "string",
+ "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "更新后的FAQ条目",
+ "description": "知识库详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3594,20 +3655,18 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
- "description": "条目不存在",
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entry": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -3616,7 +3675,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "同步创建单个FAQ条目",
+ "description": "更新知识库的名称、描述和配置",
"consumes": [
"application/json"
],
@@ -3624,9 +3683,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "创建单个FAQ条目",
+ "summary": "更新知识库",
"parameters": [
{
"type": "string",
@@ -3636,18 +3695,18 @@ const docTemplate = `{
"required": true
},
{
- "description": "FAQ条目",
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.FAQEntryPayload"
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
}
}
],
"responses": {
"200": {
- "description": "创建的FAQ条目",
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3656,14 +3715,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/import/last-result/display": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3672,7 +3729,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
+ "description": "删除指定的知识库及其所有内容",
"consumes": [
"application/json"
],
@@ -3680,9 +3737,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "更新FAQ最后一次导入结果显示状态",
+ "summary": "删除知识库",
"parameters": [
{
"type": "string",
@@ -3690,20 +3747,11 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "状态更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3712,20 +3760,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识库不存在或无导入记录",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/search": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3734,7 +3776,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
+ "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -3744,7 +3786,7 @@ const docTemplate = `{
"tags": [
"FAQ管理"
],
- "summary": "搜索FAQ",
+ "summary": "获取FAQ条目列表",
"parameters": [
{
"type": "string",
@@ -3754,18 +3796,45 @@ const docTemplate = `{
"required": true
},
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQSearchRequest"
- }
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "标签ID筛选(seq_id)",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
+ "name": "search_field",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "FAQ列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3774,14 +3843,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/hybrid-search": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -3790,7 +3857,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "在知识库中执行向量和关键词混合搜索",
+ "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
"consumes": [
"application/json"
],
@@ -3798,9 +3865,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "FAQ管理"
],
- "summary": "混合搜索",
+ "summary": "批量更新/插入FAQ条目",
"parameters": [
{
"type": "string",
@@ -3810,18 +3877,18 @@ const docTemplate = `{
"required": true
},
{
- "description": "搜索参数",
+ "description": "批量操作请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.SearchParams"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
}
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3830,14 +3897,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/knowledge": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3846,7 +3911,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "批量删除指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -3854,9 +3919,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "获取知识列表",
+ "summary": "批量删除FAQ条目",
"parameters": [
{
"type": "string",
@@ -3866,39 +3931,26 @@ const docTemplate = `{
"required": true
},
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "文件类型筛选",
- "name": "file_type",
- "in": "query"
+ "description": "要删除的FAQ ID列表(seq_id)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3907,12 +3959,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries/export": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3921,17 +3975,17 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除知识库下的所有知识条目(异步任务)。知识库本身保留,仅清空其中的内容",
+ "description": "将所有FAQ条目导出为CSV文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/csv"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "清空知识库内容",
+ "summary": "导出FAQ条目",
"parameters": [
{
"type": "string",
@@ -3943,29 +3997,22 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "清空任务已提交",
+ "description": "CSV文件",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/file": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/fields": {
+ "put": {
"security": [
{
"Bearer": []
@@ -3974,17 +4021,17 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "上传文件并创建知识条目",
+ "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "从文件创建知识",
+ "summary": "批量更新FAQ字段",
"parameters": [
{
"type": "string",
@@ -3994,34 +4041,18 @@ const docTemplate = `{
"required": true
},
{
- "type": "file",
- "description": "上传的文件",
- "name": "file",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "自定义文件名",
- "name": "fileName",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "元数据JSON",
- "name": "metadata",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "启用多模态处理",
- "name": "enable_multimodel",
- "in": "formData"
+ "description": "字段更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
+ }
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4030,21 +4061,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "409": {
- "description": "文件重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/manual": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -4053,7 +4077,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "手工录入Markdown格式的知识内容",
+ "description": "批量更新FAQ条目的标签",
"consumes": [
"application/json"
],
@@ -4061,9 +4085,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "手工创建知识",
+ "summary": "批量更新FAQ标签",
"parameters": [
{
"type": "string",
@@ -4073,18 +4097,18 @@ const docTemplate = `{
"required": true
},
{
- "description": "手工知识内容",
+ "description": "标签更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ManualKnowledgePayload"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4093,14 +4117,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/url": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -4109,7 +4133,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
+ "description": "根据ID获取单个FAQ条目的详情",
"consumes": [
"application/json"
],
@@ -4117,9 +4141,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "从URL创建知识",
+ "summary": "获取FAQ条目详情",
"parameters": [
{
"type": "string",
@@ -4129,38 +4153,16 @@ const docTemplate = `{
"required": true
},
{
- "description": "URL请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "enable_multimodel": {
- "type": "boolean"
- },
- "file_name": {
- "type": "string"
- },
- "file_type": {
- "type": "string"
- },
- "tag_id": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- }
- }
- }
- ],
- "responses": {
- "201": {
- "description": "创建的知识",
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "FAQ条目详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4169,20 +4171,17 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
- "409": {
- "description": "URL重复",
+ "404": {
+ "description": "条目不存在",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/pin": {
+ },
"put": {
"security": [
{
@@ -4192,7 +4191,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "切换知识库的置顶状态",
+ "description": "更新指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -4200,9 +4199,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库"
+ "FAQ管理"
],
- "summary": "置顶/取消置顶知识库",
+ "summary": "更新FAQ条目",
"parameters": [
{
"type": "string",
@@ -4210,40 +4209,62 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "FAQ条目",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/shares": {
- "get": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取知识库的所有共享记录",
+ "description": "向指定的FAQ条目添加相似问题",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "获取知识库的共享列表",
+ "summary": "添加相似问",
"parameters": [
{
"type": "string",
@@ -4251,24 +4272,58 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "相似问列表",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
+ }
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新后的FAQ条目",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "条目不存在",
"schema": {
- "$ref": "#/definitions/types.ListSharesResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge-bases/{id}/faq/entry": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "将知识库共享到指定组织",
+ "description": "同步创建单个FAQ条目",
"consumes": [
"application/json"
],
@@ -4276,9 +4331,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "共享知识库到组织",
+ "summary": "创建单个FAQ条目",
"parameters": [
{
"type": "string",
@@ -4288,25 +4343,25 @@ const docTemplate = `{
"required": true
},
{
- "description": "共享信息",
+ "description": "FAQ条目",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ShareKnowledgeBaseRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "创建的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4314,14 +4369,17 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/shares/{share_id}": {
+ "/knowledge-bases/{id}/faq/import/last-result/display": {
"put": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "更新知识库共享的权限级别",
+ "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
"consumes": [
"application/json"
],
@@ -4329,9 +4387,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "更新共享权限",
+ "summary": "更新FAQ最后一次导入结果显示状态",
"parameters": [
{
"type": "string",
@@ -4341,49 +4399,59 @@ const docTemplate = `{
"required": true
},
{
- "type": "string",
- "description": "共享记录ID",
- "name": "share_id",
- "in": "path",
- "required": true
- },
- {
- "description": "权限信息",
+ "description": "状态更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateSharePermissionRequest"
+ "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在或无导入记录",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/search": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "取消知识库的共享",
+ "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "取消共享",
+ "summary": "搜索FAQ",
"parameters": [
{
"type": "string",
@@ -4393,23 +4461,25 @@ const docTemplate = `{
"required": true
},
{
- "type": "string",
- "description": "共享记录ID",
- "name": "share_id",
- "in": "path",
- "required": true
+ "description": "搜索请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
+ }
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4417,7 +4487,7 @@ const docTemplate = `{
}
}
},
- "/knowledge-bases/{id}/tags": {
+ "/knowledge-bases/{id}/hybrid-search": {
"get": {
"security": [
{
@@ -4427,7 +4497,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的所有标签及统计信息",
+ "description": "在知识库中执行向量和关键词混合搜索",
"consumes": [
"application/json"
],
@@ -4435,9 +4505,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "知识库"
],
- "summary": "获取标签列表",
+ "summary": "混合搜索",
"parameters": [
{
"type": "string",
@@ -4447,27 +4517,18 @@ const docTemplate = `{
"required": true
},
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
+ "description": "搜索参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ }
}
],
"responses": {
"200": {
- "description": "标签列表",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4476,12 +4537,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge-bases/{id}/knowledge": {
+ "get": {
"security": [
{
"Bearer": []
@@ -4490,7 +4553,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "在知识库下创建新标签",
+ "description": "获取知识库下的知识列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -4498,9 +4561,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "创建标签",
+ "summary": "获取知识列表",
"parameters": [
{
"type": "string",
@@ -4510,29 +4573,39 @@ const docTemplate = `{
"required": true
},
{
- "description": "标签信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "sort_order": {
- "type": "integer"
- }
- }
- }
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标签ID筛选",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "文件类型筛选",
+ "name": "file_type",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "创建的标签",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4541,14 +4614,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/tags/{tag_id}": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -4557,7 +4628,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新标签信息",
+ "description": "删除知识库下的所有知识条目(异步任务)。知识库本身保留,仅清空其中的内容",
"consumes": [
"application/json"
],
@@ -4565,9 +4636,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "更新标签",
+ "summary": "清空知识库内容",
"parameters": [
{
"type": "string",
@@ -4575,27 +4646,11 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "标签ID (UUID或seq_id)",
- "name": "tag_id",
- "in": "path",
- "required": true
- },
- {
- "description": "标签更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
}
],
"responses": {
"200": {
- "description": "更新后的标签",
+ "description": "清空任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4604,12 +4659,20 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/knowledge/file": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4618,17 +4681,17 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
+ "description": "上传文件并创建知识条目",
"consumes": [
- "application/json"
+ "multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "删除标签",
+ "summary": "从文件创建知识",
"parameters": [
{
"type": "string",
@@ -4638,36 +4701,34 @@ const docTemplate = `{
"required": true
},
{
- "type": "string",
- "description": "标签ID (UUID或seq_id)",
- "name": "tag_id",
- "in": "path",
+ "type": "file",
+ "description": "上传的文件",
+ "name": "file",
+ "in": "formData",
"required": true
},
{
- "type": "boolean",
- "description": "强制删除",
- "name": "force",
- "in": "query"
+ "type": "string",
+ "description": "自定义文件名",
+ "name": "fileName",
+ "in": "formData"
},
{
- "type": "boolean",
- "description": "仅删除内容,保留标签",
- "name": "content_only",
- "in": "query"
+ "type": "string",
+ "description": "元数据JSON",
+ "name": "metadata",
+ "in": "formData"
},
{
- "description": "删除选项",
- "name": "body",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/handler.DeleteTagRequest"
- }
+ "type": "boolean",
+ "description": "启用多模态处理",
+ "name": "enable_multimodel",
+ "in": "formData"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4676,14 +4737,21 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "409": {
+ "description": "文件重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/knowledge/batch": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/manual": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4692,7 +4760,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
+ "description": "手工录入Markdown格式的知识内容",
"consumes": [
"application/json"
],
@@ -4702,35 +4770,28 @@ const docTemplate = `{
"tags": [
"知识管理"
],
- "summary": "批量获取知识",
+ "summary": "手工创建知识",
"parameters": [
- {
- "type": "array",
- "items": {
- "type": "string"
- },
- "collectionFormat": "csv",
- "description": "知识ID列表",
- "name": "ids",
- "in": "query",
- "required": true
- },
{
"type": "string",
- "description": "可选,知识库ID(用于共享知识库时指定范围)",
- "name": "kb_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
},
{
- "type": "string",
- "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
- "name": "agent_id",
- "in": "query"
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4739,14 +4800,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/image/{id}/{chunk_id}": {
- "put": {
+ "/knowledge-bases/{id}/knowledge/url": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4755,7 +4816,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新知识分块的图像信息",
+ "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
"consumes": [
"application/json"
],
@@ -4765,31 +4826,39 @@ const docTemplate = `{
"tags": [
"知识管理"
],
- "summary": "更新图像信息",
+ "summary": "从URL创建知识",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "chunk_id",
- "in": "path",
- "required": true
- },
- {
- "description": "图像信息",
+ "description": "URL请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "image_info": {
+ "enable_multimodel": {
+ "type": "boolean"
+ },
+ "file_name": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
"type": "string"
}
}
@@ -4797,8 +4866,8 @@ const docTemplate = `{
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4807,13 +4876,20 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "409": {
+ "description": "URL重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/knowledge/manual/{id}": {
+ "/knowledge-bases/{id}/pin": {
"put": {
"security": [
{
@@ -4823,7 +4899,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新手工录入的Markdown知识内容",
+ "description": "切换知识库的置顶状态",
"consumes": [
"application/json"
],
@@ -4831,125 +4907,75 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "知识库"
],
- "summary": "更新手工知识",
+ "summary": "置顶/取消置顶知识库",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "更新后的知识",
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/search": {
+ "/knowledge-bases/{id}/shares": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
- "consumes": [
- "application/json"
- ],
+ "description": "获取知识库的所有共享记录",
"produces": [
"application/json"
],
"tags": [
- "Knowledge"
+ "知识库共享"
],
- "summary": "Search knowledge",
+ "summary": "获取知识库的共享列表",
"parameters": [
{
"type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
- "name": "file_types",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Shared agent ID (search within agent's KB scope)",
- "name": "agent_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "Search results",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "Invalid request",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
- }
- },
- "/knowledge/tags": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
+ "description": "将知识库共享到指定组织",
"consumes": [
"application/json"
],
@@ -4957,48 +4983,52 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "批量更新知识标签",
+ "summary": "共享知识库到组织",
"parameters": [
{
- "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "共享信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
}
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/{id}": {
- "get": {
+ "/knowledge-bases/{id}/shares/{share_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取知识条目详情",
+ "description": "更新知识库共享的权限级别",
"consumes": [
"application/json"
],
@@ -5006,95 +5036,96 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "获取知识详情",
+ "summary": "更新共享权限",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "权限信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新知识条目信息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "取消知识库的共享",
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "更新知识",
+ "summary": "取消共享",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "知识信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.Knowledge"
- }
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/tags": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5103,7 +5134,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID删除知识条目",
+ "description": "获取知识库下的所有标签及统计信息",
"consumes": [
"application/json"
],
@@ -5111,21 +5142,39 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "删除知识",
+ "summary": "获取标签列表",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "标签列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5134,14 +5183,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/{id}/download": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -5150,44 +5197,65 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "下载知识条目关联的原始文件",
+ "description": "在知识库下创建新标签",
"consumes": [
"application/json"
],
"produces": [
- "application/octet-stream"
+ "application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "下载知识文件",
+ "summary": "创建标签",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "文件内容",
+ "description": "创建的标签",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/{id}/preview": {
- "get": {
+ "/knowledge-bases/{id}/tags/{tag_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5196,78 +5264,45 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "返回知识条目关联的原始文件,Content-Type 根据文件类型设置,用于浏览器内嵌预览",
+ "description": "更新标签信息",
"consumes": [
"application/json"
],
"produces": [
- "application/pdf",
- "image/jpeg",
- "image/png",
- "text/plain"
+ "application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "预览知识文件",
+ "summary": "更新标签",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
- }
- ],
- "responses": {
- "200": {
- "description": "文件内容",
- "schema": {
- "type": "file"
- }
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- }
- }
- }
- },
- "/knowledge/{id}/reparse": {
- "post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "知识管理"
- ],
- "summary": "重新解析知识",
- "parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签更新信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "重新解析任务已提交",
+ "description": "更新后的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5276,20 +5311,12 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -5298,7 +5325,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有MCP服务",
+ "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
"consumes": [
"application/json"
],
@@ -5306,12 +5333,48 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "标签管理"
+ ],
+ "summary": "删除标签",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "boolean",
+ "description": "强制删除",
+ "name": "force",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "仅删除内容,保留标签",
+ "name": "content_only",
+ "in": "query"
+ },
+ {
+ "description": "删除选项",
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ }
+ }
],
- "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "MCP服务列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5320,12 +5383,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge/batch": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5334,7 +5399,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "创建新的MCP服务配置",
+ "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
"consumes": [
"application/json"
],
@@ -5342,23 +5407,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "创建MCP服务",
+ "summary": "批量获取知识",
"parameters": [
{
- "description": "MCP服务配置",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.MCPService"
- }
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "description": "知识ID列表",
+ "name": "ids",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "可选,知识库ID(用于共享知识库时指定范围)",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "创建的MCP服务",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5367,14 +5446,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}": {
- "get": {
+ "/knowledge/image/{id}/{chunk_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5383,7 +5462,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取MCP服务详情",
+ "description": "更新知识分块的图像信息",
"consumes": [
"application/json"
],
@@ -5391,34 +5470,57 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务详情",
+ "summary": "更新图像信息",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "chunk_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "图像信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "image_info": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "MCP服务详情",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "服务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge/manual/{id}": {
"put": {
"security": [
{
@@ -5428,7 +5530,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新MCP服务配置",
+ "description": "更新手工录入的Markdown知识内容",
"consumes": [
"application/json"
],
@@ -5436,30 +5538,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "更新MCP服务",
+ "summary": "更新手工知识",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新字段",
+ "description": "手工知识内容",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
}
}
],
"responses": {
"200": {
- "description": "更新后的MCP服务",
+ "description": "更新后的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5468,12 +5570,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/search": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5482,7 +5586,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除指定的MCP服务",
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
"consumes": [
"application/json"
],
@@ -5490,37 +5594,60 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "Knowledge"
],
- "summary": "删除MCP服务",
+ "summary": "Search knowledge",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "Keyword to search",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Offset for pagination",
+ "name": "offset",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "Search results",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "Invalid request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}/resources": {
- "get": {
+ "/knowledge/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5529,7 +5656,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的资源列表",
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
"consumes": [
"application/json"
],
@@ -5537,37 +5664,39 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务资源列表",
+ "summary": "批量更新知识标签",
"parameters": [
{
- "type": "string",
- "description": "MCP服务ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "资源列表",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}/test": {
- "post": {
+ "/knowledge/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5576,7 +5705,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "测试MCP服务是否可以正常连接",
+ "description": "根据ID获取知识条目详情",
"consumes": [
"application/json"
],
@@ -5584,13 +5713,13 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "测试MCP服务连接",
+ "summary": "获取知识详情",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
@@ -5598,7 +5727,7 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "知识详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5607,14 +5736,18 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services/{id}/tools": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -5623,7 +5756,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的工具列表",
+ "description": "更新知识条目信息",
"consumes": [
"application/json"
],
@@ -5631,37 +5764,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务工具列表",
+ "summary": "更新知识",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "知识信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
}
],
"responses": {
"200": {
- "description": "工具列表",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/messages/chat-history-stats": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -5670,7 +5810,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取聊天历史知识库的统计信息(已索引消息数、知识库大小等)",
+ "description": "根据ID删除知识条目",
"consumes": [
"application/json"
],
@@ -5678,22 +5818,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "消息"
+ "知识管理"
+ ],
+ "summary": "删除知识",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取聊天历史知识库统计",
"responses": {
"200": {
- "description": "统计信息",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/messages/search": {
- "post": {
+ "/knowledge/{id}/download": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5702,46 +5857,43 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "通过关键词和/或向量相似度搜索历史对话记录,支持关键词、向量、混合三种模式",
+ "description": "下载知识条目关联的原始文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/octet-stream"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "搜索历史对话",
+ "summary": "下载知识文件",
"parameters": [
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.SearchMessagesRequest"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/messages/{session_id}/load": {
+ "/knowledge/{id}/preview": {
"get": {
"security": [
{
@@ -5751,58 +5903,47 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "加载会话的消息历史,支持分页和时间筛选",
+ "description": "返回知识条目关联的原始文件,Content-Type 根据文件类型设置,用于浏览器内嵌预览",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/pdf",
+ "image/jpeg",
+ "image/png",
+ "text/plain"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "加载消息历史",
+ "summary": "预览知识文件",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "知识ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "type": "integer",
- "default": 20,
- "description": "返回数量",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "在此时间之前的消息(RFC3339Nano格式)",
- "name": "before_time",
- "in": "query"
}
],
"responses": {
"200": {
- "description": "消息列表",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/messages/{session_id}/{id}": {
- "delete": {
+ "/knowledge/{id}/reparse": {
+ "post": {
"security": [
{
"Bearer": []
@@ -5811,7 +5952,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "从会话中删除指定消息",
+ "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
"consumes": [
"application/json"
],
@@ -5819,20 +5960,13 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "删除消息",
+ "summary": "重新解析知识",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "消息ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
@@ -5840,22 +5974,28 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "重新解析任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/models": {
+ "/mcp-services": {
"get": {
"security": [
{
@@ -5865,7 +6005,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有模型",
+ "description": "获取当前租户的所有MCP服务",
"consumes": [
"application/json"
],
@@ -5873,12 +6013,12 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型列表",
+ "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "MCP服务列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5887,7 +6027,7 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -5901,7 +6041,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "创建新的模型配置",
+ "description": "创建新的MCP服务配置",
"consumes": [
"application/json"
],
@@ -5909,23 +6049,23 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "创建模型",
+ "summary": "创建MCP服务",
"parameters": [
{
- "description": "模型信息",
+ "description": "MCP服务配置",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateModelRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
}
}
],
"responses": {
- "201": {
- "description": "创建的模型",
+ "200": {
+ "description": "创建的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5934,13 +6074,13 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/models/providers": {
+ "/mcp-services/{id}": {
"get": {
"security": [
{
@@ -5950,7 +6090,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据模型类型获取支持的厂商列表及配置信息",
+ "description": "根据ID获取MCP服务详情",
"consumes": [
"application/json"
],
@@ -5958,30 +6098,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型厂商列表",
+ "summary": "获取MCP服务详情",
"parameters": [
{
"type": "string",
- "description": "模型类型 (chat, embedding, rerank, vllm)",
- "name": "model_type",
- "in": "query"
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "厂商列表",
+ "description": "MCP服务详情",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "服务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/models/{id}": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -5990,7 +6135,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据ID获取模型详情",
+ "description": "更新MCP服务配置",
"consumes": [
"application/json"
],
@@ -5998,35 +6143,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型详情",
+ "summary": "更新MCP服务",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- }
+ },
+ {
+ "description": "更新字段",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
],
"responses": {
"200": {
- "description": "模型详情",
+ "description": "更新后的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -6035,7 +6189,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "更新模型配置信息",
+ "description": "删除指定的MCP服务",
"consumes": [
"application/json"
],
@@ -6043,44 +6197,37 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "更新模型",
+ "summary": "删除MCP服务",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateModelRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的模型",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/mcp-services/{id}/resources": {
+ "get": {
"security": [
{
"Bearer": []
@@ -6089,7 +6236,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "删除指定的模型",
+ "description": "获取MCP服务提供的资源列表",
"consumes": [
"application/json"
],
@@ -6097,13 +6244,13 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "删除模型",
+ "summary": "获取MCP服务资源列表",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
@@ -6111,52 +6258,32 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "资源列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/organizations": {
- "get": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
- "produces": [
- "application/json"
- ],
- "tags": [
- "组织管理"
- ],
- "summary": "获取我的组织列表",
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/types.ListOrganizationsResponse"
- }
- }
- }
- },
+ "/mcp-services/{id}/test": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "创建新的组织,创建者自动成为管理员",
+ "description": "测试MCP服务是否可以正常连接",
"consumes": [
"application/json"
],
@@ -6164,30 +6291,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
+ "MCP服务"
],
- "summary": "创建组织",
+ "summary": "测试MCP服务连接",
"parameters": [
{
- "description": "组织信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.CreateOrganizationRequest"
- }
+ "type": "string",
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Bad Request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6195,14 +6320,17 @@ const docTemplate = `{
}
}
},
- "/organizations/join": {
- "post": {
+ "/mcp-services/{id}/tools": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "使用邀请码加入组织",
+ "description": "获取MCP服务提供的工具列表",
"consumes": [
"application/json"
],
@@ -6210,30 +6338,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
+ "MCP服务"
],
- "summary": "通过邀请码加入组织",
+ "summary": "获取MCP服务工具列表",
"parameters": [
{
- "description": "邀请码",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.JoinOrganizationRequest"
- }
+ "type": "string",
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "工具列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6241,14 +6367,17 @@ const docTemplate = `{
}
}
},
- "/organizations/join-by-id": {
- "post": {
+ "/messages/chat-history-stats": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "加入已开放可被搜索的空间,无需邀请码",
+ "description": "获取聊天历史知识库的统计信息(已索引消息数、知识库大小等)",
"consumes": [
"application/json"
],
@@ -6256,45 +6385,31 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
- ],
- "summary": "通过空间 ID 加入(可搜索空间)",
- "parameters": [
- {
- "description": "空间 ID",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.JoinByOrganizationIDRequest"
- }
- }
+ "消息"
],
+ "summary": "获取聊天历史知识库统计",
"responses": {
"200": {
- "description": "OK",
+ "description": "统计信息",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "403": {
- "description": "Forbidden",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/organizations/join-request": {
+ "/messages/search": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "对需要审核的组织提交加入申请",
+ "description": "通过关键词和/或向量相似度搜索历史对话记录,支持关键词、向量、混合三种模式",
"consumes": [
"application/json"
],
@@ -6302,30 +6417,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "提交加入申请",
+ "summary": "搜索历史对话",
"parameters": [
{
- "description": "申请信息",
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.SubmitJoinRequestRequest"
+ "$ref": "#/definitions/internal_handler.SearchMessagesRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Bad Request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6333,40 +6448,59 @@ const docTemplate = `{
}
}
},
- "/organizations/preview/{code}": {
+ "/messages/{session_id}/load": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "通过邀请码获取组织基本信息(不加入)",
+ "description": "加载会话的消息历史,支持分页和时间筛选",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "通过邀请码预览组织",
+ "summary": "加载消息历史",
"parameters": [
{
"type": "string",
- "description": "邀请码",
- "name": "code",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "在此时间之前的消息(RFC3339Nano格式)",
+ "name": "before_time",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "消息列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6374,94 +6508,107 @@ const docTemplate = `{
}
}
},
- "/organizations/search": {
- "get": {
+ "/messages/{session_id}/{id}": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "搜索已开放可被搜索的空间,用于发现并加入",
+ "description": "从会话中删除指定消息",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "搜索可加入的空间",
+ "summary": "删除消息",
"parameters": [
{
"type": "string",
- "description": "搜索关键词(空间名称或描述)",
- "name": "q",
- "in": "query"
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
},
{
- "type": "integer",
- "default": 20,
- "description": "返回数量限制",
- "name": "limit",
- "in": "query"
+ "type": "string",
+ "description": "消息ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/organizations/{id}": {
+ "/models": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "根据ID获取组织详情",
+ "description": "获取当前租户的所有模型",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
- ],
- "summary": "获取组织详情",
- "parameters": [
- {
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "模型管理"
],
+ "summary": "获取模型列表",
"responses": {
"200": {
- "description": "OK",
+ "description": "模型列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "更新组织信息(需要管理员权限)",
+ "description": "创建新的模型配置",
"consumes": [
"application/json"
],
@@ -6469,58 +6616,102 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "更新组织",
+ "summary": "创建模型",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "更新信息",
+ "description": "模型信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateOrganizationRequest"
+ "$ref": "#/definitions/internal_handler.CreateModelRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "创建的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/models/providers": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "删除组织(仅组织创建者可操作)",
+ "description": "根据模型类型获取支持的厂商列表及配置信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "删除组织",
+ "summary": "获取模型厂商列表",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型类型 (chat, embedding, rerank, vllm)",
+ "name": "model_type",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "厂商列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/models/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取模型详情",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "模型管理"
+ ],
+ "summary": "获取模型详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
@@ -6528,29 +6719,30 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "OK",
+ "description": "模型详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/invite": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "管理员直接添加用户为组织成员",
+ "description": "更新模型配置信息",
"consumes": [
"application/json"
],
@@ -6558,69 +6750,67 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "邀请成员",
+ "summary": "更新模型",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "邀请信息",
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.InviteMemberRequest"
+ "$ref": "#/definitions/internal_handler.UpdateModelRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新后的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
- },
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/invite-code": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "生成新的组织邀请码(需要管理员权限)",
+ "description": "删除指定的模型",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "生成邀请码",
+ "summary": "删除模型",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
@@ -6628,14 +6818,14 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6643,55 +6833,37 @@ const docTemplate = `{
}
}
},
- "/organizations/{id}/join-requests": {
+ "/organizations": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "获取组织的待审核加入申请(仅管理员)",
+ "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取待审核加入申请列表",
- "parameters": [
- {
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- }
- ],
+ "summary": "获取我的组织列表",
"responses": {
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "403": {
- "description": "Forbidden",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
}
}
}
- }
- },
- "/organizations/{id}/join-requests/{request_id}/review": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "通过或拒绝加入申请(仅管理员)",
+ "description": "创建新的组织,创建者自动成为管理员",
"consumes": [
"application/json"
],
@@ -6701,42 +6873,28 @@ const docTemplate = `{
"tags": [
"组织管理"
],
- "summary": "审核加入申请",
+ "summary": "创建组织",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "申请ID",
- "name": "request_id",
- "in": "path",
- "required": true
- },
- {
- "description": "审核结果",
+ "description": "组织信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ReviewJoinRequestRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6744,25 +6902,33 @@ const docTemplate = `{
}
}
},
- "/organizations/{id}/leave": {
+ "/organizations/join": {
"post": {
"security": [
{
"Bearer": []
}
],
- "description": "退出指定组织",
+ "description": "使用邀请码加入组织",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
"组织管理"
],
- "summary": "退出组织",
+ "summary": "通过邀请码加入组织",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "邀请码",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
+ }
}
],
"responses": {
@@ -6773,8 +6939,8 @@ const docTemplate = `{
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6782,48 +6948,60 @@ const docTemplate = `{
}
}
},
- "/organizations/{id}/members": {
- "get": {
+ "/organizations/join-by-id": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "获取组织的所有成员",
+ "description": "加入已开放可被搜索的空间,无需邀请码",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取组织成员列表",
+ "summary": "通过空间 ID 加入(可搜索空间)",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "空间 ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ }
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.ListMembersResponse"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/organizations/{id}/members/{user_id}": {
- "put": {
+ "/organizations/join-request": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "更新组织成员的角色(需要管理员权限)",
+ "description": "对需要审核的组织提交加入申请",
"consumes": [
"application/json"
],
@@ -6833,29 +7011,15 @@ const docTemplate = `{
"tags": [
"组织管理"
],
- "summary": "更新成员角色",
+ "summary": "提交加入申请",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "用户ID",
- "name": "user_id",
- "in": "path",
- "required": true
- },
- {
- "description": "角色信息",
+ "description": "申请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateMemberRoleRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
}
}
],
@@ -6867,37 +7031,35 @@ const docTemplate = `{
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/preview/{code}": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "从组织中移除成员(需要管理员权限)",
+ "description": "通过邀请码获取组织基本信息(不加入)",
+ "produces": [
+ "application/json"
+ ],
"tags": [
"组织管理"
],
- "summary": "移除成员",
+ "summary": "通过邀请码预览组织",
"parameters": [
{
"type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "用户ID",
- "name": "user_id",
+ "description": "邀请码",
+ "name": "code",
"in": "path",
"required": true
}
@@ -6910,8 +7072,8 @@ const docTemplate = `{
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6919,40 +7081,34 @@ const docTemplate = `{
}
}
},
- "/organizations/{id}/request-upgrade": {
- "post": {
+ "/organizations/search": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "现有成员申请更高权限",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索已开放可被搜索的空间,用于发现并加入",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "申请权限升级",
+ "summary": "搜索可加入的空间",
"parameters": [
{
"type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "搜索关键词(空间名称或描述)",
+ "name": "q",
+ "in": "query"
},
{
- "description": "申请信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.RequestRoleUpgradeRequest"
- }
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
@@ -6962,31 +7118,25 @@ const docTemplate = `{
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/organizations/{id}/search-users": {
+ "/organizations/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "搜索用户(排除已有成员)用于邀请加入组织",
+ "description": "根据ID获取组织详情",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "搜索可邀请的用户",
+ "summary": "获取组织详情",
"parameters": [
{
"type": "string",
@@ -6994,20 +7144,6 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "搜索关键词(用户名或邮箱)",
- "name": "q",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "default": 10,
- "description": "返回数量限制",
- "name": "limit",
- "in": "query"
}
],
"responses": {
@@ -7018,30 +7154,31 @@ const docTemplate = `{
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/shared-agents": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
}
],
- "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
+ "description": "更新组织信息(需要管理员权限)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取空间内全部智能体(含我共享的)",
+ "summary": "更新组织",
"parameters": [
{
"type": "string",
@@ -7049,6 +7186,15 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "更新信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
+ }
}
],
"responses": {
@@ -7058,25 +7204,26 @@ const docTemplate = `{
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/organizations/{id}/shared-knowledge-bases": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
}
],
- "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
- "produces": [
- "application/json"
- ],
+ "description": "删除组织(仅组织创建者可操作)",
"tags": [
"组织管理"
],
- "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
+ "summary": "删除组织",
"parameters": [
{
"type": "string",
@@ -7093,25 +7240,34 @@ const docTemplate = `{
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/organizations/{id}/shares": {
- "get": {
+ "/organizations/{id}/invite": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "获取共享到指定组织的所有知识库",
+ "description": "管理员直接添加用户为组织成员",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取组织的共享知识库列表",
+ "summary": "邀请成员",
"parameters": [
{
"type": "string",
@@ -7119,128 +7275,130 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "邀请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
+ }
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.ListSharesResponse"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions": {
- "get": {
+ "/organizations/{id}/invite-code": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的会话列表,支持分页",
- "consumes": [
- "application/json"
- ],
+ "description": "生成新的组织邀请码(需要管理员权限)",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "获取会话列表",
+ "summary": "生成邀请码",
"parameters": [
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "会话列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/organizations/{id}/join-requests": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的对话会话",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的待审核加入申请(仅管理员)",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "创建会话",
+ "summary": "获取待审核加入申请列表",
"parameters": [
{
- "description": "会话创建请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateSessionRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "201": {
- "description": "创建的会话",
+ "200": {
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/batch": {
- "delete": {
+ "/organizations/{id}/join-requests/{request_id}/review": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID列表批量删除对话会话,或设置 delete_all=true 删除当前租户的所有会话",
+ "description": "通过或拒绝加入申请(仅管理员)",
"consumes": [
"application/json"
],
@@ -7248,111 +7406,108 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "批量删除会话",
+ "summary": "审核加入申请",
"parameters": [
{
- "description": "批量删除请求",
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "申请ID",
+ "name": "request_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "审核结果",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler_session.batchDeleteRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
}
}
],
"responses": {
"200": {
- "description": "删除结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/search": {
+ "/organizations/{id}/leave": {
"post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "在知识库中搜索(不使用LLM总结)",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "退出指定组织",
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "知识搜索",
+ "summary": "退出组织",
"parameters": [
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.SearchKnowledgeRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{id}": {
+ "/organizations/{id}/members": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取会话详情",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的所有成员",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "获取会话详情",
+ "summary": "获取组织成员列表",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -7360,30 +7515,22 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "会话详情",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "会话不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
}
}
}
- },
+ }
+ },
+ "/organizations/{id}/members/{user_id}": {
"put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新会话属性",
+ "description": "更新组织成员的角色(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -7391,39 +7538,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "更新会话",
+ "summary": "更新成员角色",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "会话信息",
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "角色信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Session"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
}
}
],
"responses": {
"200": {
- "description": "更新后的会话",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -7432,59 +7586,54 @@ const docTemplate = `{
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的会话",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "从组织中移除成员(需要管理员权限)",
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "删除会话",
+ "summary": "移除成员",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{id}/messages": {
- "delete": {
+ "/organizations/{id}/request-upgrade": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除会话中的所有消息,同时清除 LLM 上下文和聊天历史知识库条目。会话本身保留。",
+ "description": "现有成员申请更高权限",
"consumes": [
"application/json"
],
@@ -7492,209 +7641,205 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "清空会话消息",
+ "summary": "申请权限升级",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "申请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ }
}
],
"responses": {
"200": {
- "description": "清空成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "会话不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{session_id}/agent-qa": {
- "post": {
+ "/organizations/{id}/search-users": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "基于Agent的智能问答,支持多轮对话和SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索用户(排除已有成员)用于邀请加入组织",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "Agent问答",
+ "summary": "搜索可邀请的用户",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
- }
+ "type": "string",
+ "description": "搜索关键词(用户名或邮箱)",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{session_id}/continue": {
+ "/organizations/{id}/shared-agents": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "继续获取正在进行的流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "继续流式响应",
+ "summary": "获取空间内全部智能体(含我共享的)",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "消息ID",
- "name": "message_id",
- "in": "query",
- "required": true
}
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "会话或消息不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
}
},
- "/sessions/{session_id}/knowledge-qa": {
- "post": {
+ "/organizations/{id}/shared-knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "知识问答",
+ "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
- }
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
+ }
+ }
+ }
+ },
+ "/organizations/{id}/shares": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取共享到指定组织的所有知识库",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取组织的共享知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
}
},
- "/sessions/{session_id}/stop": {
- "post": {
+ "/sessions": {
+ "get": {
"security": [
{
"Bearer": []
@@ -7703,7 +7848,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "停止当前正在进行的生成任务",
+ "description": "获取当前租户的会话列表,支持分页",
"consumes": [
"application/json"
],
@@ -7711,45 +7856,39 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "问答"
+ "会话"
],
- "summary": "停止生成",
+ "summary": "获取会话列表",
"parameters": [
{
- "type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
},
{
- "description": "停止请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.StopSessionRequest"
- }
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "停止成功",
+ "description": "会话列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话或消息不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/sessions/{session_id}/title": {
+ },
"post": {
"security": [
{
@@ -7759,7 +7898,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "根据消息内容自动生成会话标题",
+ "description": "创建新的对话会话",
"consumes": [
"application/json"
],
@@ -7769,28 +7908,21 @@ const docTemplate = `{
"tags": [
"会话"
],
- "summary": "生成会话标题",
+ "summary": "创建会话",
"parameters": [
{
- "type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
- },
- {
- "description": "生成请求",
+ "description": "会话创建请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler_session.GenerateTitleRequest"
+ "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
}
}
],
"responses": {
- "200": {
- "description": "生成的标题",
+ "201": {
+ "description": "创建的会话",
"schema": {
"type": "object",
"additionalProperties": true
@@ -7799,40 +7931,63 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/shared-knowledge-bases": {
- "get": {
+ "/sessions/batch": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取通过组织共享给当前用户的所有知识库",
+ "description": "根据ID列表批量删除对话会话,或设置 delete_all=true 删除当前租户的所有会话",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "知识库共享"
+ "会话"
+ ],
+ "summary": "批量删除会话",
+ "parameters": [
+ {
+ "description": "批量删除请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
+ }
+ }
],
- "summary": "获取共享给我的知识库列表",
"responses": {
"200": {
- "description": "OK",
+ "description": "删除结果",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/skills": {
- "get": {
+ "/sessions/search": {
+ "post": {
"security": [
{
"Bearer": []
@@ -7841,7 +7996,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取所有预装的Agent Skills元数据",
+ "description": "在知识库中搜索(不使用LLM总结)",
"consumes": [
"application/json"
],
@@ -7849,59 +8004,48 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Skills"
+ "问答"
],
- "summary": "获取预装Skills列表",
- "responses": {
- "200": {
- "description": "Skills列表",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- }
- }
- }
- },
- "/system/docreader/reconnect": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "重连文档解析服务",
+ "summary": "知识搜索",
"parameters": [
{
- "description": "DocReader 地址",
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler_session.SearchKnowledgeRequest"
}
}
],
"responses": {
"200": {
- "description": "OK"
+ "description": "搜索结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/system/info": {
+ "/sessions/{id}": {
"get": {
- "description": "获取系统版本、构建信息和引擎配置",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取会话详情",
"consumes": [
"application/json"
],
@@ -7909,41 +8053,44 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "获取系统信息",
- "responses": {
- "200": {
- "description": "系统信息",
- "schema": {
- "$ref": "#/definitions/handler.GetSystemInfoResponse"
- }
+ "summary": "获取会话详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
- }
- }
- },
- "/system/parser-engines": {
- "get": {
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
],
- "summary": "列出可用的文档解析引擎",
"responses": {
"200": {
- "description": "解析引擎列表",
+ "description": "会话详情",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/system/parser-engines/check": {
- "post": {
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新会话属性",
"consumes": [
"application/json"
],
@@ -7951,30 +8098,53 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "使用当前参数检测解析引擎可用性",
+ "summary": "更新会话",
"parameters": [
{
- "description": "解析引擎配置(与保存接口同结构)",
- "name": "body",
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "会话信息",
+ "name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Session"
}
}
],
"responses": {
"200": {
- "description": "OK"
+ "description": "更新后的会话",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/system/storage-engine-check": {
- "post": {
- "description": "使用当前填写的参数测试 MinIO/COS 连通性,不保存配置",
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的会话",
"consumes": [
"application/json"
],
@@ -7982,58 +8152,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "测试存储引擎连通性",
+ "summary": "删除会话",
"parameters": [
{
- "description": "存储引擎配置",
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.StorageCheckRequest"
- }
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
- "$ref": "#/definitions/handler.StorageCheckResponse"
+ "type": "object",
+ "additionalProperties": true
}
- }
- }
- }
- },
- "/system/storage-engine-status": {
- "get": {
- "description": "返回 Local、MinIO、COS 各存储引擎的可用状态及说明,供全局设置与知识库选择使用",
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "获取存储引擎状态",
- "responses": {
- "200": {
- "description": "OK",
+ },
+ "404": {
+ "description": "会话不存在",
"schema": {
- "$ref": "#/definitions/handler.GetStorageEngineStatusResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants": {
- "get": {
+ "/sessions/{id}/messages": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取当前用户可访问的租户列表",
+ "description": "删除会话中的所有消息,同时清除 LLM 上下文和聊天历史知识库条目。会话本身保留。",
"consumes": [
"application/json"
],
@@ -8041,56 +8199,83 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "会话"
+ ],
+ "summary": "清空会话消息",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取租户列表",
"responses": {
"200": {
- "description": "租户列表",
+ "description": "清空成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "会话不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/sessions/{session_id}/agent-qa": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "创建新的租户",
+ "description": "基于Agent的智能问答,支持多轮对话和SSE流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
],
- "summary": "创建租户",
+ "summary": "Agent问答",
"parameters": [
{
- "description": "租户信息",
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问答请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Tenant"
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的租户",
+ "200": {
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8099,49 +8284,68 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/all": {
+ "/sessions/{session_id}/continue": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取系统中所有租户(需要跨租户访问权限)",
+ "description": "继续获取正在进行的流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "继续流式响应",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "消息ID",
+ "name": "message_id",
+ "in": "query",
+ "required": true
+ }
],
- "summary": "获取所有租户列表",
"responses": {
"200": {
- "description": "所有租户列表",
+ "description": "流式响应",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "权限不足",
+ "404": {
+ "description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/agent-config": {
- "get": {
+ "/sessions/{session_id}/knowledge-qa": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8150,20 +8354,38 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取租户的全局Agent配置(默认应用于所有会话)",
+ "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "知识问答",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问答请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ }
+ }
],
- "summary": "获取租户Agent配置",
"responses": {
"200": {
- "description": "Agent配置",
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8172,14 +8394,14 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/conversation-config": {
- "get": {
+ "/sessions/{session_id}/stop": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8188,7 +8410,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取租户的全局对话配置(默认应用于普通模式会话)",
+ "description": "停止当前正在进行的生成任务",
"consumes": [
"application/json"
],
@@ -8196,28 +8418,46 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "停止生成",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "停止请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.StopSessionRequest"
+ }
+ }
],
- "summary": "获取租户对话配置",
"responses": {
"200": {
- "description": "对话配置",
+ "description": "停止成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/prompt-templates": {
- "get": {
+ "/sessions/{session_id}/title": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8226,7 +8466,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取系统配置的提示词模板列表",
+ "description": "根据消息内容自动生成会话标题",
"consumes": [
"application/json"
],
@@ -8234,12 +8474,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "会话"
+ ],
+ "summary": "生成会话标题",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "生成请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.GenerateTitleRequest"
+ }
+ }
],
- "summary": "获取提示词模板",
"responses": {
"200": {
- "description": "提示词模板配置",
+ "description": "生成的标题",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8248,51 +8506,39 @@ const docTemplate = `{
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/web-search-config": {
+ "/shared-knowledge-bases": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取租户的网络搜索配置",
- "consumes": [
- "application/json"
- ],
+ "description": "获取通过组织共享给当前用户的所有知识库",
"produces": [
"application/json"
],
"tags": [
- "租户管理"
+ "知识库共享"
],
- "summary": "获取租户网络搜索配置",
+ "summary": "获取共享给我的知识库列表",
"responses": {
"200": {
- "description": "网络搜索配置",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
}
},
- "/tenants/kv/{key}": {
+ "/skills": {
"get": {
"security": [
{
@@ -8302,7 +8548,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "获取租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ "description": "获取所有预装的Agent Skills元数据",
"consumes": [
"application/json"
],
@@ -8310,44 +8556,28 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "获取租户KV配置",
- "parameters": [
- {
- "type": "string",
- "description": "配置键名",
- "name": "key",
- "in": "path",
- "required": true
- }
+ "Skills"
],
+ "summary": "获取预装Skills列表",
"responses": {
"200": {
- "description": "配置值",
+ "description": "Skills列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "不支持的键",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "更新租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ }
+ },
+ "/system/docreader/reconnect": {
+ "post": {
"consumes": [
"application/json"
],
@@ -8355,19 +8585,12 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "更新租户KV配置",
+ "summary": "重连文档解析服务",
"parameters": [
{
- "type": "string",
- "description": "配置键名",
- "name": "key",
- "in": "path",
- "required": true
- },
- {
- "description": "配置值",
+ "description": "DocReader 地址",
"name": "request",
"in": "body",
"required": true,
@@ -8378,32 +8601,14 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "更新成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "不支持的键",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "description": "OK"
}
}
}
},
- "/tenants/search": {
+ "/system/info": {
"get": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "分页搜索租户(需要跨租户访问权限)",
+ "description": "获取系统版本、构建信息和引擎配置",
"consumes": [
"application/json"
],
@@ -8411,113 +8616,41 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "搜索租户",
- "parameters": [
- {
- "type": "string",
- "description": "搜索关键词",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "租户ID筛选",
- "name": "tenant_id",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 20,
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- }
+ "系统"
],
+ "summary": "获取系统信息",
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "系统信息",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/internal_handler.GetSystemInfoResponse"
}
}
}
}
},
- "/tenants/{id}": {
+ "/system/parser-engines": {
"get": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "根据ID获取租户详情",
- "consumes": [
- "application/json"
- ],
"produces": [
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "获取租户详情",
- "parameters": [
- {
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "系统"
],
+ "summary": "列出可用的文档解析引擎",
"responses": {
"200": {
- "description": "租户详情",
+ "description": "解析引擎列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "租户不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
- },
- "put": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "更新租户信息",
+ }
+ },
+ "/system/parser-engines/check": {
+ "post": {
"consumes": [
"application/json"
],
@@ -8525,50 +8658,30 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "更新租户",
+ "summary": "使用当前参数检测解析引擎可用性",
"parameters": [
{
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "租户信息",
- "name": "request",
+ "description": "解析引擎配置(与保存接口同结构)",
+ "name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Tenant"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "更新后的租户",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "description": "OK"
}
}
- },
- "delete": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "删除指定的租户",
+ }
+ },
+ "/system/storage-engine-check": {
+ "post": {
+ "description": "使用当前填写的参数测试 MinIO/COS 连通性,不保存配置",
"consumes": [
"application/json"
],
@@ -8576,66 +8689,80 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "删除租户",
+ "summary": "测试存储引擎连通性",
"parameters": [
{
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "存储引擎配置",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.StorageCheckRequest"
+ }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.StorageCheckResponse"
}
- },
- "400": {
- "description": "请求参数错误",
+ }
+ }
+ }
+ },
+ "/system/storage-engine-status": {
+ "get": {
+ "description": "返回 Local、MinIO、COS 各存储引擎的可用状态及说明,供全局设置与知识库选择使用",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "系统"
+ ],
+ "summary": "获取存储引擎状态",
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/internal_handler.GetStorageEngineStatusResponse"
}
}
}
}
},
- "/vector-stores": {
+ "/tenants": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
+ "description": "获取当前用户可访问的租户列表",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "List vector stores",
+ "summary": "获取租户列表",
"responses": {
"200": {
- "description": "List of vector stores (env + DB)",
+ "description": "租户列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -8644,12 +8771,9 @@ const docTemplate = `{
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Create a new vector store configuration for the current tenant",
+ "description": "创建新的租户",
"consumes": [
"application/json"
],
@@ -8657,61 +8781,45 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Create vector store",
+ "summary": "创建租户",
"parameters": [
{
- "description": "Vector store configuration",
+ "description": "租户信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateStoreRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
}
}
],
"responses": {
"201": {
- "description": "Created vector store",
+ "description": "创建的租户",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Invalid request or validation error",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "401": {
- "description": "Unauthorized",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "409": {
- "description": "Duplicate endpoint and index",
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/test": {
- "post": {
+ "/tenants/all": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "description": "获取系统中所有租户(需要跨租户访问权限)",
"consumes": [
"application/json"
],
@@ -8719,66 +8827,65 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "VectorStore"
- ],
- "summary": "Test vector store connection with raw credentials",
- "parameters": [
- {
- "description": "Engine type and connection config",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.TestStoreRequest"
- }
- }
+ "租户管理"
],
+ "summary": "获取所有租户列表",
"responses": {
"200": {
- "description": "Connection test result (success, version)",
+ "description": "所有租户列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "Invalid request",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "401": {
- "description": "Unauthorized",
+ "403": {
+ "description": "权限不足",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/types": {
+ "/tenants/kv/agent-config": {
"get": {
- "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取租户的全局Agent配置(默认应用于所有会话)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "List vector store types",
+ "summary": "获取租户Agent配置",
"responses": {
"200": {
- "description": "List of engine types with config schemas",
+ "description": "Agent配置",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/vector-stores/{id}": {
+ "/tenants/kv/conversation-config": {
"get": {
"security": [
{
@@ -8788,48 +8895,112 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
- "produces": [
- "application/json"
+ "description": "获取租户的全局对话配置(默认应用于普通模式会话)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Get vector store",
- "parameters": [
+ "summary": "获取租户对话配置",
+ "responses": {
+ "200": {
+ "description": "对话配置",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/tenants/kv/prompt-templates": {
+ "get": {
+ "security": [
{
- "type": "string",
- "description": "Vector store ID",
- "name": "id",
- "in": "path",
- "required": true
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
+ "description": "获取系统配置的提示词模板列表",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取提示词模板",
"responses": {
"200": {
- "description": "Vector store details",
+ "description": "提示词模板配置",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ }
+ }
+ }
+ },
+ "/tenants/kv/web-search-config": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
- "404": {
- "description": "Vector store not found",
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取租户的网络搜索配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取租户网络搜索配置",
+ "responses": {
+ "200": {
+ "description": "网络搜索配置",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- },
- "put": {
+ }
+ },
+ "/tenants/kv/{key}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -8838,7 +9009,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "description": "获取租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
"consumes": [
"application/json"
],
@@ -8846,59 +9017,35 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Update vector store",
+ "summary": "获取租户KV配置",
"parameters": [
{
"type": "string",
- "description": "Vector store ID",
- "name": "id",
+ "description": "配置键名",
+ "name": "key",
"in": "path",
"required": true
- },
- {
- "description": "Updated fields",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateStoreRequest"
- }
}
],
"responses": {
"200": {
- "description": "Updated vector store",
+ "description": "配置值",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Env store or validation error",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "401": {
- "description": "Unauthorized",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "Vector store not found",
+ "description": "不支持的键",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "delete": {
+ "put": {
"security": [
{
"Bearer": []
@@ -8907,57 +9054,120 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "description": "更新租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Delete vector store",
+ "summary": "更新租户KV配置",
"parameters": [
{
"type": "string",
- "description": "Vector store ID",
- "name": "id",
+ "description": "配置键名",
+ "name": "key",
"in": "path",
"required": true
+ },
+ {
+ "description": "配置值",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "Deletion success",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Env store cannot be deleted",
+ "description": "不支持的键",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ }
+ }
+ }
+ },
+ "/tenants/search": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
- "401": {
- "description": "Unauthorized",
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "分页搜索租户(需要跨租户访问权限)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "搜索租户",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "搜索关键词",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "租户ID筛选",
+ "name": "tenant_id",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Vector store not found",
+ "403": {
+ "description": "权限不足",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/{id}/test": {
- "post": {
+ "/tenants/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -8966,18 +9176,21 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
- "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "description": "根据ID获取租户详情",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Test vector store connection by ID",
+ "summary": "获取租户详情",
"parameters": [
{
- "type": "string",
- "description": "Vector store ID",
+ "type": "integer",
+ "description": "租户ID",
"name": "id",
"in": "path",
"required": true
@@ -8985,21 +9198,264 @@ const docTemplate = `{
],
"responses": {
"200": {
- "description": "Connection test result (success, version)",
+ "description": "租户详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "租户不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "更新租户信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "更新租户",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "租户信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的租户",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Vector store not found",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "删除指定的租户",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "删除租户",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector stores",
+ "responses": {
+ "200": {
+ "description": "List of vector stores (env + DB)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Create a new vector store configuration for the current tenant",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Create vector store",
+ "parameters": [
+ {
+ "description": "Vector store configuration",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CreateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request or validation error",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "409": {
+ "description": "Duplicate endpoint and index",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection with raw credentials",
+ "parameters": [
+ {
+ "description": "Engine type and connection config",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TestStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": true
@@ -9007,2440 +9463,2917 @@ const docTemplate = `{
}
}
}
- }
- },
- "definitions": {
- "datasource.ConnectorMetadata": {
+ },
+ "/vector-stores/types": {
+ "get": {
+ "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector store types",
+ "responses": {
+ "200": {
+ "description": "List of engine types with config schemas",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Get vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Vector store details",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Update vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Updated fields",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Updated vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store or validation error",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Delete vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deletion success",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store cannot be deleted",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection by ID",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
+ "type": "object",
+ "properties": {
+ "auto_fixable": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "page_slug": {
+ "type": "string"
+ },
+ "severity": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
+ },
+ "target_slug": {
+ "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity": {
+ "type": "string",
+ "enum": [
+ "info",
+ "warning",
+ "error"
+ ],
+ "x-enum-varnames": [
+ "SeverityInfo",
+ "SeverityWarning",
+ "SeverityError"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType": {
+ "type": "string",
+ "enum": [
+ "orphan_page",
+ "broken_link",
+ "stale_ref",
+ "missing_cross_ref",
+ "empty_content",
+ "duplicate_slug"
+ ],
+ "x-enum-varnames": [
+ "LintIssueOrphanPage",
+ "LintIssueBrokenLink",
+ "LintIssueStaleRef",
+ "LintIssueMissingCrossRef",
+ "LintIssueEmptyContent",
+ "LintIssueDuplicateSlug"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintReport": {
+ "type": "object",
+ "properties": {
+ "health_score": {
+ "description": "0-100",
+ "type": "integer"
+ },
+ "issues": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue"
+ }
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "stats": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "type": "string"
+ },
+ "capabilities": {
+ "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "priority": {
+ "description": "Priority order for UI display (lower = higher priority)",
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ },
+ "details": {},
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.ErrorCode": {
+ "type": "integer",
+ "enum": [
+ 1000,
+ 1001,
+ 1002,
+ 1003,
+ 1004,
+ 1005,
+ 1006,
+ 1007,
+ 1008,
+ 1009,
+ 1010,
+ 2000,
+ 2001,
+ 2002,
+ 2003,
+ 2004,
+ 2100,
+ 2101,
+ 2102,
+ 2103
+ ],
+ "x-enum-varnames": [
+ "ErrBadRequest",
+ "ErrUnauthorized",
+ "ErrForbidden",
+ "ErrNotFound",
+ "ErrMethodNotAllowed",
+ "ErrConflict",
+ "ErrTooManyRequests",
+ "ErrInternalServer",
+ "ErrServiceUnavailable",
+ "ErrTimeout",
+ "ErrValidation",
+ "ErrTenantNotFound",
+ "ErrTenantAlreadyExists",
+ "ErrTenantInactive",
+ "ErrTenantNameRequired",
+ "ErrTenantInvalidStatus",
+ "ErrAgentMissingThinkingModel",
+ "ErrAgentMissingAllowedTools",
+ "ErrAgentInvalidMaxIterations",
+ "ErrAgentInvalidTemperature"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "language": {
+ "description": "optional: language hint for transcription",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentConfig": {
+ "type": "object",
+ "properties": {
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "allowed_tools": {
+ "description": "List of allowed tool names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "knowledge_bases": {
+ "description": "Accessible knowledge base IDs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_ids": {
+ "description": "Accessible knowledge IDs (individual documents)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
+ "type": "integer"
+ },
+ "max_context_tokens": {
+ "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "Maximum number of ReAct iterations",
+ "type": "integer"
+ },
+ "max_tool_output_chars": {
+ "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "parallel_tool_calls": {
+ "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "type": "boolean"
+ },
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history (like wiki_read_page results) across turns (default: false)",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
+ },
+ "system_prompt_web_disabled": {
+ "description": "Deprecated: Custom prompt when web search is disabled",
+ "type": "string"
+ },
+ "system_prompt_web_enabled": {
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "LLM temperature for agent",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
+ "use_custom_system_prompt": {
+ "description": "Whether to use custom system prompt instead of default",
+ "type": "boolean"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search tool is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum number of web search results (default: 5)",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderEntity ID (resolved from agent config)",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "type": "object",
+ "properties": {
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
+ "type": "integer"
+ },
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "When this step occurred",
+ "type": "string"
+ },
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
+ ],
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_id": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
"type": "object",
"properties": {
- "auth_type": {
- "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
"type": "string"
},
- "capabilities": {
- "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "type": "object",
+ "properties": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "chunk_overlap": {
+ "description": "Chunk overlap",
+ "type": "integer"
+ },
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
+ },
+ "enable_multimodal": {
+ "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
+ "type": "boolean"
+ },
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
+ },
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
+ "type": "object",
+ "properties": {
+ "addr": {
+ "description": "Common",
+ "type": "string"
},
- "description": {
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "icon": {
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "name": {
+ "host": {
+ "description": "Qdrant",
"type": "string"
},
- "priority": {
- "description": "Priority order for UI display (lower = higher priority)",
+ "password": {
+ "description": "AES-GCM encrypted",
+ "type": "string"
+ },
+ "port": {
"type": "integer"
},
- "type": {
+ "scheme": {
"type": "string"
- }
- }
- },
- "errors.AppError": {
- "type": "object",
- "properties": {
- "code": {
- "$ref": "#/definitions/errors.ErrorCode"
},
- "details": {},
- "message": {
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
+ "type": "boolean"
+ },
+ "username": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
"type": "string"
}
}
},
- "errors.ErrorCode": {
- "type": "integer",
+ "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "type": "string",
"enum": [
- 1000,
- 1001,
- 1002,
- 1003,
- 1004,
- 1005,
- 1006,
- 1007,
- 1008,
- 1009,
- 1010,
- 2000,
- 2001,
- 2002,
- 2003,
- 2004,
- 2100,
- 2101,
- 2102,
- 2103
+ "sliding_window",
+ "smart"
],
"x-enum-varnames": [
- "ErrBadRequest",
- "ErrUnauthorized",
- "ErrForbidden",
- "ErrNotFound",
- "ErrMethodNotAllowed",
- "ErrConflict",
- "ErrTooManyRequests",
- "ErrInternalServer",
- "ErrServiceUnavailable",
- "ErrTimeout",
- "ErrValidation",
- "ErrTenantNotFound",
- "ErrTenantAlreadyExists",
- "ErrTenantInactive",
- "ErrTenantNameRequired",
- "ErrTenantInvalidStatus",
- "ErrAgentMissingThinkingModel",
- "ErrAgentMissingAllowedTools",
- "ErrAgentInvalidMaxIterations",
- "ErrAgentInvalidTemperature"
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
]
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "code": {
- "$ref": "#/definitions/errors.ErrorCode"
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
+ }
+ ]
},
- "details": {},
- "message": {
- "type": "string"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
+ },
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
+ },
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
}
}
},
- "gorm.DeletedAt": {
+ "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
"type": "object",
"properties": {
- "time": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
+ "embedding_top_k": {
+ "type": "integer"
+ },
+ "enable_query_expansion": {
"type": "boolean"
- }
- }
- },
- "handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
- ],
- "properties": {
- "source_id": {
- "type": "string"
},
- "target_id": {
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
"type": "string"
},
- "task_id": {
+ "fallback_response": {
"type": "string"
- }
- }
- },
- "handler.CreateAgentRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "avatar": {
+ },
+ "fallback_strategy": {
+ "description": "Fallback strategy",
"type": "string"
},
- "config": {
- "$ref": "#/definitions/types.CustomAgentConfig"
+ "keyword_threshold": {
+ "type": "number"
},
- "description": {
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
+ "type": "integer"
+ },
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
+ },
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
"type": "string"
},
- "name": {
+ "rerank_model_id": {
"type": "string"
- }
- }
- },
- "handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "type": "integer"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
"type": "string"
},
- "name": {
+ "rewrite_prompt_user": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/types.ModelParameters"
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
},
- "source": {
- "$ref": "#/definitions/types.ModelSource"
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
},
- "type": {
- "$ref": "#/definitions/types.ModelType"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "handler.CreateStoreRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
"type": "object",
"required": [
- "connection_config",
- "engine_type",
"name"
],
"properties": {
- "connection_config": {
- "$ref": "#/definitions/types.ConnectionConfig"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "engine_type": {
- "$ref": "#/definitions/types.RetrieverEngineType"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "index_config": {
- "$ref": "#/definitions/types.IndexConfig"
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
+ "type": "integer"
},
"name": {
- "type": "string"
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "handler.DeleteTagRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
"type": "object",
"properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "weknoracloud": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
}
}
},
- "handler.EvaluationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "agent_type": {
+ "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
- }
- }
- },
- "handler.FabriTextRequest": {
- "type": "object",
- "required": [
- "model_id"
- ],
- "properties": {
- "model_id": {
+ },
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "handler.GetStorageEngineStatusResponse": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler.StorageEngineStatusItem"
- }
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
+ "type": "integer"
},
- "minio_env_available": {
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
- }
- }
- },
- "handler.GetSystemInfoResponse": {
- "type": "object",
- "properties": {
- "build_time": {
+ },
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
- "commit_id": {
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "db_version": {
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "edition": {
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
"type": "string"
},
- "go_version": {
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "graph_database_engine": {
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
+ "type": "integer"
+ },
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens (only for normal mode)",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
"type": "string"
},
- "keyword_index_engine": {
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
- "minio_enabled": {
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
"type": "boolean"
},
- "vector_store_engine": {
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "version": {
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
+ },
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history across turns",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
- }
- }
- },
- "handler.KBModelConfigRequest": {
- "type": "object",
- "required": [
- "embeddingModelId",
- "llmModelId"
- ],
- "properties": {
- "asr_config": {
- "$ref": "#/definitions/types.ASRConfig"
},
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
+ "type": "string"
+ },
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "suggested_prompts": {
+ "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
- "embeddingModelId": {
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "llmModelId": {
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
- }
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
- }
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
- }
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
"type": "string"
},
- "vlm_config": {
- "$ref": "#/definitions/types.VLMConfig"
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
+ },
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
+ "type": "integer"
+ },
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
+ "type": "string"
}
}
},
- "handler.RemoteModelCheckRequest": {
+ "github_com_Tencent_WeKnora_internal_types.DataSource": {
"type": "object",
- "required": [
- "baseUrl",
- "modelName"
- ],
"properties": {
- "apiKey": {
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
"type": "string"
},
- "baseUrl": {
+ "created_at": {
+ "description": "Creation timestamp",
"type": "string"
},
- "modelName": {
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "error_message": {
+ "description": "Error message if status is \"error\"",
"type": "string"
},
- "provider": {
+ "id": {
+ "description": "Unique identifier",
"type": "string"
- }
- }
- },
- "handler.SearchMessagesRequest": {
- "type": "object",
- "required": [
- "query"
- ],
- "properties": {
- "limit": {
- "description": "Maximum number of results to return (default: 20)",
- "type": "integer"
},
- "mode": {
- "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "knowledge_base_id": {
+ "description": "Target knowledge base ID",
"type": "string"
},
- "query": {
- "description": "Query text for search",
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "session_ids": {
- "description": "Filter by specific session IDs (optional)",
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "handler.StorageCheckRequest": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/types.COSEngineConfig"
},
- "minio": {
- "$ref": "#/definitions/types.MinIOEngineConfig"
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "oss": {
- "$ref": "#/definitions/types.OSSEngineConfig"
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ }
+ ]
},
- "provider": {
- "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "name": {
+ "description": "User-friendly name",
"type": "string"
},
- "s3": {
- "$ref": "#/definitions/types.S3EngineConfig"
- },
- "tos": {
- "$ref": "#/definitions/types.TOSEngineConfig"
- }
- }
- },
- "handler.StorageCheckResponse": {
- "type": "object",
- "properties": {
- "bucket_created": {
- "type": "boolean"
- },
- "message": {
+ "status": {
+ "description": "Current status: active, paused, error",
"type": "string"
},
- "ok": {
- "type": "boolean"
- }
- }
- },
- "handler.StorageEngineStatusItem": {
- "type": "object",
- "properties": {
- "available": {
- "description": "whether the engine can be used",
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
"type": "boolean"
},
- "description": {
- "description": "short description for UI",
- "type": "string"
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
},
- "name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
"type": "string"
- }
- }
- },
- "handler.TestStoreRequest": {
- "type": "object",
- "required": [
- "connection_config",
- "engine_type"
- ],
- "properties": {
- "connection_config": {
- "$ref": "#/definitions/types.ConnectionConfig"
},
- "engine_type": {
- "$ref": "#/definitions/types.RetrieverEngineType"
- }
- }
- },
- "handler.TextRelationExtractionRequest": {
- "type": "object",
- "required": [
- "model_id",
- "tags",
- "text"
- ],
- "properties": {
- "model_id": {
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "tenant_id": {
+ "description": "Tenant ID for multi-tenancy",
+ "type": "integer"
},
- "text": {
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
}
}
},
- "handler.UpdateAgentRequest": {
+ "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "config": {
- "$ref": "#/definitions/types.CustomAgentConfig"
- },
- "description": {
- "type": "string"
+ "dimension": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "truncate_prompt_tokens": {
+ "type": "integer"
}
}
},
- "handler.UpdateChunkRequest": {
+ "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
- "chunk_index": {
- "type": "integer"
+ "enabled": {
+ "type": "boolean"
},
- "content": {
- "type": "string"
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
},
- "embedding": {
+ "relations": {
"type": "array",
"items": {
- "type": "number"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
}
},
- "end_at": {
- "type": "integer"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "image_info": {
+ "text": {
"type": "string"
- },
- "is_enabled": {
- "type": "boolean"
- },
- "start_at": {
- "type": "integer"
}
}
},
- "handler.UpdateKnowledgeBaseRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
"type": "object",
"required": [
- "name"
+ "entries"
],
"properties": {
- "config": {
- "$ref": "#/definitions/types.KnowledgeBaseConfig"
- },
- "description": {
- "type": "string"
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "name": {
- "type": "string"
- }
- }
- },
- "handler.UpdateModelRequest": {
- "type": "object",
- "properties": {
- "description": {
- "type": "string"
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
},
- "name": {
+ "knowledge_id": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/types.ModelParameters"
- },
- "source": {
- "$ref": "#/definitions/types.ModelSource"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "type": {
- "$ref": "#/definitions/types.ModelType"
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
+ "type": "string"
}
}
},
- "handler.UpdateStoreRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "name": {
- "type": "string"
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ },
+ "question_index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
}
}
},
- "handler.addSimilarQuestionsRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
"type": "object",
- "required": [
- "similar_questions"
- ],
"properties": {
- "similar_questions": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
"type": "array",
- "minItems": 1,
"items": {
- "type": "string"
+ "type": "integer"
}
}
}
},
- "handler.updateLastFAQImportResultDisplayStatusRequest": {
- "type": "object",
- "required": [
- "display_status"
- ],
- "properties": {
- "display_status": {
- "type": "string",
- "enum": [
- "open",
- "close"
- ]
- }
- }
- },
- "handler_session.AttachmentUpload": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
"type": "object",
"properties": {
- "data": {
- "description": "Base64-encoded file content",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "file_name": {
- "description": "Original filename",
- "type": "string"
+ "is_recommended": {
+ "type": "boolean"
},
- "file_size": {
- "description": "File size in bytes",
+ "tag_id": {
"type": "integer"
}
}
},
- "handler_session.CreateKnowledgeQARequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
"type": "object",
"required": [
- "query"
+ "standard_question"
],
"properties": {
- "agent_enabled": {
- "description": "Whether agent mode is enabled for this request",
- "type": "boolean"
- },
- "agent_id": {
- "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
- "type": "string"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "attachment_uploads": {
- "description": "Attached files (documents, audio, etc.)",
+ "answers": {
"type": "array",
"items": {
- "$ref": "#/definitions/handler_session.AttachmentUpload"
+ "type": "string"
}
},
- "channel": {
- "description": "Source channel: \"web\", \"api\", \"im\", etc.",
- "type": "string"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "disable_title": {
- "description": "Whether to disable auto title generation",
+ "is_enabled": {
"type": "boolean"
},
- "enable_memory": {
- "description": "Whether memory feature is enabled for this request",
+ "is_recommended": {
"type": "boolean"
},
- "images": {
- "description": "Attached images for multimodal chat",
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler_session.ImageAttachment"
- }
- },
- "knowledge_base_ids": {
- "description": "Selected knowledge base ID for this request",
+ "negative_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "knowledge_ids": {
- "description": "Selected knowledge ID for this request",
+ "similar_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "description": "@mentioned knowledge bases and files",
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler_session.MentionedItemRequest"
- }
- },
- "query": {
- "description": "Query text for knowledge base search",
- "type": "string"
- },
- "summary_model_id": {
- "description": "Optional summary model ID for this request (overrides session default)",
+ "standard_question": {
"type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this request",
- "type": "boolean"
- }
- }
- },
- "handler_session.CreateSessionRequest": {
- "type": "object",
- "properties": {
- "description": {
- "description": "Description for the session (optional)",
- "type": "string"
+ "tag_id": {
+ "type": "integer"
},
- "title": {
- "description": "Title for the session (optional)",
+ "tag_name": {
"type": "string"
}
}
},
- "handler_session.GenerateTitleRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
"type": "object",
"required": [
- "messages"
+ "query_text"
],
"properties": {
- "messages": {
- "description": "Messages to use as context for title generation",
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
"type": "array",
"items": {
- "$ref": "#/definitions/types.Message"
+ "type": "integer"
}
- }
- }
- },
- "handler_session.ImageAttachment": {
- "type": "object",
- "properties": {
- "caption": {
- "description": "VLM analysis result (context-aware, single call)",
- "type": "string"
},
- "data": {
- "description": "base64 data URI from frontend (data:image/png;base64,...)",
- "type": "string"
+ "match_count": {
+ "type": "integer"
},
- "url": {
- "description": "serving URL after saving to storage",
- "type": "string"
- }
- }
- },
- "handler_session.MentionedItemRequest": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
+ "query_text": {
"type": "string"
},
- "name": {
- "type": "string"
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "handler_session.SearchKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.GraphNode": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "knowledge_base_id": {
- "description": "Single knowledge base ID (for backward compatibility)",
- "type": "string"
- },
- "knowledge_base_ids": {
- "description": "IDs of knowledge bases to search (multi-KB support)",
+ "attributes": {
"type": "array",
"items": {
"type": "string"
}
},
- "knowledge_ids": {
- "description": "IDs of specific knowledge (files) to search",
+ "chunks": {
"type": "array",
"items": {
"type": "string"
}
},
- "query": {
- "description": "Query text to search for",
+ "name": {
"type": "string"
}
}
},
- "handler_session.StopSessionRequest": {
+ "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
"type": "object",
- "required": [
- "message_id"
- ],
"properties": {
- "message_id": {
+ "node1": {
"type": "string"
- }
- }
- },
- "handler_session.batchDeleteRequest": {
- "type": "object",
- "properties": {
- "delete_all": {
- "type": "boolean"
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "node2": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
}
}
},
- "types.ASRConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "language": {
- "description": "optional: language hint for transcription",
- "type": "string"
- },
"model_id": {
+ "description": "Model ID",
"type": "string"
}
}
},
- "types.AgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.IndexConfig": {
"type": "object",
"properties": {
- "allowed_skills": {
- "description": "Skill names whitelist (empty = allow all)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "collection_name": {
+ "description": "Milvus",
+ "type": "string"
},
- "allowed_tools": {
- "description": "List of allowed tool names",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "collection_prefix": {
+ "description": "Qdrant, Weaviate",
+ "type": "string"
},
- "history_turns": {
- "description": "Number of history turns to keep in context",
+ "desired_shard_count": {
+ "description": "Weaviate: number of shards per collection",
"type": "integer"
},
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "index_name": {
+ "description": "--- Existing fields ---",
+ "type": "string"
},
- "llm_call_timeout": {
- "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_context_tokens": {
- "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_iterations": {
- "description": "Maximum number of ReAct iterations",
+ "replica_number": {
+ "description": "Milvus: in-memory replica count (LoadCollection)",
"type": "integer"
},
- "max_tool_output_chars": {
- "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "replication_factor": {
+ "description": "Qdrant, Weaviate: number of replicas",
"type": "integer"
},
- "mcp_selection_mode": {
- "description": "MCP service selection",
- "type": "string"
- },
- "mcp_services": {
- "description": "Selected MCP service IDs (when mode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "multi_turn_enabled": {
- "description": "Whether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "parallel_tool_calls": {
- "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
- "type": "boolean"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
- "type": "boolean"
- },
- "skill_dirs": {
- "description": "Directories to search for skills",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "shard_number": {
+ "description": "--- Scalability fields ---",
+ "type": "integer"
},
- "skills_enabled": {
- "description": "Skills configuration (Progressive Disclosure pattern)",
+ "shards_num": {
+ "description": "Milvus: number of shards per collection (CreateCollection)",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
+ "type": "object",
+ "properties": {
+ "graph_enabled": {
+ "description": "GraphEnabled enables knowledge graph entity/relation extraction",
"type": "boolean"
},
- "system_prompt": {
- "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
- "type": "string"
- },
- "system_prompt_web_disabled": {
- "description": "Deprecated: Custom prompt when web search is disabled",
- "type": "string"
- },
- "system_prompt_web_enabled": {
- "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
- "type": "string"
- },
- "temperature": {
- "description": "LLM temperature for agent",
- "type": "number"
- },
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "keyword_enabled": {
+ "description": "KeywordEnabled enables keyword-based (BM25) search",
"type": "boolean"
},
- "use_custom_system_prompt": {
- "description": "Whether to use custom system prompt instead of default",
+ "vector_enabled": {
+ "description": "VectorEnabled enables semantic vector embedding and search",
"type": "boolean"
},
- "web_search_enabled": {
- "description": "Whether web search tool is enabled",
+ "wiki_enabled": {
+ "description": "WikiEnabled enables automatic wiki page generation from documents",
"type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum number of web search results (default: 5)",
- "type": "integer"
- },
- "web_search_provider_id": {
- "description": "WebSearchProviderEntity ID (resolved from agent config)",
- "type": "string"
}
}
},
- "types.AgentStep": {
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
"type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
"properties": {
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
+ "user_id": {
+ "description": "User ID to invite",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "timestamp": {
- "description": "When this step occurred",
+ "organization_id": {
"type": "string"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.ToolCall"
- }
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
},
- "types.COSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
- "app_id": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
- "bucket_name": {
+ "created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
- "path_prefix": {
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "region": {
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "enable_status": {
+ "description": "Enable status of the knowledge",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "secret_id": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "secret_key": {
- "type": "string"
- }
- }
- },
- "types.ChatHistoryConfig": {
- "type": "object",
- "properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "file_name": {
+ "description": "File name of the knowledge",
"type": "string"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
- },
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "file_path": {
+ "description": "File path of the knowledge",
"type": "string"
- }
- }
- },
- "types.ChunkingConfig": {
- "type": "object",
- "properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
},
- "chunk_overlap": {
- "description": "Chunk overlap",
+ "file_size": {
+ "description": "File size of the knowledge",
"type": "integer"
},
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
+ "file_type": {
+ "description": "File type of the knowledge",
+ "type": "string"
},
- "enable_multimodal": {
- "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
- "type": "boolean"
+ "id": {
+ "description": "Unique identifier of the knowledge",
+ "type": "string"
},
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
+ "type": "string"
},
- "parent_chunk_size": {
- "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
- "type": "integer"
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
+ "type": "string"
},
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
"type": "array",
"items": {
- "$ref": "#/definitions/types.ParserEngineRule"
+ "type": "integer"
}
},
- "separators": {
- "description": "Separators",
+ "metadata": {
+ "description": "Metadata of the knowledge",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "types.ConnectionConfig": {
- "type": "object",
- "properties": {
- "addr": {
- "description": "Common",
+ },
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "api_key": {
- "description": "AES-GCM encrypted",
+ "processed_at": {
+ "description": "Processed time of the knowledge",
"type": "string"
},
- "grpc_address": {
- "description": "Weaviate",
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
"type": "string"
},
- "host": {
- "description": "Qdrant",
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
+ },
+ "summary_status": {
+ "description": "Summary status for async summary generation",
"type": "string"
},
- "password": {
- "description": "AES-GCM encrypted",
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base",
"type": "string"
},
- "port": {
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "scheme": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "use_default_connection": {
- "description": "Postgres",
- "type": "boolean"
- },
- "use_tls": {
- "type": "boolean"
- },
- "username": {
+ "type": {
+ "description": "Type of the knowledge",
"type": "string"
},
- "version": {
- "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
}
}
},
- "types.ContextCompressionStrategy": {
- "type": "string",
- "enum": [
- "sliding_window",
- "smart"
- ],
- "x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
- ]
- },
- "types.ContextConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
"allOf": [
{
- "$ref": "#/definitions/types.ContextCompressionStrategy"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
}
]
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
"type": "integer"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
- "type": "integer"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
- "type": "integer"
- }
- }
- },
- "types.ConversationConfig": {
- "type": "object",
- "properties": {
- "context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
- "embedding_top_k": {
- "type": "integer"
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "enable_query_expansion": {
+ "description": {
+ "description": "Description of the knowledge base",
+ "type": "string"
+ },
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
+ "type": "string"
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ },
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
+ },
+ "is_pinned": {
+ "description": "Whether this knowledge base is pinned to the top of the list",
"type": "boolean"
},
- "enable_rewrite": {
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
"type": "boolean"
},
- "fallback_prompt": {
- "type": "string"
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
},
- "fallback_response": {
- "type": "string"
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
},
- "fallback_strategy": {
- "description": "Fallback strategy",
+ "name": {
+ "description": "Name of the knowledge base",
"type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "pinned_at": {
+ "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "type": "string"
},
- "max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
+ },
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
"type": "integer"
},
- "prompt": {
- "description": "Prompt is the system prompt for normal mode",
- "type": "string"
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
},
- "rerank_model_id": {
+ "summary_model_id": {
+ "description": "Summary model ID",
"type": "string"
},
- "rerank_threshold": {
- "type": "number"
- },
- "rerank_top_k": {
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
"type": "string"
},
- "rewrite_prompt_user": {
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the tenant's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (` + "`" + `\u003c-:create` + "`" + `) plus the service-layer\nKB update path, which omits this field from its update DTO.",
"type": "string"
},
- "temperature": {
- "description": "Temperature controls the randomness of the model output",
- "type": "number"
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
},
- "vector_threshold": {
- "type": "number"
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "types.CreateOrganizationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
- "type": "integer"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "types.CredentialsConfig": {
- "type": "object",
- "properties": {
- "weknoracloud": {
- "$ref": "#/definitions/types.WeKnoraCloudCredentials"
+ "wiki_config": {
+ "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "types.CustomAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
- "type": "string"
- },
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "asr_model_id": {
- "description": "ASR model ID for audio transcription (optional)",
- "type": "string"
- },
- "audio_upload_enabled": {
- "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
- "type": "boolean"
+ "chunk_count": {
+ "type": "integer"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
+ "created_at": {
"type": "string"
},
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
+ "id": {
"type": "string"
},
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
+ "knowledge_base_id": {
"type": "string"
},
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
+ "knowledge_base_name": {
"type": "string"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "knowledge_base_type": {
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
- },
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
- "type": "boolean"
- },
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
+ "knowledge_count": {
"type": "integer"
},
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
- "type": "boolean"
- },
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "llm_call_timeout": {
- "description": "Timeout for a single LLM call in seconds (0 = use global default)",
- "type": "integer"
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens (only for normal mode)",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
- "type": "integer"
- },
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "organization_id": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "organization_name": {
"type": "string"
},
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
- "type": "integer"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "require_approval": {
"type": "boolean"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
+ "shared_by_user_id": {
"type": "string"
},
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
+ "shared_by_username": {
"type": "string"
},
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
}
},
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
- "type": "string"
- },
- "suggested_prompts": {
- "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "organizations": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
}
},
- "supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
}
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
+ "password": {
+ "type": "string",
+ "minLength": 6
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "temperature": {
- "description": "Temperature for LLM (0-1)",
- "type": "number"
+ "refresh_token": {
+ "type": "string"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "success": {
"type": "boolean"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
+ "token": {
"type": "string"
},
- "web_fetch_enabled": {
- "description": "Whether to auto-fetch full page content for reranked web search results",
- "type": "boolean"
- },
- "web_fetch_top_n": {
- "description": "Max number of pages to fetch after rerank (default: 3)",
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "type": "object",
+ "properties": {
+ "retry_count": {
+ "description": "Number of retries, default: 3",
"type": "integer"
},
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum web search results",
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
"type": "integer"
},
- "web_search_provider_id": {
- "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
- "type": "string"
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
}
}
},
- "types.DataSource": {
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
"type": "object",
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
- "type": "array",
- "items": {
- "type": "integer"
+ "api_key": {
+ "type": "string"
+ },
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ "token": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
+ },
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
},
"created_at": {
- "description": "Creation timestamp",
"type": "string"
},
"deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "error_message": {
- "description": "Error message if status is \"error\"",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier",
- "type": "string"
- },
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
- "type": "string"
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
+ "description": {
"type": "string"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "last_sync_result": {
- "description": "Summary of last sync result",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "enabled": {
+ "type": "boolean"
},
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
}
]
},
- "name": {
- "description": "User-friendly name",
- "type": "string"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "status": {
- "description": "Current status: active, paused, error",
+ "id": {
"type": "string"
},
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all tenants)",
"type": "boolean"
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
- "type": "integer"
- },
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "name": {
"type": "string"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
- "type": "string"
+ "stdio_config": {
+ "description": "Required for stdio transport",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ }
+ ]
},
"tenant_id": {
- "description": "Tenant ID for multi-tenancy",
- "type": "integer"
- },
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
"type": "integer"
},
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
- "type": "string"
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
},
"updated_at": {
- "description": "Last update timestamp",
"type": "string"
- }
- }
- },
- "types.EmbeddingParameters": {
- "type": "object",
- "properties": {
- "dimension": {
- "type": "integer"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
}
}
},
- "types.ExtractConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphRelation"
- }
- },
- "tags": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
"type": "string"
}
},
- "text": {
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
"type": "string"
}
}
},
- "types.FAQBatchUpsertPayload": {
- "type": "object",
- "required": [
- "entries"
+ "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
+ "type": "string",
+ "enum": [
+ "sse",
+ "http-streamable",
+ "stdio"
+ ],
+ "x-enum-comments": {
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ },
+ "x-enum-descriptions": [
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
],
+ "x-enum-varnames": [
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
+ "type": "object",
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
+ "channel": {
+ "type": "string"
},
- "entries": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.FAQEntryPayload"
- }
+ "content": {
+ "type": "string"
},
- "knowledge_id": {
+ "status": {
"type": "string"
},
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "tag_id": {
+ "type": "string"
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
+ "title": {
"type": "string"
}
}
},
- "types.FAQConfig": {
- "type": "object",
- "properties": {
- "index_mode": {
- "$ref": "#/definitions/types.FAQIndexMode"
- },
- "question_index_mode": {
- "$ref": "#/definitions/types.FAQQuestionIndexMode"
- }
- }
+ "github_com_Tencent_WeKnora_internal_types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "直接加载匹配类型",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "直接加载匹配类型",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
},
- "types.FAQEntryFieldsBatchUpdate": {
+ "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
"type": "object",
"properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
- }
- },
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
- }
+ "id": {
+ "type": "string"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "types.FAQEntryFieldsUpdate": {
- "type": "object",
- "properties": {
- "is_enabled": {
- "type": "boolean"
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
},
- "is_recommended": {
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "tag_id": {
- "type": "integer"
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
+ "type": "string"
}
}
},
- "types.FAQEntryPayload": {
+ "github_com_Tencent_WeKnora_internal_types.Message": {
"type": "object",
- "required": [
- "standard_question"
- ],
"properties": {
- "answer_strategy": {
- "$ref": "#/definitions/types.AnswerStrategy"
- },
- "answers": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
"type": "integer"
},
- "is_enabled": {
- "type": "boolean"
- },
- "is_recommended": {
- "type": "boolean"
- },
- "negative_questions": {
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
}
},
- "similar_questions": {
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
}
},
- "standard_question": {
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
"type": "string"
},
- "tag_id": {
- "type": "integer"
+ "content": {
+ "description": "Message text content",
+ "type": "string"
},
- "tag_name": {
+ "created_at": {
+ "description": "Message creation timestamp",
"type": "string"
- }
- }
- },
- "types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
+ "type": "string"
+ },
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
}
},
- "match_count": {
- "type": "integer"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "query_text": {
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "vector_threshold": {
- "type": "number"
- }
- }
- },
- "types.GraphNode": {
- "type": "object",
- "properties": {
- "attributes": {
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
}
},
- "chunks": {
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
}
},
- "name": {
- "type": "string"
- }
- }
- },
- "types.GraphRelation": {
- "type": "object",
- "properties": {
- "node1": {
- "type": "string"
- },
- "node2": {
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
"type": "string"
},
- "type": {
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
"type": "string"
- }
- }
- },
- "types.ImageProcessingConfig": {
- "type": "object",
- "properties": {
- "model_id": {
- "description": "Model ID",
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
}
}
},
- "types.IndexConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
"type": "object",
"properties": {
- "collection_name": {
- "description": "Milvus",
+ "content": {
+ "description": "Extracted text content (for small text files)",
"type": "string"
},
- "collection_prefix": {
- "description": "Qdrant",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "index_name": {
- "description": "ES, OpenSearch",
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
- "number_of_replicas": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
},
- "number_of_shards": {
- "description": "ES, OpenSearch",
+ "line_count": {
+ "description": "Total line count (for text files)",
"type": "integer"
+ },
+ "url": {
+ "description": "Storage URL (provider://path)",
+ "type": "string"
}
}
},
- "types.InviteMemberRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MessageImage": {
"type": "object",
- "required": [
- "role",
- "user_id"
- ],
"properties": {
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
+ "caption": {
+ "type": "string"
},
- "user_id": {
- "description": "User ID to invite",
+ "url": {
"type": "string"
}
}
},
- "types.JoinByOrganizationIDRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
"type": "object",
- "required": [
- "organization_id"
- ],
"properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
+ "access_key_id": {
+ "type": "string"
},
- "organization_id": {
+ "bucket_name": {
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "endpoint": {
+ "type": "string"
+ },
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "secret_access_key": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
}
}
},
- "types.Knowledge": {
+ "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
"type": "object",
"properties": {
- "channel": {
- "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
+ "api_key": {
"type": "string"
},
- "created_at": {
- "description": "Creation time of the knowledge",
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge",
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "base_url": {
"type": "string"
},
- "enable_status": {
- "description": "Enable status of the knowledge",
+ "custom_headers": {
+ "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
+ },
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "interface_type": {
"type": "string"
},
- "error_message": {
- "description": "Error message of the knowledge",
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
"type": "string"
},
- "file_hash": {
- "description": "File hash of the knowledge",
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
"type": "string"
},
- "file_name": {
- "description": "File name of the knowledge",
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
+ "type": "object",
+ "properties": {
+ "authorization_url": {
"type": "string"
},
- "file_path": {
- "description": "File path of the knowledge",
+ "provider_display_name": {
"type": "string"
},
- "file_size": {
- "description": "File size of the knowledge",
- "type": "integer"
- },
- "file_type": {
- "description": "File type of the knowledge",
+ "state": {
"type": "string"
},
- "id": {
- "description": "Unique identifier of the knowledge",
- "type": "string"
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "ID of the knowledge base",
+ "provider_display_name": {
"type": "string"
},
- "knowledge_base_name": {
- "description": "Knowledge base name (not stored in database, populated on query)",
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
"type": "string"
},
- "last_faq_import_result": {
- "description": "Last FAQ import result (for FAQ type knowledge only)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "metadata": {
- "description": "Metadata of the knowledge",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "parse_status": {
- "description": "Parse status of the knowledge",
+ "bucket_name": {
"type": "string"
},
- "processed_at": {
- "description": "Processed time of the knowledge",
+ "endpoint": {
"type": "string"
},
- "source": {
- "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "path_prefix": {
"type": "string"
},
- "storage_size": {
- "description": "Storage size of the knowledge",
- "type": "integer"
- },
- "summary_status": {
- "description": "Summary status for async summary generation",
+ "region": {
"type": "string"
},
- "tag_id": {
- "description": "Optional tag ID for categorization within a knowledge base",
+ "secret_key": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "title": {
- "description": "Title of the knowledge",
+ "temp_bucket_name": {
"type": "string"
},
- "type": {
- "description": "Type of the knowledge",
+ "temp_region": {
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge",
- "type": "string"
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "types.KnowledgeBase": {
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "asr_config": {
- "description": "ASR config (Automatic Speech Recognition)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ASRConfig"
- }
- ]
- },
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge base",
+ "avatar": {
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "email": {
"type": "string"
},
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/types.ExtractConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/types.FAQConfig"
- }
- ]
- },
"id": {
- "description": "Unique identifier of the knowledge base",
- "type": "string"
- },
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ImageProcessingConfig"
- }
- ]
- },
- "is_pinned": {
- "description": "Whether this knowledge base is pinned to the top of the list",
- "type": "boolean"
- },
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
- "type": "boolean"
- },
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
- "type": "boolean"
- },
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "name": {
- "description": "Name of the knowledge base",
"type": "string"
},
- "pinned_at": {
- "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "joined_at": {
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
- },
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/types.QuestionGenerationConfig"
- }
- ]
- },
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
- "type": "integer"
- },
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageConfig"
- }
- ]
- },
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageProviderConfig"
- }
- ]
- },
- "summary_model_id": {
- "description": "Summary model ID",
+ "role": {
"type": "string"
},
"tenant_id": {
- "description": "Tenant ID",
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
- "type": "string"
- },
- "updated_at": {
- "description": "Last updated time of the knowledge base",
- "type": "string"
- },
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/types.VLMConfig"
- }
- ]
- }
- }
- },
- "types.KnowledgeBaseConfig": {
- "type": "object",
- "properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChunkingConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/types.FAQConfig"
- }
- ]
- },
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ImageProcessingConfig"
- }
- ]
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
}
}
},
- "types.KnowledgeBaseShareResponse": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
"type": "object",
"properties": {
- "chunk_count": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
"type": "integer"
},
+ "avatar": {
+ "type": "string"
+ },
"created_at": {
"type": "string"
},
- "id": {
+ "description": {
"type": "string"
},
- "knowledge_base_id": {
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "knowledge_base_name": {
+ "invite_code": {
"type": "string"
},
- "knowledge_base_type": {
+ "invite_code_expires_at": {
"type": "string"
},
- "knowledge_count": {
+ "invite_code_validity_days": {
"type": "integer"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
- "type": "string"
+ "is_owner": {
+ "type": "boolean"
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
- "type": "string"
+ "member_count": {
+ "type": "integer"
},
- "organization_id": {
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
"type": "string"
},
- "organization_name": {
+ "name": {
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
+ "owner_id": {
"type": "string"
},
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
"require_approval": {
"type": "boolean"
},
- "shared_by_user_id": {
- "type": "string"
- },
- "shared_by_username": {
- "type": "string"
+ "searchable": {
+ "type": "boolean"
},
- "source_tenant_id": {
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
"type": "integer"
- }
- }
- },
- "types.ListMembersResponse": {
- "type": "object",
- "properties": {
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.OrganizationMemberResponse"
- }
},
- "total": {
- "type": "integer"
+ "updated_at": {
+ "type": "string"
}
}
},
- "types.ListOrganizationsResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
"type": "object",
"properties": {
- "organizations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.OrganizationResponse"
- }
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
+ "type": "string"
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
- "allOf": [
- {
- "$ref": "#/definitions/types.ResourceCountsByOrgResponse"
- }
- ]
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "total": {
- "type": "integer"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
+ },
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_cloud_language": {
+ "type": "string"
+ },
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
+ "type": "string"
+ },
+ "mineru_enable_formula": {
+ "type": "boolean"
+ },
+ "mineru_enable_ocr": {
+ "type": "boolean"
+ },
+ "mineru_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
+ "type": "string"
+ },
+ "mineru_language": {
+ "type": "string"
+ },
+ "mineru_model": {
+ "description": "MinerU 自建解析参数",
+ "type": "string"
}
}
},
- "types.ListSharesResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
"type": "object",
"properties": {
- "shares": {
+ "engine": {
+ "type": "string"
+ },
+ "file_types": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.KnowledgeBaseShareResponse"
+ "type": "string"
}
- },
- "total": {
- "type": "integer"
}
}
},
- "types.LocalEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
- "path_prefix": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
+ },
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "type": "integer"
}
}
},
- "types.LoginRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
"email",
- "password"
+ "password",
+ "username"
],
"properties": {
"email": {
@@ -11449,1894 +12382,2150 @@ const docTemplate = `{
"password": {
"type": "string",
"minLength": 6
+ },
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
}
}
},
- "types.LoginResponse": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
- "refresh_token": {
- "type": "string"
- },
"success": {
"type": "boolean"
},
"tenant": {
- "$ref": "#/definitions/types.Tenant"
- },
- "token": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
},
"user": {
- "$ref": "#/definitions/types.User"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "types.MCPAdvancedConfig": {
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
"type": "object",
+ "required": [
+ "requested_role"
+ ],
"properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
- },
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
- "type": "integer"
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.MCPAuthConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Resource": {
"type": "object",
"properties": {
- "api_key": {
+ "description": {
+ "description": "Optional description",
"type": "string"
},
- "custom_headers": {
+ "external_id": {
+ "description": "Unique identifier in the external system",
+ "type": "string"
+ },
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
"type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "additionalProperties": true
},
- "token": {
+ "modified_at": {
+ "description": "Last modified time in external system",
+ "type": "string"
+ },
+ "name": {
+ "description": "Display name",
+ "type": "string"
+ },
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
+ "type": "string"
+ },
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
+ "type": "string"
+ },
+ "url": {
+ "description": "URL to access in external system",
"type": "string"
}
}
},
- "types.MCPEnvVars": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "types.MCPHeaders": {
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
},
- "types.MCPService": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
"type": "object",
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/types.MCPAdvancedConfig"
- },
- "auth_config": {
- "$ref": "#/definitions/types.MCPAuthConfig"
- },
- "created_at": {
- "type": "string"
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
},
- "description": {
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
"type": "string"
},
- "enabled": {
- "type": "boolean"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
},
- "env_vars": {
- "description": "Environment variables for stdio",
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
+ },
+ "vector_threshold": {
+ "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
+ "type": "object",
+ "properties": {
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
"allOf": [
{
- "$ref": "#/definitions/types.MCPEnvVars"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
}
]
},
- "headers": {
- "$ref": "#/definitions/types.MCPHeaders"
- },
- "id": {
- "type": "string"
- },
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all tenants)",
- "type": "boolean"
- },
- "name": {
- "type": "string"
- },
- "stdio_config": {
- "description": "Required for stdio transport",
+ "retriever_type": {
+ "description": "Retriever type",
"allOf": [
{
- "$ref": "#/definitions/types.MCPStdioConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
}
]
- },
- "tenant_id": {
- "type": "integer"
- },
- "transport_type": {
- "$ref": "#/definitions/types.MCPTransportType"
- },
- "updated_at": {
- "type": "string"
- },
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
- "type": "string"
}
}
},
- "types.MCPStdioConfig": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "sqlite"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "SQLiteRetrieverEngineType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "engines": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
}
- },
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
- "type": "string"
}
}
},
- "types.MCPTransportType": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
"type": "string",
"enum": [
- "sse",
- "http-streamable",
- "stdio"
+ "keywords",
+ "vector",
+ "websearch"
],
"x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
},
"x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
"x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
]
},
- "types.ManualKnowledgePayload": {
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
"type": "object",
"properties": {
- "channel": {
- "type": "string"
- },
- "content": {
- "type": "string"
- },
- "status": {
- "type": "string"
+ "approved": {
+ "type": "boolean"
},
- "tag_id": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "title": {
- "type": "string"
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "直接加载匹配类型",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "直接加载匹配类型",
- "数据分析匹配类型"
- ],
- "x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
- ]
- },
- "types.MentionedItem": {
+ "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
"type": "object",
"properties": {
- "id": {
+ "access_key": {
"type": "string"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
+ "bucket_name": {
"type": "string"
},
- "name": {
+ "endpoint": {
"type": "string"
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
"type": "string"
}
}
},
- "types.Message": {
+ "github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
- "type": "integer"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.AgentStep"
- }
+ "disable_vector_match": {
+ "type": "boolean"
},
- "attachments": {
- "description": "Attached files (documents, audio, etc., for user messages)",
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
- "$ref": "#/definitions/types.MessageAttachment"
+ "type": "string"
}
},
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
- },
- "content": {
- "description": "Message text content",
- "type": "string"
- },
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
- },
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "id": {
- "description": "Unique identifier for the message",
- "type": "string"
- },
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
+ "knowledge_ids": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.MessageImage"
+ "type": "string"
}
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
- },
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
- "type": "boolean"
- },
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
- "type": "string"
+ "match_count": {
+ "type": "integer"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.SearchResult"
- }
+ "only_recommended": {
+ "type": "boolean"
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "query_embedding": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.MentionedItem"
+ "type": "number"
}
},
- "request_id": {
- "description": "Request identifier for tracking API requests",
+ "query_text": {
"type": "string"
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
- "type": "string"
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
+ "type": "boolean"
},
- "session_id": {
- "description": "ID of the session this message belongs to",
- "type": "string"
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "types.MessageAttachment": {
+ "github_com_Tencent_WeKnora_internal_types.SearchResult": {
"type": "object",
"properties": {
- "content": {
- "description": "Extracted text content (for small text files)",
- "type": "string"
- },
- "file_name": {
- "description": "Original filename",
- "type": "string"
- },
- "file_size": {
- "description": "File size in bytes",
+ "chunk_index": {
+ "description": "Chunk index",
"type": "integer"
},
- "file_type": {
- "description": "File extension (e.g., \".pdf\", \".docx\")",
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "is_truncated": {
- "description": "Whether content was truncated",
- "type": "boolean"
+ "content": {
+ "description": "Content",
+ "type": "string"
},
- "line_count": {
- "description": "Total line count (for text files)",
+ "end_at": {
+ "description": "End at",
"type": "integer"
},
- "url": {
- "description": "Storage URL (provider://path)",
- "type": "string"
- }
- }
- },
- "types.MessageImage": {
- "type": "object",
- "properties": {
- "caption": {
+ "id": {
+ "description": "ID",
"type": "string"
},
- "url": {
- "type": "string"
- }
- }
- },
- "types.MinIOEngineConfig": {
- "type": "object",
- "properties": {
- "access_key_id": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
},
- "bucket_name": {
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "endpoint": {
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
"type": "string"
},
- "mode": {
- "description": "\"docker\" or \"remote\"",
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "path_prefix": {
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
"type": "string"
},
- "secret_access_key": {
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "types.ModelParameters": {
- "type": "object",
- "properties": {
- "api_key": {
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
"type": "string"
},
- "app_id": {
- "description": "WeKnoraCloud 厂商专用凭证",
+ "knowledge_title": {
+ "description": "Knowledge title",
"type": "string"
},
- "app_secret": {
- "description": "AES-256 加密存储,实际承载上游 API Key",
- "type": "string"
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ }
+ ]
},
- "base_url": {
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
"type": "string"
},
- "embedding_parameters": {
- "$ref": "#/definitions/types.EmbeddingParameters"
- },
- "extra_config": {
- "description": "Provider-specific configuration",
+ "metadata": {
+ "description": "Metadata",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "interface_type": {
- "type": "string"
- },
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
- "type": "string"
- },
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
- "type": "string"
- },
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
- }
- }
- },
- "types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "nvidia",
- "novita",
- "azure_openai"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceAzureOpenAI": "Azure OpenAI model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "NVIDIA model",
- "Novita AI model",
- "Azure OpenAI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceNvidia",
- "ModelSourceNovita",
- "ModelSourceAzureOpenAI"
- ]
- },
- "types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM",
- "ASR"
- ],
- "x-enum-comments": {
- "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model",
- "ASR (Automatic Speech Recognition) model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM",
- "ModelTypeASR"
- ]
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
+ },
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
},
- "types.OIDCAuthURLResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Session": {
"type": "object",
"properties": {
- "authorization_url": {
+ "created_at": {
"type": "string"
},
- "provider_display_name": {
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
"type": "string"
},
- "state": {
+ "id": {
+ "description": "ID",
"type": "string"
},
- "success": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "types.OIDCConfigResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
"type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "provider_display_name": {
+ "organization_id": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
- "types.OSSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
"type": "object",
"properties": {
- "access_key": {
+ "app_id": {
"type": "string"
},
"bucket_name": {
"type": "string"
},
- "endpoint": {
+ "path_prefix": {
"type": "string"
},
- "path_prefix": {
+ "provider": {
"type": "string"
},
"region": {
"type": "string"
},
- "secret_key": {
+ "secret_id": {
"type": "string"
},
- "temp_bucket_name": {
+ "secret_key": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
- "temp_region": {
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
+ "local": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ },
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ },
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ },
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
}
}
},
- "types.OrgMemberRole": {
- "type": "string",
- "enum": [
- "admin",
- "editor",
- "viewer"
+ "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "type": "object",
+ "properties": {
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
],
- "x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
- ]
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
},
- "types.OrganizationMemberResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SyncLog": {
"type": "object",
"properties": {
- "avatar": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
"type": "string"
},
- "email": {
+ "data_source_id": {
+ "description": "Reference to the data source",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
+ "type": "string"
+ },
+ "finished_at": {
+ "description": "Sync completion time",
"type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
- "joined_at": {
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
+ "type": "integer"
+ },
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
+ },
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "started_at": {
+ "description": "Sync start time",
"type": "string"
},
- "role": {
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
"type": "string"
},
"tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "user_id": {
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
"type": "string"
},
- "username": {
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
"type": "string"
}
}
},
- "types.OrganizationResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Tenant": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
- "type": "integer"
+ "agent_config": {
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
+ }
+ ]
},
- "avatar": {
+ "api_key": {
+ "description": "API key",
"type": "string"
},
+ "business": {
+ "description": "Business",
+ "type": "string"
+ },
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
+ }
+ ]
+ },
+ "context_config": {
+ "description": "Global Context configuration for this tenant (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ }
+ ]
+ },
+ "conversation_config": {
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
+ }
+ ]
+ },
"created_at": {
+ "description": "Creation time",
"type": "string"
},
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ }
+ ]
+ },
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
- },
"id": {
- "type": "string"
- },
- "invite_code": {
- "type": "string"
- },
- "invite_code_expires_at": {
- "type": "string"
- },
- "invite_code_validity_days": {
+ "description": "ID",
"type": "integer"
},
- "is_owner": {
- "type": "boolean"
+ "name": {
+ "description": "Name",
+ "type": "string"
},
- "member_count": {
- "type": "integer"
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ }
+ ]
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ }
+ ]
},
- "my_role": {
- "type": "string"
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ }
+ ]
},
- "name": {
+ "status": {
+ "description": "Status",
"type": "string"
},
- "owner_id": {
- "type": "string"
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ }
+ ]
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
"type": "integer"
},
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "type": "boolean"
- },
- "share_count": {
- "description": "共享到该组织的知识库数量",
+ "storage_used": {
+ "description": "Storage used (Bytes)",
"type": "integer"
},
"updated_at": {
+ "description": "Last updated time",
"type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this tenant",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ ]
}
}
},
- "types.ParserEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ToolCall": {
"type": "object",
"properties": {
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
- "type": "string"
- },
- "mineru_cloud_enable_formula": {
- "type": "boolean"
- },
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
- },
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
},
- "mineru_cloud_language": {
- "type": "string"
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "id": {
+ "description": "Function call ID from LLM",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
- },
- "mineru_enable_ocr": {
- "type": "boolean"
- },
- "mineru_enable_table": {
- "type": "boolean"
- },
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
+ "name": {
+ "description": "Tool name",
"type": "string"
},
- "mineru_language": {
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
"type": "string"
},
- "mineru_model": {
- "description": "MinerU 自建解析参数",
- "type": "string"
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ }
+ ]
}
}
},
- "types.ParserEngineRule": {
+ "github_com_Tencent_WeKnora_internal_types.ToolResult": {
"type": "object",
"properties": {
- "engine": {
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "error": {
+ "description": "Error message if execution failed",
"type": "string"
},
- "file_types": {
+ "images": {
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "output": {
+ "description": "Human-readable output",
+ "type": "string"
+ },
+ "success": {
+ "description": "Whether the tool executed successfully",
+ "type": "boolean"
}
}
},
- "types.QuestionGenerationConfig": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
"type": "object",
+ "required": [
+ "role"
+ ],
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
- "type": "integer"
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
- "types.RegisterRequest": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
"type": "object",
- "required": [
- "email",
- "password",
- "username"
- ],
"properties": {
- "email": {
- "type": "string"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "password": {
+ "description": {
"type": "string",
- "minLength": 6
+ "maxLength": 1000
},
- "username": {
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
"type": "string",
- "maxLength": 50,
- "minLength": 2
- }
- }
- },
- "types.RegisterResponse": {
- "type": "object",
- "properties": {
- "message": {
- "type": "string"
+ "maxLength": 255,
+ "minLength": 1
},
- "success": {
+ "require_approval": {
"type": "boolean"
},
- "tenant": {
- "$ref": "#/definitions/types.Tenant"
- },
- "user": {
- "$ref": "#/definitions/types.User"
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
}
}
},
- "types.RequestRoleUpgradeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
"type": "object",
"required": [
- "requested_role"
+ "permission"
],
"properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.User": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "Avatar URL of the user",
+ "type": "string"
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all tenants (cross-tenant access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the user",
+ "type": "string"
+ },
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
+ },
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
"allOf": [
{
- "$ref": "#/definitions/types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
}
]
+ },
+ "tenant_id": {
+ "description": "Tenant ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
+ "type": "string"
+ },
+ "username": {
+ "description": "Username of the user",
+ "type": "string"
}
}
},
- "types.Resource": {
+ "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
+ "api_key": {
+ "description": "API Key",
"type": "string"
},
- "external_id": {
- "description": "Unique identifier in the external system",
+ "base_url": {
+ "description": "Base URL",
"type": "string"
},
- "has_children": {
- "description": "Whether this resource has children that can be expanded",
+ "enabled": {
"type": "boolean"
},
- "metadata": {
- "description": "Additional metadata",
- "type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
- "type": "string"
- },
- "name": {
- "description": "Display name",
- "type": "string"
- },
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
"type": "string"
},
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
+ "model_id": {
"type": "string"
},
- "url": {
- "description": "URL to access in external system",
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
"type": "string"
}
}
},
- "types.ResourceCountsByOrgResponse": {
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
"type": "object",
"properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "app_id": {
+ "type": "string"
},
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "app_secret": {
+ "type": "string"
}
}
},
- "types.RetrievalConfig": {
+ "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "blacklist": {
+ "description": "黑名单规则列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
"type": "integer"
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "max_results": {
+ "description": "最大搜索结果数",
"type": "integer"
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "proxy_url": {
+ "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
}
}
},
- "types.RetrieverEngineParams": {
+ "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "extraction_granularity": {
+ "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
"allOf": [
{
- "$ref": "#/definitions/types.RetrieverEngineType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrieverType"
- }
- ]
+ "max_pages_per_ingest": {
+ "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "type": "integer"
+ },
+ "synthesis_model_id": {
+ "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "type": "string"
}
}
},
- "types.RetrieverEngineType": {
+ "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
"type": "string",
"enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "sqlite"
+ "focused",
+ "standard",
+ "exhaustive"
],
"x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
+ "WikiExtractionFocused",
+ "WikiExtractionStandard",
+ "WikiExtractionExhaustive"
]
},
- "types.RetrieverEngines": {
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
"type": "object",
"properties": {
- "engines": {
+ "edges": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
+ }
+ },
+ "nodes": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.RetrieverEngineParams"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
}
}
}
},
- "types.RetrieverType": {
- "type": "string",
- "enum": [
- "keywords",
- "vector",
- "websearch"
- ],
- "x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
- },
- "x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
- ],
- "x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
- ]
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "description": "source slug",
+ "type": "string"
+ },
+ "target": {
+ "description": "target slug",
+ "type": "string"
+ }
+ }
},
- "types.ReviewJoinRequestRequest": {
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
"type": "object",
"properties": {
- "approved": {
- "type": "boolean"
+ "link_count": {
+ "description": "Number of inbound + outbound links",
+ "type": "integer"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPage": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, log, synthesis, comparison",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on ` + "`" + `|` + "`" + `\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID for multi-tenant isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
}
}
},
- "types.S3EngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
"type": "object",
"properties": {
- "access_key": {
+ "created_at": {
"type": "string"
},
- "bucket_name": {
- "type": "string"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "endpoint": {
+ "description": {
"type": "string"
},
- "path_prefix": {
+ "id": {
"type": "string"
},
- "region": {
+ "issue_type": {
"type": "string"
},
- "secret_key": {
+ "knowledge_base_id": {
"type": "string"
- }
- }
- },
- "types.SearchParams": {
- "type": "object",
- "properties": {
- "disable_keywords_match": {
- "type": "boolean"
},
- "disable_vector_match": {
- "type": "boolean"
+ "reported_by": {
+ "type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "slug": {
+ "type": "string"
},
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "status": {
+ "type": "string"
},
- "knowledge_ids": {
+ "suspected_knowledge_ids": {
"type": "array",
"items": {
"type": "string"
}
},
- "match_count": {
+ "tenant_id": {
"type": "integer"
},
- "only_recommended": {
- "type": "boolean"
- },
- "query_embedding": {
- "type": "array",
- "items": {
- "type": "number"
- }
- },
- "query_text": {
+ "updated_at": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
+ "type": "object",
+ "properties": {
+ "page": {
+ "type": "integer"
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
- "type": "boolean"
+ "page_size": {
+ "type": "integer"
},
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "pages": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
- "vector_threshold": {
- "type": "number"
+ "total": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
}
}
},
- "types.SearchResult": {
+ "github_com_Tencent_WeKnora_internal_types.WikiStats": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
+ "is_active": {
+ "description": "whether wiki ingestion is currently running",
+ "type": "boolean"
+ },
+ "orphan_count": {
+ "description": "pages with no inbound links",
"type": "integer"
},
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
- "type": "array",
- "items": {
- "type": "integer"
+ "pages_by_type": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
}
},
- "chunk_type": {
- "description": "Chunk 类型",
- "type": "string"
+ "pending_issues": {
+ "description": "number of pending wiki issues",
+ "type": "integer"
},
- "content": {
- "description": "Content",
- "type": "string"
+ "pending_tasks": {
+ "description": "number of documents waiting to be ingested",
+ "type": "integer"
},
- "end_at": {
- "description": "End at",
+ "recent_updates": {
+ "description": "last N updated pages",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total_links": {
"type": "integer"
},
- "id": {
- "description": "ID",
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
"type": "string"
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "target_id": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "task_id": {
"type": "string"
- },
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
"type": "string"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
- "type": "string"
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "description": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "name": {
"type": "string"
- },
- "knowledge_title": {
- "description": "Knowledge title",
+ }
+ }
+ },
+ "internal_handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
"type": "string"
},
- "match_type": {
- "description": "Match type",
- "allOf": [
- {
- "$ref": "#/definitions/types.MatchType"
- }
- ]
- },
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "name": {
"type": "string"
},
- "metadata": {
- "description": "Metadata",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
- "type": "string"
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
},
- "score": {
- "description": "Score",
- "type": "number"
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ }
+ },
+ "internal_handler.CreateStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
},
- "seq": {
- "description": "Seq",
- "type": "integer"
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
},
- "start_at": {
- "description": "Start at",
- "type": "integer"
+ "index_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
},
- "sub_chunk_id": {
- "description": "SubChunkIndex",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
}
}
},
- "types.Session": {
+ "internal_handler.EvaluationRequest": {
"type": "object",
"properties": {
- "created_at": {
- "type": "string"
- },
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "chat_id": {
+ "description": "ID of chat model to use",
"type": "string"
},
- "id": {
- "description": "ID",
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "title": {
- "description": "Title",
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
"type": "string"
},
- "updated_at": {
+ "rerank_id": {
+ "description": "ID of rerank model to use",
"type": "string"
}
}
},
- "types.ShareKnowledgeBaseRequest": {
+ "internal_handler.FabriTextRequest": {
"type": "object",
"required": [
- "organization_id",
- "permission"
+ "model_id"
],
"properties": {
- "organization_id": {
+ "model_id": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "types.StorageConfig": {
+ "internal_handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ }
},
- "bucket_name": {
+ "minio_env_available": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.GetSystemInfoResponse": {
+ "type": "object",
+ "properties": {
+ "build_time": {
"type": "string"
},
- "path_prefix": {
+ "commit_id": {
"type": "string"
},
- "provider": {
+ "db_version": {
"type": "string"
},
- "region": {
+ "edition": {
"type": "string"
},
- "secret_id": {
+ "go_version": {
"type": "string"
},
- "secret_key": {
+ "graph_database_engine": {
"type": "string"
- }
- }
- },
- "types.StorageEngineConfig": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/types.COSEngineConfig"
},
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "keyword_index_engine": {
"type": "string"
},
- "local": {
- "$ref": "#/definitions/types.LocalEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/types.MinIOEngineConfig"
- },
- "oss": {
- "$ref": "#/definitions/types.OSSEngineConfig"
+ "minio_enabled": {
+ "type": "boolean"
},
- "s3": {
- "$ref": "#/definitions/types.S3EngineConfig"
+ "vector_store_engine": {
+ "type": "string"
},
- "tos": {
- "$ref": "#/definitions/types.TOSEngineConfig"
- }
- }
- },
- "types.StorageProviderConfig": {
- "type": "object",
- "properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "version": {
"type": "string"
}
}
},
- "types.SubmitJoinRequestRequest": {
+ "internal_handler.KBModelConfigRequest": {
"type": "object",
"required": [
- "invite_code"
+ "llmModelId"
],
"properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "embeddingModelId": {
+ "description": "optional when RAG indexing is disabled",
+ "type": "string"
+ },
+ "llmModelId": {
+ "type": "string"
+ },
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
}
- ]
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
+ },
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "type": "string"
+ },
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
}
}
},
- "types.SyncLog": {
+ "internal_handler.RemoteModelCheckRequest": {
"type": "object",
+ "required": [
+ "modelName"
+ ],
"properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "apiKey": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "baseUrl": {
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
- "type": "string"
+ "customHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "finished_at": {
- "description": "Sync completion time",
- "type": "string"
+ "dimension": {
+ "type": "integer"
},
- "id": {
- "description": "Unique identifier",
- "type": "string"
+ "extraConfig": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
+ "interfaceType": {
+ "type": "string"
},
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "modelName": {
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
- "type": "integer"
+ "provider": {
+ "type": "string"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
+ "source": {
+ "description": "为空时按需默认为 \"remote\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.SearchMessagesRequest": {
+ "type": "object",
+ "required": [
+ "query"
+ ],
+ "properties": {
+ "limit": {
+ "description": "Maximum number of results to return (default: 20)",
"type": "integer"
},
- "items_total": {
- "description": "Total items fetched from source",
- "type": "integer"
+ "mode": {
+ "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "type": "string"
},
- "items_updated": {
- "description": "Existing items updated",
- "type": "integer"
+ "query": {
+ "description": "Query text for search",
+ "type": "string"
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
+ "session_ids": {
+ "description": "Filter by specific session IDs (optional)",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
+ }
+ }
+ },
+ "internal_handler.StorageCheckRequest": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
- "started_at": {
- "description": "Sync start time",
- "type": "string"
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "provider": {
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
},
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
}
}
},
- "types.TOSEngineConfig": {
+ "internal_handler.StorageCheckResponse": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
+ "bucket_created": {
+ "type": "boolean"
},
- "endpoint": {
+ "message": {
"type": "string"
},
- "path_prefix": {
- "type": "string"
+ "ok": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.StorageEngineStatusItem": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "description": "whether the engine can be used",
+ "type": "boolean"
},
- "region": {
+ "description": {
+ "description": "short description for UI",
"type": "string"
},
- "secret_key": {
+ "name": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\"",
"type": "string"
}
}
},
- "types.Tenant": {
+ "internal_handler.TestStoreRequest": {
"type": "object",
+ "required": [
+ "connection_config",
+ "engine_type"
+ ],
"properties": {
- "agent_config": {
- "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/types.AgentConfig"
- }
- ]
- },
- "api_key": {
- "description": "API key",
- "type": "string"
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
},
- "business": {
- "description": "Business",
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ }
+ },
+ "internal_handler.TextRelationExtractionRequest": {
+ "type": "object",
+ "required": [
+ "model_id",
+ "tags",
+ "text"
+ ],
+ "properties": {
+ "model_id": {
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this tenant (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ContextConfig"
- }
- ]
- },
- "conversation_config": {
- "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/types.ConversationConfig"
- }
- ]
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "created_at": {
- "description": "Creation time",
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
"type": "string"
},
- "credentials": {
- "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
- "allOf": [
- {
- "$ref": "#/definitions/types.CredentialsConfig"
- }
- ]
- },
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
},
"description": {
- "description": "Description",
"type": "string"
},
- "id": {
- "description": "ID",
- "type": "integer"
- },
"name": {
- "description": "Name",
"type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateChunkRequest": {
+ "type": "object",
+ "properties": {
+ "chunk_index": {
+ "type": "integer"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/types.ParserEngineConfig"
- }
- ]
+ "content": {
+ "type": "string"
},
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrievalConfig"
- }
- ]
+ "embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
},
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrieverEngines"
- }
- ]
+ "end_at": {
+ "type": "integer"
},
- "status": {
- "description": "Status",
+ "image_info": {
"type": "string"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageEngineConfig"
- }
- ]
- },
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
- "type": "integer"
+ "is_enabled": {
+ "type": "boolean"
},
- "storage_used": {
- "description": "Storage used (Bytes)",
+ "start_at": {
"type": "integer"
+ }
+ }
+ },
+ "internal_handler.UpdateKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig"
},
- "updated_at": {
- "description": "Last updated time",
+ "description": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this tenant",
- "allOf": [
- {
- "$ref": "#/definitions/types.WebSearchConfig"
- }
- ]
+ "name": {
+ "type": "string"
}
}
},
- "types.ToolCall": {
+ "internal_handler.UpdateModelRequest": {
"type": "object",
"properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
- },
- "duration": {
- "description": "Execution time in milliseconds",
- "type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ "description": {
"type": "string"
},
"name": {
- "description": "Tool name",
"type": "string"
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
- "type": "string"
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
},
- "result": {
- "description": "Execution result (contains Output)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ToolResult"
- }
- ]
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
}
}
},
- "types.ToolResult": {
+ "internal_handler.UpdateStoreRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "data": {
- "description": "Structured data for programmatic use",
- "type": "object",
- "additionalProperties": true
- },
- "error": {
- "description": "Error message if execution failed",
+ "name": {
"type": "string"
- },
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ }
+ }
+ },
+ "internal_handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
"type": "array",
- "items": {
- "type": "string"
- }
- },
- "output": {
- "description": "Human-readable output",
- "type": "string"
- },
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
}
}
},
- "types.UpdateMemberRoleRequest": {
+ "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
"type": "object",
"required": [
- "role"
+ "display_status"
],
"properties": {
- "role": {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
}
}
},
- "types.UpdateOrganizationRequest": {
+ "internal_handler_session.AttachmentUpload": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
- },
- "description": {
- "type": "string",
- "maxLength": 1000
+ "data": {
+ "description": "Base64-encoded file content",
+ "type": "string"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "file_name": {
+ "description": "Original filename",
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
+ "file_size": {
+ "description": "File size in bytes",
"type": "integer"
- },
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- },
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "description": "open for search so others can discover and join",
- "type": "boolean"
}
}
},
- "types.UpdateSharePermissionRequest": {
+ "internal_handler_session.CreateKnowledgeQARequest": {
"type": "object",
"required": [
- "permission"
+ "query"
],
"properties": {
- "permission": {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- }
- },
- "types.User": {
- "type": "object",
- "properties": {
- "avatar": {
- "description": "Avatar URL of the user",
- "type": "string"
- },
- "can_access_all_tenants": {
- "description": "Whether the user can access all tenants (cross-tenant access)",
+ "agent_enabled": {
+ "description": "Whether agent mode is enabled for this request",
"type": "boolean"
},
- "created_at": {
- "description": "Creation time of the user",
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "attachment_uploads": {
+ "description": "Attached files (documents, audio, etc.)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.AttachmentUpload"
+ }
},
- "email": {
- "description": "Email address of the user",
+ "channel": {
+ "description": "Source channel: \"web\", \"api\", \"im\", etc.",
"type": "string"
},
- "id": {
- "description": "Unique identifier of the user",
- "type": "string"
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
},
- "is_active": {
- "description": "Whether the user is active",
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
"type": "boolean"
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
- "allOf": [
- {
- "$ref": "#/definitions/types.Tenant"
- }
- ]
+ "images": {
+ "description": "Attached images for multimodal chat",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.ImageAttachment"
+ }
},
- "tenant_id": {
- "description": "Tenant ID that the user belongs to",
- "type": "integer"
+ "knowledge_base_ids": {
+ "description": "Selected knowledge base ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "updated_at": {
- "description": "Last updated time of the user",
+ "knowledge_ids": {
+ "description": "Selected knowledge ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mentioned_items": {
+ "description": "@mentioned knowledge bases and files",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.MentionedItemRequest"
+ }
+ },
+ "query": {
+ "description": "Query text for knowledge base search",
"type": "string"
},
- "username": {
- "description": "Username of the user",
+ "summary_model_id": {
+ "description": "Optional summary model ID for this request (overrides session default)",
"type": "string"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search is enabled for this request",
+ "type": "boolean"
}
}
},
- "types.VLMConfig": {
+ "internal_handler_session.CreateSessionRequest": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "title": {
+ "description": "Title for the session (optional)",
"type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ }
+ }
+ },
+ "internal_handler_session.GenerateTitleRequest": {
+ "type": "object",
+ "required": [
+ "messages"
+ ],
+ "properties": {
+ "messages": {
+ "description": "Messages to use as context for title generation",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
+ }
+ }
+ }
+ },
+ "internal_handler_session.ImageAttachment": {
+ "type": "object",
+ "properties": {
+ "caption": {
+ "description": "VLM analysis result (context-aware, single call)",
"type": "string"
},
- "model_id": {
+ "data": {
+ "description": "base64 data URI from frontend (data:image/png;base64,...)",
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
+ "url": {
+ "description": "serving URL after saving to storage",
"type": "string"
}
}
},
- "types.WeKnoraCloudCredentials": {
+ "internal_handler_session.MentionedItemRequest": {
"type": "object",
"properties": {
- "app_id": {
+ "id": {
"type": "string"
},
- "app_secret": {
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "types.WebSearchConfig": {
+ "internal_handler_session.SearchKnowledgeRequest": {
"type": "object",
+ "required": [
+ "query"
+ ],
"properties": {
- "api_key": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "knowledge_base_id": {
+ "description": "Single knowledge base ID (for backward compatibility)",
"type": "string"
},
- "blacklist": {
- "description": "黑名单规则列表",
+ "knowledge_base_ids": {
+ "description": "IDs of knowledge bases to search (multi-KB support)",
"type": "array",
"items": {
"type": "string"
}
},
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
- "type": "string"
- },
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
+ "knowledge_ids": {
+ "description": "IDs of specific knowledge (files) to search",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "query": {
+ "description": "Query text to search for",
"type": "string"
- },
- "include_date": {
- "description": "是否包含日期",
- "type": "boolean"
- },
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
- },
- "provider": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ }
+ }
+ },
+ "internal_handler_session.StopSessionRequest": {
+ "type": "object",
+ "required": [
+ "message_id"
+ ],
+ "properties": {
+ "message_id": {
"type": "string"
+ }
+ }
+ },
+ "internal_handler_session.batchDeleteRequest": {
+ "type": "object",
+ "properties": {
+ "delete_all": {
+ "type": "boolean"
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
- "type": "string"
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
}
diff --git a/docs/images/architecture.png b/docs/images/architecture.png
index a163d9687..dfb06f9ac 100644
Binary files a/docs/images/architecture.png and b/docs/images/architecture.png differ
diff --git a/docs/images/wiki-browser.png b/docs/images/wiki-browser.png
new file mode 100644
index 000000000..ee98dbca1
Binary files /dev/null and b/docs/images/wiki-browser.png differ
diff --git a/docs/images/wiki-graph.png b/docs/images/wiki-graph.png
new file mode 100644
index 000000000..671b49bf3
Binary files /dev/null and b/docs/images/wiki-graph.png differ
diff --git a/docs/swagger.json b/docs/swagger.json
index 13adbdb14..198bd8b70 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -44,7 +44,7 @@
"500": {
"description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -76,7 +76,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateAgentRequest"
+ "$ref": "#/definitions/internal_handler.CreateAgentRequest"
}
}
],
@@ -91,7 +91,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -129,6 +129,38 @@
}
}
},
+ "/agents/type-presets": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "返回所有 smart-reasoning 下可用的智能体类型预设(RAG/Wiki/Hybrid/Custom),用于编辑器自动填充系统提示词、工具和 KB 兼容性",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "智能体"
+ ],
+ "summary": "获取智能体类型预设列表",
+ "responses": {
+ "200": {
+ "description": "预设列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
"/agents/{id}": {
"get": {
"security": [
@@ -170,13 +202,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -215,7 +247,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.UpdateAgentRequest"
+ "$ref": "#/definitions/internal_handler.UpdateAgentRequest"
}
}
],
@@ -230,13 +262,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"403": {
"description": "无法修改内置智能体",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -281,19 +313,19 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"403": {
"description": "无法删除内置智能体",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -340,13 +372,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -411,13 +443,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
"description": "智能体不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -448,7 +480,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
},
@@ -482,7 +514,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
],
@@ -490,7 +522,7 @@
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"400": {
@@ -528,7 +560,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
},
"404": {
@@ -559,7 +591,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/datasource.ConnectorMetadata"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata"
}
}
}
@@ -635,7 +667,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"404": {
@@ -675,7 +707,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
}
],
@@ -683,7 +715,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.DataSource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource"
}
},
"400": {
@@ -765,7 +797,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
}
},
@@ -844,7 +876,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.Resource"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Resource"
}
}
},
@@ -918,7 +950,7 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
}
},
"400": {
@@ -971,172 +1003,166 @@
}
}
},
- "/auth/auto-setup": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/auto-fix": {
"post": {
- "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Automatically fix fixable wiki issues (broken links, etc.)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Auto-fix wiki issues",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "自动初始化(Lite 桌面版)",
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.LoginResponse"
- }
- },
- "403": {
- "description": "非 Lite 版本",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/auth/change-password": {
- "post": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/graph": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "修改当前用户的登录密码",
- "consumes": [
- "application/json"
- ],
+ "description": "Returns the wiki link graph data for visualization",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "修改密码",
+ "summary": "Get wiki link graph",
"parameters": [
{
- "description": "密码修改请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "new_password": {
- "type": "string"
- },
- "old_password": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "修改成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphData"
}
}
}
}
},
- "/auth/login": {
- "post": {
- "description": "用户登录并获取访问令牌",
- "consumes": [
- "application/json"
+ "/api/v1/knowledgebase/{kb_id}/wiki/index": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Returns the wiki index page (creates default if not exists)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "用户登录",
+ "summary": "Get wiki index page",
"parameters": [
{
- "description": "登录请求参数",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.LoginRequest"
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.LoginResponse"
- }
- },
- "401": {
- "description": "认证失败",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
}
}
},
- "/auth/logout": {
- "post": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/issues": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "撤销当前访问令牌并登出",
- "consumes": [
- "application/json"
- ],
+ "description": "List issues flagged on wiki pages with optional filtering",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "List wiki page issues",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Filter by page slug",
+ "name": "slug",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Filter by status (pending, ignored, resolved)",
+ "name": "status",
+ "in": "query"
+ }
],
- "summary": "用户登出",
"responses": {
"200": {
- "description": "登出成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue"
+ }
}
}
}
}
},
- "/auth/me": {
- "get": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/issues/{issue_id}/status": {
+ "put": {
"security": [
{
"Bearer": []
}
],
- "description": "获取当前登录用户的详细信息",
+ "description": "Update the status of a flagged wiki page issue",
"consumes": [
"application/json"
],
@@ -1144,108 +1170,108 @@
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Update wiki page issue status",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Issue ID",
+ "name": "issue_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "New status {'status': 'ignored'}",
+ "name": "status",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
],
- "summary": "获取当前用户信息",
"responses": {
"200": {
- "description": "用户信息",
+ "description": "OK",
"schema": {
"type": "object",
- "additionalProperties": true
+ "additionalProperties": {
+ "type": "string"
+ }
}
},
- "401": {
- "description": "未授权",
+ "400": {
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/auth/oidc/callback": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/lint": {
"get": {
- "description": "接收OIDC provider回调并由后端完成code交换,随后重定向回前端登录页",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Perform a comprehensive health check on the wiki",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "OIDC登录重定向回调",
+ "summary": "Run wiki lint",
"parameters": [
{
"type": "string",
- "description": "OIDC授权码",
- "name": "code",
- "in": "query"
- },
- {
- "type": "string",
- "description": "OIDC状态",
- "name": "state",
- "in": "query"
- },
- {
- "type": "string",
- "description": "OIDC错误码",
- "name": "error",
- "in": "query"
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "302": {
- "description": "Found"
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport"
+ }
}
}
}
},
- "/auth/oidc/config": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/log": {
"get": {
- "description": "返回OIDC是否启用以及provider展示名称,供前端决定是否展示OIDC登录入口",
- "consumes": [
- "application/json"
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "Returns the wiki operation log page (creates default if not exists)",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "获取OIDC登录配置",
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/types.OIDCConfigResponse"
- }
- }
- }
- }
- },
- "/auth/oidc/url": {
- "get": {
- "description": "根据后端OIDC配置生成第三方登录跳转地址",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "认证"
- ],
- "summary": "获取OIDC授权地址",
+ "summary": "Get wiki operation log",
"parameters": [
{
"type": "string",
- "description": "OIDC回调地址",
- "name": "redirect_uri",
- "in": "query",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
"required": true
}
],
@@ -1253,73 +1279,100 @@
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.OIDCAuthURLResponse"
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "OIDC未启用",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
}
}
},
- "/auth/refresh": {
- "post": {
- "description": "使用刷新令牌获取新的访问令牌",
- "consumes": [
- "application/json"
+ "/api/v1/knowledgebase/{kb_id}/wiki/pages": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
],
+ "description": "List wiki pages with optional filtering and pagination",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "刷新令牌",
+ "summary": "List wiki pages",
"parameters": [
{
- "description": "刷新令牌",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "refreshToken": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Filter by page type",
+ "name": "page_type",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Filter by status",
+ "name": "status",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Full-text search",
+ "name": "query",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page number",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Page size",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Sort field",
+ "name": "sort_by",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Sort order (asc/desc)",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "新令牌",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageListResponse"
}
},
- "401": {
- "description": "令牌无效",
+ "400": {
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/auth/register": {
+ },
"post": {
- "description": "注册新用户账号",
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "Create a new wiki page in the knowledge base",
"consumes": [
"application/json"
],
@@ -1327,17 +1380,24 @@
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
],
- "summary": "用户注册",
+ "summary": "Create a wiki page",
"parameters": [
{
- "description": "注册请求参数",
- "name": "request",
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Wiki page data",
+ "name": "page",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.RegisterRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
}
],
@@ -1345,70 +1405,71 @@
"201": {
"description": "Created",
"schema": {
- "$ref": "#/definitions/types.RegisterResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
"400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "注册功能已禁用",
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/auth/validate": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/pages/{slug}": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "验证访问令牌是否有效",
- "consumes": [
- "application/json"
- ],
+ "description": "Retrieve a wiki page by its slug",
"produces": [
"application/json"
],
"tags": [
- "认证"
+ "Wiki"
+ ],
+ "summary": "Get a wiki page by slug",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "验证令牌",
"responses": {
"200": {
- "description": "令牌有效",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
- "401": {
- "description": "令牌无效",
+ "404": {
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/chunks/by-id/{id}": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
+ "description": "Update an existing wiki page by slug",
"consumes": [
"application/json"
],
@@ -1416,292 +1477,210 @@
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "通过ID获取分块",
+ "summary": "Update a wiki page",
"parameters": [
{
"type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
"in": "path",
"required": true
+ },
+ {
+ "description": "Updated wiki page data",
+ "name": "page",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
}
],
"responses": {
"200": {
- "description": "分块详情",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
"404": {
- "description": "分块不存在",
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/chunks/by-id/{id}/questions": {
+ },
"delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除分块中生成的问题",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "Soft-delete a wiki page by slug",
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "删除生成的问题",
+ "summary": "Delete a wiki page",
"parameters": [
{
"type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
},
{
- "description": "问题ID",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "question_id": {
- "type": "string"
- }
- }
- }
+ "type": "string",
+ "description": "Page slug",
+ "name": "slug",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "204": {
+ "description": "No Content"
},
"404": {
- "description": "分块不存在",
+ "description": "Not Found",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/chunks/{knowledge_id}": {
- "get": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/rebuild-links": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取指定知识下的所有分块列表,支持分页",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "Re-parse all pages and rebuild bidirectional link references",
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "获取知识分块列表",
+ "summary": "Rebuild wiki links",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
- },
- {
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 10,
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
}
],
"responses": {
"200": {
- "description": "分块列表",
+ "description": "OK",
"schema": {
"type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "additionalProperties": {
+ "type": "string"
+ }
}
}
}
- },
- "delete": {
+ }
+ },
+ "/api/v1/knowledgebase/{kb_id}/wiki/search": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定知识下的所有分块",
- "consumes": [
- "application/json"
- ],
+ "description": "Full-text search over wiki pages",
"produces": [
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "删除知识下所有分块",
+ "summary": "Search wiki pages",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "Search query",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "description": "Max results (default 10)",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
}
}
}
}
},
- "/chunks/{knowledge_id}/{id}": {
- "put": {
+ "/api/v1/knowledgebase/{kb_id}/wiki/stats": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新指定分块的内容和属性",
- "consumes": [
- "application/json"
- ],
+ "description": "Returns aggregate statistics about the wiki",
"produces": [
"application/json"
],
"tags": [
- "分块管理"
+ "Wiki"
],
- "summary": "更新分块",
+ "summary": "Get wiki statistics",
"parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
- "name": "id",
+ "description": "Knowledge base ID",
+ "name": "kb_id",
"in": "path",
"required": true
- },
- {
- "description": "更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateChunkRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的分块",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "分块不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
}
}
}
- },
- "delete": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除指定的分块",
+ }
+ },
+ "/auth/auto-setup": {
+ "post": {
+ "description": "Lite 版专用:首次启动时自动创建默认用户和租户并返回令牌,后续启动直接签发令牌,免除手动注册/登录流程",
"consumes": [
"application/json"
],
@@ -1709,59 +1688,33 @@
"application/json"
],
"tags": [
- "分块管理"
- ],
- "summary": "删除分块",
- "parameters": [
- {
- "type": "string",
- "description": "知识ID",
- "name": "knowledge_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "分块ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "自动初始化(Lite 桌面版)",
"responses": {
"200": {
- "description": "删除成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
}
},
- "404": {
- "description": "分块不存在",
+ "403": {
+ "description": "非 Lite 版本",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/evaluation/": {
- "get": {
+ "/auth/change-password": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据任务ID获取评估结果",
+ "description": "修改当前用户的登录密码",
"consumes": [
"application/json"
],
@@ -1769,21 +1722,31 @@
"application/json"
],
"tags": [
- "评估"
+ "认证"
],
- "summary": "获取评估结果",
+ "summary": "修改密码",
"parameters": [
{
- "type": "string",
- "description": "评估任务ID",
- "name": "task_id",
- "in": "query",
- "required": true
+ "description": "密码修改请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "new_password": {
+ "type": "string"
+ },
+ "old_password": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "评估结果",
+ "description": "修改成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -1792,21 +1755,15 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/auth/login": {
"post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "对知识库进行评估测试",
+ "description": "用户登录并获取访问令牌",
"consumes": [
"application/json"
],
@@ -1814,48 +1771,44 @@
"application/json"
],
"tags": [
- "评估"
+ "认证"
],
- "summary": "执行评估",
+ "summary": "用户登录",
"parameters": [
{
- "description": "评估请求参数",
+ "description": "登录请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.EvaluationRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest"
}
}
],
"responses": {
"200": {
- "description": "评估任务",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse"
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "认证失败",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/faq/import/progress/{task_id}": {
- "get": {
+ "/auth/logout": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取FAQ导入任务的进度",
+ "description": "撤销当前访问令牌并登出",
"consumes": [
"application/json"
],
@@ -1863,46 +1816,34 @@
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "获取FAQ导入进度",
- "parameters": [
- {
- "type": "string",
- "description": "任务ID",
- "name": "task_id",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "用户登出",
"responses": {
"200": {
- "description": "导入进度",
+ "description": "登出成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/extract/relations": {
- "post": {
+ "/auth/me": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "从文本中提取实体和关系",
+ "description": "获取当前登录用户的详细信息",
"consumes": [
"application/json"
],
@@ -1910,40 +1851,29 @@
"application/json"
],
"tags": [
- "初始化"
- ],
- "summary": "提取文本关系",
- "parameters": [
- {
- "description": "提取请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.TextRelationExtractionRequest"
- }
- }
+ "认证"
],
+ "summary": "获取当前用户信息",
"responses": {
"200": {
- "description": "提取结果",
+ "description": "用户信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "未授权",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/fabri/tag": {
+ "/auth/oidc/callback": {
"get": {
- "description": "随机生成一组标签",
+ "description": "接收OIDC provider回调并由后端完成code交换,随后重定向回前端登录页",
"consumes": [
"application/json"
],
@@ -1951,31 +1881,106 @@
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "生成随机标签",
+ "summary": "OIDC登录重定向回调",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "OIDC授权码",
+ "name": "code",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "OIDC状态",
+ "name": "state",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "OIDC错误码",
+ "name": "error",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "302": {
+ "description": "Found"
+ }
+ }
+ }
+ },
+ "/auth/oidc/config": {
+ "get": {
+ "description": "返回OIDC是否启用以及provider展示名称,供前端决定是否展示OIDC登录入口",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取OIDC登录配置",
"responses": {
"200": {
- "description": "生成的标签",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse"
}
}
}
}
},
- "/initialization/fabri/text": {
- "post": {
- "security": [
- {
- "Bearer": []
- },
+ "/auth/oidc/url": {
+ "get": {
+ "description": "根据后端OIDC配置生成第三方登录跳转地址",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "认证"
+ ],
+ "summary": "获取OIDC授权地址",
+ "parameters": [
{
- "ApiKeyAuth": []
+ "type": "string",
+ "description": "OIDC回调地址",
+ "name": "redirect_uri",
+ "in": "query",
+ "required": true
}
],
- "description": "根据标签生成示例文本",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse"
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "OIDC未启用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/auth/refresh": {
+ "post": {
+ "description": "使用刷新令牌获取新的访问令牌",
"consumes": [
"application/json"
],
@@ -1983,48 +1988,45 @@
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "生成示例文本",
+ "summary": "刷新令牌",
"parameters": [
{
- "description": "生成请求",
+ "description": "刷新令牌",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.FabriTextRequest"
+ "type": "object",
+ "properties": {
+ "refreshToken": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "生成的文本",
+ "description": "新令牌",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "401": {
+ "description": "令牌无效",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/kb/{kbId}": {
+ "/auth/register": {
"post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "根据知识库ID执行完整配置更新",
+ "description": "注册新用户账号",
"consumes": [
"application/json"
],
@@ -2032,55 +2034,50 @@
"application/json"
],
"tags": [
- "初始化"
+ "认证"
],
- "summary": "初始化知识库配置",
+ "summary": "用户注册",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "kbId",
- "in": "path",
- "required": true
- },
- {
- "description": "初始化请求",
+ "description": "注册请求参数",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest"
}
}
],
"responses": {
- "200": {
- "description": "初始化成功",
+ "201": {
+ "description": "Created",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "注册功能已禁用",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/kb/{kbId}/config": {
+ "/auth/validate": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据知识库ID获取当前配置信息",
+ "description": "验证访问令牌是否有效",
"consumes": [
"application/json"
],
@@ -2088,35 +2085,28 @@
"application/json"
],
"tags": [
- "初始化"
- ],
- "summary": "获取知识库配置",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "kbId",
- "in": "path",
- "required": true
- }
+ "认证"
],
+ "summary": "验证令牌",
"responses": {
"200": {
- "description": "配置信息",
+ "description": "令牌有效",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "401": {
+ "description": "令牌无效",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/chunks/by-id/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2125,7 +2115,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据知识库ID更新模型和分块配置",
+ "description": "仅通过分块ID获取分块详情(不需要knowledge_id);支持共享知识库下的分块访问",
"consumes": [
"application/json"
],
@@ -2133,30 +2123,21 @@
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "更新知识库配置",
+ "summary": "通过ID获取分块",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "kbId",
+ "description": "分块ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "description": "配置请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.KBModelConfigRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "分块详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2165,20 +2146,20 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
- "description": "知识库不存在",
+ "description": "分块不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/asr/check": {
- "post": {
+ "/chunks/by-id/{id}/questions": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -2187,7 +2168,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
+ "description": "删除分块中生成的问题",
"consumes": [
"application/json"
],
@@ -2195,23 +2176,35 @@
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查ASR模型",
+ "summary": "删除生成的问题",
"parameters": [
{
- "description": "ASR检查请求",
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问题ID",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "type": "object",
+ "properties": {
+ "question_id": {
+ "type": "string"
+ }
+ }
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2220,14 +2213,20 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/embedding/test": {
- "post": {
+ "/chunks/{knowledge_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -2236,7 +2235,7 @@
"ApiKeyAuth": []
}
],
- "description": "测试Embedding接口是否可用并返回向量维度",
+ "description": "获取指定知识下的所有分块列表,支持分页",
"consumes": [
"application/json"
],
@@ -2244,23 +2243,35 @@
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "测试Embedding模型",
+ "summary": "获取知识分块列表",
"parameters": [
{
- "description": "Embedding测试请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "分块列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2269,14 +2280,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/models/remote/check": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2285,7 +2294,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查远程API模型连接是否正常",
+ "description": "删除指定知识下的所有分块",
"consumes": [
"application/json"
],
@@ -2293,23 +2302,21 @@
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查远程模型",
+ "summary": "删除知识下所有分块",
"parameters": [
{
- "description": "模型检查请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.RemoteModelCheckRequest"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2318,14 +2325,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/models/rerank/check": {
- "post": {
+ "/chunks/{knowledge_id}/{id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2334,7 +2341,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查Rerank模型连接和功能是否正常",
+ "description": "更新指定分块的内容和属性",
"consumes": [
"application/json"
],
@@ -2342,23 +2349,37 @@
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "检查Rerank模型",
+ "summary": "更新分块",
"parameters": [
{
- "description": "Rerank检查请求",
+ "type": "string",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler.UpdateChunkRequest"
}
}
],
"responses": {
"200": {
- "description": "检查结果",
+ "description": "更新后的分块",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2367,14 +2388,18 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/initialization/multimodal/test": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -2383,62 +2408,36 @@
"ApiKeyAuth": []
}
],
- "description": "上传图片测试多模态处理功能",
+ "description": "删除指定的分块",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "初始化"
+ "分块管理"
],
- "summary": "测试多模态功能",
+ "summary": "删除分块",
"parameters": [
- {
- "type": "file",
- "description": "测试图片",
- "name": "image",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "VLM模型名称",
- "name": "vlm_model",
- "in": "formData",
- "required": true
- },
{
"type": "string",
- "description": "VLM Base URL",
- "name": "vlm_base_url",
- "in": "formData",
+ "description": "知识ID",
+ "name": "knowledge_id",
+ "in": "path",
"required": true
},
{
"type": "string",
- "description": "VLM API Key",
- "name": "vlm_api_key",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "VLM接口类型",
- "name": "vlm_interface_type",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "存储类型(cos/minio)",
- "name": "storage_type",
- "in": "formData",
+ "description": "分块ID",
+ "name": "id",
+ "in": "path",
"required": true
}
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2447,13 +2446,19 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "分块不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/download/tasks": {
+ "/evaluation/": {
"get": {
"security": [
{
@@ -2463,7 +2468,7 @@
"ApiKeyAuth": []
}
],
- "description": "列出所有Ollama模型下载任务",
+ "description": "根据任务ID获取评估结果",
"consumes": [
"application/json"
],
@@ -2471,22 +2476,35 @@
"application/json"
],
"tags": [
- "初始化"
+ "评估"
+ ],
+ "summary": "获取评估结果",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "评估任务ID",
+ "name": "task_id",
+ "in": "query",
+ "required": true
+ }
],
- "summary": "列出下载任务",
"responses": {
"200": {
- "description": "任务列表",
+ "description": "评估结果",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/initialization/ollama/download/{taskId}": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -2495,7 +2513,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取Ollama模型下载任务的进度",
+ "description": "对知识库进行评估测试",
"consumes": [
"application/json"
],
@@ -2503,36 +2521,38 @@
"application/json"
],
"tags": [
- "初始化"
+ "评估"
],
- "summary": "获取下载进度",
+ "summary": "执行评估",
"parameters": [
{
- "type": "string",
- "description": "任务ID",
- "name": "taskId",
- "in": "path",
- "required": true
+ "description": "评估请求参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.EvaluationRequest"
+ }
}
],
"responses": {
"200": {
- "description": "下载进度",
+ "description": "评估任务",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models": {
+ "/faq/import/progress/{task_id}": {
"get": {
"security": [
{
@@ -2542,7 +2562,7 @@
"ApiKeyAuth": []
}
],
- "description": "列出已安装的Ollama模型",
+ "description": "获取FAQ导入任务的进度",
"consumes": [
"application/json"
],
@@ -2550,27 +2570,36 @@
"application/json"
],
"tags": [
- "初始化"
+ "FAQ管理"
+ ],
+ "summary": "获取FAQ导入进度",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "任务ID",
+ "name": "task_id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "导入进度",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models/check": {
+ "/initialization/extract/relations": {
"post": {
"security": [
{
@@ -2580,7 +2609,7 @@
"ApiKeyAuth": []
}
],
- "description": "检查指定的Ollama模型是否已安装",
+ "description": "从文本中提取实体和关系",
"consumes": [
"application/json"
],
@@ -2590,29 +2619,21 @@
"tags": [
"初始化"
],
- "summary": "检查Ollama模型状态",
+ "summary": "提取文本关系",
"parameters": [
{
- "description": "模型名称列表",
+ "description": "提取请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "models": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
+ "$ref": "#/definitions/internal_handler.TextRelationExtractionRequest"
}
}
],
"responses": {
"200": {
- "description": "模型状态",
+ "description": "提取结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2621,13 +2642,37 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/models/download": {
+ "/initialization/fabri/tag": {
+ "get": {
+ "description": "随机生成一组标签",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "生成随机标签",
+ "responses": {
+ "200": {
+ "description": "生成的标签",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/initialization/fabri/text": {
"post": {
"security": [
{
@@ -2637,7 +2682,7 @@
"ApiKeyAuth": []
}
],
- "description": "异步下载指定的Ollama模型",
+ "description": "根据标签生成示例文本",
"consumes": [
"application/json"
],
@@ -2647,26 +2692,21 @@
"tags": [
"初始化"
],
- "summary": "下载Ollama模型",
+ "summary": "生成示例文本",
"parameters": [
{
- "description": "模型名称",
+ "description": "生成请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object",
- "properties": {
- "modelName": {
- "type": "string"
- }
- }
+ "$ref": "#/definitions/internal_handler.FabriTextRequest"
}
}
],
"responses": {
"200": {
- "description": "下载任务信息",
+ "description": "生成的文本",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2675,15 +2715,23 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/initialization/ollama/status": {
- "get": {
- "description": "检查Ollama服务是否可用",
+ "/initialization/kb/{kbId}": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据知识库ID执行完整配置更新",
"consumes": [
"application/json"
],
@@ -2693,19 +2741,43 @@
"tags": [
"初始化"
],
- "summary": "检查Ollama服务状态",
+ "summary": "初始化知识库配置",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "初始化请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
+ ],
"responses": {
"200": {
- "description": "Ollama状态",
+ "description": "初始化成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/knowledge-bases": {
+ "/initialization/kb/{kbId}/config": {
"get": {
"security": [
{
@@ -2715,7 +2787,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
+ "description": "根据知识库ID获取当前配置信息",
"consumes": [
"application/json"
],
@@ -2723,34 +2795,35 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库列表",
+ "summary": "获取知识库配置",
"parameters": [
{
"type": "string",
- "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
- "name": "agent_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "知识库列表",
+ "description": "配置信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "404": {
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "post": {
+ "put": {
"security": [
{
"Bearer": []
@@ -2759,7 +2832,7 @@
"ApiKeyAuth": []
}
],
- "description": "创建新的知识库",
+ "description": "根据知识库ID更新模型和分块配置",
"consumes": [
"application/json"
],
@@ -2767,23 +2840,30 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "创建知识库",
+ "summary": "更新知识库配置",
"parameters": [
{
- "description": "知识库信息",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kbId",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "配置请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.KnowledgeBase"
+ "$ref": "#/definitions/internal_handler.KBModelConfigRequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的知识库",
+ "200": {
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2792,13 +2872,19 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/copy": {
+ "/initialization/models/asr/check": {
"post": {
"security": [
{
@@ -2808,7 +2894,7 @@
"ApiKeyAuth": []
}
],
- "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
+ "description": "检查ASR(语音识别)模型连接是否正常,通过发送一段静默音频测试 /v1/audio/transcriptions 端点",
"consumes": [
"application/json"
],
@@ -2816,23 +2902,23 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "复制知识库",
+ "summary": "检查ASR模型",
"parameters": [
{
- "description": "复制请求",
+ "description": "ASR检查请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CopyKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "任务ID",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2841,14 +2927,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/copy/progress/{task_id}": {
- "get": {
+ "/initialization/models/embedding/test": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2857,7 +2943,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库复制任务的进度",
+ "description": "测试Embedding接口是否可用并返回向量维度",
"consumes": [
"application/json"
],
@@ -2865,37 +2951,39 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库复制进度",
+ "summary": "测试Embedding模型",
"parameters": [
{
- "type": "string",
- "description": "任务ID",
- "name": "task_id",
- "in": "path",
- "required": true
+ "description": "Embedding测试请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "进度信息",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "任务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}": {
- "get": {
+ "/initialization/models/remote/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2904,7 +2992,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
+ "description": "检查远程API模型连接是否正常",
"consumes": [
"application/json"
],
@@ -2912,27 +3000,23 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "获取知识库详情",
+ "summary": "检查远程模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
- "name": "agent_id",
- "in": "query"
+ "description": "模型检查请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.RemoteModelCheckRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识库详情",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -2941,18 +3025,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识库不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/initialization/models/rerank/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -2961,7 +3041,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新知识库的名称、描述和配置",
+ "description": "检查Rerank模型连接和功能是否正常",
"consumes": [
"application/json"
],
@@ -2969,30 +3049,23 @@
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "更新知识库",
+ "summary": "检查Rerank模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "更新请求",
+ "description": "Rerank检查请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.UpdateKnowledgeBaseRequest"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "检查结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3001,12 +3074,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/initialization/multimodal/test": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3015,29 +3090,62 @@
"ApiKeyAuth": []
}
],
- "description": "删除指定的知识库及其所有内容",
+ "description": "上传图片测试多模态处理功能",
"consumes": [
- "application/json"
+ "multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
- "知识库"
+ "初始化"
],
- "summary": "删除知识库",
+ "summary": "测试多模态功能",
"parameters": [
+ {
+ "type": "file",
+ "description": "测试图片",
+ "name": "image",
+ "in": "formData",
+ "required": true
+ },
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
+ "description": "VLM模型名称",
+ "name": "vlm_model",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM Base URL",
+ "name": "vlm_base_url",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "VLM API Key",
+ "name": "vlm_api_key",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "VLM接口类型",
+ "name": "vlm_interface_type",
+ "in": "formData"
+ },
+ {
+ "type": "string",
+ "description": "存储类型(cos/minio)",
+ "name": "storage_type",
+ "in": "formData",
"required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3046,13 +3154,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries": {
+ "/initialization/ollama/download/tasks": {
"get": {
"security": [
{
@@ -3062,7 +3170,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
+ "description": "列出所有Ollama模型下载任务",
"consumes": [
"application/json"
],
@@ -3070,71 +3178,22 @@
"application/json"
],
"tags": [
- "FAQ管理"
- ],
- "summary": "获取FAQ条目列表",
- "parameters": [
- {
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "标签ID筛选(seq_id)",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
- "name": "search_field",
- "in": "query"
- },
- {
- "type": "string",
- "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
- "name": "sort_order",
- "in": "query"
- }
+ "初始化"
],
+ "summary": "列出下载任务",
"responses": {
"200": {
- "description": "FAQ列表",
+ "description": "任务列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
- },
- "post": {
+ }
+ },
+ "/initialization/ollama/download/{taskId}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3143,7 +3202,7 @@
"ApiKeyAuth": []
}
],
- "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
+ "description": "获取Ollama模型下载任务的进度",
"consumes": [
"application/json"
],
@@ -3151,44 +3210,75 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "批量更新/插入FAQ条目",
+ "summary": "获取下载进度",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
+ "description": "任务ID",
+ "name": "taskId",
"in": "path",
"required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "下载进度",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
},
- {
- "description": "批量操作请求",
- "name": "request",
- "in": "body",
- "required": true,
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/types.FAQBatchUpsertPayload"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
+ }
+ }
+ },
+ "/initialization/ollama/models": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "列出已安装的Ollama模型",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
],
+ "summary": "列出Ollama模型",
"responses": {
"200": {
- "description": "任务ID",
+ "description": "模型列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/initialization/ollama/models/check": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3197,7 +3287,7 @@
"ApiKeyAuth": []
}
],
- "description": "批量删除指定的FAQ条目",
+ "description": "检查指定的Ollama模型是否已安装",
"consumes": [
"application/json"
],
@@ -3205,29 +3295,22 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "批量删除FAQ条目",
+ "summary": "检查Ollama模型状态",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "要删除的FAQ ID列表(seq_id)",
+ "description": "模型名称列表",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "ids": {
+ "models": {
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
}
}
@@ -3236,7 +3319,7 @@
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "模型状态",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3245,14 +3328,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/export": {
- "get": {
+ "/initialization/ollama/models/download": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3261,44 +3344,76 @@
"ApiKeyAuth": []
}
],
- "description": "将所有FAQ条目导出为CSV文件",
+ "description": "异步下载指定的Ollama模型",
"consumes": [
"application/json"
],
"produces": [
- "text/csv"
+ "application/json"
],
"tags": [
- "FAQ管理"
+ "初始化"
],
- "summary": "导出FAQ条目",
+ "summary": "下载Ollama模型",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- }
- ],
+ "description": "模型名称",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "modelName": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ],
"responses": {
"200": {
- "description": "CSV文件",
+ "description": "下载任务信息",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/fields": {
- "put": {
+ "/initialization/ollama/status": {
+ "get": {
+ "description": "检查Ollama服务是否可用",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "初始化"
+ ],
+ "summary": "检查Ollama服务状态",
+ "responses": {
+ "200": {
+ "description": "Ollama状态",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3307,7 +3422,7 @@
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
+ "description": "获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)",
"consumes": [
"application/json"
],
@@ -3315,46 +3430,34 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "批量更新FAQ字段",
+ "summary": "获取知识库列表",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "字段更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQEntryFieldsBatchUpdate"
- }
+ "description": "共享智能体 ID(传入时返回该智能体可用的知识库)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "知识库列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entries/tags": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -3363,7 +3466,7 @@
"ApiKeyAuth": []
}
],
- "description": "批量更新FAQ条目的标签",
+ "description": "创建新的知识库",
"consumes": [
"application/json"
],
@@ -3371,30 +3474,23 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "批量更新FAQ标签",
+ "summary": "创建知识库",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "标签更新请求",
+ "description": "知识库信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase"
}
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "创建的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3403,14 +3499,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}": {
- "get": {
+ "/knowledge-bases/copy": {
+ "post": {
"security": [
{
"Bearer": []
@@ -3419,7 +3515,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取单个FAQ条目的详情",
+ "description": "将一个知识库的内容复制到另一个知识库(异步任务)",
"consumes": [
"application/json"
],
@@ -3427,28 +3523,23 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "获取FAQ条目详情",
+ "summary": "复制知识库",
"parameters": [
{
- "type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
- "in": "path",
- "required": true
+ "description": "复制请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CopyKnowledgeBaseRequest"
+ }
}
],
"responses": {
"200": {
- "description": "FAQ条目详情",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3457,18 +3548,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "条目不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
+ }
+ },
+ "/knowledge-bases/copy/progress/{task_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3477,7 +3564,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新指定的FAQ条目",
+ "description": "获取知识库复制任务的进度",
"consumes": [
"application/json"
],
@@ -3485,53 +3572,37 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "更新FAQ条目",
+ "summary": "获取知识库复制进度",
"parameters": [
{
"type": "string",
- "description": "知识库ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
+ "description": "任务ID",
+ "name": "task_id",
"in": "path",
"required": true
- },
- {
- "description": "FAQ条目",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQEntryPayload"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "进度信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "任务不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
- "post": {
+ "/knowledge-bases/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3540,7 +3611,7 @@
"ApiKeyAuth": []
}
],
- "description": "向指定的FAQ条目添加相似问题",
+ "description": "根据ID获取知识库详情。当使用共享智能体时,可传 agent_id 以校验该智能体是否有权访问该知识库。",
"consumes": [
"application/json"
],
@@ -3548,9 +3619,9 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "添加相似问",
+ "summary": "获取知识库详情",
"parameters": [
{
"type": "string",
@@ -3560,25 +3631,15 @@
"required": true
},
{
- "type": "integer",
- "description": "FAQ条目ID(seq_id)",
- "name": "entry_id",
- "in": "path",
- "required": true
- },
- {
- "description": "相似问列表",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.addSimilarQuestionsRequest"
- }
+ "type": "string",
+ "description": "共享智能体 ID(用于校验智能体是否有权访问该知识库)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "更新后的FAQ条目",
+ "description": "知识库详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3587,20 +3648,18 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
"404": {
- "description": "条目不存在",
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/entry": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -3609,7 +3668,7 @@
"ApiKeyAuth": []
}
],
- "description": "同步创建单个FAQ条目",
+ "description": "更新知识库的名称、描述和配置",
"consumes": [
"application/json"
],
@@ -3617,9 +3676,9 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "创建单个FAQ条目",
+ "summary": "更新知识库",
"parameters": [
{
"type": "string",
@@ -3629,18 +3688,18 @@
"required": true
},
{
- "description": "FAQ条目",
+ "description": "更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.FAQEntryPayload"
+ "$ref": "#/definitions/internal_handler.UpdateKnowledgeBaseRequest"
}
}
],
"responses": {
"200": {
- "description": "创建的FAQ条目",
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3649,14 +3708,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/faq/import/last-result/display": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3665,7 +3722,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
+ "description": "删除指定的知识库及其所有内容",
"consumes": [
"application/json"
],
@@ -3673,9 +3730,9 @@
"application/json"
],
"tags": [
- "FAQ管理"
+ "知识库"
],
- "summary": "更新FAQ最后一次导入结果显示状态",
+ "summary": "删除知识库",
"parameters": [
{
"type": "string",
@@ -3683,20 +3740,11 @@
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "状态更新请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3705,20 +3753,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识库不存在或无导入记录",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/faq/search": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3727,7 +3769,7 @@
"ApiKeyAuth": []
}
],
- "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
+ "description": "获取知识库下的FAQ条目列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -3737,7 +3779,7 @@
"tags": [
"FAQ管理"
],
- "summary": "搜索FAQ",
+ "summary": "获取FAQ条目列表",
"parameters": [
{
"type": "string",
@@ -3747,18 +3789,45 @@
"required": true
},
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.FAQSearchRequest"
- }
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "标签ID筛选(seq_id)",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "搜索字段: standard_question(标准问题), similar_questions(相似问法), answers(答案), 默认搜索全部",
+ "name": "search_field",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "排序方式: asc(按更新时间正序), 默认按更新时间倒序",
+ "name": "sort_order",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "FAQ列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3767,14 +3836,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/hybrid-search": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -3783,7 +3850,7 @@
"ApiKeyAuth": []
}
],
- "description": "在知识库中执行向量和关键词混合搜索",
+ "description": "异步批量更新或插入FAQ条目。支持 dry_run 模式(设置 dry_run=true),异步验证不实际导入。\ndry_run 模式是异步操作,返回 task_id,通过 /faq/import/progress/{task_id} 查询进度和结果。\n验证内容包括:1) 条目基本格式 2) 重复问题(批次内和知识库已有) 3) 内容安全检查。",
"consumes": [
"application/json"
],
@@ -3791,9 +3858,9 @@
"application/json"
],
"tags": [
- "知识库"
+ "FAQ管理"
],
- "summary": "混合搜索",
+ "summary": "批量更新/插入FAQ条目",
"parameters": [
{
"type": "string",
@@ -3803,18 +3870,18 @@
"required": true
},
{
- "description": "搜索参数",
+ "description": "批量操作请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.SearchParams"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload"
}
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "任务ID",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3823,14 +3890,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/knowledge": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -3839,7 +3904,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的知识列表,支持分页和筛选",
+ "description": "批量删除指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -3847,9 +3912,9 @@
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "获取知识列表",
+ "summary": "批量删除FAQ条目",
"parameters": [
{
"type": "string",
@@ -3859,39 +3924,26 @@
"required": true
},
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "标签ID筛选",
- "name": "tag_id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "文件类型筛选",
- "name": "file_type",
- "in": "query"
+ "description": "要删除的FAQ ID列表(seq_id)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -3900,12 +3952,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/entries/export": {
+ "get": {
"security": [
{
"Bearer": []
@@ -3914,17 +3968,17 @@
"ApiKeyAuth": []
}
],
- "description": "删除知识库下的所有知识条目(异步任务)。知识库本身保留,仅清空其中的内容",
+ "description": "将所有FAQ条目导出为CSV文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/csv"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "清空知识库内容",
+ "summary": "导出FAQ条目",
"parameters": [
{
"type": "string",
@@ -3936,29 +3990,22 @@
],
"responses": {
"200": {
- "description": "清空任务已提交",
+ "description": "CSV文件",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/file": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/fields": {
+ "put": {
"security": [
{
"Bearer": []
@@ -3967,17 +4014,17 @@
"ApiKeyAuth": []
}
],
- "description": "上传文件并创建知识条目",
+ "description": "批量更新FAQ条目的多个字段(is_enabled, is_recommended, tag_id)",
"consumes": [
- "multipart/form-data"
+ "application/json"
],
"produces": [
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "从文件创建知识",
+ "summary": "批量更新FAQ字段",
"parameters": [
{
"type": "string",
@@ -3987,34 +4034,18 @@
"required": true
},
{
- "type": "file",
- "description": "上传的文件",
- "name": "file",
- "in": "formData",
- "required": true
- },
- {
- "type": "string",
- "description": "自定义文件名",
- "name": "fileName",
- "in": "formData"
- },
- {
- "type": "string",
- "description": "元数据JSON",
- "name": "metadata",
- "in": "formData"
- },
- {
- "type": "boolean",
- "description": "启用多模态处理",
- "name": "enable_multimodel",
- "in": "formData"
+ "description": "字段更新请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate"
+ }
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4023,21 +4054,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "409": {
- "description": "文件重复",
- "schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/manual": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -4046,7 +4070,7 @@
"ApiKeyAuth": []
}
],
- "description": "手工录入Markdown格式的知识内容",
+ "description": "批量更新FAQ条目的标签",
"consumes": [
"application/json"
],
@@ -4054,9 +4078,9 @@
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "手工创建知识",
+ "summary": "批量更新FAQ标签",
"parameters": [
{
"type": "string",
@@ -4066,18 +4090,18 @@
"required": true
},
{
- "description": "手工知识内容",
+ "description": "标签更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ManualKnowledgePayload"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "创建的知识",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4086,14 +4110,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/knowledge/url": {
- "post": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -4102,7 +4126,7 @@
"ApiKeyAuth": []
}
],
- "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
+ "description": "根据ID获取单个FAQ条目的详情",
"consumes": [
"application/json"
],
@@ -4110,9 +4134,9 @@
"application/json"
],
"tags": [
- "知识管理"
+ "FAQ管理"
],
- "summary": "从URL创建知识",
+ "summary": "获取FAQ条目详情",
"parameters": [
{
"type": "string",
@@ -4122,38 +4146,16 @@
"required": true
},
{
- "description": "URL请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "enable_multimodel": {
- "type": "boolean"
- },
- "file_name": {
- "type": "string"
- },
- "file_type": {
- "type": "string"
- },
- "tag_id": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "url": {
- "type": "string"
- }
- }
- }
- }
- ],
- "responses": {
- "201": {
- "description": "创建的知识",
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "FAQ条目详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4162,20 +4164,17 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
},
- "409": {
- "description": "URL重复",
+ "404": {
+ "description": "条目不存在",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/pin": {
+ },
"put": {
"security": [
{
@@ -4185,7 +4184,7 @@
"ApiKeyAuth": []
}
],
- "description": "切换知识库的置顶状态",
+ "description": "更新指定的FAQ条目",
"consumes": [
"application/json"
],
@@ -4193,9 +4192,9 @@
"application/json"
],
"tags": [
- "知识库"
+ "FAQ管理"
],
- "summary": "置顶/取消置顶知识库",
+ "summary": "更新FAQ条目",
"parameters": [
{
"type": "string",
@@ -4203,40 +4202,62 @@
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "FAQ条目",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
}
],
"responses": {
"200": {
- "description": "更新后的知识库",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "知识库不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge-bases/{id}/shares": {
- "get": {
+ "/knowledge-bases/{id}/faq/entries/{entry_id}/similar-questions": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取知识库的所有共享记录",
+ "description": "向指定的FAQ条目添加相似问题",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "获取知识库的共享列表",
+ "summary": "添加相似问",
"parameters": [
{
"type": "string",
@@ -4244,24 +4265,58 @@
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "FAQ条目ID(seq_id)",
+ "name": "entry_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "相似问列表",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.addSimilarQuestionsRequest"
+ }
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新后的FAQ条目",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "条目不存在",
"schema": {
- "$ref": "#/definitions/types.ListSharesResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge-bases/{id}/faq/entry": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "将知识库共享到指定组织",
+ "description": "同步创建单个FAQ条目",
"consumes": [
"application/json"
],
@@ -4269,9 +4324,9 @@
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "共享知识库到组织",
+ "summary": "创建单个FAQ条目",
"parameters": [
{
"type": "string",
@@ -4281,25 +4336,25 @@
"required": true
},
{
- "description": "共享信息",
+ "description": "FAQ条目",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ShareKnowledgeBaseRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
}
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "创建的FAQ条目",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4307,14 +4362,17 @@
}
}
},
- "/knowledge-bases/{id}/shares/{share_id}": {
+ "/knowledge-bases/{id}/faq/import/last-result/display": {
"put": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "更新知识库共享的权限级别",
+ "description": "更新FAQ知识库导入结果统计卡片的显示或隐藏状态",
"consumes": [
"application/json"
],
@@ -4322,9 +4380,9 @@
"application/json"
],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "更新共享权限",
+ "summary": "更新FAQ最后一次导入结果显示状态",
"parameters": [
{
"type": "string",
@@ -4334,49 +4392,59 @@
"required": true
},
{
- "type": "string",
- "description": "共享记录ID",
- "name": "share_id",
- "in": "path",
- "required": true
- },
- {
- "description": "权限信息",
+ "description": "状态更新请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateSharePermissionRequest"
+ "$ref": "#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识库不存在或无导入记录",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/faq/search": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "取消知识库的共享",
+ "description": "使用混合搜索在FAQ中搜索,支持两级优先级标签召回:first_priority_tag_ids优先级最高,second_priority_tag_ids次之",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
- "知识库共享"
+ "FAQ管理"
],
- "summary": "取消共享",
+ "summary": "搜索FAQ",
"parameters": [
{
"type": "string",
@@ -4386,23 +4454,25 @@
"required": true
},
{
- "type": "string",
- "description": "共享记录ID",
- "name": "share_id",
- "in": "path",
- "required": true
+ "description": "搜索请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest"
+ }
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -4410,7 +4480,7 @@
}
}
},
- "/knowledge-bases/{id}/tags": {
+ "/knowledge-bases/{id}/hybrid-search": {
"get": {
"security": [
{
@@ -4420,7 +4490,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取知识库下的所有标签及统计信息",
+ "description": "在知识库中执行向量和关键词混合搜索",
"consumes": [
"application/json"
],
@@ -4428,9 +4498,9 @@
"application/json"
],
"tags": [
- "标签管理"
+ "知识库"
],
- "summary": "获取标签列表",
+ "summary": "混合搜索",
"parameters": [
{
"type": "string",
@@ -4440,27 +4510,18 @@
"required": true
},
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键词搜索",
- "name": "keyword",
- "in": "query"
+ "description": "搜索参数",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams"
+ }
}
],
"responses": {
"200": {
- "description": "标签列表",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4469,12 +4530,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge-bases/{id}/knowledge": {
+ "get": {
"security": [
{
"Bearer": []
@@ -4483,7 +4546,7 @@
"ApiKeyAuth": []
}
],
- "description": "在知识库下创建新标签",
+ "description": "获取知识库下的知识列表,支持分页和筛选",
"consumes": [
"application/json"
],
@@ -4491,9 +4554,9 @@
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "创建标签",
+ "summary": "获取知识列表",
"parameters": [
{
"type": "string",
@@ -4503,29 +4566,39 @@
"required": true
},
{
- "description": "标签信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "color": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "sort_order": {
- "type": "integer"
- }
- }
- }
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标签ID筛选",
+ "name": "tag_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "文件类型筛选",
+ "name": "file_type",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "创建的标签",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4534,14 +4607,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge-bases/{id}/tags/{tag_id}": {
- "put": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -4550,7 +4621,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新标签信息",
+ "description": "删除知识库下的所有知识条目(异步任务)。知识库本身保留,仅清空其中的内容",
"consumes": [
"application/json"
],
@@ -4558,9 +4629,9 @@
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "更新标签",
+ "summary": "清空知识库内容",
"parameters": [
{
"type": "string",
@@ -4568,27 +4639,11 @@
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "标签ID (UUID或seq_id)",
- "name": "tag_id",
- "in": "path",
- "required": true
- },
- {
- "description": "标签更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object"
- }
}
],
"responses": {
"200": {
- "description": "更新后的标签",
+ "description": "清空任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4597,12 +4652,20 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/knowledge/file": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4611,17 +4674,17 @@
"ApiKeyAuth": []
}
],
- "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
+ "description": "上传文件并创建知识条目",
"consumes": [
- "application/json"
+ "multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
- "标签管理"
+ "知识管理"
],
- "summary": "删除标签",
+ "summary": "从文件创建知识",
"parameters": [
{
"type": "string",
@@ -4631,36 +4694,34 @@
"required": true
},
{
- "type": "string",
- "description": "标签ID (UUID或seq_id)",
- "name": "tag_id",
- "in": "path",
+ "type": "file",
+ "description": "上传的文件",
+ "name": "file",
+ "in": "formData",
"required": true
},
{
- "type": "boolean",
- "description": "强制删除",
- "name": "force",
- "in": "query"
+ "type": "string",
+ "description": "自定义文件名",
+ "name": "fileName",
+ "in": "formData"
},
{
- "type": "boolean",
- "description": "仅删除内容,保留标签",
- "name": "content_only",
- "in": "query"
+ "type": "string",
+ "description": "元数据JSON",
+ "name": "metadata",
+ "in": "formData"
},
{
- "description": "删除选项",
- "name": "body",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/handler.DeleteTagRequest"
- }
+ "type": "boolean",
+ "description": "启用多模态处理",
+ "name": "enable_multimodel",
+ "in": "formData"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4669,14 +4730,21 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "409": {
+ "description": "文件重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/knowledge/batch": {
- "get": {
+ "/knowledge-bases/{id}/knowledge/manual": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4685,7 +4753,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
+ "description": "手工录入Markdown格式的知识内容",
"consumes": [
"application/json"
],
@@ -4695,35 +4763,28 @@
"tags": [
"知识管理"
],
- "summary": "批量获取知识",
+ "summary": "手工创建知识",
"parameters": [
- {
- "type": "array",
- "items": {
- "type": "string"
- },
- "collectionFormat": "csv",
- "description": "知识ID列表",
- "name": "ids",
- "in": "query",
- "required": true
- },
{
"type": "string",
- "description": "可选,知识库ID(用于共享知识库时指定范围)",
- "name": "kb_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
},
{
- "type": "string",
- "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
- "name": "agent_id",
- "in": "query"
+ "description": "手工知识内容",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
+ }
}
],
"responses": {
"200": {
- "description": "知识列表",
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4732,14 +4793,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/image/{id}/{chunk_id}": {
- "put": {
+ "/knowledge-bases/{id}/knowledge/url": {
+ "post": {
"security": [
{
"Bearer": []
@@ -4748,7 +4809,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新知识分块的图像信息",
+ "description": "从指定URL抓取内容并创建知识条目。当提供 file_name/file_type 或 URL 路径含已知文件扩展名时,自动切换为文件下载模式",
"consumes": [
"application/json"
],
@@ -4758,31 +4819,39 @@
"tags": [
"知识管理"
],
- "summary": "更新图像信息",
+ "summary": "从URL创建知识",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "type": "string",
- "description": "分块ID",
- "name": "chunk_id",
- "in": "path",
- "required": true
- },
- {
- "description": "图像信息",
+ "description": "URL请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
- "image_info": {
+ "enable_multimodel": {
+ "type": "boolean"
+ },
+ "file_name": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "tag_id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
"type": "string"
}
}
@@ -4790,8 +4859,8 @@
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "创建的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -4800,13 +4869,20 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "409": {
+ "description": "URL重复",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
}
}
}
}
},
- "/knowledge/manual/{id}": {
+ "/knowledge-bases/{id}/pin": {
"put": {
"security": [
{
@@ -4816,7 +4892,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新手工录入的Markdown知识内容",
+ "description": "切换知识库的置顶状态",
"consumes": [
"application/json"
],
@@ -4824,125 +4900,75 @@
"application/json"
],
"tags": [
- "知识管理"
+ "知识库"
],
- "summary": "更新手工知识",
+ "summary": "置顶/取消置顶知识库",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "手工知识内容",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.ManualKnowledgePayload"
- }
}
],
"responses": {
"200": {
- "description": "更新后的知识",
+ "description": "更新后的知识库",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "知识库不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/search": {
+ "/knowledge-bases/{id}/shares": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
- "consumes": [
- "application/json"
- ],
+ "description": "获取知识库的所有共享记录",
"produces": [
"application/json"
],
"tags": [
- "Knowledge"
+ "知识库共享"
],
- "summary": "Search knowledge",
+ "summary": "获取知识库的共享列表",
"parameters": [
{
"type": "string",
- "description": "Keyword to search",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Offset for pagination",
- "name": "offset",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "Limit for pagination (default 20)",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
- "name": "file_types",
- "in": "query"
- },
- {
- "type": "string",
- "description": "Shared agent ID (search within agent's KB scope)",
- "name": "agent_id",
- "in": "query"
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "Search results",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "Invalid request",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
- }
- },
- "/knowledge/tags": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
+ "description": "将知识库共享到指定组织",
"consumes": [
"application/json"
],
@@ -4950,48 +4976,52 @@
"application/json"
],
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "批量更新知识标签",
+ "summary": "共享知识库到组织",
"parameters": [
{
- "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "共享信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest"
}
}
],
"responses": {
- "200": {
- "description": "更新成功",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/{id}": {
- "get": {
+ "/knowledge-bases/{id}/shares/{share_id}": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取知识条目详情",
+ "description": "更新知识库共享的权限级别",
"consumes": [
"application/json"
],
@@ -4999,95 +5029,96 @@
"application/json"
],
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "获取知识详情",
+ "summary": "更新共享权限",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "权限信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest"
+ }
}
],
"responses": {
"200": {
- "description": "知识详情",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "知识不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "delete": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新知识条目信息",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "取消知识库的共享",
"tags": [
- "知识管理"
+ "知识库共享"
],
- "summary": "更新知识",
+ "summary": "取消共享",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "知识信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.Knowledge"
- }
+ "type": "string",
+ "description": "共享记录ID",
+ "name": "share_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "更新成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge-bases/{id}/tags": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5096,7 +5127,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID删除知识条目",
+ "description": "获取知识库下的所有标签及统计信息",
"consumes": [
"application/json"
],
@@ -5104,21 +5135,39 @@
"application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "删除知识",
+ "summary": "获取标签列表",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键词搜索",
+ "name": "keyword",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "标签列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5127,14 +5176,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/knowledge/{id}/download": {
- "get": {
+ },
+ "post": {
"security": [
{
"Bearer": []
@@ -5143,44 +5190,65 @@
"ApiKeyAuth": []
}
],
- "description": "下载知识条目关联的原始文件",
+ "description": "在知识库下创建新标签",
"consumes": [
"application/json"
],
"produces": [
- "application/octet-stream"
+ "application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "下载知识文件",
+ "summary": "创建标签",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "sort_order": {
+ "type": "integer"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "文件内容",
+ "description": "创建的标签",
"schema": {
- "type": "file"
+ "type": "object",
+ "additionalProperties": true
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/knowledge/{id}/preview": {
- "get": {
+ "/knowledge-bases/{id}/tags/{tag_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5189,78 +5257,45 @@
"ApiKeyAuth": []
}
],
- "description": "返回知识条目关联的原始文件,Content-Type 根据文件类型设置,用于浏览器内嵌预览",
+ "description": "更新标签信息",
"consumes": [
"application/json"
],
"produces": [
- "application/pdf",
- "image/jpeg",
- "image/png",
- "text/plain"
+ "application/json"
],
"tags": [
- "知识管理"
+ "标签管理"
],
- "summary": "预览知识文件",
+ "summary": "更新标签",
"parameters": [
{
"type": "string",
- "description": "知识ID",
+ "description": "知识库ID",
"name": "id",
"in": "path",
"required": true
- }
- ],
- "responses": {
- "200": {
- "description": "文件内容",
- "schema": {
- "type": "file"
- }
},
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- }
- }
- }
- },
- "/knowledge/{id}/reparse": {
- "post": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "知识管理"
- ],
- "summary": "重新解析知识",
- "parameters": [
{
"type": "string",
- "description": "知识ID",
- "name": "id",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
"in": "path",
"required": true
+ },
+ {
+ "description": "标签更新信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "重新解析任务已提交",
+ "description": "更新后的标签",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5269,20 +5304,12 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -5291,7 +5318,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有MCP服务",
+ "description": "删除标签,可使用force=true强制删除被引用的标签,content_only=true仅删除标签下的内容而保留标签本身",
"consumes": [
"application/json"
],
@@ -5299,12 +5326,48 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "标签管理"
+ ],
+ "summary": "删除标签",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "标签ID (UUID或seq_id)",
+ "name": "tag_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "boolean",
+ "description": "强制删除",
+ "name": "force",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "仅删除内容,保留标签",
+ "name": "content_only",
+ "in": "query"
+ },
+ {
+ "description": "删除选项",
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/internal_handler.DeleteTagRequest"
+ }
+ }
],
- "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "MCP服务列表",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5313,12 +5376,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/knowledge/batch": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5327,7 +5392,7 @@
"ApiKeyAuth": []
}
],
- "description": "创建新的MCP服务配置",
+ "description": "根据ID列表批量获取知识条目。可选 kb_id:指定时按该知识库校验权限并用于共享知识库的租户解析;可选 agent_id:使用共享智能体时传此参数,后端按智能体所属租户查询(用于刷新后恢复共享知识库下的文件)",
"consumes": [
"application/json"
],
@@ -5335,23 +5400,37 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "创建MCP服务",
+ "summary": "批量获取知识",
"parameters": [
{
- "description": "MCP服务配置",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.MCPService"
- }
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "description": "知识ID列表",
+ "name": "ids",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "可选,知识库ID(用于共享知识库时指定范围)",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "可选,共享智能体ID(用于按智能体租户批量拉取文件详情)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "创建的MCP服务",
+ "description": "知识列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5360,14 +5439,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}": {
- "get": {
+ "/knowledge/image/{id}/{chunk_id}": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5376,7 +5455,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取MCP服务详情",
+ "description": "更新知识分块的图像信息",
"consumes": [
"application/json"
],
@@ -5384,34 +5463,57 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务详情",
+ "summary": "更新图像信息",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "分块ID",
+ "name": "chunk_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "图像信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object",
+ "properties": {
+ "image_info": {
+ "type": "string"
+ }
+ }
+ }
}
],
"responses": {
"200": {
- "description": "MCP服务详情",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "服务不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/knowledge/manual/{id}": {
"put": {
"security": [
{
@@ -5421,7 +5523,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新MCP服务配置",
+ "description": "更新手工录入的Markdown知识内容",
"consumes": [
"application/json"
],
@@ -5429,30 +5531,30 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "更新MCP服务",
+ "summary": "更新手工知识",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "更新字段",
+ "description": "手工知识内容",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload"
}
}
],
"responses": {
"200": {
- "description": "更新后的MCP服务",
+ "description": "更新后的知识",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5461,12 +5563,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/knowledge/search": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5475,7 +5579,7 @@
"ApiKeyAuth": []
}
],
- "description": "删除指定的MCP服务",
+ "description": "Search knowledge files by keyword. When agent_id is set (shared agent), scope is the agent's configured knowledge bases.",
"consumes": [
"application/json"
],
@@ -5483,37 +5587,60 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "Knowledge"
],
- "summary": "删除MCP服务",
+ "summary": "Search knowledge",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "Keyword to search",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Offset for pagination",
+ "name": "offset",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "Limit for pagination (default 20)",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Comma-separated file extensions to filter (e.g., csv,xlsx)",
+ "name": "file_types",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "Shared agent ID (search within agent's KB scope)",
+ "name": "agent_id",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "Search results",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "Invalid request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}/resources": {
- "get": {
+ "/knowledge/tags": {
+ "put": {
"security": [
{
"Bearer": []
@@ -5522,7 +5649,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的资源列表",
+ "description": "批量更新知识条目的标签。可选 kb_id:指定时按该知识库校验编辑权限并用于共享知识库的租户解析",
"consumes": [
"application/json"
],
@@ -5530,37 +5657,39 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务资源列表",
+ "summary": "批量更新知识标签",
"parameters": [
{
- "type": "string",
- "description": "MCP服务ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "标签更新请求(updates 必填,kb_id 可选)",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "资源列表",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/mcp-services/{id}/test": {
- "post": {
+ "/knowledge/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5569,7 +5698,7 @@
"ApiKeyAuth": []
}
],
- "description": "测试MCP服务是否可以正常连接",
+ "description": "根据ID获取知识条目详情",
"consumes": [
"application/json"
],
@@ -5577,13 +5706,13 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "测试MCP服务连接",
+ "summary": "获取知识详情",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
@@ -5591,7 +5720,7 @@
],
"responses": {
"200": {
- "description": "测试结果",
+ "description": "知识详情",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5600,14 +5729,18 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "知识不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/mcp-services/{id}/tools": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -5616,7 +5749,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取MCP服务提供的工具列表",
+ "description": "更新知识条目信息",
"consumes": [
"application/json"
],
@@ -5624,37 +5757,44 @@
"application/json"
],
"tags": [
- "MCP服务"
+ "知识管理"
],
- "summary": "获取MCP服务工具列表",
+ "summary": "更新知识",
"parameters": [
{
"type": "string",
- "description": "MCP服务ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "知识信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge"
+ }
}
],
"responses": {
"200": {
- "description": "工具列表",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/messages/chat-history-stats": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
@@ -5663,7 +5803,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取聊天历史知识库的统计信息(已索引消息数、知识库大小等)",
+ "description": "根据ID删除知识条目",
"consumes": [
"application/json"
],
@@ -5671,22 +5811,37 @@
"application/json"
],
"tags": [
- "消息"
+ "知识管理"
+ ],
+ "summary": "删除知识",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取聊天历史知识库统计",
"responses": {
"200": {
- "description": "统计信息",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/messages/search": {
- "post": {
+ "/knowledge/{id}/download": {
+ "get": {
"security": [
{
"Bearer": []
@@ -5695,46 +5850,43 @@
"ApiKeyAuth": []
}
],
- "description": "通过关键词和/或向量相似度搜索历史对话记录,支持关键词、向量、混合三种模式",
+ "description": "下载知识条目关联的原始文件",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/octet-stream"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "搜索历史对话",
+ "summary": "下载知识文件",
"parameters": [
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.SearchMessagesRequest"
- }
+ "type": "string",
+ "description": "知识ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/messages/{session_id}/load": {
+ "/knowledge/{id}/preview": {
"get": {
"security": [
{
@@ -5744,58 +5896,47 @@
"ApiKeyAuth": []
}
],
- "description": "加载会话的消息历史,支持分页和时间筛选",
+ "description": "返回知识条目关联的原始文件,Content-Type 根据文件类型设置,用于浏览器内嵌预览",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "application/pdf",
+ "image/jpeg",
+ "image/png",
+ "text/plain"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "加载消息历史",
+ "summary": "预览知识文件",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "知识ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "type": "integer",
- "default": 20,
- "description": "返回数量",
- "name": "limit",
- "in": "query"
- },
- {
- "type": "string",
- "description": "在此时间之前的消息(RFC3339Nano格式)",
- "name": "before_time",
- "in": "query"
}
],
"responses": {
"200": {
- "description": "消息列表",
+ "description": "文件内容",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "type": "file"
}
},
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/messages/{session_id}/{id}": {
- "delete": {
+ "/knowledge/{id}/reparse": {
+ "post": {
"security": [
{
"Bearer": []
@@ -5804,7 +5945,7 @@
"ApiKeyAuth": []
}
],
- "description": "从会话中删除指定消息",
+ "description": "删除知识中现有的文档内容并重新解析,使用异步任务方式处理",
"consumes": [
"application/json"
],
@@ -5812,20 +5953,13 @@
"application/json"
],
"tags": [
- "消息"
+ "知识管理"
],
- "summary": "删除消息",
+ "summary": "重新解析知识",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "消息ID",
+ "description": "知识ID",
"name": "id",
"in": "path",
"required": true
@@ -5833,22 +5967,28 @@
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "重新解析任务已提交",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "权限不足",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/models": {
+ "/mcp-services": {
"get": {
"security": [
{
@@ -5858,7 +5998,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取当前租户的所有模型",
+ "description": "获取当前租户的所有MCP服务",
"consumes": [
"application/json"
],
@@ -5866,12 +6006,12 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型列表",
+ "summary": "获取MCP服务列表",
"responses": {
"200": {
- "description": "模型列表",
+ "description": "MCP服务列表",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5880,7 +6020,7 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -5894,7 +6034,7 @@
"ApiKeyAuth": []
}
],
- "description": "创建新的模型配置",
+ "description": "创建新的MCP服务配置",
"consumes": [
"application/json"
],
@@ -5902,23 +6042,23 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "创建模型",
+ "summary": "创建MCP服务",
"parameters": [
{
- "description": "模型信息",
+ "description": "MCP服务配置",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateModelRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService"
}
}
],
"responses": {
- "201": {
- "description": "创建的模型",
+ "200": {
+ "description": "创建的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
@@ -5927,13 +6067,13 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/models/providers": {
+ "/mcp-services/{id}": {
"get": {
"security": [
{
@@ -5943,7 +6083,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据模型类型获取支持的厂商列表及配置信息",
+ "description": "根据ID获取MCP服务详情",
"consumes": [
"application/json"
],
@@ -5951,30 +6091,35 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型厂商列表",
+ "summary": "获取MCP服务详情",
"parameters": [
{
"type": "string",
- "description": "模型类型 (chat, embedding, rerank, vllm)",
- "name": "model_type",
- "in": "query"
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "厂商列表",
+ "description": "MCP服务详情",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "服务不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/models/{id}": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
@@ -5983,7 +6128,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据ID获取模型详情",
+ "description": "更新MCP服务配置",
"consumes": [
"application/json"
],
@@ -5991,35 +6136,44 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "获取模型详情",
+ "summary": "更新MCP服务",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- }
+ },
+ {
+ "description": "更新字段",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
+ }
],
"responses": {
"200": {
- "description": "模型详情",
+ "description": "更新后的MCP服务",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "delete": {
"security": [
{
"Bearer": []
@@ -6028,7 +6182,7 @@
"ApiKeyAuth": []
}
],
- "description": "更新模型配置信息",
+ "description": "删除指定的MCP服务",
"consumes": [
"application/json"
],
@@ -6036,44 +6190,37 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "更新模型",
+ "summary": "删除MCP服务",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
- },
- {
- "description": "更新信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateModelRequest"
- }
}
],
"responses": {
"200": {
- "description": "更新后的模型",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/mcp-services/{id}/resources": {
+ "get": {
"security": [
{
"Bearer": []
@@ -6082,7 +6229,7 @@
"ApiKeyAuth": []
}
],
- "description": "删除指定的模型",
+ "description": "获取MCP服务提供的资源列表",
"consumes": [
"application/json"
],
@@ -6090,13 +6237,13 @@
"application/json"
],
"tags": [
- "模型管理"
+ "MCP服务"
],
- "summary": "删除模型",
+ "summary": "获取MCP服务资源列表",
"parameters": [
{
"type": "string",
- "description": "模型ID",
+ "description": "MCP服务ID",
"name": "id",
"in": "path",
"required": true
@@ -6104,52 +6251,32 @@
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "资源列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "模型不存在",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/organizations": {
- "get": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
- "produces": [
- "application/json"
- ],
- "tags": [
- "组织管理"
- ],
- "summary": "获取我的组织列表",
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/types.ListOrganizationsResponse"
- }
- }
- }
- },
+ "/mcp-services/{id}/test": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "创建新的组织,创建者自动成为管理员",
+ "description": "测试MCP服务是否可以正常连接",
"consumes": [
"application/json"
],
@@ -6157,30 +6284,28 @@
"application/json"
],
"tags": [
- "组织管理"
+ "MCP服务"
],
- "summary": "创建组织",
+ "summary": "测试MCP服务连接",
"parameters": [
{
- "description": "组织信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.CreateOrganizationRequest"
- }
+ "type": "string",
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "201": {
- "description": "Created",
+ "200": {
+ "description": "测试结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Bad Request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6188,14 +6313,17 @@
}
}
},
- "/organizations/join": {
- "post": {
+ "/mcp-services/{id}/tools": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "使用邀请码加入组织",
+ "description": "获取MCP服务提供的工具列表",
"consumes": [
"application/json"
],
@@ -6203,30 +6331,28 @@
"application/json"
],
"tags": [
- "组织管理"
+ "MCP服务"
],
- "summary": "通过邀请码加入组织",
+ "summary": "获取MCP服务工具列表",
"parameters": [
{
- "description": "邀请码",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.JoinOrganizationRequest"
- }
+ "type": "string",
+ "description": "MCP服务ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "工具列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "500": {
+ "description": "服务器错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6234,14 +6360,17 @@
}
}
},
- "/organizations/join-by-id": {
- "post": {
+ "/messages/chat-history-stats": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "加入已开放可被搜索的空间,无需邀请码",
+ "description": "获取聊天历史知识库的统计信息(已索引消息数、知识库大小等)",
"consumes": [
"application/json"
],
@@ -6249,45 +6378,31 @@
"application/json"
],
"tags": [
- "组织管理"
- ],
- "summary": "通过空间 ID 加入(可搜索空间)",
- "parameters": [
- {
- "description": "空间 ID",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.JoinByOrganizationIDRequest"
- }
- }
+ "消息"
],
+ "summary": "获取聊天历史知识库统计",
"responses": {
"200": {
- "description": "OK",
+ "description": "统计信息",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "403": {
- "description": "Forbidden",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/organizations/join-request": {
+ "/messages/search": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "对需要审核的组织提交加入申请",
+ "description": "通过关键词和/或向量相似度搜索历史对话记录,支持关键词、向量、混合三种模式",
"consumes": [
"application/json"
],
@@ -6295,30 +6410,30 @@
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "提交加入申请",
+ "summary": "搜索历史对话",
"parameters": [
{
- "description": "申请信息",
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.SubmitJoinRequestRequest"
+ "$ref": "#/definitions/internal_handler.SearchMessagesRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Bad Request",
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6326,40 +6441,59 @@
}
}
},
- "/organizations/preview/{code}": {
+ "/messages/{session_id}/load": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "通过邀请码获取组织基本信息(不加入)",
+ "description": "加载会话的消息历史,支持分页和时间筛选",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "通过邀请码预览组织",
+ "summary": "加载消息历史",
"parameters": [
{
"type": "string",
- "description": "邀请码",
- "name": "code",
+ "description": "会话ID",
+ "name": "session_id",
"in": "path",
"required": true
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "在此时间之前的消息(RFC3339Nano格式)",
+ "name": "before_time",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "消息列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6367,94 +6501,107 @@
}
}
},
- "/organizations/search": {
- "get": {
+ "/messages/{session_id}/{id}": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "搜索已开放可被搜索的空间,用于发现并加入",
+ "description": "从会话中删除指定消息",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "消息"
],
- "summary": "搜索可加入的空间",
+ "summary": "删除消息",
"parameters": [
{
"type": "string",
- "description": "搜索关键词(空间名称或描述)",
- "name": "q",
- "in": "query"
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
},
{
- "type": "integer",
- "default": 20,
- "description": "返回数量限制",
- "name": "limit",
- "in": "query"
+ "type": "string",
+ "description": "消息ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "500": {
+ "description": "服务器错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/organizations/{id}": {
+ "/models": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "根据ID获取组织详情",
+ "description": "获取当前租户的所有模型",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
- ],
- "summary": "获取组织详情",
- "parameters": [
- {
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "模型管理"
],
+ "summary": "获取模型列表",
"responses": {
"200": {
- "description": "OK",
+ "description": "模型列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Not Found",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "put": {
+ "post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "更新组织信息(需要管理员权限)",
+ "description": "创建新的模型配置",
"consumes": [
"application/json"
],
@@ -6462,58 +6609,102 @@
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "更新组织",
+ "summary": "创建模型",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "更新信息",
+ "description": "模型信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateOrganizationRequest"
+ "$ref": "#/definitions/internal_handler.CreateModelRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "创建的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "请求参数错误",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/models/providers": {
+ "get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "删除组织(仅组织创建者可操作)",
+ "description": "根据模型类型获取支持的厂商列表及配置信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "删除组织",
+ "summary": "获取模型厂商列表",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型类型 (chat, embedding, rerank, vllm)",
+ "name": "model_type",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "厂商列表",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/models/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取模型详情",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "模型管理"
+ ],
+ "summary": "获取模型详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
@@ -6521,29 +6712,30 @@
],
"responses": {
"200": {
- "description": "OK",
+ "description": "模型详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/invite": {
- "post": {
+ },
+ "put": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "管理员直接添加用户为组织成员",
+ "description": "更新模型配置信息",
"consumes": [
"application/json"
],
@@ -6551,69 +6743,67 @@
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "邀请成员",
+ "summary": "更新模型",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "邀请信息",
+ "description": "更新信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.InviteMemberRequest"
+ "$ref": "#/definitions/internal_handler.UpdateModelRequest"
}
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "更新后的模型",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
- },
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/invite-code": {
- "post": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "生成新的组织邀请码(需要管理员权限)",
+ "description": "删除指定的模型",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "组织管理"
+ "模型管理"
],
- "summary": "生成邀请码",
+ "summary": "删除模型",
"parameters": [
{
"type": "string",
- "description": "组织ID",
+ "description": "模型ID",
"name": "id",
"in": "path",
"required": true
@@ -6621,14 +6811,14 @@
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "模型不存在",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6636,55 +6826,37 @@
}
}
},
- "/organizations/{id}/join-requests": {
+ "/organizations": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "获取组织的待审核加入申请(仅管理员)",
+ "description": "获取当前用户所属的所有组织,并附带各空间内知识库/智能体数量",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取待审核加入申请列表",
- "parameters": [
- {
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- }
- ],
+ "summary": "获取我的组织列表",
"responses": {
"200": {
"description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "403": {
- "description": "Forbidden",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse"
}
}
}
- }
- },
- "/organizations/{id}/join-requests/{request_id}/review": {
- "put": {
+ },
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "通过或拒绝加入申请(仅管理员)",
+ "description": "创建新的组织,创建者自动成为管理员",
"consumes": [
"application/json"
],
@@ -6694,42 +6866,28 @@
"tags": [
"组织管理"
],
- "summary": "审核加入申请",
+ "summary": "创建组织",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "申请ID",
- "name": "request_id",
- "in": "path",
- "required": true
- },
- {
- "description": "审核结果",
+ "description": "组织信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.ReviewJoinRequestRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest"
}
}
],
"responses": {
- "200": {
- "description": "OK",
+ "201": {
+ "description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6737,25 +6895,33 @@
}
}
},
- "/organizations/{id}/leave": {
+ "/organizations/join": {
"post": {
"security": [
{
"Bearer": []
}
],
- "description": "退出指定组织",
+ "description": "使用邀请码加入组织",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
"tags": [
"组织管理"
],
- "summary": "退出组织",
+ "summary": "通过邀请码加入组织",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "邀请码",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest"
+ }
}
],
"responses": {
@@ -6766,8 +6932,8 @@
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6775,48 +6941,60 @@
}
}
},
- "/organizations/{id}/members": {
- "get": {
+ "/organizations/join-by-id": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "获取组织的所有成员",
+ "description": "加入已开放可被搜索的空间,无需邀请码",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取组织成员列表",
+ "summary": "通过空间 ID 加入(可搜索空间)",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "空间 ID",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest"
+ }
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.ListMembersResponse"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/organizations/{id}/members/{user_id}": {
- "put": {
+ "/organizations/join-request": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "更新组织成员的角色(需要管理员权限)",
+ "description": "对需要审核的组织提交加入申请",
"consumes": [
"application/json"
],
@@ -6826,29 +7004,15 @@
"tags": [
"组织管理"
],
- "summary": "更新成员角色",
+ "summary": "提交加入申请",
"parameters": [
{
- "type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "用户ID",
- "name": "user_id",
- "in": "path",
- "required": true
- },
- {
- "description": "角色信息",
+ "description": "申请信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.UpdateMemberRoleRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest"
}
}
],
@@ -6860,37 +7024,35 @@
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "400": {
+ "description": "Bad Request",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "delete": {
+ }
+ },
+ "/organizations/preview/{code}": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "从组织中移除成员(需要管理员权限)",
+ "description": "通过邀请码获取组织基本信息(不加入)",
+ "produces": [
+ "application/json"
+ ],
"tags": [
"组织管理"
],
- "summary": "移除成员",
+ "summary": "通过邀请码预览组织",
"parameters": [
{
"type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "type": "string",
- "description": "用户ID",
- "name": "user_id",
+ "description": "邀请码",
+ "name": "code",
"in": "path",
"required": true
}
@@ -6903,8 +7065,8 @@
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
@@ -6912,40 +7074,34 @@
}
}
},
- "/organizations/{id}/request-upgrade": {
- "post": {
+ "/organizations/search": {
+ "get": {
"security": [
{
"Bearer": []
}
],
- "description": "现有成员申请更高权限",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索已开放可被搜索的空间,用于发现并加入",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "申请权限升级",
+ "summary": "搜索可加入的空间",
"parameters": [
{
"type": "string",
- "description": "组织ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "搜索关键词(空间名称或描述)",
+ "name": "q",
+ "in": "query"
},
{
- "description": "申请信息",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/types.RequestRoleUpgradeRequest"
- }
+ "type": "integer",
+ "default": 20,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
@@ -6955,31 +7111,25 @@
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "Bad Request",
- "schema": {
- "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
- }
}
}
}
},
- "/organizations/{id}/search-users": {
+ "/organizations/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
- "description": "搜索用户(排除已有成员)用于邀请加入组织",
+ "description": "根据ID获取组织详情",
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "搜索可邀请的用户",
+ "summary": "获取组织详情",
"parameters": [
{
"type": "string",
@@ -6987,20 +7137,6 @@
"name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "搜索关键词(用户名或邮箱)",
- "name": "q",
- "in": "query",
- "required": true
- },
- {
- "type": "integer",
- "default": 10,
- "description": "返回数量限制",
- "name": "limit",
- "in": "query"
}
],
"responses": {
@@ -7011,30 +7147,31 @@
"additionalProperties": true
}
},
- "403": {
- "description": "Forbidden",
+ "404": {
+ "description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/organizations/{id}/shared-agents": {
- "get": {
+ },
+ "put": {
"security": [
{
"Bearer": []
}
],
- "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
+ "description": "更新组织信息(需要管理员权限)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取空间内全部智能体(含我共享的)",
+ "summary": "更新组织",
"parameters": [
{
"type": "string",
@@ -7042,6 +7179,15 @@
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "更新信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest"
+ }
}
],
"responses": {
@@ -7051,25 +7197,26 @@
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/organizations/{id}/shared-knowledge-bases": {
- "get": {
+ },
+ "delete": {
"security": [
{
"Bearer": []
}
],
- "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
- "produces": [
- "application/json"
- ],
+ "description": "删除组织(仅组织创建者可操作)",
"tags": [
"组织管理"
],
- "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
+ "summary": "删除组织",
"parameters": [
{
"type": "string",
@@ -7086,25 +7233,34 @@
"type": "object",
"additionalProperties": true
}
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/organizations/{id}/shares": {
- "get": {
+ "/organizations/{id}/invite": {
+ "post": {
"security": [
{
"Bearer": []
}
],
- "description": "获取共享到指定组织的所有知识库",
+ "description": "管理员直接添加用户为组织成员",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
"组织管理"
],
- "summary": "获取组织的共享知识库列表",
+ "summary": "邀请成员",
"parameters": [
{
"type": "string",
@@ -7112,128 +7268,130 @@
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "邀请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest"
+ }
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
- "$ref": "#/definitions/types.ListSharesResponse"
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions": {
- "get": {
+ "/organizations/{id}/invite-code": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取当前租户的会话列表,支持分页",
- "consumes": [
- "application/json"
- ],
+ "description": "生成新的组织邀请码(需要管理员权限)",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "获取会话列表",
+ "summary": "生成邀请码",
"parameters": [
{
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "会话列表",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "post": {
+ }
+ },
+ "/organizations/{id}/join-requests": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "创建新的对话会话",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的待审核加入申请(仅管理员)",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "创建会话",
+ "summary": "获取待审核加入申请列表",
"parameters": [
{
- "description": "会话创建请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateSessionRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
- "201": {
- "description": "创建的会话",
+ "200": {
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/batch": {
- "delete": {
+ "/organizations/{id}/join-requests/{request_id}/review": {
+ "put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID列表批量删除对话会话,或设置 delete_all=true 删除当前租户的所有会话",
+ "description": "通过或拒绝加入申请(仅管理员)",
"consumes": [
"application/json"
],
@@ -7241,111 +7399,108 @@
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "批量删除会话",
+ "summary": "审核加入申请",
"parameters": [
{
- "description": "批量删除请求",
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "申请ID",
+ "name": "request_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "审核结果",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler_session.batchDeleteRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest"
}
}
],
"responses": {
"200": {
- "description": "删除结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/search": {
+ "/organizations/{id}/leave": {
"post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "在知识库中搜索(不使用LLM总结)",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "退出指定组织",
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "知识搜索",
+ "summary": "退出组织",
"parameters": [
{
- "description": "搜索请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.SearchKnowledgeRequest"
- }
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{id}": {
+ "/organizations/{id}/members": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "根据ID获取会话详情",
- "consumes": [
- "application/json"
- ],
+ "description": "获取组织的所有成员",
"produces": [
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "获取会话详情",
+ "summary": "获取组织成员列表",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
@@ -7353,30 +7508,22 @@
],
"responses": {
"200": {
- "description": "会话详情",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "会话不存在",
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse"
}
}
}
- },
+ }
+ },
+ "/organizations/{id}/members/{user_id}": {
"put": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "更新会话属性",
+ "description": "更新组织成员的角色(需要管理员权限)",
"consumes": [
"application/json"
],
@@ -7384,39 +7531,46 @@
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "更新会话",
+ "summary": "更新成员角色",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
},
{
- "description": "会话信息",
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "角色信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Session"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest"
}
}
],
"responses": {
"200": {
- "description": "更新后的会话",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -7425,59 +7579,54 @@
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除指定的会话",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
+ "description": "从组织中移除成员(需要管理员权限)",
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "删除会话",
+ "summary": "移除成员",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "type": "string",
+ "description": "用户ID",
+ "name": "user_id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话不存在",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{id}/messages": {
- "delete": {
+ "/organizations/{id}/request-upgrade": {
+ "post": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "删除会话中的所有消息,同时清除 LLM 上下文和聊天历史知识库条目。会话本身保留。",
+ "description": "现有成员申请更高权限",
"consumes": [
"application/json"
],
@@ -7485,209 +7634,205 @@
"application/json"
],
"tags": [
- "会话"
+ "组织管理"
],
- "summary": "清空会话消息",
+ "summary": "申请权限升级",
"parameters": [
{
"type": "string",
- "description": "会话ID",
+ "description": "组织ID",
"name": "id",
"in": "path",
"required": true
+ },
+ {
+ "description": "申请信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest"
+ }
}
],
"responses": {
"200": {
- "description": "清空成功",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "请求参数错误",
+ "description": "Bad Request",
"schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "会话不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{session_id}/agent-qa": {
- "post": {
+ "/organizations/{id}/search-users": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "基于Agent的智能问答,支持多轮对话和SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "搜索用户(排除已有成员)用于邀请加入组织",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "Agent问答",
+ "summary": "搜索可邀请的用户",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
},
{
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
- }
+ "type": "string",
+ "description": "搜索关键词(用户名或邮箱)",
+ "name": "q",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "default": 10,
+ "description": "返回数量限制",
+ "name": "limit",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "403": {
+ "description": "Forbidden",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/sessions/{session_id}/continue": {
+ "/organizations/{id}/shared-agents": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "继续获取正在进行的流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享智能体,包含他人共享的与我共享的,用于列表页空间视角",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "继续流式响应",
+ "summary": "获取空间内全部智能体(含我共享的)",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "type": "string",
- "description": "消息ID",
- "name": "message_id",
- "in": "query",
- "required": true
}
],
"responses": {
"200": {
- "description": "流式响应",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "404": {
- "description": "会话或消息不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
}
},
- "/sessions/{session_id}/knowledge-qa": {
- "post": {
+ "/organizations/{id}/shared-knowledge-bases": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
- "consumes": [
- "application/json"
- ],
+ "description": "获取指定空间下所有共享知识库,包含直接共享的与通过共享智能体可见的,用于列表页空间视角",
"produces": [
- "text/event-stream"
+ "application/json"
],
"tags": [
- "问答"
+ "组织管理"
],
- "summary": "知识问答",
+ "summary": "获取空间内全部知识库(含我共享的、含智能体携带的)",
"parameters": [
{
"type": "string",
- "description": "会话ID",
- "name": "session_id",
+ "description": "组织ID",
+ "name": "id",
"in": "path",
"required": true
- },
- {
- "description": "问答请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.CreateKnowledgeQARequest"
- }
}
],
"responses": {
"200": {
- "description": "问答结果(SSE流)",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
+ }
+ }
+ }
+ },
+ "/organizations/{id}/shares": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "获取共享到指定组织的所有知识库",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "组织管理"
+ ],
+ "summary": "获取组织的共享知识库列表",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "组织ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse"
}
}
}
}
},
- "/sessions/{session_id}/stop": {
- "post": {
+ "/sessions": {
+ "get": {
"security": [
{
"Bearer": []
@@ -7696,7 +7841,7 @@
"ApiKeyAuth": []
}
],
- "description": "停止当前正在进行的生成任务",
+ "description": "获取当前租户的会话列表,支持分页",
"consumes": [
"application/json"
],
@@ -7704,45 +7849,39 @@
"application/json"
],
"tags": [
- "问答"
+ "会话"
],
- "summary": "停止生成",
+ "summary": "获取会话列表",
"parameters": [
{
- "type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
},
{
- "description": "停止请求",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler_session.StopSessionRequest"
- }
+ "type": "integer",
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
}
],
"responses": {
"200": {
- "description": "停止成功",
+ "description": "会话列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "会话或消息不存在",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- }
- },
- "/sessions/{session_id}/title": {
+ },
"post": {
"security": [
{
@@ -7752,7 +7891,7 @@
"ApiKeyAuth": []
}
],
- "description": "根据消息内容自动生成会话标题",
+ "description": "创建新的对话会话",
"consumes": [
"application/json"
],
@@ -7762,28 +7901,21 @@
"tags": [
"会话"
],
- "summary": "生成会话标题",
+ "summary": "创建会话",
"parameters": [
{
- "type": "string",
- "description": "会话ID",
- "name": "session_id",
- "in": "path",
- "required": true
- },
- {
- "description": "生成请求",
+ "description": "会话创建请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler_session.GenerateTitleRequest"
+ "$ref": "#/definitions/internal_handler_session.CreateSessionRequest"
}
}
],
"responses": {
- "200": {
- "description": "生成的标题",
+ "201": {
+ "description": "创建的会话",
"schema": {
"type": "object",
"additionalProperties": true
@@ -7792,40 +7924,63 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/shared-knowledge-bases": {
- "get": {
+ "/sessions/batch": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取通过组织共享给当前用户的所有知识库",
+ "description": "根据ID列表批量删除对话会话,或设置 delete_all=true 删除当前租户的所有会话",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "知识库共享"
+ "会话"
+ ],
+ "summary": "批量删除会话",
+ "parameters": [
+ {
+ "description": "批量删除请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.batchDeleteRequest"
+ }
+ }
],
- "summary": "获取共享给我的知识库列表",
"responses": {
"200": {
- "description": "OK",
+ "description": "删除结果",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/skills": {
- "get": {
+ "/sessions/search": {
+ "post": {
"security": [
{
"Bearer": []
@@ -7834,7 +7989,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取所有预装的Agent Skills元数据",
+ "description": "在知识库中搜索(不使用LLM总结)",
"consumes": [
"application/json"
],
@@ -7842,59 +7997,48 @@
"application/json"
],
"tags": [
- "Skills"
+ "问答"
],
- "summary": "获取预装Skills列表",
- "responses": {
- "200": {
- "description": "Skills列表",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "500": {
- "description": "服务器错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- }
- }
- }
- },
- "/system/docreader/reconnect": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "重连文档解析服务",
+ "summary": "知识搜索",
"parameters": [
{
- "description": "DocReader 地址",
+ "description": "搜索请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/internal_handler_session.SearchKnowledgeRequest"
}
}
],
"responses": {
"200": {
- "description": "OK"
+ "description": "搜索结果",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/system/info": {
+ "/sessions/{id}": {
"get": {
- "description": "获取系统版本、构建信息和引擎配置",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "根据ID获取会话详情",
"consumes": [
"application/json"
],
@@ -7902,41 +8046,44 @@
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "获取系统信息",
- "responses": {
- "200": {
- "description": "系统信息",
- "schema": {
- "$ref": "#/definitions/handler.GetSystemInfoResponse"
- }
+ "summary": "获取会话详情",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
- }
- }
- },
- "/system/parser-engines": {
- "get": {
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
],
- "summary": "列出可用的文档解析引擎",
"responses": {
"200": {
- "description": "解析引擎列表",
+ "description": "会话详情",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/system/parser-engines/check": {
- "post": {
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "更新会话属性",
"consumes": [
"application/json"
],
@@ -7944,30 +8091,53 @@
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "使用当前参数检测解析引擎可用性",
+ "summary": "更新会话",
"parameters": [
{
- "description": "解析引擎配置(与保存接口同结构)",
- "name": "body",
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "会话信息",
+ "name": "request",
"in": "body",
"required": true,
"schema": {
- "type": "object"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Session"
}
}
],
"responses": {
"200": {
- "description": "OK"
+ "description": "更新后的会话",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "会话不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- }
- },
- "/system/storage-engine-check": {
- "post": {
- "description": "使用当前填写的参数测试 MinIO/COS 连通性,不保存配置",
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "删除指定的会话",
"consumes": [
"application/json"
],
@@ -7975,58 +8145,46 @@
"application/json"
],
"tags": [
- "系统"
+ "会话"
],
- "summary": "测试存储引擎连通性",
+ "summary": "删除会话",
"parameters": [
{
- "description": "存储引擎配置",
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.StorageCheckRequest"
- }
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
}
],
"responses": {
"200": {
- "description": "OK",
+ "description": "删除成功",
"schema": {
- "$ref": "#/definitions/handler.StorageCheckResponse"
+ "type": "object",
+ "additionalProperties": true
}
- }
- }
- }
- },
- "/system/storage-engine-status": {
- "get": {
- "description": "返回 Local、MinIO、COS 各存储引擎的可用状态及说明,供全局设置与知识库选择使用",
- "produces": [
- "application/json"
- ],
- "tags": [
- "系统"
- ],
- "summary": "获取存储引擎状态",
- "responses": {
- "200": {
- "description": "OK",
+ },
+ "404": {
+ "description": "会话不存在",
"schema": {
- "$ref": "#/definitions/handler.GetStorageEngineStatusResponse"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants": {
- "get": {
+ "/sessions/{id}/messages": {
+ "delete": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取当前用户可访问的租户列表",
+ "description": "删除会话中的所有消息,同时清除 LLM 上下文和聊天历史知识库条目。会话本身保留。",
"consumes": [
"application/json"
],
@@ -8034,56 +8192,83 @@
"application/json"
],
"tags": [
- "租户管理"
+ "会话"
+ ],
+ "summary": "清空会话消息",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
],
- "summary": "获取租户列表",
"responses": {
"200": {
- "description": "租户列表",
+ "description": "清空成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "500": {
- "description": "服务器错误",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "会话不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
+ }
+ },
+ "/sessions/{session_id}/agent-qa": {
"post": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "创建新的租户",
+ "description": "基于Agent的智能问答,支持多轮对话和SSE流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
],
- "summary": "创建租户",
+ "summary": "Agent问答",
"parameters": [
{
- "description": "租户信息",
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问答请求",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Tenant"
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
}
}
],
"responses": {
- "201": {
- "description": "创建的租户",
+ "200": {
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8092,49 +8277,68 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/all": {
+ "/sessions/{session_id}/continue": {
"get": {
"security": [
{
"Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
- "description": "获取系统中所有租户(需要跨租户访问权限)",
+ "description": "继续获取正在进行的流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "继续流式响应",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "消息ID",
+ "name": "message_id",
+ "in": "query",
+ "required": true
+ }
],
- "summary": "获取所有租户列表",
"responses": {
"200": {
- "description": "所有租户列表",
+ "description": "流式响应",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "403": {
- "description": "权限不足",
+ "404": {
+ "description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/agent-config": {
- "get": {
+ "/sessions/{session_id}/knowledge-qa": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8143,20 +8347,38 @@
"ApiKeyAuth": []
}
],
- "description": "获取租户的全局Agent配置(默认应用于所有会话)",
+ "description": "基于知识库的问答(使用LLM总结),支持SSE流式响应",
"consumes": [
"application/json"
],
"produces": [
- "application/json"
+ "text/event-stream"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "知识问答",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "问答请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.CreateKnowledgeQARequest"
+ }
+ }
],
- "summary": "获取租户Agent配置",
"responses": {
"200": {
- "description": "Agent配置",
+ "description": "问答结果(SSE流)",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8165,14 +8387,14 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/conversation-config": {
- "get": {
+ "/sessions/{session_id}/stop": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8181,7 +8403,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取租户的全局对话配置(默认应用于普通模式会话)",
+ "description": "停止当前正在进行的生成任务",
"consumes": [
"application/json"
],
@@ -8189,28 +8411,46 @@
"application/json"
],
"tags": [
- "租户管理"
+ "问答"
+ ],
+ "summary": "停止生成",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "停止请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.StopSessionRequest"
+ }
+ }
],
- "summary": "获取租户对话配置",
"responses": {
"200": {
- "description": "对话配置",
+ "description": "停止成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "请求参数错误",
+ "404": {
+ "description": "会话或消息不存在",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/prompt-templates": {
- "get": {
+ "/sessions/{session_id}/title": {
+ "post": {
"security": [
{
"Bearer": []
@@ -8219,7 +8459,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取系统配置的提示词模板列表",
+ "description": "根据消息内容自动生成会话标题",
"consumes": [
"application/json"
],
@@ -8227,12 +8467,30 @@
"application/json"
],
"tags": [
- "租户管理"
+ "会话"
+ ],
+ "summary": "生成会话标题",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "会话ID",
+ "name": "session_id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "生成请求",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler_session.GenerateTitleRequest"
+ }
+ }
],
- "summary": "获取提示词模板",
"responses": {
"200": {
- "description": "提示词模板配置",
+ "description": "生成的标题",
"schema": {
"type": "object",
"additionalProperties": true
@@ -8241,51 +8499,39 @@
"400": {
"description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/tenants/kv/web-search-config": {
+ "/shared-knowledge-bases": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "获取租户的网络搜索配置",
- "consumes": [
- "application/json"
- ],
+ "description": "获取通过组织共享给当前用户的所有知识库",
"produces": [
"application/json"
],
"tags": [
- "租户管理"
+ "知识库共享"
],
- "summary": "获取租户网络搜索配置",
+ "summary": "获取共享给我的知识库列表",
"responses": {
"200": {
- "description": "网络搜索配置",
+ "description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
}
},
- "/tenants/kv/{key}": {
+ "/skills": {
"get": {
"security": [
{
@@ -8295,7 +8541,7 @@
"ApiKeyAuth": []
}
],
- "description": "获取租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ "description": "获取所有预装的Agent Skills元数据",
"consumes": [
"application/json"
],
@@ -8303,44 +8549,28 @@
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "获取租户KV配置",
- "parameters": [
- {
- "type": "string",
- "description": "配置键名",
- "name": "key",
- "in": "path",
- "required": true
- }
+ "Skills"
],
+ "summary": "获取预装Skills列表",
"responses": {
"200": {
- "description": "配置值",
+ "description": "Skills列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "不支持的键",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
- },
- "put": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "更新租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ }
+ },
+ "/system/docreader/reconnect": {
+ "post": {
"consumes": [
"application/json"
],
@@ -8348,19 +8578,12 @@
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "更新租户KV配置",
+ "summary": "重连文档解析服务",
"parameters": [
{
- "type": "string",
- "description": "配置键名",
- "name": "key",
- "in": "path",
- "required": true
- },
- {
- "description": "配置值",
+ "description": "DocReader 地址",
"name": "request",
"in": "body",
"required": true,
@@ -8371,32 +8594,14 @@
],
"responses": {
"200": {
- "description": "更新成功",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "不支持的键",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "description": "OK"
}
}
}
},
- "/tenants/search": {
+ "/system/info": {
"get": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "分页搜索租户(需要跨租户访问权限)",
+ "description": "获取系统版本、构建信息和引擎配置",
"consumes": [
"application/json"
],
@@ -8404,113 +8609,41 @@
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "搜索租户",
- "parameters": [
- {
- "type": "string",
- "description": "搜索关键词",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "租户ID筛选",
- "name": "tenant_id",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 1,
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "default": 20,
- "description": "每页数量",
- "name": "page_size",
- "in": "query"
- }
+ "系统"
],
+ "summary": "获取系统信息",
"responses": {
"200": {
- "description": "搜索结果",
+ "description": "系统信息",
"schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "403": {
- "description": "权限不足",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/internal_handler.GetSystemInfoResponse"
}
}
}
}
},
- "/tenants/{id}": {
+ "/system/parser-engines": {
"get": {
- "security": [
- {
- "Bearer": []
- },
- {
- "ApiKeyAuth": []
- }
- ],
- "description": "根据ID获取租户详情",
- "consumes": [
- "application/json"
- ],
"produces": [
"application/json"
],
"tags": [
- "租户管理"
- ],
- "summary": "获取租户详情",
- "parameters": [
- {
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
- }
+ "系统"
],
+ "summary": "列出可用的文档解析引擎",
"responses": {
"200": {
- "description": "租户详情",
+ "description": "解析引擎列表",
"schema": {
"type": "object",
"additionalProperties": true
}
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "404": {
- "description": "租户不存在",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
}
}
- },
- "put": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "更新租户信息",
+ }
+ },
+ "/system/parser-engines/check": {
+ "post": {
"consumes": [
"application/json"
],
@@ -8518,50 +8651,30 @@
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "更新租户",
+ "summary": "使用当前参数检测解析引擎可用性",
"parameters": [
{
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
- },
- {
- "description": "租户信息",
- "name": "request",
+ "description": "解析引擎配置(与保存接口同结构)",
+ "name": "body",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/types.Tenant"
+ "type": "object"
}
}
],
"responses": {
"200": {
- "description": "更新后的租户",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "400": {
- "description": "请求参数错误",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
+ "description": "OK"
}
}
- },
- "delete": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "description": "删除指定的租户",
+ }
+ },
+ "/system/storage-engine-check": {
+ "post": {
+ "description": "使用当前填写的参数测试 MinIO/COS 连通性,不保存配置",
"consumes": [
"application/json"
],
@@ -8569,66 +8682,80 @@
"application/json"
],
"tags": [
- "租户管理"
+ "系统"
],
- "summary": "删除租户",
+ "summary": "测试存储引擎连通性",
"parameters": [
{
- "type": "integer",
- "description": "租户ID",
- "name": "id",
- "in": "path",
- "required": true
+ "description": "存储引擎配置",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.StorageCheckRequest"
+ }
}
],
"responses": {
"200": {
- "description": "删除成功",
+ "description": "OK",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/internal_handler.StorageCheckResponse"
}
- },
- "400": {
- "description": "请求参数错误",
+ }
+ }
+ }
+ },
+ "/system/storage-engine-status": {
+ "get": {
+ "description": "返回 Local、MinIO、COS 各存储引擎的可用状态及说明,供全局设置与知识库选择使用",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "系统"
+ ],
+ "summary": "获取存储引擎状态",
+ "responses": {
+ "200": {
+ "description": "OK",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/internal_handler.GetStorageEngineStatusResponse"
}
}
}
}
},
- "/vector-stores": {
+ "/tenants": {
"get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
+ "description": "获取当前用户可访问的租户列表",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "List vector stores",
+ "summary": "获取租户列表",
"responses": {
"200": {
- "description": "List of vector stores (env + DB)",
+ "description": "租户列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "500": {
+ "description": "服务器错误",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
@@ -8637,12 +8764,9 @@
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Create a new vector store configuration for the current tenant",
+ "description": "创建新的租户",
"consumes": [
"application/json"
],
@@ -8650,61 +8774,45 @@
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Create vector store",
+ "summary": "创建租户",
"parameters": [
{
- "description": "Vector store configuration",
+ "description": "租户信息",
"name": "request",
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/handler.CreateStoreRequest"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
}
}
],
"responses": {
"201": {
- "description": "Created vector store",
+ "description": "创建的租户",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Invalid request or validation error",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "401": {
- "description": "Unauthorized",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "409": {
- "description": "Duplicate endpoint and index",
+ "description": "请求参数错误",
"schema": {
- "$ref": "#/definitions/errors.AppError"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/test": {
- "post": {
+ "/tenants/all": {
+ "get": {
"security": [
{
"Bearer": []
- },
- {
- "ApiKeyAuth": []
}
],
- "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "description": "获取系统中所有租户(需要跨租户访问权限)",
"consumes": [
"application/json"
],
@@ -8712,66 +8820,65 @@
"application/json"
],
"tags": [
- "VectorStore"
- ],
- "summary": "Test vector store connection with raw credentials",
- "parameters": [
- {
- "description": "Engine type and connection config",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.TestStoreRequest"
- }
- }
+ "租户管理"
],
+ "summary": "获取所有租户列表",
"responses": {
"200": {
- "description": "Connection test result (success, version)",
+ "description": "所有租户列表",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "400": {
- "description": "Invalid request",
- "schema": {
- "$ref": "#/definitions/errors.AppError"
- }
- },
- "401": {
- "description": "Unauthorized",
+ "403": {
+ "description": "权限不足",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/types": {
+ "/tenants/kv/agent-config": {
"get": {
- "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取租户的全局Agent配置(默认应用于所有会话)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "List vector store types",
+ "summary": "获取租户Agent配置",
"responses": {
"200": {
- "description": "List of engine types with config schemas",
+ "description": "Agent配置",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
}
},
- "/vector-stores/{id}": {
+ "/tenants/kv/conversation-config": {
"get": {
"security": [
{
@@ -8781,48 +8888,112 @@
"ApiKeyAuth": []
}
],
- "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
- "produces": [
- "application/json"
+ "description": "获取租户的全局对话配置(默认应用于普通模式会话)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Get vector store",
- "parameters": [
+ "summary": "获取租户对话配置",
+ "responses": {
+ "200": {
+ "description": "对话配置",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/tenants/kv/prompt-templates": {
+ "get": {
+ "security": [
{
- "type": "string",
- "description": "Vector store ID",
- "name": "id",
- "in": "path",
- "required": true
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
}
],
+ "description": "获取系统配置的提示词模板列表",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取提示词模板",
"responses": {
"200": {
- "description": "Vector store details",
+ "description": "提示词模板配置",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "400": {
+ "description": "请求参数错误",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ }
+ }
+ }
+ },
+ "/tenants/kv/web-search-config": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
- "404": {
- "description": "Vector store not found",
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "获取租户的网络搜索配置",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "获取租户网络搜索配置",
+ "responses": {
+ "200": {
+ "description": "网络搜索配置",
"schema": {
"type": "object",
"additionalProperties": true
}
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
}
}
- },
- "put": {
+ }
+ },
+ "/tenants/kv/{key}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -8831,7 +9002,7 @@
"ApiKeyAuth": []
}
],
- "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "description": "获取租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
"consumes": [
"application/json"
],
@@ -8839,59 +9010,35 @@
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Update vector store",
+ "summary": "获取租户KV配置",
"parameters": [
{
"type": "string",
- "description": "Vector store ID",
- "name": "id",
+ "description": "配置键名",
+ "name": "key",
"in": "path",
"required": true
- },
- {
- "description": "Updated fields",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/handler.UpdateStoreRequest"
- }
}
],
"responses": {
"200": {
- "description": "Updated vector store",
+ "description": "配置值",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Env store or validation error",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "401": {
- "description": "Unauthorized",
- "schema": {
- "type": "object",
- "additionalProperties": true
- }
- },
- "404": {
- "description": "Vector store not found",
+ "description": "不支持的键",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
},
- "delete": {
+ "put": {
"security": [
{
"Bearer": []
@@ -8900,57 +9047,120 @@
"ApiKeyAuth": []
}
],
- "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "description": "更新租户级别的KV配置(支持agent-config、web-search-config、conversation-config)",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Delete vector store",
+ "summary": "更新租户KV配置",
"parameters": [
{
"type": "string",
- "description": "Vector store ID",
- "name": "id",
+ "description": "配置键名",
+ "name": "key",
"in": "path",
"required": true
+ },
+ {
+ "description": "配置值",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "type": "object"
+ }
}
],
"responses": {
"200": {
- "description": "Deletion success",
+ "description": "更新成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
- "description": "Env store cannot be deleted",
+ "description": "不支持的键",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
+ }
+ }
+ }
+ },
+ "/tenants/search": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
},
- "401": {
- "description": "Unauthorized",
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "分页搜索租户(需要跨租户访问权限)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "搜索租户",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "搜索关键词",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "租户ID筛选",
+ "name": "tenant_id",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 1,
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "default": 20,
+ "description": "每页数量",
+ "name": "page_size",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "搜索结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Vector store not found",
+ "403": {
+ "description": "权限不足",
"schema": {
- "type": "object",
- "additionalProperties": true
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
}
}
}
}
},
- "/vector-stores/{id}/test": {
- "post": {
+ "/tenants/{id}": {
+ "get": {
"security": [
{
"Bearer": []
@@ -8959,18 +9169,21 @@
"ApiKeyAuth": []
}
],
- "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "description": "根据ID获取租户详情",
+ "consumes": [
+ "application/json"
+ ],
"produces": [
"application/json"
],
"tags": [
- "VectorStore"
+ "租户管理"
],
- "summary": "Test vector store connection by ID",
+ "summary": "获取租户详情",
"parameters": [
{
- "type": "string",
- "description": "Vector store ID",
+ "type": "integer",
+ "description": "租户ID",
"name": "id",
"in": "path",
"required": true
@@ -8978,21 +9191,264 @@
],
"responses": {
"200": {
- "description": "Connection test result (success, version)",
+ "description": "租户详情",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "401": {
- "description": "Unauthorized",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "404": {
+ "description": "租户不存在",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "更新租户信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "更新租户",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "租户信息",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新后的租户",
"schema": {
"type": "object",
"additionalProperties": true
}
},
- "404": {
- "description": "Vector store not found",
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ }
+ ],
+ "description": "删除指定的租户",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "租户管理"
+ ],
+ "summary": "删除租户",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "租户ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "请求参数错误",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "List all vector stores for the current tenant, including environment-configured and user-created stores",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector stores",
+ "responses": {
+ "200": {
+ "description": "List of vector stores (env + DB)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Create a new vector store configuration for the current tenant",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Create vector store",
+ "parameters": [
+ {
+ "description": "Vector store configuration",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.CreateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Created vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request or validation error",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "409": {
+ "description": "Duplicate endpoint and index",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity using provided credentials without persisting. Returns detected server version.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection with raw credentials",
+ "parameters": [
+ {
+ "description": "Engine type and connection config",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.TestStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Invalid request",
+ "schema": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError"
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": true
@@ -9000,2440 +9456,2917 @@
}
}
}
- }
- },
- "definitions": {
- "datasource.ConnectorMetadata": {
+ },
+ "/vector-stores/types": {
+ "get": {
+ "description": "Return supported engine types with connection and index field schemas for UI form generation",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "List vector store types",
+ "responses": {
+ "200": {
+ "description": "List of engine types with config schemas",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}": {
+ "get": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Retrieve a single vector store by ID. Supports both DB stores and env stores (__env_* IDs)",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Get vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Vector store details",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Update a vector store (name only). Engine type, connection config, and index config are immutable. Env stores cannot be modified.",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Update vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "description": "Updated fields",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/internal_handler.UpdateStoreRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Updated vector store",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store or validation error",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Soft-delete a vector store. Env stores cannot be deleted.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Delete vector store",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deletion success",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "400": {
+ "description": "Env store cannot be deleted",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ "/vector-stores/{id}/test": {
+ "post": {
+ "security": [
+ {
+ "Bearer": []
+ },
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "description": "Test connectivity of an existing saved or env store. Returns detected server version. For DB stores, the version is automatically saved to connection_config.",
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "VectorStore"
+ ],
+ "summary": "Test vector store connection by ID",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Vector store ID",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Connection test result (success, version)",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ },
+ "404": {
+ "description": "Vector store not found",
+ "schema": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue": {
+ "type": "object",
+ "properties": {
+ "auto_fixable": {
+ "type": "boolean"
+ },
+ "description": {
+ "type": "string"
+ },
+ "page_slug": {
+ "type": "string"
+ },
+ "severity": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity"
+ },
+ "target_slug": {
+ "description": "TargetSlug identifies the other page involved in the issue (e.g. the\nbroken link target, or the entity slug for a missing cross-ref). It is\nthe structured field used by AutoFix instead of parsing Description.",
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity": {
+ "type": "string",
+ "enum": [
+ "info",
+ "warning",
+ "error"
+ ],
+ "x-enum-varnames": [
+ "SeverityInfo",
+ "SeverityWarning",
+ "SeverityError"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType": {
+ "type": "string",
+ "enum": [
+ "orphan_page",
+ "broken_link",
+ "stale_ref",
+ "missing_cross_ref",
+ "empty_content",
+ "duplicate_slug"
+ ],
+ "x-enum-varnames": [
+ "LintIssueOrphanPage",
+ "LintIssueBrokenLink",
+ "LintIssueStaleRef",
+ "LintIssueMissingCrossRef",
+ "LintIssueEmptyContent",
+ "LintIssueDuplicateSlug"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_application_service.WikiLintReport": {
+ "type": "object",
+ "properties": {
+ "health_score": {
+ "description": "0-100",
+ "type": "integer"
+ },
+ "issues": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue"
+ }
+ },
+ "knowledge_base_id": {
+ "type": "string"
+ },
+ "stats": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "type": "string"
+ },
+ "capabilities": {
+ "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "priority": {
+ "description": "Priority order for UI display (lower = higher priority)",
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode"
+ },
+ "details": {},
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_errors.ErrorCode": {
+ "type": "integer",
+ "enum": [
+ 1000,
+ 1001,
+ 1002,
+ 1003,
+ 1004,
+ 1005,
+ 1006,
+ 1007,
+ 1008,
+ 1009,
+ 1010,
+ 2000,
+ 2001,
+ 2002,
+ 2003,
+ 2004,
+ 2100,
+ 2101,
+ 2102,
+ 2103
+ ],
+ "x-enum-varnames": [
+ "ErrBadRequest",
+ "ErrUnauthorized",
+ "ErrForbidden",
+ "ErrNotFound",
+ "ErrMethodNotAllowed",
+ "ErrConflict",
+ "ErrTooManyRequests",
+ "ErrInternalServer",
+ "ErrServiceUnavailable",
+ "ErrTimeout",
+ "ErrValidation",
+ "ErrTenantNotFound",
+ "ErrTenantAlreadyExists",
+ "ErrTenantInactive",
+ "ErrTenantNameRequired",
+ "ErrTenantInvalidStatus",
+ "ErrAgentMissingThinkingModel",
+ "ErrAgentMissingAllowedTools",
+ "ErrAgentInvalidMaxIterations",
+ "ErrAgentInvalidTemperature"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ASRConfig": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "language": {
+ "description": "optional: language hint for transcription",
+ "type": "string"
+ },
+ "model_id": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentConfig": {
+ "type": "object",
+ "properties": {
+ "allowed_skills": {
+ "description": "Skill names whitelist (empty = allow all)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "allowed_tools": {
+ "description": "List of allowed tool names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "knowledge_bases": {
+ "description": "Accessible knowledge base IDs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_ids": {
+ "description": "Accessible knowledge IDs (individual documents)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
+ "type": "integer"
+ },
+ "max_context_tokens": {
+ "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "Maximum number of ReAct iterations",
+ "type": "integer"
+ },
+ "max_tool_output_chars": {
+ "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection",
+ "type": "string"
+ },
+ "mcp_services": {
+ "description": "Selected MCP service IDs (when mode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "multi_turn_enabled": {
+ "description": "Whether multi-turn conversation is enabled",
+ "type": "boolean"
+ },
+ "parallel_tool_calls": {
+ "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
+ "type": "boolean"
+ },
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history (like wiki_read_page results) across turns (default: false)",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
+ "type": "boolean"
+ },
+ "skill_dirs": {
+ "description": "Directories to search for skills",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_enabled": {
+ "description": "Skills configuration (Progressive Disclosure pattern)",
+ "type": "boolean"
+ },
+ "system_prompt": {
+ "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
+ "type": "string"
+ },
+ "system_prompt_web_disabled": {
+ "description": "Deprecated: Custom prompt when web search is disabled",
+ "type": "string"
+ },
+ "system_prompt_web_enabled": {
+ "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
+ "type": "string"
+ },
+ "temperature": {
+ "description": "LLM temperature for agent",
+ "type": "number"
+ },
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
+ },
+ "use_custom_system_prompt": {
+ "description": "Whether to use custom system prompt instead of default",
+ "type": "boolean"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search tool is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum number of web search results (default: 5)",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderEntity ID (resolved from agent config)",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AgentStep": {
+ "type": "object",
+ "properties": {
+ "iteration": {
+ "description": "Iteration number (0-indexed)",
+ "type": "integer"
+ },
+ "thought": {
+ "description": "LLM's reasoning/thinking (Think phase)",
+ "type": "string"
+ },
+ "timestamp": {
+ "description": "When this step occurred",
+ "type": "string"
+ },
+ "tool_calls": {
+ "description": "Tools called in this step (Act phase)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall"
+ }
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.AnswerStrategy": {
+ "type": "string",
+ "enum": [
+ "all",
+ "random"
+ ],
+ "x-enum-varnames": [
+ "AnswerStrategyAll",
+ "AnswerStrategyRandom"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.COSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "bucket_name": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_id": {
+ "type": "string"
+ },
+ "secret_key": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig": {
"type": "object",
"properties": {
- "auth_type": {
- "description": "\"oauth2\", \"api_key\", \"token\", etc.",
+ "embedding_model_id": {
+ "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
"type": "string"
},
- "capabilities": {
- "description": "\"incremental\", \"webhook\", \"deletion_sync\", etc.",
+ "enabled": {
+ "description": "Enabled controls whether chat history indexing is active",
+ "type": "boolean"
+ },
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ChunkingConfig": {
+ "type": "object",
+ "properties": {
+ "child_chunk_size": {
+ "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "chunk_overlap": {
+ "description": "Chunk overlap",
+ "type": "integer"
+ },
+ "chunk_size": {
+ "description": "Chunk size",
+ "type": "integer"
+ },
+ "enable_multimodal": {
+ "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
+ "type": "boolean"
+ },
+ "enable_parent_child": {
+ "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
+ "type": "boolean"
+ },
+ "parent_chunk_size": {
+ "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
+ "type": "integer"
+ },
+ "parser_engine_rules": {
+ "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "description": "Separators",
"type": "array",
"items": {
"type": "string"
}
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ConnectionConfig": {
+ "type": "object",
+ "properties": {
+ "addr": {
+ "description": "Common",
+ "type": "string"
},
- "description": {
+ "api_key": {
+ "description": "AES-GCM encrypted",
"type": "string"
},
- "icon": {
+ "grpc_address": {
+ "description": "Weaviate",
"type": "string"
},
- "name": {
+ "host": {
+ "description": "Qdrant",
"type": "string"
},
- "priority": {
- "description": "Priority order for UI display (lower = higher priority)",
+ "password": {
+ "description": "AES-GCM encrypted",
+ "type": "string"
+ },
+ "port": {
"type": "integer"
},
- "type": {
+ "scheme": {
"type": "string"
- }
- }
- },
- "errors.AppError": {
- "type": "object",
- "properties": {
- "code": {
- "$ref": "#/definitions/errors.ErrorCode"
},
- "details": {},
- "message": {
+ "use_default_connection": {
+ "description": "Postgres",
+ "type": "boolean"
+ },
+ "use_tls": {
+ "type": "boolean"
+ },
+ "username": {
+ "type": "string"
+ },
+ "version": {
+ "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
"type": "string"
}
}
},
- "errors.ErrorCode": {
- "type": "integer",
+ "github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy": {
+ "type": "string",
"enum": [
- 1000,
- 1001,
- 1002,
- 1003,
- 1004,
- 1005,
- 1006,
- 1007,
- 1008,
- 1009,
- 1010,
- 2000,
- 2001,
- 2002,
- 2003,
- 2004,
- 2100,
- 2101,
- 2102,
- 2103
+ "sliding_window",
+ "smart"
],
"x-enum-varnames": [
- "ErrBadRequest",
- "ErrUnauthorized",
- "ErrForbidden",
- "ErrNotFound",
- "ErrMethodNotAllowed",
- "ErrConflict",
- "ErrTooManyRequests",
- "ErrInternalServer",
- "ErrServiceUnavailable",
- "ErrTimeout",
- "ErrValidation",
- "ErrTenantNotFound",
- "ErrTenantAlreadyExists",
- "ErrTenantInactive",
- "ErrTenantNameRequired",
- "ErrTenantInvalidStatus",
- "ErrAgentMissingThinkingModel",
- "ErrAgentMissingAllowedTools",
- "ErrAgentInvalidMaxIterations",
- "ErrAgentInvalidTemperature"
+ "ContextCompressionSlidingWindow",
+ "ContextCompressionSmart"
]
},
- "github_com_Tencent_WeKnora_internal_errors.AppError": {
+ "github_com_Tencent_WeKnora_internal_types.ContextConfig": {
"type": "object",
"properties": {
- "code": {
- "$ref": "#/definitions/errors.ErrorCode"
+ "compression_strategy": {
+ "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy"
+ }
+ ]
},
- "details": {},
- "message": {
- "type": "string"
+ "max_tokens": {
+ "description": "Maximum tokens allowed in LLM context",
+ "type": "integer"
+ },
+ "recent_message_count": {
+ "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
+ "type": "integer"
+ },
+ "summarize_threshold": {
+ "description": "Summarize threshold: number of messages before summarization",
+ "type": "integer"
}
}
},
- "gorm.DeletedAt": {
+ "github_com_Tencent_WeKnora_internal_types.ConversationConfig": {
"type": "object",
"properties": {
- "time": {
+ "context_template": {
+ "description": "ContextTemplate is the prompt template for summarizing retrieval results",
"type": "string"
},
- "valid": {
- "description": "Valid is true if Time is not NULL",
+ "embedding_top_k": {
+ "type": "integer"
+ },
+ "enable_query_expansion": {
"type": "boolean"
- }
- }
- },
- "handler.CopyKnowledgeBaseRequest": {
- "type": "object",
- "required": [
- "source_id"
- ],
- "properties": {
- "source_id": {
- "type": "string"
},
- "target_id": {
+ "enable_rewrite": {
+ "type": "boolean"
+ },
+ "fallback_prompt": {
"type": "string"
},
- "task_id": {
+ "fallback_response": {
"type": "string"
- }
- }
- },
- "handler.CreateAgentRequest": {
- "type": "object",
- "required": [
- "name"
- ],
- "properties": {
- "avatar": {
+ },
+ "fallback_strategy": {
+ "description": "Fallback strategy",
"type": "string"
},
- "config": {
- "$ref": "#/definitions/types.CustomAgentConfig"
+ "keyword_threshold": {
+ "type": "number"
},
- "description": {
+ "max_completion_tokens": {
+ "description": "MaxTokens is the maximum number of tokens to generate",
+ "type": "integer"
+ },
+ "max_rounds": {
+ "description": "Retrieval \u0026 strategy parameters",
+ "type": "integer"
+ },
+ "prompt": {
+ "description": "Prompt is the system prompt for normal mode",
"type": "string"
},
- "name": {
+ "rerank_model_id": {
"type": "string"
- }
- }
- },
- "handler.CreateModelRequest": {
- "type": "object",
- "required": [
- "name",
- "parameters",
- "source",
- "type"
- ],
- "properties": {
- "description": {
+ },
+ "rerank_threshold": {
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "type": "integer"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompts",
"type": "string"
},
- "name": {
+ "rewrite_prompt_user": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/types.ModelParameters"
+ "summary_model_id": {
+ "description": "Model configuration",
+ "type": "string"
},
- "source": {
- "$ref": "#/definitions/types.ModelSource"
+ "temperature": {
+ "description": "Temperature controls the randomness of the model output",
+ "type": "number"
},
- "type": {
- "$ref": "#/definitions/types.ModelType"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "handler.CreateStoreRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest": {
"type": "object",
"required": [
- "connection_config",
- "engine_type",
"name"
],
"properties": {
- "connection_config": {
- "$ref": "#/definitions/types.ConnectionConfig"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "engine_type": {
- "$ref": "#/definitions/types.RetrieverEngineType"
+ "description": {
+ "type": "string",
+ "maxLength": 1000
},
- "index_config": {
- "$ref": "#/definitions/types.IndexConfig"
+ "invite_code_validity_days": {
+ "description": "optional: 0=never, 1, 7, 30; default 7",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "optional: max members; 0=unlimited; default 50",
+ "type": "integer"
},
"name": {
- "type": "string"
+ "type": "string",
+ "maxLength": 255,
+ "minLength": 1
}
}
},
- "handler.DeleteTagRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CredentialsConfig": {
"type": "object",
"properties": {
- "exclude_ids": {
- "description": "Chunk seq_ids to exclude from deletion",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "weknoracloud": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials"
}
}
},
- "handler.EvaluationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.CustomAgentConfig": {
"type": "object",
"properties": {
- "chat_id": {
- "description": "ID of chat model to use",
+ "agent_mode": {
+ "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
"type": "string"
},
- "dataset_id": {
- "description": "ID of dataset to evaluate",
+ "agent_type": {
+ "description": "AgentType is a preset category under smart-reasoning mode that pre-fills\nsystem prompt, allowed tools and recommended KB compatibility.\nValid values: \"rag-qa\", \"wiki-qa\", \"hybrid-rag-wiki\", \"custom\".\nEmpty / unknown values are treated as \"custom\" (no preset applied).\nIgnored for quick-answer mode.",
"type": "string"
},
- "knowledge_base_id": {
- "description": "ID of knowledge base to use",
+ "allowed_tools": {
+ "description": "Allowed tools (only for agent type)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "asr_model_id": {
+ "description": "ASR model ID for audio transcription (optional)",
"type": "string"
},
- "rerank_id": {
- "description": "ID of rerank model to use",
+ "audio_upload_enabled": {
+ "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "context_template": {
+ "description": "Context template for normal mode (how to format retrieved chunks)",
"type": "string"
- }
- }
- },
- "handler.FabriTextRequest": {
- "type": "object",
- "required": [
- "model_id"
- ],
- "properties": {
- "model_id": {
+ },
+ "context_template_id": {
+ "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- },
- "handler.GetStorageEngineStatusResponse": {
- "type": "object",
- "properties": {
- "engines": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler.StorageEngineStatusItem"
- }
+ "embedding_top_k": {
+ "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
+ "type": "integer"
},
- "minio_env_available": {
+ "enable_query_expansion": {
+ "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
"type": "boolean"
- }
- }
- },
- "handler.GetSystemInfoResponse": {
- "type": "object",
- "properties": {
- "build_time": {
+ },
+ "enable_rewrite": {
+ "description": "Whether to enable query rewrite for multi-turn conversations",
+ "type": "boolean"
+ },
+ "fallback_prompt": {
+ "description": "Fallback prompt (when FallbackStrategy is \"model\")",
"type": "string"
},
- "commit_id": {
+ "fallback_response": {
+ "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
"type": "string"
},
- "db_version": {
+ "fallback_strategy": {
+ "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
"type": "string"
},
- "edition": {
+ "faq_direct_answer_threshold": {
+ "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
+ "type": "number"
+ },
+ "faq_priority_enabled": {
+ "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
+ "type": "boolean"
+ },
+ "faq_score_boost": {
+ "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
+ "type": "number"
+ },
+ "history_turns": {
+ "description": "Number of history turns to keep in context",
+ "type": "integer"
+ },
+ "image_storage_provider": {
+ "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
"type": "string"
},
- "go_version": {
+ "image_upload_enabled": {
+ "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
+ "type": "boolean"
+ },
+ "kb_selection_mode": {
+ "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
"type": "string"
},
- "graph_database_engine": {
+ "keyword_threshold": {
+ "description": "Keyword retrieval threshold",
+ "type": "number"
+ },
+ "knowledge_bases": {
+ "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "llm_call_timeout": {
+ "description": "Timeout for a single LLM call in seconds (0 = use global default)",
+ "type": "integer"
+ },
+ "max_completion_tokens": {
+ "description": "Maximum completion tokens (only for normal mode)",
+ "type": "integer"
+ },
+ "max_iterations": {
+ "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
+ "type": "integer"
+ },
+ "mcp_selection_mode": {
+ "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
"type": "string"
},
- "keyword_index_engine": {
+ "mcp_services": {
+ "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "model_id": {
+ "description": "===== Model Settings =====\nModel ID to use for conversations",
"type": "string"
},
- "minio_enabled": {
+ "multi_turn_enabled": {
+ "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
"type": "boolean"
},
- "vector_store_engine": {
+ "rerank_model_id": {
+ "description": "ReRank model ID for retrieval",
"type": "string"
},
- "version": {
+ "rerank_threshold": {
+ "description": "Rerank threshold",
+ "type": "number"
+ },
+ "rerank_top_k": {
+ "description": "Rerank top K",
+ "type": "integer"
+ },
+ "retain_retrieval_history": {
+ "description": "Whether to retain retrieval history across turns",
+ "type": "boolean"
+ },
+ "retrieve_kb_only_when_mentioned": {
+ "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "type": "boolean"
+ },
+ "rewrite_prompt_system": {
+ "description": "Rewrite prompt system message",
"type": "string"
- }
- }
- },
- "handler.KBModelConfigRequest": {
- "type": "object",
- "required": [
- "embeddingModelId",
- "llmModelId"
- ],
- "properties": {
- "asr_config": {
- "$ref": "#/definitions/types.ASRConfig"
},
- "documentSplitting": {
- "description": "文档分块配置",
- "type": "object",
- "properties": {
- "childChunkSize": {
- "type": "integer"
- },
- "chunkOverlap": {
- "type": "integer"
- },
- "chunkSize": {
- "type": "integer"
- },
- "enableParentChild": {
- "type": "boolean"
- },
- "parentChunkSize": {
- "type": "integer"
- },
- "parserEngineRules": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.ParserEngineRule"
- }
- },
- "separators": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
+ "rewrite_prompt_user": {
+ "description": "Rewrite prompt user message template",
+ "type": "string"
+ },
+ "selected_skills": {
+ "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "skills_selection_mode": {
+ "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
+ "type": "string"
+ },
+ "suggested_prompts": {
+ "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
- "embeddingModelId": {
+ "supported_file_types": {
+ "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "system_prompt": {
+ "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
"type": "string"
},
- "llmModelId": {
+ "system_prompt_id": {
+ "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
"type": "string"
},
- "multimodal": {
- "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- }
- }
+ "temperature": {
+ "description": "Temperature for LLM (0-1)",
+ "type": "number"
},
- "nodeExtract": {
- "description": "知识图谱配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphRelation"
- }
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "text": {
- "type": "string"
- }
- }
+ "thinking": {
+ "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "type": "boolean"
},
- "questionGeneration": {
- "description": "问题生成配置",
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
- },
- "questionCount": {
- "type": "integer"
- }
- }
+ "vector_threshold": {
+ "description": "Vector retrieval threshold",
+ "type": "number"
},
- "storageProvider": {
- "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "vlm_model_id": {
+ "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
"type": "string"
},
- "vlm_config": {
- "$ref": "#/definitions/types.VLMConfig"
+ "web_fetch_enabled": {
+ "description": "Whether to auto-fetch full page content for reranked web search results",
+ "type": "boolean"
+ },
+ "web_fetch_top_n": {
+ "description": "Max number of pages to fetch after rerank (default: 3)",
+ "type": "integer"
+ },
+ "web_search_enabled": {
+ "description": "===== Web Search Settings =====\nWhether web search is enabled",
+ "type": "boolean"
+ },
+ "web_search_max_results": {
+ "description": "Maximum web search results",
+ "type": "integer"
+ },
+ "web_search_provider_id": {
+ "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
+ "type": "string"
}
}
},
- "handler.RemoteModelCheckRequest": {
+ "github_com_Tencent_WeKnora_internal_types.DataSource": {
"type": "object",
- "required": [
- "baseUrl",
- "modelName"
- ],
"properties": {
- "apiKey": {
+ "config": {
+ "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "conflict_strategy": {
+ "description": "Conflict resolution strategy: overwrite or skip",
"type": "string"
},
- "baseUrl": {
+ "created_at": {
+ "description": "Creation timestamp",
"type": "string"
},
- "modelName": {
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "error_message": {
+ "description": "Error message if status is \"error\"",
"type": "string"
},
- "provider": {
+ "id": {
+ "description": "Unique identifier",
"type": "string"
- }
- }
- },
- "handler.SearchMessagesRequest": {
- "type": "object",
- "required": [
- "query"
- ],
- "properties": {
- "limit": {
- "description": "Maximum number of results to return (default: 20)",
- "type": "integer"
},
- "mode": {
- "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "knowledge_base_id": {
+ "description": "Target knowledge base ID",
"type": "string"
},
- "query": {
- "description": "Query text for search",
+ "last_sync_at": {
+ "description": "Last successful sync timestamp",
"type": "string"
},
- "session_ids": {
- "description": "Filter by specific session IDs (optional)",
+ "last_sync_cursor": {
+ "description": "Cursor or state for incremental sync (connector-specific)",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "handler.StorageCheckRequest": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/types.COSEngineConfig"
},
- "minio": {
- "$ref": "#/definitions/types.MinIOEngineConfig"
+ "last_sync_result": {
+ "description": "Summary of last sync result",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "oss": {
- "$ref": "#/definitions/types.OSSEngineConfig"
+ "latest_sync_log": {
+ "description": "Latest sync log (not stored in DB, populated on query)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog"
+ }
+ ]
},
- "provider": {
- "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "name": {
+ "description": "User-friendly name",
"type": "string"
},
- "s3": {
- "$ref": "#/definitions/types.S3EngineConfig"
- },
- "tos": {
- "$ref": "#/definitions/types.TOSEngineConfig"
- }
- }
- },
- "handler.StorageCheckResponse": {
- "type": "object",
- "properties": {
- "bucket_created": {
- "type": "boolean"
- },
- "message": {
+ "status": {
+ "description": "Current status: active, paused, error",
"type": "string"
},
- "ok": {
- "type": "boolean"
- }
- }
- },
- "handler.StorageEngineStatusItem": {
- "type": "object",
- "properties": {
- "available": {
- "description": "whether the engine can be used",
+ "sync_deletions": {
+ "description": "Whether to sync deletions from source",
"type": "boolean"
},
- "description": {
- "description": "short description for UI",
- "type": "string"
+ "sync_log_retention_days": {
+ "description": "Number of days to keep sync logs (default: 30)",
+ "type": "integer"
},
- "name": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\"",
+ "sync_mode": {
+ "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
"type": "string"
- }
- }
- },
- "handler.TestStoreRequest": {
- "type": "object",
- "required": [
- "connection_config",
- "engine_type"
- ],
- "properties": {
- "connection_config": {
- "$ref": "#/definitions/types.ConnectionConfig"
},
- "engine_type": {
- "$ref": "#/definitions/types.RetrieverEngineType"
- }
- }
- },
- "handler.TextRelationExtractionRequest": {
- "type": "object",
- "required": [
- "model_id",
- "tags",
- "text"
- ],
- "properties": {
- "model_id": {
+ "sync_schedule": {
+ "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
"type": "string"
},
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "tenant_id": {
+ "description": "Tenant ID for multi-tenancy",
+ "type": "integer"
},
- "text": {
+ "total_items_synced": {
+ "description": "Total items synced (not stored in DB, calculated on query)",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Connector type (feishu, notion, confluence, etc.)",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
}
}
},
- "handler.UpdateAgentRequest": {
+ "github_com_Tencent_WeKnora_internal_types.EmbeddingParameters": {
"type": "object",
"properties": {
- "avatar": {
- "type": "string"
- },
- "config": {
- "$ref": "#/definitions/types.CustomAgentConfig"
- },
- "description": {
- "type": "string"
+ "dimension": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "truncate_prompt_tokens": {
+ "type": "integer"
}
}
},
- "handler.UpdateChunkRequest": {
+ "github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
- "chunk_index": {
- "type": "integer"
+ "enabled": {
+ "type": "boolean"
},
- "content": {
- "type": "string"
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
},
- "embedding": {
+ "relations": {
"type": "array",
"items": {
- "type": "number"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
}
},
- "end_at": {
- "type": "integer"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "image_info": {
+ "text": {
"type": "string"
- },
- "is_enabled": {
- "type": "boolean"
- },
- "start_at": {
- "type": "integer"
}
}
},
- "handler.UpdateKnowledgeBaseRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload": {
"type": "object",
"required": [
- "name"
+ "entries"
],
"properties": {
- "config": {
- "$ref": "#/definitions/types.KnowledgeBaseConfig"
- },
- "description": {
- "type": "string"
+ "dry_run": {
+ "description": "仅验证,不实际导入",
+ "type": "boolean"
},
- "name": {
- "type": "string"
- }
- }
- },
- "handler.UpdateModelRequest": {
- "type": "object",
- "properties": {
- "description": {
- "type": "string"
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload"
+ }
},
- "name": {
+ "knowledge_id": {
"type": "string"
},
- "parameters": {
- "$ref": "#/definitions/types.ModelParameters"
- },
- "source": {
- "$ref": "#/definitions/types.ModelSource"
+ "mode": {
+ "type": "string",
+ "enum": [
+ "append",
+ "replace"
+ ]
},
- "type": {
- "$ref": "#/definitions/types.ModelType"
+ "task_id": {
+ "description": "可选,如果不传则自动生成UUID",
+ "type": "string"
}
}
},
- "handler.UpdateStoreRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQConfig": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "name": {
- "type": "string"
+ "index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode"
+ },
+ "question_index_mode": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode"
}
}
},
- "handler.addSimilarQuestionsRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate": {
"type": "object",
- "required": [
- "similar_questions"
- ],
"properties": {
- "similar_questions": {
+ "by_id": {
+ "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "by_tag": {
+ "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate"
+ }
+ },
+ "exclude_ids": {
+ "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
"type": "array",
- "minItems": 1,
"items": {
- "type": "string"
+ "type": "integer"
}
}
}
},
- "handler.updateLastFAQImportResultDisplayStatusRequest": {
- "type": "object",
- "required": [
- "display_status"
- ],
- "properties": {
- "display_status": {
- "type": "string",
- "enum": [
- "open",
- "close"
- ]
- }
- }
- },
- "handler_session.AttachmentUpload": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate": {
"type": "object",
"properties": {
- "data": {
- "description": "Base64-encoded file content",
- "type": "string"
+ "is_enabled": {
+ "type": "boolean"
},
- "file_name": {
- "description": "Original filename",
- "type": "string"
+ "is_recommended": {
+ "type": "boolean"
},
- "file_size": {
- "description": "File size in bytes",
+ "tag_id": {
"type": "integer"
}
}
},
- "handler_session.CreateKnowledgeQARequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQEntryPayload": {
"type": "object",
"required": [
- "query"
+ "standard_question"
],
"properties": {
- "agent_enabled": {
- "description": "Whether agent mode is enabled for this request",
- "type": "boolean"
- },
- "agent_id": {
- "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
- "type": "string"
+ "answer_strategy": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy"
},
- "attachment_uploads": {
- "description": "Attached files (documents, audio, etc.)",
+ "answers": {
"type": "array",
"items": {
- "$ref": "#/definitions/handler_session.AttachmentUpload"
+ "type": "string"
}
},
- "channel": {
- "description": "Source channel: \"web\", \"api\", \"im\", etc.",
- "type": "string"
+ "id": {
+ "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "type": "integer"
},
- "disable_title": {
- "description": "Whether to disable auto title generation",
+ "is_enabled": {
"type": "boolean"
},
- "enable_memory": {
- "description": "Whether memory feature is enabled for this request",
+ "is_recommended": {
"type": "boolean"
},
- "images": {
- "description": "Attached images for multimodal chat",
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler_session.ImageAttachment"
- }
- },
- "knowledge_base_ids": {
- "description": "Selected knowledge base ID for this request",
+ "negative_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "knowledge_ids": {
- "description": "Selected knowledge ID for this request",
+ "similar_questions": {
"type": "array",
"items": {
"type": "string"
}
},
- "mentioned_items": {
- "description": "@mentioned knowledge bases and files",
- "type": "array",
- "items": {
- "$ref": "#/definitions/handler_session.MentionedItemRequest"
- }
- },
- "query": {
- "description": "Query text for knowledge base search",
- "type": "string"
- },
- "summary_model_id": {
- "description": "Optional summary model ID for this request (overrides session default)",
+ "standard_question": {
"type": "string"
},
- "web_search_enabled": {
- "description": "Whether web search is enabled for this request",
- "type": "boolean"
- }
- }
- },
- "handler_session.CreateSessionRequest": {
- "type": "object",
- "properties": {
- "description": {
- "description": "Description for the session (optional)",
- "type": "string"
+ "tag_id": {
+ "type": "integer"
},
- "title": {
- "description": "Title for the session (optional)",
+ "tag_name": {
"type": "string"
}
}
},
- "handler_session.GenerateTitleRequest": {
+ "github_com_Tencent_WeKnora_internal_types.FAQIndexMode": {
+ "type": "string",
+ "enum": [
+ "question_only",
+ "question_answer"
+ ],
+ "x-enum-varnames": [
+ "FAQIndexModeQuestionOnly",
+ "FAQIndexModeQuestionAnswer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode": {
+ "type": "string",
+ "enum": [
+ "combined",
+ "separate"
+ ],
+ "x-enum-varnames": [
+ "FAQQuestionIndexModeCombined",
+ "FAQQuestionIndexModeSeparate"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.FAQSearchRequest": {
"type": "object",
"required": [
- "messages"
+ "query_text"
],
"properties": {
- "messages": {
- "description": "Messages to use as context for title generation",
+ "first_priority_tag_ids": {
+ "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
"type": "array",
"items": {
- "$ref": "#/definitions/types.Message"
+ "type": "integer"
}
- }
- }
- },
- "handler_session.ImageAttachment": {
- "type": "object",
- "properties": {
- "caption": {
- "description": "VLM analysis result (context-aware, single call)",
- "type": "string"
},
- "data": {
- "description": "base64 data URI from frontend (data:image/png;base64,...)",
- "type": "string"
+ "match_count": {
+ "type": "integer"
},
- "url": {
- "description": "serving URL after saving to storage",
- "type": "string"
- }
- }
- },
- "handler_session.MentionedItemRequest": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
+ "only_recommended": {
+ "description": "是否仅返回推荐的条目",
+ "type": "boolean"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
+ "query_text": {
"type": "string"
},
- "name": {
- "type": "string"
+ "second_priority_tag_ids": {
+ "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "handler_session.SearchKnowledgeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.GraphNode": {
"type": "object",
- "required": [
- "query"
- ],
"properties": {
- "knowledge_base_id": {
- "description": "Single knowledge base ID (for backward compatibility)",
- "type": "string"
- },
- "knowledge_base_ids": {
- "description": "IDs of knowledge bases to search (multi-KB support)",
+ "attributes": {
"type": "array",
"items": {
"type": "string"
}
},
- "knowledge_ids": {
- "description": "IDs of specific knowledge (files) to search",
+ "chunks": {
"type": "array",
"items": {
"type": "string"
}
},
- "query": {
- "description": "Query text to search for",
+ "name": {
"type": "string"
}
}
},
- "handler_session.StopSessionRequest": {
+ "github_com_Tencent_WeKnora_internal_types.GraphRelation": {
"type": "object",
- "required": [
- "message_id"
- ],
"properties": {
- "message_id": {
+ "node1": {
"type": "string"
- }
- }
- },
- "handler_session.batchDeleteRequest": {
- "type": "object",
- "properties": {
- "delete_all": {
- "type": "boolean"
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "node2": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
}
}
},
- "types.ASRConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "language": {
- "description": "optional: language hint for transcription",
- "type": "string"
- },
"model_id": {
+ "description": "Model ID",
"type": "string"
}
}
},
- "types.AgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.IndexConfig": {
"type": "object",
"properties": {
- "allowed_skills": {
- "description": "Skill names whitelist (empty = allow all)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "collection_name": {
+ "description": "Milvus",
+ "type": "string"
},
- "allowed_tools": {
- "description": "List of allowed tool names",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "collection_prefix": {
+ "description": "Qdrant, Weaviate",
+ "type": "string"
},
- "history_turns": {
- "description": "Number of history turns to keep in context",
+ "desired_shard_count": {
+ "description": "Weaviate: number of shards per collection",
"type": "integer"
},
- "knowledge_bases": {
- "description": "Accessible knowledge base IDs",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "knowledge_ids": {
- "description": "Accessible knowledge IDs (individual documents)",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "index_name": {
+ "description": "--- Existing fields ---",
+ "type": "string"
},
- "llm_call_timeout": {
- "description": "LLM call timeout in seconds (default: 120). Controls the maximum time for a single LLM call.",
+ "number_of_replicas": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_context_tokens": {
- "description": "Maximum context window tokens for the agent (default: 200000).\nThe agent compresses older messages to stay within this limit,\npreserving tool_call/tool_result pairs.",
+ "number_of_shards": {
+ "description": "ES, OpenSearch",
"type": "integer"
},
- "max_iterations": {
- "description": "Maximum number of ReAct iterations",
+ "replica_number": {
+ "description": "Milvus: in-memory replica count (LoadCollection)",
"type": "integer"
},
- "max_tool_output_chars": {
- "description": "Maximum character length for tool output (default: 16000).\nOutputs exceeding this limit are truncated with head + tail preservation.",
+ "replication_factor": {
+ "description": "Qdrant, Weaviate: number of replicas",
"type": "integer"
},
- "mcp_selection_mode": {
- "description": "MCP service selection",
- "type": "string"
- },
- "mcp_services": {
- "description": "Selected MCP service IDs (when mode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "multi_turn_enabled": {
- "description": "Whether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "parallel_tool_calls": {
- "description": "Whether to execute independent tool calls in parallel (default: false).\nWhen enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.",
- "type": "boolean"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)",
- "type": "boolean"
- },
- "skill_dirs": {
- "description": "Directories to search for skills",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "shard_number": {
+ "description": "--- Scalability fields ---",
+ "type": "integer"
},
- "skills_enabled": {
- "description": "Skills configuration (Progressive Disclosure pattern)",
+ "shards_num": {
+ "description": "Milvus: number of shards per collection (CreateCollection)",
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.IndexingStrategy": {
+ "type": "object",
+ "properties": {
+ "graph_enabled": {
+ "description": "GraphEnabled enables knowledge graph entity/relation extraction",
"type": "boolean"
},
- "system_prompt": {
- "description": "Unified system prompt (uses web_search_status placeholder for dynamic behavior)",
- "type": "string"
- },
- "system_prompt_web_disabled": {
- "description": "Deprecated: Custom prompt when web search is disabled",
- "type": "string"
- },
- "system_prompt_web_enabled": {
- "description": "Deprecated: Use SystemPrompt instead. Kept for backward compatibility during migration.",
- "type": "string"
- },
- "temperature": {
- "description": "LLM temperature for agent",
- "type": "number"
- },
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "keyword_enabled": {
+ "description": "KeywordEnabled enables keyword-based (BM25) search",
"type": "boolean"
},
- "use_custom_system_prompt": {
- "description": "Whether to use custom system prompt instead of default",
+ "vector_enabled": {
+ "description": "VectorEnabled enables semantic vector embedding and search",
"type": "boolean"
},
- "web_search_enabled": {
- "description": "Whether web search tool is enabled",
+ "wiki_enabled": {
+ "description": "WikiEnabled enables automatic wiki page generation from documents",
"type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum number of web search results (default: 5)",
- "type": "integer"
- },
- "web_search_provider_id": {
- "description": "WebSearchProviderEntity ID (resolved from agent config)",
- "type": "string"
}
}
},
- "types.AgentStep": {
+ "github_com_Tencent_WeKnora_internal_types.InviteMemberRequest": {
"type": "object",
+ "required": [
+ "role",
+ "user_id"
+ ],
"properties": {
- "iteration": {
- "description": "Iteration number (0-indexed)",
- "type": "integer"
+ "role": {
+ "description": "Role to assign: admin/editor/viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
},
- "thought": {
- "description": "LLM's reasoning/thinking (Think phase)",
+ "user_id": {
+ "description": "User ID to invite",
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest": {
+ "type": "object",
+ "required": [
+ "organization_id"
+ ],
+ "properties": {
+ "message": {
+ "description": "Optional message for join request",
+ "type": "string",
+ "maxLength": 500
},
- "timestamp": {
- "description": "When this step occurred",
+ "organization_id": {
"type": "string"
},
- "tool_calls": {
- "description": "Tools called in this step (Act phase)",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.ToolCall"
- }
+ "role": {
+ "description": "Optional: requested role (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.AnswerStrategy": {
- "type": "string",
- "enum": [
- "all",
- "random"
+ "github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
],
- "x-enum-varnames": [
- "AnswerStrategyAll",
- "AnswerStrategyRandom"
- ]
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ }
+ }
},
- "types.COSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Knowledge": {
"type": "object",
"properties": {
- "app_id": {
+ "channel": {
+ "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
"type": "string"
},
- "bucket_name": {
+ "created_at": {
+ "description": "Creation time of the knowledge",
"type": "string"
},
- "path_prefix": {
+ "deleted_at": {
+ "description": "Deletion time of the knowledge",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "description": {
+ "description": "Description of the knowledge",
"type": "string"
},
- "region": {
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "enable_status": {
+ "description": "Enable status of the knowledge",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error message of the knowledge",
"type": "string"
},
- "secret_id": {
+ "file_hash": {
+ "description": "File hash of the knowledge",
"type": "string"
},
- "secret_key": {
- "type": "string"
- }
- }
- },
- "types.ChatHistoryConfig": {
- "type": "object",
- "properties": {
- "embedding_model_id": {
- "description": "EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.\nOnce messages have been indexed, the model cannot be changed (requires re-indexing).",
+ "file_name": {
+ "description": "File name of the knowledge",
"type": "string"
},
- "enabled": {
- "description": "Enabled controls whether chat history indexing is active",
- "type": "boolean"
- },
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.\nThis is set internally when the feature is first enabled; users should not set this directly.",
+ "file_path": {
+ "description": "File path of the knowledge",
"type": "string"
- }
- }
- },
- "types.ChunkingConfig": {
- "type": "object",
- "properties": {
- "child_chunk_size": {
- "description": "ChildChunkSize is the size of child chunks used for embedding (default: 384).\nOnly used when EnableParentChild is true.",
- "type": "integer"
},
- "chunk_overlap": {
- "description": "Chunk overlap",
+ "file_size": {
+ "description": "File size of the knowledge",
"type": "integer"
},
- "chunk_size": {
- "description": "Chunk size",
- "type": "integer"
+ "file_type": {
+ "description": "File type of the knowledge",
+ "type": "string"
},
- "enable_multimodal": {
- "description": "EnableMultimodal (deprecated, kept for backward compatibility with old data)",
- "type": "boolean"
+ "id": {
+ "description": "Unique identifier of the knowledge",
+ "type": "string"
},
- "enable_parent_child": {
- "description": "EnableParentChild enables two-level parent-child chunking strategy.\nWhen enabled, large parent chunks provide context while small child chunks\nare used for vector matching. Retrieval matches on child but returns parent content.",
- "type": "boolean"
+ "knowledge_base_id": {
+ "description": "ID of the knowledge base",
+ "type": "string"
},
- "parent_chunk_size": {
- "description": "ParentChunkSize is the size of parent chunks (default: 4096).\nOnly used when EnableParentChild is true.",
- "type": "integer"
+ "knowledge_base_name": {
+ "description": "Knowledge base name (not stored in database, populated on query)",
+ "type": "string"
},
- "parser_engine_rules": {
- "description": "ParserEngineRules configures which parser engine to use for each file type.\nWhen empty, the builtin engine is used for all types.",
+ "last_faq_import_result": {
+ "description": "Last FAQ import result (for FAQ type knowledge only)",
"type": "array",
"items": {
- "$ref": "#/definitions/types.ParserEngineRule"
+ "type": "integer"
}
},
- "separators": {
- "description": "Separators",
+ "metadata": {
+ "description": "Metadata of the knowledge",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
- }
- }
- },
- "types.ConnectionConfig": {
- "type": "object",
- "properties": {
- "addr": {
- "description": "Common",
+ },
+ "parse_status": {
+ "description": "Parse status of the knowledge",
"type": "string"
},
- "api_key": {
- "description": "AES-GCM encrypted",
+ "processed_at": {
+ "description": "Processed time of the knowledge",
"type": "string"
},
- "grpc_address": {
- "description": "Weaviate",
+ "source": {
+ "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
"type": "string"
},
- "host": {
- "description": "Qdrant",
+ "storage_size": {
+ "description": "Storage size of the knowledge",
+ "type": "integer"
+ },
+ "summary_status": {
+ "description": "Summary status for async summary generation",
"type": "string"
},
- "password": {
- "description": "AES-GCM encrypted",
+ "tag_id": {
+ "description": "Optional tag ID for categorization within a knowledge base",
"type": "string"
},
- "port": {
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "scheme": {
+ "title": {
+ "description": "Title of the knowledge",
"type": "string"
},
- "use_default_connection": {
- "description": "Postgres",
- "type": "boolean"
- },
- "use_tls": {
- "type": "boolean"
- },
- "username": {
+ "type": {
+ "description": "Type of the knowledge",
"type": "string"
},
- "version": {
- "description": "Version is the detected server version (e.g., \"7.10.1\", \"16.2\", \"1.12.6\").\nAuto-populated by TestConnection on successful connectivity check.",
+ "updated_at": {
+ "description": "Last updated time of the knowledge",
"type": "string"
}
}
},
- "types.ContextCompressionStrategy": {
- "type": "string",
- "enum": [
- "sliding_window",
- "smart"
- ],
- "x-enum-varnames": [
- "ContextCompressionSlidingWindow",
- "ContextCompressionSmart"
- ]
- },
- "types.ContextConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBase": {
"type": "object",
"properties": {
- "compression_strategy": {
- "description": "Compression strategy: \"sliding_window\" or \"smart\"",
+ "asr_config": {
+ "description": "ASR config (Automatic Speech Recognition)",
"allOf": [
{
- "$ref": "#/definitions/types.ContextCompressionStrategy"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
}
]
},
- "max_tokens": {
- "description": "Maximum tokens allowed in LLM context",
+ "chunk_count": {
+ "description": "Chunk count (not stored in database, calculated on query)",
"type": "integer"
},
- "recent_message_count": {
- "description": "For sliding_window: number of messages to keep\nFor smart: number of recent messages to keep uncompressed",
- "type": "integer"
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "summarize_threshold": {
- "description": "Summarize threshold: number of messages before summarization",
- "type": "integer"
- }
- }
- },
- "types.ConversationConfig": {
- "type": "object",
- "properties": {
- "context_template": {
- "description": "ContextTemplate is the prompt template for summarizing retrieval results",
+ "created_at": {
+ "description": "Creation time of the knowledge base",
"type": "string"
},
- "embedding_top_k": {
- "type": "integer"
+ "deleted_at": {
+ "description": "Deletion time of the knowledge base",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
},
- "enable_query_expansion": {
+ "description": {
+ "description": "Description of the knowledge base",
+ "type": "string"
+ },
+ "embedding_model_id": {
+ "description": "ID of the embedding model",
+ "type": "string"
+ },
+ "extract_config": {
+ "description": "Extract config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig"
+ }
+ ]
+ },
+ "faq_config": {
+ "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier of the knowledge base",
+ "type": "string"
+ },
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
+ },
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active for this knowledge base.\nPipelines: vector search, keyword search, wiki generation, knowledge graph extraction.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
+ },
+ "is_pinned": {
+ "description": "Whether this knowledge base is pinned to the top of the list",
"type": "boolean"
},
- "enable_rewrite": {
+ "is_processing": {
+ "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
"type": "boolean"
},
- "fallback_prompt": {
- "type": "string"
+ "is_temporary": {
+ "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
+ "type": "boolean"
},
- "fallback_response": {
- "type": "string"
+ "knowledge_count": {
+ "description": "Knowledge count (not stored in database, calculated on query)",
+ "type": "integer"
},
- "fallback_strategy": {
- "description": "Fallback strategy",
+ "name": {
+ "description": "Name of the knowledge base",
"type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "pinned_at": {
+ "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "type": "string"
},
- "max_completion_tokens": {
- "description": "MaxTokens is the maximum number of tokens to generate",
+ "processing_count": {
+ "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
"type": "integer"
},
- "max_rounds": {
- "description": "Retrieval \u0026 strategy parameters",
+ "question_generation_config": {
+ "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig"
+ }
+ ]
+ },
+ "share_count": {
+ "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
"type": "integer"
},
- "prompt": {
- "description": "Prompt is the system prompt for normal mode",
- "type": "string"
+ "storage_config": {
+ "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig"
+ }
+ ]
+ },
+ "storage_provider_config": {
+ "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig"
+ }
+ ]
},
- "rerank_model_id": {
+ "summary_model_id": {
+ "description": "Summary model ID",
"type": "string"
},
- "rerank_threshold": {
- "type": "number"
- },
- "rerank_top_k": {
+ "tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompts",
+ "type": {
+ "description": "Type of the knowledge base (document, faq, etc.)",
"type": "string"
},
- "rewrite_prompt_user": {
+ "updated_at": {
+ "description": "Last updated time of the knowledge base",
"type": "string"
},
- "summary_model_id": {
- "description": "Model configuration",
+ "vector_store_id": {
+ "description": "VectorStoreID references the VectorStore this knowledge base is bound to.\nWhen nil, the KB falls back to the tenant's effective engines derived from\nthe RETRIEVE_DRIVER environment variable (env store flow).\nThis field is set once at creation time and must not be modified afterwards;\nenforcement lives at the GORM layer (`\u003c-:create`) plus the service-layer\nKB update path, which omits this field from its update DTO.",
"type": "string"
},
- "temperature": {
- "description": "Temperature controls the randomness of the model output",
- "type": "number"
+ "vlm_config": {
+ "description": "VLM config",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
+ }
+ ]
},
- "vector_threshold": {
- "type": "number"
+ "wiki_config": {
+ "description": "WikiConfig stores wiki-specific configuration (only for wiki type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "types.CreateOrganizationRequest": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig": {
"type": "object",
- "required": [
- "name"
- ],
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
+ "chunking_config": {
+ "description": "Chunking configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig"
+ }
+ ]
},
- "description": {
- "type": "string",
- "maxLength": 1000
+ "faq_config": {
+ "description": "FAQ configuration (only for FAQ type knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig"
+ }
+ ]
},
- "invite_code_validity_days": {
- "description": "optional: 0=never, 1, 7, 30; default 7",
- "type": "integer"
+ "image_processing_config": {
+ "description": "Image processing configuration",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig"
+ }
+ ]
},
- "member_limit": {
- "description": "optional: max members; 0=unlimited; default 50",
- "type": "integer"
+ "indexing_strategy": {
+ "description": "IndexingStrategy controls which indexing pipelines are active.\nnil means \"no change\" when updating (preserves existing strategy).",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy"
+ }
+ ]
},
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- }
- }
- },
- "types.CredentialsConfig": {
- "type": "object",
- "properties": {
- "weknoracloud": {
- "$ref": "#/definitions/types.WeKnoraCloudCredentials"
+ "wiki_config": {
+ "description": "Wiki configuration (only for wiki-enabled knowledge bases)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig"
+ }
+ ]
}
}
},
- "types.CustomAgentConfig": {
+ "github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse": {
"type": "object",
"properties": {
- "agent_mode": {
- "description": "===== Basic Settings =====\nAgent mode: \"quick-answer\" for RAG mode, \"smart-reasoning\" for ReAct agent mode",
- "type": "string"
- },
- "allowed_tools": {
- "description": "Allowed tools (only for agent type)",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "asr_model_id": {
- "description": "ASR model ID for audio transcription (optional)",
- "type": "string"
- },
- "audio_upload_enabled": {
- "description": "Whether audio upload (ASR transcription) is enabled for this agent (default: false)",
- "type": "boolean"
+ "chunk_count": {
+ "type": "integer"
},
- "context_template": {
- "description": "Context template for normal mode (how to format retrieved chunks)",
+ "created_at": {
"type": "string"
},
- "context_template_id": {
- "description": "ContextTemplateID references a template ID in prompt_templates/ YAML files.\nIf set and ContextTemplate is empty, the template content will be resolved at startup.",
+ "id": {
"type": "string"
},
- "embedding_top_k": {
- "description": "===== Retrieval Strategy Settings (for both modes) =====\nEmbedding/Vector retrieval top K",
- "type": "integer"
- },
- "enable_query_expansion": {
- "description": "===== Advanced Settings (mainly for normal mode) =====\nWhether to enable query expansion",
- "type": "boolean"
- },
- "enable_rewrite": {
- "description": "Whether to enable query rewrite for multi-turn conversations",
- "type": "boolean"
- },
- "fallback_prompt": {
- "description": "Fallback prompt (when FallbackStrategy is \"model\")",
+ "knowledge_base_id": {
"type": "string"
},
- "fallback_response": {
- "description": "Fixed fallback response (when FallbackStrategy is \"fixed\")",
+ "knowledge_base_name": {
"type": "string"
},
- "fallback_strategy": {
- "description": "Fallback strategy: \"fixed\" for fixed response, \"model\" for model generation",
+ "knowledge_base_type": {
"type": "string"
},
- "faq_direct_answer_threshold": {
- "description": "FAQ direct answer threshold - if similarity \u003e this value, use FAQ answer directly",
- "type": "number"
- },
- "faq_priority_enabled": {
- "description": "===== FAQ Strategy Settings =====\nWhether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)",
- "type": "boolean"
- },
- "faq_score_boost": {
- "description": "FAQ score boost multiplier - FAQ results score multiplied by this factor",
- "type": "number"
- },
- "history_turns": {
- "description": "Number of history turns to keep in context",
+ "knowledge_count": {
"type": "integer"
},
- "image_storage_provider": {
- "description": "Storage provider for image uploads: \"local\", \"minio\", \"cos\", \"tos\"\nEmpty means use the global/tenant default provider.",
+ "my_permission": {
+ "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
"type": "string"
},
- "image_upload_enabled": {
- "description": "===== Image Upload / Multimodal Settings =====\nWhether image upload is enabled for this agent (default: false)",
- "type": "boolean"
- },
- "kb_selection_mode": {
- "description": "===== Knowledge Base Settings =====\nKnowledge base selection mode: \"all\" = all KBs, \"selected\" = specific KBs, \"none\" = no KB",
+ "my_role_in_org": {
+ "description": "Current user's role in this organization (admin/editor/viewer)",
"type": "string"
},
- "keyword_threshold": {
- "description": "Keyword retrieval threshold",
- "type": "number"
- },
- "knowledge_bases": {
- "description": "Associated knowledge base IDs (only used when KBSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "llm_call_timeout": {
- "description": "Timeout for a single LLM call in seconds (0 = use global default)",
- "type": "integer"
- },
- "max_completion_tokens": {
- "description": "Maximum completion tokens (only for normal mode)",
- "type": "integer"
- },
- "max_iterations": {
- "description": "===== Agent Mode Settings =====\nMaximum iterations for ReAct loop (only for agent type)",
- "type": "integer"
- },
- "mcp_selection_mode": {
- "description": "MCP service selection mode: \"all\" = all enabled MCP services, \"selected\" = specific services, \"none\" = no MCP",
+ "organization_id": {
"type": "string"
},
- "mcp_services": {
- "description": "Selected MCP service IDs (only used when MCPSelectionMode is \"selected\")",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "model_id": {
- "description": "===== Model Settings =====\nModel ID to use for conversations",
+ "organization_name": {
"type": "string"
},
- "multi_turn_enabled": {
- "description": "===== Multi-turn Conversation Settings =====\nWhether multi-turn conversation is enabled",
- "type": "boolean"
- },
- "rerank_model_id": {
- "description": "ReRank model ID for retrieval",
+ "permission": {
+ "description": "Share permission (what the space was granted: viewer/editor)",
"type": "string"
},
- "rerank_threshold": {
- "description": "Rerank threshold",
- "type": "number"
- },
- "rerank_top_k": {
- "description": "Rerank top K",
- "type": "integer"
- },
- "retrieve_kb_only_when_mentioned": {
- "description": "Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)\nWhen true, knowledge base retrieval only happens if user explicitly mentions KB/files with @\nWhen false, knowledge base retrieval happens according to KBSelectionMode",
+ "require_approval": {
"type": "boolean"
},
- "rewrite_prompt_system": {
- "description": "Rewrite prompt system message",
+ "shared_by_user_id": {
"type": "string"
},
- "rewrite_prompt_user": {
- "description": "Rewrite prompt user message template",
+ "shared_by_username": {
"type": "string"
},
- "selected_skills": {
- "description": "Selected skill names (only used when SkillsSelectionMode is \"selected\")",
+ "source_tenant_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListMembersResponse": {
+ "type": "object",
+ "properties": {
+ "members": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse"
}
},
- "skills_selection_mode": {
- "description": "===== Skills Settings (only for smart-reasoning mode) =====\nSkills selection mode: \"all\" = all preloaded skills, \"selected\" = specific skills, \"none\" = no skills",
- "type": "string"
- },
- "suggested_prompts": {
- "description": "===== Suggested Prompts =====\n推荐问题列表,用于在前端对话面板展示快捷提问",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse": {
+ "type": "object",
+ "properties": {
+ "organizations": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse"
}
},
- "supported_file_types": {
- "description": "===== File Type Restriction Settings =====\nSupported file types for this agent (e.g., [\"csv\", \"xlsx\", \"xls\"])\nEmpty means all file types are supported\nWhen set, only files with matching extensions can be used with this agent",
+ "resource_counts": {
+ "description": "各空间内知识库/智能体数量,供列表侧栏展示",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse"
+ }
+ ]
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ListSharesResponse": {
+ "type": "object",
+ "properties": {
+ "shares": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse"
}
},
- "system_prompt": {
- "description": "System prompt for the agent (unified prompt, uses web_search_status placeholder for dynamic behavior)",
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LocalEngineConfig": {
+ "type": "object",
+ "properties": {
+ "path_prefix": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginRequest": {
+ "type": "object",
+ "required": [
+ "email",
+ "password"
+ ],
+ "properties": {
+ "email": {
"type": "string"
},
- "system_prompt_id": {
- "description": "SystemPromptID references a template ID in prompt_templates/ YAML files.\nIf set and SystemPrompt is empty, the template content will be resolved at startup.",
+ "password": {
+ "type": "string",
+ "minLength": 6
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.LoginResponse": {
+ "type": "object",
+ "properties": {
+ "message": {
"type": "string"
},
- "temperature": {
- "description": "Temperature for LLM (0-1)",
- "type": "number"
+ "refresh_token": {
+ "type": "string"
},
- "thinking": {
- "description": "Whether to enable thinking mode (for models that support extended thinking)",
+ "success": {
"type": "boolean"
},
- "vector_threshold": {
- "description": "Vector retrieval threshold",
- "type": "number"
+ "tenant": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
},
- "vlm_model_id": {
- "description": "VLM model ID for image analysis (optional, falls back to tenant-level VLM)",
+ "token": {
"type": "string"
},
- "web_fetch_enabled": {
- "description": "Whether to auto-fetch full page content for reranked web search results",
- "type": "boolean"
- },
- "web_fetch_top_n": {
- "description": "Max number of pages to fetch after rerank (default: 3)",
+ "user": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig": {
+ "type": "object",
+ "properties": {
+ "retry_count": {
+ "description": "Number of retries, default: 3",
"type": "integer"
},
- "web_search_enabled": {
- "description": "===== Web Search Settings =====\nWhether web search is enabled",
- "type": "boolean"
- },
- "web_search_max_results": {
- "description": "Maximum web search results",
+ "retry_delay": {
+ "description": "Delay between retries in seconds, default: 1",
"type": "integer"
},
- "web_search_provider_id": {
- "description": "WebSearchProviderID references a specific WebSearchProviderEntity.\nIf empty, the tenant's default provider (is_default=true) is used.",
- "type": "string"
+ "timeout": {
+ "description": "Timeout in seconds, default: 30",
+ "type": "integer"
}
}
},
- "types.DataSource": {
+ "github_com_Tencent_WeKnora_internal_types.MCPAuthConfig": {
"type": "object",
"properties": {
- "config": {
- "description": "Encrypted configuration (API credentials, tokens, etc.)\nStored as JSON with AES-256-GCM encryption",
- "type": "array",
- "items": {
- "type": "integer"
+ "api_key": {
+ "type": "string"
+ },
+ "custom_headers": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
- "conflict_strategy": {
- "description": "Conflict resolution strategy: overwrite or skip",
+ "token": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPEnvVars": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.MCPService": {
+ "type": "object",
+ "properties": {
+ "advanced_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig"
+ },
+ "auth_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig"
},
"created_at": {
- "description": "Creation timestamp",
"type": "string"
},
"deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "error_message": {
- "description": "Error message if status is \"error\"",
- "type": "string"
- },
- "id": {
- "description": "Unique identifier",
- "type": "string"
- },
- "knowledge_base_id": {
- "description": "Target knowledge base ID",
- "type": "string"
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "last_sync_at": {
- "description": "Last successful sync timestamp",
+ "description": {
"type": "string"
},
- "last_sync_cursor": {
- "description": "Cursor or state for incremental sync (connector-specific)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "last_sync_result": {
- "description": "Summary of last sync result",
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "enabled": {
+ "type": "boolean"
},
- "latest_sync_log": {
- "description": "Latest sync log (not stored in DB, populated on query)",
+ "env_vars": {
+ "description": "Environment variables for stdio",
"allOf": [
{
- "$ref": "#/definitions/types.SyncLog"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars"
}
]
},
- "name": {
- "description": "User-friendly name",
- "type": "string"
+ "headers": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders"
},
- "status": {
- "description": "Current status: active, paused, error",
+ "id": {
"type": "string"
},
- "sync_deletions": {
- "description": "Whether to sync deletions from source",
+ "is_builtin": {
+ "description": "Whether this is a builtin MCP service (visible to all tenants)",
"type": "boolean"
},
- "sync_log_retention_days": {
- "description": "Number of days to keep sync logs (default: 30)",
- "type": "integer"
- },
- "sync_mode": {
- "description": "Sync mode: \"incremental\" (recommended) or \"full\"",
+ "name": {
"type": "string"
},
- "sync_schedule": {
- "description": "Cron expression for scheduled syncs (e.g., \"0 */6 * * *\" = every 6 hours)",
- "type": "string"
+ "stdio_config": {
+ "description": "Required for stdio transport",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig"
+ }
+ ]
},
"tenant_id": {
- "description": "Tenant ID for multi-tenancy",
- "type": "integer"
- },
- "total_items_synced": {
- "description": "Total items synced (not stored in DB, calculated on query)",
"type": "integer"
},
- "type": {
- "description": "Connector type (feishu, notion, confluence, etc.)",
- "type": "string"
+ "transport_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType"
},
"updated_at": {
- "description": "Last update timestamp",
"type": "string"
- }
- }
- },
- "types.EmbeddingParameters": {
- "type": "object",
- "properties": {
- "dimension": {
- "type": "integer"
},
- "truncate_prompt_tokens": {
- "type": "integer"
+ "url": {
+ "description": "Optional: required for SSE/HTTP Streamable",
+ "type": "string"
}
}
},
- "types.ExtractConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MCPStdioConfig": {
"type": "object",
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "nodes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphNode"
- }
- },
- "relations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.GraphRelation"
- }
- },
- "tags": {
+ "args": {
+ "description": "Command arguments array",
"type": "array",
"items": {
"type": "string"
}
},
- "text": {
+ "command": {
+ "description": "Command: \"uvx\" or \"npx\"",
"type": "string"
}
}
},
- "types.FAQBatchUpsertPayload": {
- "type": "object",
- "required": [
- "entries"
+ "github_com_Tencent_WeKnora_internal_types.MCPTransportType": {
+ "type": "string",
+ "enum": [
+ "sse",
+ "http-streamable",
+ "stdio"
+ ],
+ "x-enum-comments": {
+ "MCPTransportHTTPStreamable": "HTTP Streamable",
+ "MCPTransportSSE": "Server-Sent Events",
+ "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ },
+ "x-enum-descriptions": [
+ "Server-Sent Events",
+ "HTTP Streamable",
+ "Stdio (Standard Input/Output)"
],
+ "x-enum-varnames": [
+ "MCPTransportSSE",
+ "MCPTransportHTTPStreamable",
+ "MCPTransportStdio"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload": {
+ "type": "object",
"properties": {
- "dry_run": {
- "description": "仅验证,不实际导入",
- "type": "boolean"
+ "channel": {
+ "type": "string"
},
- "entries": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.FAQEntryPayload"
- }
+ "content": {
+ "type": "string"
},
- "knowledge_id": {
+ "status": {
"type": "string"
},
- "mode": {
- "type": "string",
- "enum": [
- "append",
- "replace"
- ]
+ "tag_id": {
+ "type": "string"
},
- "task_id": {
- "description": "可选,如果不传则自动生成UUID",
+ "title": {
"type": "string"
}
}
},
- "types.FAQConfig": {
- "type": "object",
- "properties": {
- "index_mode": {
- "$ref": "#/definitions/types.FAQIndexMode"
- },
- "question_index_mode": {
- "$ref": "#/definitions/types.FAQQuestionIndexMode"
- }
- }
+ "github_com_Tencent_WeKnora_internal_types.MatchType": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "x-enum-comments": {
+ "MatchTypeDataAnalysis": "数据分析匹配类型",
+ "MatchTypeDirectLoad": "直接加载匹配类型",
+ "MatchTypeParentChunk": "父Chunk匹配类型",
+ "MatchTypeRelationChunk": "关系Chunk匹配类型",
+ "MatchTypeWebSearch": "网络搜索匹配类型"
+ },
+ "x-enum-descriptions": [
+ "",
+ "",
+ "",
+ "",
+ "父Chunk匹配类型",
+ "关系Chunk匹配类型",
+ "",
+ "网络搜索匹配类型",
+ "直接加载匹配类型",
+ "数据分析匹配类型"
+ ],
+ "x-enum-varnames": [
+ "MatchTypeEmbedding",
+ "MatchTypeKeywords",
+ "MatchTypeNearByChunk",
+ "MatchTypeHistory",
+ "MatchTypeParentChunk",
+ "MatchTypeRelationChunk",
+ "MatchTypeGraph",
+ "MatchTypeWebSearch",
+ "MatchTypeDirectLoad",
+ "MatchTypeDataAnalysis"
+ ]
},
- "types.FAQEntryFieldsBatchUpdate": {
+ "github_com_Tencent_WeKnora_internal_types.MentionedItem": {
"type": "object",
"properties": {
- "by_id": {
- "description": "ByID 按条目ID更新,key为条目ID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
- }
- },
- "by_tag": {
- "description": "ByTag 按Tag批量更新,key为TagID (seq_id)",
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/types.FAQEntryFieldsUpdate"
- }
+ "id": {
+ "type": "string"
},
- "exclude_ids": {
- "description": "ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- "types.FAQEntryFieldsUpdate": {
- "type": "object",
- "properties": {
- "is_enabled": {
- "type": "boolean"
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
},
- "is_recommended": {
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "tag_id": {
- "type": "integer"
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
+ "type": "string"
}
}
},
- "types.FAQEntryPayload": {
+ "github_com_Tencent_WeKnora_internal_types.Message": {
"type": "object",
- "required": [
- "standard_question"
- ],
"properties": {
- "answer_strategy": {
- "$ref": "#/definitions/types.AnswerStrategy"
- },
- "answers": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "id": {
- "description": "ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)",
+ "agent_duration_ms": {
+ "description": "Agent total execution duration in milliseconds (from query start to answer start)",
"type": "integer"
},
- "is_enabled": {
- "type": "boolean"
- },
- "is_recommended": {
- "type": "boolean"
- },
- "negative_questions": {
+ "agent_steps": {
+ "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep"
}
},
- "similar_questions": {
+ "attachments": {
+ "description": "Attached files (documents, audio, etc., for user messages)",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment"
}
},
- "standard_question": {
+ "channel": {
+ "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
"type": "string"
},
- "tag_id": {
- "type": "integer"
+ "content": {
+ "description": "Message text content",
+ "type": "string"
},
- "tag_name": {
+ "created_at": {
+ "description": "Message creation timestamp",
"type": "string"
- }
- }
- },
- "types.FAQIndexMode": {
- "type": "string",
- "enum": [
- "question_only",
- "question_answer"
- ],
- "x-enum-varnames": [
- "FAQIndexModeQuestionOnly",
- "FAQIndexModeQuestionAnswer"
- ]
- },
- "types.FAQQuestionIndexMode": {
- "type": "string",
- "enum": [
- "combined",
- "separate"
- ],
- "x-enum-varnames": [
- "FAQQuestionIndexModeCombined",
- "FAQQuestionIndexModeSeparate"
- ]
- },
- "types.FAQSearchRequest": {
- "type": "object",
- "required": [
- "query_text"
- ],
- "properties": {
- "first_priority_tag_ids": {
- "description": "第一优先级标签ID列表,限定命中范围,优先级最高",
+ },
+ "deleted_at": {
+ "description": "Soft delete timestamp",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier for the message",
+ "type": "string"
+ },
+ "images": {
+ "description": "Attached images with OCR/Caption text (for user messages)",
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage"
}
},
- "match_count": {
- "type": "integer"
+ "is_completed": {
+ "description": "Whether message generation is complete",
+ "type": "boolean"
},
- "only_recommended": {
- "description": "是否仅返回推荐的条目",
+ "is_fallback": {
+ "description": "Whether this response is a fallback (no knowledge base match found)",
"type": "boolean"
},
- "query_text": {
+ "knowledge_id": {
+ "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
"type": "string"
},
- "second_priority_tag_ids": {
- "description": "第二优先级标签ID列表,限定命中范围,优先级低于第一优先级",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "vector_threshold": {
- "type": "number"
- }
- }
- },
- "types.GraphNode": {
- "type": "object",
- "properties": {
- "attributes": {
+ "knowledge_references": {
+ "description": "References to knowledge chunks used in the response",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult"
}
},
- "chunks": {
+ "mentioned_items": {
+ "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
}
},
- "name": {
- "type": "string"
- }
- }
- },
- "types.GraphRelation": {
- "type": "object",
- "properties": {
- "node1": {
- "type": "string"
- },
- "node2": {
+ "request_id": {
+ "description": "Request identifier for tracking API requests",
"type": "string"
},
- "type": {
+ "role": {
+ "description": "Message role: \"user\", \"assistant\", \"system\"",
"type": "string"
- }
- }
- },
- "types.ImageProcessingConfig": {
- "type": "object",
- "properties": {
- "model_id": {
- "description": "Model ID",
+ },
+ "session_id": {
+ "description": "ID of the session this message belongs to",
+ "type": "string"
+ },
+ "updated_at": {
+ "description": "Last update timestamp",
"type": "string"
}
}
},
- "types.IndexConfig": {
+ "github_com_Tencent_WeKnora_internal_types.MessageAttachment": {
"type": "object",
"properties": {
- "collection_name": {
- "description": "Milvus",
+ "content": {
+ "description": "Extracted text content (for small text files)",
"type": "string"
},
- "collection_prefix": {
- "description": "Qdrant",
+ "file_name": {
+ "description": "Original filename",
"type": "string"
},
- "index_name": {
- "description": "ES, OpenSearch",
+ "file_size": {
+ "description": "File size in bytes",
+ "type": "integer"
+ },
+ "file_type": {
+ "description": "File extension (e.g., \".pdf\", \".docx\")",
"type": "string"
},
- "number_of_replicas": {
- "description": "ES, OpenSearch",
- "type": "integer"
+ "is_truncated": {
+ "description": "Whether content was truncated",
+ "type": "boolean"
},
- "number_of_shards": {
- "description": "ES, OpenSearch",
+ "line_count": {
+ "description": "Total line count (for text files)",
"type": "integer"
+ },
+ "url": {
+ "description": "Storage URL (provider://path)",
+ "type": "string"
}
}
},
- "types.InviteMemberRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MessageImage": {
"type": "object",
- "required": [
- "role",
- "user_id"
- ],
"properties": {
- "role": {
- "description": "Role to assign: admin/editor/viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
+ "caption": {
+ "type": "string"
},
- "user_id": {
- "description": "User ID to invite",
+ "url": {
"type": "string"
}
}
},
- "types.JoinByOrganizationIDRequest": {
+ "github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig": {
"type": "object",
- "required": [
- "organization_id"
- ],
"properties": {
- "message": {
- "description": "Optional message for join request",
- "type": "string",
- "maxLength": 500
+ "access_key_id": {
+ "type": "string"
},
- "organization_id": {
+ "bucket_name": {
"type": "string"
},
- "role": {
- "description": "Optional: requested role (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
- }
- }
- },
- "types.JoinOrganizationRequest": {
- "type": "object",
- "required": [
- "invite_code"
- ],
- "properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "endpoint": {
+ "type": "string"
+ },
+ "mode": {
+ "description": "\"docker\" or \"remote\"",
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "secret_access_key": {
+ "type": "string"
+ },
+ "use_ssl": {
+ "type": "boolean"
}
}
},
- "types.Knowledge": {
+ "github_com_Tencent_WeKnora_internal_types.ModelParameters": {
"type": "object",
"properties": {
- "channel": {
- "description": "Channel indicates through which channel the knowledge was ingested (web, api, browser_extension, wechat, etc.)",
+ "api_key": {
"type": "string"
},
- "created_at": {
- "description": "Creation time of the knowledge",
+ "app_id": {
+ "description": "WeKnoraCloud 厂商专用凭证",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the knowledge",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge",
+ "app_secret": {
+ "description": "AES-256 加密存储,实际承载上游 API Key",
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "base_url": {
"type": "string"
},
- "enable_status": {
- "description": "Enable status of the knowledge",
+ "custom_headers": {
+ "description": "CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,\n用途类似 Python OpenAI SDK 的 extra_headers 参数,\n常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。\n保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "embedding_parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters"
+ },
+ "extra_config": {
+ "description": "Provider-specific configuration",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "interface_type": {
"type": "string"
},
- "error_message": {
- "description": "Error message of the knowledge",
+ "parameter_size": {
+ "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
"type": "string"
},
- "file_hash": {
- "description": "File hash of the knowledge",
+ "provider": {
+ "description": "Provider identifier: openai, aliyun, zhipu, generic",
"type": "string"
},
- "file_name": {
- "description": "File name of the knowledge",
+ "supports_vision": {
+ "description": "Whether the model accepts image/multimodal input",
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelSource": {
+ "type": "string",
+ "enum": [
+ "local",
+ "remote",
+ "aliyun",
+ "zhipu",
+ "volcengine",
+ "deepseek",
+ "hunyuan",
+ "minimax",
+ "openai",
+ "gemini",
+ "mimo",
+ "siliconflow",
+ "jina",
+ "openrouter",
+ "nvidia",
+ "novita",
+ "azure_openai"
+ ],
+ "x-enum-comments": {
+ "ModelSourceAliyun": "Aliyun DashScope model",
+ "ModelSourceAzureOpenAI": "Azure OpenAI model",
+ "ModelSourceDeepseek": "Deepseek model",
+ "ModelSourceGemini": "Gemini model",
+ "ModelSourceHunyuan": "Hunyuan model",
+ "ModelSourceJina": "Jina AI model",
+ "ModelSourceLocal": "Local model",
+ "ModelSourceMimo": "Mimo model",
+ "ModelSourceMinimax": "Minimax mode",
+ "ModelSourceNovita": "Novita AI model",
+ "ModelSourceNvidia": "NVIDIA model",
+ "ModelSourceOpenAI": "OpenAI model",
+ "ModelSourceOpenRouter": "OpenRouter model",
+ "ModelSourceRemote": "Remote model",
+ "ModelSourceSiliconFlow": "SiliconFlow model",
+ "ModelSourceVolcengine": "Volcengine model",
+ "ModelSourceZhipu": "Zhipu model"
+ },
+ "x-enum-descriptions": [
+ "Local model",
+ "Remote model",
+ "Aliyun DashScope model",
+ "Zhipu model",
+ "Volcengine model",
+ "Deepseek model",
+ "Hunyuan model",
+ "Minimax mode",
+ "OpenAI model",
+ "Gemini model",
+ "Mimo model",
+ "SiliconFlow model",
+ "Jina AI model",
+ "OpenRouter model",
+ "NVIDIA model",
+ "Novita AI model",
+ "Azure OpenAI model"
+ ],
+ "x-enum-varnames": [
+ "ModelSourceLocal",
+ "ModelSourceRemote",
+ "ModelSourceAliyun",
+ "ModelSourceZhipu",
+ "ModelSourceVolcengine",
+ "ModelSourceDeepseek",
+ "ModelSourceHunyuan",
+ "ModelSourceMinimax",
+ "ModelSourceOpenAI",
+ "ModelSourceGemini",
+ "ModelSourceMimo",
+ "ModelSourceSiliconFlow",
+ "ModelSourceJina",
+ "ModelSourceOpenRouter",
+ "ModelSourceNvidia",
+ "ModelSourceNovita",
+ "ModelSourceAzureOpenAI"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.ModelType": {
+ "type": "string",
+ "enum": [
+ "Embedding",
+ "Rerank",
+ "KnowledgeQA",
+ "VLLM",
+ "ASR"
+ ],
+ "x-enum-comments": {
+ "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
+ "ModelTypeEmbedding": "Embedding model",
+ "ModelTypeKnowledgeQA": "KnowledgeQA model",
+ "ModelTypeRerank": "Rerank model",
+ "ModelTypeVLLM": "VLLM model"
+ },
+ "x-enum-descriptions": [
+ "Embedding model",
+ "Rerank model",
+ "KnowledgeQA model",
+ "VLLM model",
+ "ASR (Automatic Speech Recognition) model"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeKnowledgeQA",
+ "ModelTypeVLLM",
+ "ModelTypeASR"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse": {
+ "type": "object",
+ "properties": {
+ "authorization_url": {
"type": "string"
},
- "file_path": {
- "description": "File path of the knowledge",
+ "provider_display_name": {
"type": "string"
},
- "file_size": {
- "description": "File size of the knowledge",
- "type": "integer"
- },
- "file_type": {
- "description": "File type of the knowledge",
+ "state": {
"type": "string"
},
- "id": {
- "description": "Unique identifier of the knowledge",
- "type": "string"
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
},
- "knowledge_base_id": {
- "description": "ID of the knowledge base",
+ "provider_display_name": {
"type": "string"
},
- "knowledge_base_name": {
- "description": "Knowledge base name (not stored in database, populated on query)",
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.OSSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
"type": "string"
},
- "last_faq_import_result": {
- "description": "Last FAQ import result (for FAQ type knowledge only)",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "metadata": {
- "description": "Metadata of the knowledge",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "parse_status": {
- "description": "Parse status of the knowledge",
+ "bucket_name": {
"type": "string"
},
- "processed_at": {
- "description": "Processed time of the knowledge",
+ "endpoint": {
"type": "string"
},
- "source": {
- "description": "Source of the knowledge (e.g. URL address for url type, \"manual\" for manual type)",
+ "path_prefix": {
"type": "string"
},
- "storage_size": {
- "description": "Storage size of the knowledge",
- "type": "integer"
- },
- "summary_status": {
- "description": "Summary status for async summary generation",
+ "region": {
"type": "string"
},
- "tag_id": {
- "description": "Optional tag ID for categorization within a knowledge base",
+ "secret_key": {
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "title": {
- "description": "Title of the knowledge",
+ "temp_bucket_name": {
"type": "string"
},
- "type": {
- "description": "Type of the knowledge",
+ "temp_region": {
"type": "string"
},
- "updated_at": {
- "description": "Last updated time of the knowledge",
- "type": "string"
+ "use_temp_bucket": {
+ "type": "boolean"
}
}
},
- "types.KnowledgeBase": {
+ "github_com_Tencent_WeKnora_internal_types.OrgMemberRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "editor",
+ "viewer"
+ ],
+ "x-enum-varnames": [
+ "OrgRoleAdmin",
+ "OrgRoleEditor",
+ "OrgRoleViewer"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse": {
"type": "object",
"properties": {
- "asr_config": {
- "description": "ASR config (Automatic Speech Recognition)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ASRConfig"
- }
- ]
- },
- "chunk_count": {
- "description": "Chunk count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChunkingConfig"
- }
- ]
- },
- "created_at": {
- "description": "Creation time of the knowledge base",
- "type": "string"
- },
- "deleted_at": {
- "description": "Deletion time of the knowledge base",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "description": {
- "description": "Description of the knowledge base",
+ "avatar": {
"type": "string"
},
- "embedding_model_id": {
- "description": "ID of the embedding model",
+ "email": {
"type": "string"
},
- "extract_config": {
- "description": "Extract config",
- "allOf": [
- {
- "$ref": "#/definitions/types.ExtractConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQConfig stores FAQ specific configuration such as indexing strategy",
- "allOf": [
- {
- "$ref": "#/definitions/types.FAQConfig"
- }
- ]
- },
"id": {
- "description": "Unique identifier of the knowledge base",
- "type": "string"
- },
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ImageProcessingConfig"
- }
- ]
- },
- "is_pinned": {
- "description": "Whether this knowledge base is pinned to the top of the list",
- "type": "boolean"
- },
- "is_processing": {
- "description": "IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)",
- "type": "boolean"
- },
- "is_temporary": {
- "description": "Whether this knowledge base is temporary (ephemeral) and should be hidden from UI",
- "type": "boolean"
- },
- "knowledge_count": {
- "description": "Knowledge count (not stored in database, calculated on query)",
- "type": "integer"
- },
- "name": {
- "description": "Name of the knowledge base",
"type": "string"
},
- "pinned_at": {
- "description": "Time when the knowledge base was pinned (nil if not pinned)",
+ "joined_at": {
"type": "string"
},
- "processing_count": {
- "description": "ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)",
- "type": "integer"
- },
- "question_generation_config": {
- "description": "QuestionGenerationConfig stores question generation configuration for document knowledge bases",
- "allOf": [
- {
- "$ref": "#/definitions/types.QuestionGenerationConfig"
- }
- ]
- },
- "share_count": {
- "description": "ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)",
- "type": "integer"
- },
- "storage_config": {
- "description": "Deprecated: legacy COS config column. Kept for backward compatibility with old data.",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageConfig"
- }
- ]
- },
- "storage_provider_config": {
- "description": "Storage provider config (new): only stores provider selection; credentials from tenant StorageEngineConfig",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageProviderConfig"
- }
- ]
- },
- "summary_model_id": {
- "description": "Summary model ID",
+ "role": {
"type": "string"
},
"tenant_id": {
- "description": "Tenant ID",
"type": "integer"
},
- "type": {
- "description": "Type of the knowledge base (document, faq, etc.)",
- "type": "string"
- },
- "updated_at": {
- "description": "Last updated time of the knowledge base",
- "type": "string"
- },
- "vlm_config": {
- "description": "VLM config",
- "allOf": [
- {
- "$ref": "#/definitions/types.VLMConfig"
- }
- ]
- }
- }
- },
- "types.KnowledgeBaseConfig": {
- "type": "object",
- "properties": {
- "chunking_config": {
- "description": "Chunking configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChunkingConfig"
- }
- ]
- },
- "faq_config": {
- "description": "FAQ configuration (only for FAQ type knowledge bases)",
- "allOf": [
- {
- "$ref": "#/definitions/types.FAQConfig"
- }
- ]
- },
- "image_processing_config": {
- "description": "Image processing configuration",
- "allOf": [
- {
- "$ref": "#/definitions/types.ImageProcessingConfig"
- }
- ]
+ "user_id": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
}
}
},
- "types.KnowledgeBaseShareResponse": {
+ "github_com_Tencent_WeKnora_internal_types.OrganizationResponse": {
"type": "object",
"properties": {
- "chunk_count": {
+ "agent_share_count": {
+ "description": "共享到该组织的智能体数量",
"type": "integer"
},
+ "avatar": {
+ "type": "string"
+ },
"created_at": {
"type": "string"
},
- "id": {
+ "description": {
"type": "string"
},
- "knowledge_base_id": {
+ "has_pending_upgrade": {
+ "description": "当前用户是否有待处理的权限升级申请",
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "knowledge_base_name": {
+ "invite_code": {
"type": "string"
},
- "knowledge_base_type": {
+ "invite_code_expires_at": {
"type": "string"
},
- "knowledge_count": {
+ "invite_code_validity_days": {
"type": "integer"
},
- "my_permission": {
- "description": "Effective permission for current user = min(Permission, MyRoleInOrg)",
- "type": "string"
+ "is_owner": {
+ "type": "boolean"
},
- "my_role_in_org": {
- "description": "Current user's role in this organization (admin/editor/viewer)",
- "type": "string"
+ "member_count": {
+ "type": "integer"
},
- "organization_id": {
+ "member_limit": {
+ "description": "0 = unlimited",
+ "type": "integer"
+ },
+ "my_role": {
"type": "string"
},
- "organization_name": {
+ "name": {
"type": "string"
},
- "permission": {
- "description": "Share permission (what the space was granted: viewer/editor)",
+ "owner_id": {
"type": "string"
},
+ "pending_join_request_count": {
+ "description": "待审批加入申请数(仅管理员可见)",
+ "type": "integer"
+ },
"require_approval": {
"type": "boolean"
},
- "shared_by_user_id": {
- "type": "string"
- },
- "shared_by_username": {
- "type": "string"
+ "searchable": {
+ "type": "boolean"
},
- "source_tenant_id": {
+ "share_count": {
+ "description": "共享到该组织的知识库数量",
"type": "integer"
- }
- }
- },
- "types.ListMembersResponse": {
- "type": "object",
- "properties": {
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.OrganizationMemberResponse"
- }
},
- "total": {
- "type": "integer"
+ "updated_at": {
+ "type": "string"
}
}
},
- "types.ListOrganizationsResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineConfig": {
"type": "object",
"properties": {
- "organizations": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.OrganizationResponse"
- }
+ "mineru_api_key": {
+ "description": "MinerU 云 API Key",
+ "type": "string"
},
- "resource_counts": {
- "description": "各空间内知识库/智能体数量,供列表侧栏展示",
- "allOf": [
- {
- "$ref": "#/definitions/types.ResourceCountsByOrgResponse"
- }
- ]
+ "mineru_cloud_enable_formula": {
+ "type": "boolean"
},
- "total": {
- "type": "integer"
+ "mineru_cloud_enable_ocr": {
+ "type": "boolean"
+ },
+ "mineru_cloud_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_cloud_language": {
+ "type": "string"
+ },
+ "mineru_cloud_model": {
+ "description": "MinerU 云 API 解析参数",
+ "type": "string"
+ },
+ "mineru_enable_formula": {
+ "type": "boolean"
+ },
+ "mineru_enable_ocr": {
+ "type": "boolean"
+ },
+ "mineru_enable_table": {
+ "type": "boolean"
+ },
+ "mineru_endpoint": {
+ "description": "MinerU 自建服务端点",
+ "type": "string"
+ },
+ "mineru_language": {
+ "type": "string"
+ },
+ "mineru_model": {
+ "description": "MinerU 自建解析参数",
+ "type": "string"
}
}
},
- "types.ListSharesResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ParserEngineRule": {
"type": "object",
"properties": {
- "shares": {
+ "engine": {
+ "type": "string"
+ },
+ "file_types": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.KnowledgeBaseShareResponse"
+ "type": "string"
}
- },
- "total": {
- "type": "integer"
}
}
},
- "types.LocalEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
- "path_prefix": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
+ },
+ "question_count": {
+ "description": "Number of questions to generate per chunk (default: 3, max: 10)",
+ "type": "integer"
}
}
},
- "types.LoginRequest": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
"email",
- "password"
+ "password",
+ "username"
],
"properties": {
"email": {
@@ -11442,1894 +12375,2150 @@
"password": {
"type": "string",
"minLength": 6
+ },
+ "username": {
+ "type": "string",
+ "maxLength": 50,
+ "minLength": 2
}
}
},
- "types.LoginResponse": {
+ "github_com_Tencent_WeKnora_internal_types.RegisterResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
- "refresh_token": {
- "type": "string"
- },
"success": {
"type": "boolean"
},
"tenant": {
- "$ref": "#/definitions/types.Tenant"
- },
- "token": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
},
"user": {
- "$ref": "#/definitions/types.User"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.User"
}
}
},
- "types.MCPAdvancedConfig": {
+ "github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest": {
"type": "object",
+ "required": [
+ "requested_role"
+ ],
"properties": {
- "retry_count": {
- "description": "Number of retries, default: 3",
- "type": "integer"
- },
- "retry_delay": {
- "description": "Delay between retries in seconds, default: 1",
- "type": "integer"
+ "message": {
+ "description": "Optional message explaining the reason",
+ "type": "string",
+ "maxLength": 500
},
- "timeout": {
- "description": "Timeout in seconds, default: 30",
- "type": "integer"
+ "requested_role": {
+ "description": "The role user wants to upgrade to",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.MCPAuthConfig": {
+ "github_com_Tencent_WeKnora_internal_types.Resource": {
"type": "object",
"properties": {
- "api_key": {
+ "description": {
+ "description": "Optional description",
"type": "string"
},
- "custom_headers": {
+ "external_id": {
+ "description": "Unique identifier in the external system",
+ "type": "string"
+ },
+ "has_children": {
+ "description": "Whether this resource has children that can be expanded",
+ "type": "boolean"
+ },
+ "metadata": {
+ "description": "Additional metadata",
"type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "additionalProperties": true
},
- "token": {
+ "modified_at": {
+ "description": "Last modified time in external system",
+ "type": "string"
+ },
+ "name": {
+ "description": "Display name",
+ "type": "string"
+ },
+ "parent_id": {
+ "description": "For hierarchical resources (parent ID if applicable)",
+ "type": "string"
+ },
+ "type": {
+ "description": "Resource type (document, folder, space, page, etc.)",
+ "type": "string"
+ },
+ "url": {
+ "description": "URL to access in external system",
"type": "string"
}
}
},
- "types.MCPEnvVars": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "types.MCPHeaders": {
+ "github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse": {
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "agents": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "knowledge_bases": {
+ "type": "object",
+ "properties": {
+ "by_organization": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ }
+ }
+ }
}
},
- "types.MCPService": {
+ "github_com_Tencent_WeKnora_internal_types.RetrievalConfig": {
"type": "object",
"properties": {
- "advanced_config": {
- "$ref": "#/definitions/types.MCPAdvancedConfig"
- },
- "auth_config": {
- "$ref": "#/definitions/types.MCPAuthConfig"
- },
- "created_at": {
- "type": "string"
+ "embedding_top_k": {
+ "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "type": "integer"
},
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
+ "keyword_threshold": {
+ "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
+ "type": "number"
},
- "description": {
+ "rerank_model_id": {
+ "description": "RerankModelID is the ID of the rerank model to use (required for search)",
"type": "string"
},
- "enabled": {
- "type": "boolean"
+ "rerank_threshold": {
+ "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
+ "type": "number"
},
- "env_vars": {
- "description": "Environment variables for stdio",
+ "rerank_top_k": {
+ "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "type": "integer"
+ },
+ "vector_threshold": {
+ "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
+ "type": "number"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams": {
+ "type": "object",
+ "properties": {
+ "retriever_engine_type": {
+ "description": "Retriever engine type",
"allOf": [
{
- "$ref": "#/definitions/types.MCPEnvVars"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
}
]
},
- "headers": {
- "$ref": "#/definitions/types.MCPHeaders"
- },
- "id": {
- "type": "string"
- },
- "is_builtin": {
- "description": "Whether this is a builtin MCP service (visible to all tenants)",
- "type": "boolean"
- },
- "name": {
- "type": "string"
- },
- "stdio_config": {
- "description": "Required for stdio transport",
+ "retriever_type": {
+ "description": "Retriever type",
"allOf": [
{
- "$ref": "#/definitions/types.MCPStdioConfig"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType"
}
]
- },
- "tenant_id": {
- "type": "integer"
- },
- "transport_type": {
- "$ref": "#/definitions/types.MCPTransportType"
- },
- "updated_at": {
- "type": "string"
- },
- "url": {
- "description": "Optional: required for SSE/HTTP Streamable",
- "type": "string"
}
}
},
- "types.MCPStdioConfig": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngineType": {
+ "type": "string",
+ "enum": [
+ "postgres",
+ "elasticsearch",
+ "infinity",
+ "elasticfaiss",
+ "qdrant",
+ "milvus",
+ "weaviate",
+ "sqlite"
+ ],
+ "x-enum-varnames": [
+ "PostgresRetrieverEngineType",
+ "ElasticsearchRetrieverEngineType",
+ "InfinityRetrieverEngineType",
+ "ElasticFaissRetrieverEngineType",
+ "QdrantRetrieverEngineType",
+ "MilvusRetrieverEngineType",
+ "WeaviateRetrieverEngineType",
+ "SQLiteRetrieverEngineType"
+ ]
+ },
+ "github_com_Tencent_WeKnora_internal_types.RetrieverEngines": {
"type": "object",
"properties": {
- "args": {
- "description": "Command arguments array",
+ "engines": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams"
}
- },
- "command": {
- "description": "Command: \"uvx\" or \"npx\"",
- "type": "string"
}
}
},
- "types.MCPTransportType": {
+ "github_com_Tencent_WeKnora_internal_types.RetrieverType": {
"type": "string",
"enum": [
- "sse",
- "http-streamable",
- "stdio"
+ "keywords",
+ "vector",
+ "websearch"
],
"x-enum-comments": {
- "MCPTransportHTTPStreamable": "HTTP Streamable",
- "MCPTransportSSE": "Server-Sent Events",
- "MCPTransportStdio": "Stdio (Standard Input/Output)"
+ "KeywordsRetrieverType": "Keywords retriever",
+ "VectorRetrieverType": "Vector retriever",
+ "WebSearchRetrieverType": "Web search retriever"
},
"x-enum-descriptions": [
- "Server-Sent Events",
- "HTTP Streamable",
- "Stdio (Standard Input/Output)"
+ "Keywords retriever",
+ "Vector retriever",
+ "Web search retriever"
],
"x-enum-varnames": [
- "MCPTransportSSE",
- "MCPTransportHTTPStreamable",
- "MCPTransportStdio"
+ "KeywordsRetrieverType",
+ "VectorRetrieverType",
+ "WebSearchRetrieverType"
]
},
- "types.ManualKnowledgePayload": {
+ "github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest": {
"type": "object",
"properties": {
- "channel": {
- "type": "string"
- },
- "content": {
- "type": "string"
- },
- "status": {
- "type": "string"
+ "approved": {
+ "type": "boolean"
},
- "tag_id": {
- "type": "string"
+ "message": {
+ "type": "string",
+ "maxLength": 500
},
- "title": {
- "type": "string"
+ "role": {
+ "description": "Optional: role to assign when approving; overrides applicant's requested role",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
}
}
},
- "types.MatchType": {
- "type": "integer",
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "x-enum-comments": {
- "MatchTypeDataAnalysis": "数据分析匹配类型",
- "MatchTypeDirectLoad": "直接加载匹配类型",
- "MatchTypeParentChunk": "父Chunk匹配类型",
- "MatchTypeRelationChunk": "关系Chunk匹配类型",
- "MatchTypeWebSearch": "网络搜索匹配类型"
- },
- "x-enum-descriptions": [
- "",
- "",
- "",
- "",
- "父Chunk匹配类型",
- "关系Chunk匹配类型",
- "",
- "网络搜索匹配类型",
- "直接加载匹配类型",
- "数据分析匹配类型"
- ],
- "x-enum-varnames": [
- "MatchTypeEmbedding",
- "MatchTypeKeywords",
- "MatchTypeNearByChunk",
- "MatchTypeHistory",
- "MatchTypeParentChunk",
- "MatchTypeRelationChunk",
- "MatchTypeGraph",
- "MatchTypeWebSearch",
- "MatchTypeDirectLoad",
- "MatchTypeDataAnalysis"
- ]
- },
- "types.MentionedItem": {
+ "github_com_Tencent_WeKnora_internal_types.S3EngineConfig": {
"type": "object",
"properties": {
- "id": {
+ "access_key": {
"type": "string"
},
- "kb_type": {
- "description": "\"document\" or \"faq\" (only for kb type)",
+ "bucket_name": {
"type": "string"
},
- "name": {
+ "endpoint": {
"type": "string"
},
- "type": {
- "description": "\"kb\" for knowledge base, \"file\" for file",
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
"type": "string"
}
}
},
- "types.Message": {
+ "github_com_Tencent_WeKnora_internal_types.SearchParams": {
"type": "object",
"properties": {
- "agent_duration_ms": {
- "description": "Agent total execution duration in milliseconds (from query start to answer start)",
- "type": "integer"
+ "disable_keywords_match": {
+ "type": "boolean"
},
- "agent_steps": {
- "description": "Agent execution steps (only for assistant messages generated by agent)\nThis contains the detailed reasoning process and tool calls made by the agent\nStored for user history display, but NOT included in LLM context to avoid redundancy",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.AgentStep"
- }
+ "disable_vector_match": {
+ "type": "boolean"
},
- "attachments": {
- "description": "Attached files (documents, audio, etc., for user messages)",
+ "keyword_threshold": {
+ "type": "number"
+ },
+ "knowledge_base_ids": {
+ "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
"type": "array",
"items": {
- "$ref": "#/definitions/types.MessageAttachment"
+ "type": "string"
}
},
- "channel": {
- "description": "Channel indicates the source channel of this message (e.g., \"web\", \"api\", \"im\")",
- "type": "string"
- },
- "content": {
- "description": "Message text content",
- "type": "string"
- },
- "created_at": {
- "description": "Message creation timestamp",
- "type": "string"
- },
- "deleted_at": {
- "description": "Soft delete timestamp",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
- },
- "id": {
- "description": "Unique identifier for the message",
- "type": "string"
- },
- "images": {
- "description": "Attached images with OCR/Caption text (for user messages)",
+ "knowledge_ids": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.MessageImage"
+ "type": "string"
}
},
- "is_completed": {
- "description": "Whether message generation is complete",
- "type": "boolean"
- },
- "is_fallback": {
- "description": "Whether this response is a fallback (no knowledge base match found)",
- "type": "boolean"
- },
- "knowledge_id": {
- "description": "KnowledgeID links this message to a Knowledge entry in the chat history knowledge base\nUsed for vector search indexing: when set, the message content has been indexed as a Knowledge passage",
- "type": "string"
+ "match_count": {
+ "type": "integer"
},
- "knowledge_references": {
- "description": "References to knowledge chunks used in the response",
- "type": "array",
- "items": {
- "$ref": "#/definitions/types.SearchResult"
- }
+ "only_recommended": {
+ "type": "boolean"
},
- "mentioned_items": {
- "description": "Mentioned knowledge bases and files (for user messages)\nStores the @mentioned items when user sends a message",
+ "query_embedding": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.MentionedItem"
+ "type": "number"
}
},
- "request_id": {
- "description": "Request identifier for tracking API requests",
+ "query_text": {
"type": "string"
},
- "role": {
- "description": "Message role: \"user\", \"assistant\", \"system\"",
- "type": "string"
+ "skip_context_enrichment": {
+ "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
+ "type": "boolean"
},
- "session_id": {
- "description": "ID of the session this message belongs to",
- "type": "string"
+ "tag_ids": {
+ "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
+ "vector_threshold": {
+ "type": "number"
}
}
},
- "types.MessageAttachment": {
+ "github_com_Tencent_WeKnora_internal_types.SearchResult": {
"type": "object",
"properties": {
- "content": {
- "description": "Extracted text content (for small text files)",
- "type": "string"
- },
- "file_name": {
- "description": "Original filename",
- "type": "string"
- },
- "file_size": {
- "description": "File size in bytes",
+ "chunk_index": {
+ "description": "Chunk index",
"type": "integer"
},
- "file_type": {
- "description": "File extension (e.g., \".pdf\", \".docx\")",
+ "chunk_metadata": {
+ "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "chunk_type": {
+ "description": "Chunk 类型",
"type": "string"
},
- "is_truncated": {
- "description": "Whether content was truncated",
- "type": "boolean"
+ "content": {
+ "description": "Content",
+ "type": "string"
},
- "line_count": {
- "description": "Total line count (for text files)",
+ "end_at": {
+ "description": "End at",
"type": "integer"
},
- "url": {
- "description": "Storage URL (provider://path)",
- "type": "string"
- }
- }
- },
- "types.MessageImage": {
- "type": "object",
- "properties": {
- "caption": {
+ "id": {
+ "description": "ID",
"type": "string"
},
- "url": {
- "type": "string"
- }
- }
- },
- "types.MinIOEngineConfig": {
- "type": "object",
- "properties": {
- "access_key_id": {
+ "image_info": {
+ "description": "图片信息 (JSON 格式)",
"type": "string"
},
- "bucket_name": {
+ "knowledge_base_id": {
+ "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
"type": "string"
},
- "endpoint": {
+ "knowledge_channel": {
+ "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
"type": "string"
},
- "mode": {
- "description": "\"docker\" or \"remote\"",
+ "knowledge_description": {
+ "description": "KnowledgeDescription is the description of the knowledge document",
"type": "string"
},
- "path_prefix": {
+ "knowledge_filename": {
+ "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
"type": "string"
},
- "secret_access_key": {
+ "knowledge_id": {
+ "description": "Knowledge ID",
"type": "string"
},
- "use_ssl": {
- "type": "boolean"
- }
- }
- },
- "types.ModelParameters": {
- "type": "object",
- "properties": {
- "api_key": {
+ "knowledge_source": {
+ "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
"type": "string"
},
- "app_id": {
- "description": "WeKnoraCloud 厂商专用凭证",
+ "knowledge_title": {
+ "description": "Knowledge title",
"type": "string"
},
- "app_secret": {
- "description": "AES-256 加密存储,实际承载上游 API Key",
- "type": "string"
+ "match_type": {
+ "description": "Match type",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType"
+ }
+ ]
},
- "base_url": {
+ "matched_content": {
+ "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
"type": "string"
},
- "embedding_parameters": {
- "$ref": "#/definitions/types.EmbeddingParameters"
- },
- "extra_config": {
- "description": "Provider-specific configuration",
+ "metadata": {
+ "description": "Metadata",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- "interface_type": {
- "type": "string"
- },
- "parameter_size": {
- "description": "Ollama model parameter size (e.g., \"7B\", \"13B\", \"70B\")",
- "type": "string"
- },
- "provider": {
- "description": "Provider identifier: openai, aliyun, zhipu, generic",
- "type": "string"
- },
- "supports_vision": {
- "description": "Whether the model accepts image/multimodal input",
- "type": "boolean"
- }
- }
- },
- "types.ModelSource": {
- "type": "string",
- "enum": [
- "local",
- "remote",
- "aliyun",
- "zhipu",
- "volcengine",
- "deepseek",
- "hunyuan",
- "minimax",
- "openai",
- "gemini",
- "mimo",
- "siliconflow",
- "jina",
- "openrouter",
- "nvidia",
- "novita",
- "azure_openai"
- ],
- "x-enum-comments": {
- "ModelSourceAliyun": "Aliyun DashScope model",
- "ModelSourceAzureOpenAI": "Azure OpenAI model",
- "ModelSourceDeepseek": "Deepseek model",
- "ModelSourceGemini": "Gemini model",
- "ModelSourceHunyuan": "Hunyuan model",
- "ModelSourceJina": "Jina AI model",
- "ModelSourceLocal": "Local model",
- "ModelSourceMimo": "Mimo model",
- "ModelSourceMinimax": "Minimax mode",
- "ModelSourceNovita": "Novita AI model",
- "ModelSourceNvidia": "NVIDIA model",
- "ModelSourceOpenAI": "OpenAI model",
- "ModelSourceOpenRouter": "OpenRouter model",
- "ModelSourceRemote": "Remote model",
- "ModelSourceSiliconFlow": "SiliconFlow model",
- "ModelSourceVolcengine": "Volcengine model",
- "ModelSourceZhipu": "Zhipu model"
- },
- "x-enum-descriptions": [
- "Local model",
- "Remote model",
- "Aliyun DashScope model",
- "Zhipu model",
- "Volcengine model",
- "Deepseek model",
- "Hunyuan model",
- "Minimax mode",
- "OpenAI model",
- "Gemini model",
- "Mimo model",
- "SiliconFlow model",
- "Jina AI model",
- "OpenRouter model",
- "NVIDIA model",
- "Novita AI model",
- "Azure OpenAI model"
- ],
- "x-enum-varnames": [
- "ModelSourceLocal",
- "ModelSourceRemote",
- "ModelSourceAliyun",
- "ModelSourceZhipu",
- "ModelSourceVolcengine",
- "ModelSourceDeepseek",
- "ModelSourceHunyuan",
- "ModelSourceMinimax",
- "ModelSourceOpenAI",
- "ModelSourceGemini",
- "ModelSourceMimo",
- "ModelSourceSiliconFlow",
- "ModelSourceJina",
- "ModelSourceOpenRouter",
- "ModelSourceNvidia",
- "ModelSourceNovita",
- "ModelSourceAzureOpenAI"
- ]
- },
- "types.ModelType": {
- "type": "string",
- "enum": [
- "Embedding",
- "Rerank",
- "KnowledgeQA",
- "VLLM",
- "ASR"
- ],
- "x-enum-comments": {
- "ModelTypeASR": "ASR (Automatic Speech Recognition) model",
- "ModelTypeEmbedding": "Embedding model",
- "ModelTypeKnowledgeQA": "KnowledgeQA model",
- "ModelTypeRerank": "Rerank model",
- "ModelTypeVLLM": "VLLM model"
- },
- "x-enum-descriptions": [
- "Embedding model",
- "Rerank model",
- "KnowledgeQA model",
- "VLLM model",
- "ASR (Automatic Speech Recognition) model"
- ],
- "x-enum-varnames": [
- "ModelTypeEmbedding",
- "ModelTypeRerank",
- "ModelTypeKnowledgeQA",
- "ModelTypeVLLM",
- "ModelTypeASR"
- ]
+ "parent_chunk_id": {
+ "description": "父 Chunk ID",
+ "type": "string"
+ },
+ "score": {
+ "description": "Score",
+ "type": "number"
+ },
+ "seq": {
+ "description": "Seq",
+ "type": "integer"
+ },
+ "start_at": {
+ "description": "Start at",
+ "type": "integer"
+ },
+ "sub_chunk_id": {
+ "description": "SubChunkIndex",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
},
- "types.OIDCAuthURLResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Session": {
"type": "object",
"properties": {
- "authorization_url": {
+ "created_at": {
"type": "string"
},
- "provider_display_name": {
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ },
+ "description": {
+ "description": "Description",
"type": "string"
},
- "state": {
+ "id": {
+ "description": "ID",
"type": "string"
},
- "success": {
- "type": "boolean"
+ "tenant_id": {
+ "description": "Tenant ID",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Title",
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
}
}
},
- "types.OIDCConfigResponse": {
+ "github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest": {
"type": "object",
+ "required": [
+ "organization_id",
+ "permission"
+ ],
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "provider_display_name": {
+ "organization_id": {
"type": "string"
},
- "success": {
- "type": "boolean"
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
- "types.OSSEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.StorageConfig": {
"type": "object",
"properties": {
- "access_key": {
+ "app_id": {
"type": "string"
},
"bucket_name": {
"type": "string"
},
- "endpoint": {
+ "path_prefix": {
"type": "string"
},
- "path_prefix": {
+ "provider": {
"type": "string"
},
"region": {
"type": "string"
},
- "secret_key": {
+ "secret_id": {
"type": "string"
},
- "temp_bucket_name": {
+ "secret_key": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.StorageEngineConfig": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
- "temp_region": {
+ "default_provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "use_temp_bucket": {
- "type": "boolean"
+ "local": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig"
+ },
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
+ },
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
+ },
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
}
}
},
- "types.OrgMemberRole": {
- "type": "string",
- "enum": [
- "admin",
- "editor",
- "viewer"
+ "github_com_Tencent_WeKnora_internal_types.StorageProviderConfig": {
+ "type": "object",
+ "properties": {
+ "provider": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest": {
+ "type": "object",
+ "required": [
+ "invite_code"
],
- "x-enum-varnames": [
- "OrgRoleAdmin",
- "OrgRoleEditor",
- "OrgRoleViewer"
- ]
+ "properties": {
+ "invite_code": {
+ "type": "string",
+ "maxLength": 32,
+ "minLength": 8
+ },
+ "message": {
+ "type": "string",
+ "maxLength": 500
+ },
+ "role": {
+ "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ ]
+ }
+ }
},
- "types.OrganizationMemberResponse": {
+ "github_com_Tencent_WeKnora_internal_types.SyncLog": {
"type": "object",
"properties": {
- "avatar": {
+ "created_at": {
+ "description": "Creation timestamp (usually same as StartedAt)",
"type": "string"
},
- "email": {
+ "data_source_id": {
+ "description": "Reference to the data source",
+ "type": "string"
+ },
+ "error_message": {
+ "description": "Error details if status is \"failed\"",
+ "type": "string"
+ },
+ "finished_at": {
+ "description": "Sync completion time",
"type": "string"
},
"id": {
+ "description": "Unique identifier",
"type": "string"
},
- "joined_at": {
+ "items_created": {
+ "description": "New items created in knowledge base",
+ "type": "integer"
+ },
+ "items_deleted": {
+ "description": "Items deleted from knowledge base",
+ "type": "integer"
+ },
+ "items_failed": {
+ "description": "Items that failed to sync",
+ "type": "integer"
+ },
+ "items_skipped": {
+ "description": "Items skipped (no changes detected)",
+ "type": "integer"
+ },
+ "items_total": {
+ "description": "Total items fetched from source",
+ "type": "integer"
+ },
+ "items_updated": {
+ "description": "Existing items updated",
+ "type": "integer"
+ },
+ "result": {
+ "description": "Detailed sync result (JSON-encoded)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "started_at": {
+ "description": "Sync start time",
"type": "string"
},
- "role": {
+ "status": {
+ "description": "Sync status: running, success, partial, failed, canceled",
"type": "string"
},
"tenant_id": {
+ "description": "Tenant ID",
"type": "integer"
},
- "user_id": {
+ "updated_at": {
+ "description": "Last update timestamp",
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.TOSEngineConfig": {
+ "type": "object",
+ "properties": {
+ "access_key": {
"type": "string"
},
- "username": {
+ "bucket_name": {
+ "type": "string"
+ },
+ "endpoint": {
+ "type": "string"
+ },
+ "path_prefix": {
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secret_key": {
"type": "string"
}
}
},
- "types.OrganizationResponse": {
+ "github_com_Tencent_WeKnora_internal_types.Tenant": {
"type": "object",
"properties": {
- "agent_share_count": {
- "description": "共享到该组织的智能体数量",
- "type": "integer"
+ "agent_config": {
+ "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig"
+ }
+ ]
},
- "avatar": {
+ "api_key": {
+ "description": "API key",
"type": "string"
},
+ "business": {
+ "description": "Business",
+ "type": "string"
+ },
+ "chat_history_config": {
+ "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig"
+ }
+ ]
+ },
+ "context_config": {
+ "description": "Global Context configuration for this tenant (default for all sessions)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig"
+ }
+ ]
+ },
+ "conversation_config": {
+ "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig"
+ }
+ ]
+ },
"created_at": {
+ "description": "Creation time",
"type": "string"
},
+ "credentials": {
+ "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig"
+ }
+ ]
+ },
+ "deleted_at": {
+ "description": "Deletion time",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
"description": {
+ "description": "Description",
"type": "string"
},
- "has_pending_upgrade": {
- "description": "当前用户是否有待处理的权限升级申请",
- "type": "boolean"
- },
"id": {
- "type": "string"
- },
- "invite_code": {
- "type": "string"
- },
- "invite_code_expires_at": {
- "type": "string"
- },
- "invite_code_validity_days": {
+ "description": "ID",
"type": "integer"
},
- "is_owner": {
- "type": "boolean"
+ "name": {
+ "description": "Name",
+ "type": "string"
},
- "member_count": {
- "type": "integer"
+ "parser_engine_config": {
+ "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig"
+ }
+ ]
},
- "member_limit": {
- "description": "0 = unlimited",
- "type": "integer"
+ "retrieval_config": {
+ "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig"
+ }
+ ]
},
- "my_role": {
- "type": "string"
+ "retriever_engines": {
+ "description": "Retriever engines",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines"
+ }
+ ]
},
- "name": {
+ "status": {
+ "description": "Status",
"type": "string"
},
- "owner_id": {
- "type": "string"
+ "storage_engine_config": {
+ "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig"
+ }
+ ]
},
- "pending_join_request_count": {
- "description": "待审批加入申请数(仅管理员可见)",
+ "storage_quota": {
+ "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
"type": "integer"
},
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "type": "boolean"
- },
- "share_count": {
- "description": "共享到该组织的知识库数量",
+ "storage_used": {
+ "description": "Storage used (Bytes)",
"type": "integer"
},
"updated_at": {
+ "description": "Last updated time",
"type": "string"
+ },
+ "web_search_config": {
+ "description": "Global WebSearch configuration for this tenant",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig"
+ }
+ ]
}
}
},
- "types.ParserEngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.ToolCall": {
"type": "object",
"properties": {
- "mineru_api_key": {
- "description": "MinerU 云 API Key",
- "type": "string"
- },
- "mineru_cloud_enable_formula": {
- "type": "boolean"
- },
- "mineru_cloud_enable_ocr": {
- "type": "boolean"
- },
- "mineru_cloud_enable_table": {
- "type": "boolean"
+ "args": {
+ "description": "Tool arguments",
+ "type": "object",
+ "additionalProperties": true
},
- "mineru_cloud_language": {
- "type": "string"
+ "duration": {
+ "description": "Execution time in milliseconds",
+ "type": "integer"
},
- "mineru_cloud_model": {
- "description": "MinerU 云 API 解析参数",
+ "id": {
+ "description": "Function call ID from LLM",
"type": "string"
},
- "mineru_enable_formula": {
- "type": "boolean"
- },
- "mineru_enable_ocr": {
- "type": "boolean"
- },
- "mineru_enable_table": {
- "type": "boolean"
- },
- "mineru_endpoint": {
- "description": "MinerU 自建服务端点",
+ "name": {
+ "description": "Tool name",
"type": "string"
},
- "mineru_language": {
+ "reflection": {
+ "description": "Agent's reflection on this tool call result (if enabled)",
"type": "string"
},
- "mineru_model": {
- "description": "MinerU 自建解析参数",
- "type": "string"
+ "result": {
+ "description": "Execution result (contains Output)",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult"
+ }
+ ]
}
}
},
- "types.ParserEngineRule": {
+ "github_com_Tencent_WeKnora_internal_types.ToolResult": {
"type": "object",
"properties": {
- "engine": {
+ "data": {
+ "description": "Structured data for programmatic use",
+ "type": "object",
+ "additionalProperties": true
+ },
+ "error": {
+ "description": "Error message if execution failed",
"type": "string"
},
- "file_types": {
+ "images": {
+ "description": "Base64 data URIs from tool (e.g. MCP image content)",
"type": "array",
"items": {
"type": "string"
}
+ },
+ "output": {
+ "description": "Human-readable output",
+ "type": "string"
+ },
+ "success": {
+ "description": "Whether the tool executed successfully",
+ "type": "boolean"
}
}
},
- "types.QuestionGenerationConfig": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest": {
"type": "object",
+ "required": [
+ "role"
+ ],
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "question_count": {
- "description": "Number of questions to generate per chunk (default: 3, max: 10)",
- "type": "integer"
+ "role": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
}
}
},
- "types.RegisterRequest": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest": {
"type": "object",
- "required": [
- "email",
- "password",
- "username"
- ],
"properties": {
- "email": {
- "type": "string"
+ "avatar": {
+ "description": "optional avatar URL",
+ "type": "string",
+ "maxLength": 512
},
- "password": {
+ "description": {
"type": "string",
- "minLength": 6
+ "maxLength": 1000
},
- "username": {
+ "invite_code_validity_days": {
+ "description": "0=never, 1, 7, 30",
+ "type": "integer"
+ },
+ "member_limit": {
+ "description": "max members; 0=unlimited",
+ "type": "integer"
+ },
+ "name": {
"type": "string",
- "maxLength": 50,
- "minLength": 2
- }
- }
- },
- "types.RegisterResponse": {
- "type": "object",
- "properties": {
- "message": {
- "type": "string"
+ "maxLength": 255,
+ "minLength": 1
},
- "success": {
+ "require_approval": {
"type": "boolean"
},
- "tenant": {
- "$ref": "#/definitions/types.Tenant"
- },
- "user": {
- "$ref": "#/definitions/types.User"
+ "searchable": {
+ "description": "open for search so others can discover and join",
+ "type": "boolean"
}
}
},
- "types.RequestRoleUpgradeRequest": {
+ "github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest": {
"type": "object",
"required": [
- "requested_role"
+ "permission"
],
"properties": {
- "message": {
- "description": "Optional message explaining the reason",
- "type": "string",
- "maxLength": 500
+ "permission": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.User": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "description": "Avatar URL of the user",
+ "type": "string"
},
- "requested_role": {
- "description": "The role user wants to upgrade to",
+ "can_access_all_tenants": {
+ "description": "Whether the user can access all tenants (cross-tenant access)",
+ "type": "boolean"
+ },
+ "created_at": {
+ "description": "Creation time of the user",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Deletion time of the user",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "email": {
+ "description": "Email address of the user",
+ "type": "string"
+ },
+ "id": {
+ "description": "Unique identifier of the user",
+ "type": "string"
+ },
+ "is_active": {
+ "description": "Whether the user is active",
+ "type": "boolean"
+ },
+ "tenant": {
+ "description": "Association relationship, not stored in the database",
"allOf": [
{
- "$ref": "#/definitions/types.OrgMemberRole"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant"
}
]
+ },
+ "tenant_id": {
+ "description": "Tenant ID that the user belongs to",
+ "type": "integer"
+ },
+ "updated_at": {
+ "description": "Last updated time of the user",
+ "type": "string"
+ },
+ "username": {
+ "description": "Username of the user",
+ "type": "string"
}
}
},
- "types.Resource": {
+ "github_com_Tencent_WeKnora_internal_types.VLMConfig": {
"type": "object",
"properties": {
- "description": {
- "description": "Optional description",
+ "api_key": {
+ "description": "API Key",
"type": "string"
},
- "external_id": {
- "description": "Unique identifier in the external system",
+ "base_url": {
+ "description": "Base URL",
"type": "string"
},
- "has_children": {
- "description": "Whether this resource has children that can be expanded",
+ "enabled": {
"type": "boolean"
},
- "metadata": {
- "description": "Additional metadata",
- "type": "object",
- "additionalProperties": true
- },
- "modified_at": {
- "description": "Last modified time in external system",
- "type": "string"
- },
- "name": {
- "description": "Display name",
- "type": "string"
- },
- "parent_id": {
- "description": "For hierarchical resources (parent ID if applicable)",
+ "interface_type": {
+ "description": "Interface Type: \"ollama\" or \"openai\"",
"type": "string"
},
- "type": {
- "description": "Resource type (document, folder, space, page, etc.)",
+ "model_id": {
"type": "string"
},
- "url": {
- "description": "URL to access in external system",
+ "model_name": {
+ "description": "兼容老版本\nModel Name",
"type": "string"
}
}
},
- "types.ResourceCountsByOrgResponse": {
+ "github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials": {
"type": "object",
"properties": {
- "agents": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "app_id": {
+ "type": "string"
},
- "knowledge_bases": {
- "type": "object",
- "properties": {
- "by_organization": {
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
- }
- }
+ "app_secret": {
+ "type": "string"
}
}
},
- "types.RetrievalConfig": {
+ "github_com_Tencent_WeKnora_internal_types.WebSearchConfig": {
"type": "object",
"properties": {
- "embedding_top_k": {
- "description": "EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)",
+ "api_key": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "blacklist": {
+ "description": "黑名单规则列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "compression_method": {
+ "description": "压缩方法:none, summary, extract, rag",
+ "type": "string"
+ },
+ "document_fragments": {
+ "description": "文档片段数量(用于RAG压缩)",
"type": "integer"
},
- "keyword_threshold": {
- "description": "KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)",
- "type": "number"
+ "embedding_dimension": {
+ "description": "嵌入维度(用于RAG压缩)",
+ "type": "integer"
},
- "rerank_model_id": {
- "description": "RerankModelID is the ID of the rerank model to use (required for search)",
+ "embedding_model_id": {
+ "description": "RAG压缩相关配置",
"type": "string"
},
- "rerank_threshold": {
- "description": "RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)",
- "type": "number"
+ "include_date": {
+ "description": "是否包含日期",
+ "type": "boolean"
},
- "rerank_top_k": {
- "description": "RerankTopK is the maximum number of results after reranking (default: 10)",
+ "max_results": {
+ "description": "最大搜索结果数",
"type": "integer"
},
- "vector_threshold": {
- "description": "VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)",
- "type": "number"
+ "provider": {
+ "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "type": "string"
+ },
+ "proxy_url": {
+ "description": "Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.",
+ "type": "string"
+ },
+ "rerank_model_id": {
+ "description": "重排模型ID(用于RAG压缩)",
+ "type": "string"
}
}
},
- "types.RetrieverEngineParams": {
+ "github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
- "retriever_engine_type": {
- "description": "Retriever engine type",
+ "extraction_granularity": {
+ "description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
"allOf": [
{
- "$ref": "#/definitions/types.RetrieverEngineType"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity"
}
]
},
- "retriever_type": {
- "description": "Retriever type",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrieverType"
- }
- ]
+ "max_pages_per_ingest": {
+ "description": "MaxPagesPerIngest limits pages created/updated per ingest operation (0 = no limit)",
+ "type": "integer"
+ },
+ "synthesis_model_id": {
+ "description": "SynthesisModelID is the LLM model ID used for wiki page generation and updates",
+ "type": "string"
}
}
},
- "types.RetrieverEngineType": {
+ "github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity": {
"type": "string",
"enum": [
- "postgres",
- "elasticsearch",
- "infinity",
- "elasticfaiss",
- "qdrant",
- "milvus",
- "weaviate",
- "sqlite"
+ "focused",
+ "standard",
+ "exhaustive"
],
"x-enum-varnames": [
- "PostgresRetrieverEngineType",
- "ElasticsearchRetrieverEngineType",
- "InfinityRetrieverEngineType",
- "ElasticFaissRetrieverEngineType",
- "QdrantRetrieverEngineType",
- "MilvusRetrieverEngineType",
- "WeaviateRetrieverEngineType",
- "SQLiteRetrieverEngineType"
+ "WikiExtractionFocused",
+ "WikiExtractionStandard",
+ "WikiExtractionExhaustive"
]
},
- "types.RetrieverEngines": {
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphData": {
"type": "object",
"properties": {
- "engines": {
+ "edges": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge"
+ }
+ },
+ "nodes": {
"type": "array",
"items": {
- "$ref": "#/definitions/types.RetrieverEngineParams"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode"
}
}
}
},
- "types.RetrieverType": {
- "type": "string",
- "enum": [
- "keywords",
- "vector",
- "websearch"
- ],
- "x-enum-comments": {
- "KeywordsRetrieverType": "Keywords retriever",
- "VectorRetrieverType": "Vector retriever",
- "WebSearchRetrieverType": "Web search retriever"
- },
- "x-enum-descriptions": [
- "Keywords retriever",
- "Vector retriever",
- "Web search retriever"
- ],
- "x-enum-varnames": [
- "KeywordsRetrieverType",
- "VectorRetrieverType",
- "WebSearchRetrieverType"
- ]
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphEdge": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "description": "source slug",
+ "type": "string"
+ },
+ "target": {
+ "description": "target slug",
+ "type": "string"
+ }
+ }
},
- "types.ReviewJoinRequestRequest": {
+ "github_com_Tencent_WeKnora_internal_types.WikiGraphNode": {
"type": "object",
"properties": {
- "approved": {
- "type": "boolean"
+ "link_count": {
+ "description": "Number of inbound + outbound links",
+ "type": "integer"
+ },
+ "page_type": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPage": {
+ "type": "object",
+ "properties": {
+ "aliases": {
+ "description": "Alternate names, abbreviations, acronyms or translated names",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "chunk_refs": {
+ "description": "ChunkRefs records the specific source-document chunks this page was\nbuilt from — one UUID per cited chunk. Populated during ingest from\nthe chunk-citation pass; refreshed wholesale whenever the page is\nre-materialized. Empty for summary pages (they are document-level\nsynopses and don't carry chunk-level citations). Use this when you\nneed to surface the underlying evidence for a wiki page, or to\nretract citations when a source document is deleted.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "content": {
+ "description": "Full markdown content",
+ "type": "string"
+ },
+ "created_at": {
+ "description": "Creation time",
+ "type": "string"
+ },
+ "deleted_at": {
+ "description": "Soft delete",
+ "allOf": [
+ {
+ "$ref": "#/definitions/gorm.DeletedAt"
+ }
+ ]
+ },
+ "id": {
+ "description": "Unique identifier (UUID)",
+ "type": "string"
+ },
+ "in_links": {
+ "description": "Slugs of pages that link TO this page (backlinks)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "knowledge_base_id": {
+ "description": "Knowledge base this page belongs to",
+ "type": "string"
+ },
+ "out_links": {
+ "description": "Slugs of pages this page links to (outbound links)",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "page_metadata": {
+ "description": "Arbitrary metadata (tags, categories, dates, etc.)",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "page_type": {
+ "description": "Page type: summary, entity, concept, index, log, synthesis, comparison",
+ "type": "string"
+ },
+ "slug": {
+ "description": "URL-friendly slug for addressing, e.g. \"entity/acme-corp\", \"concept/rag\"\nUnique within a knowledge base",
+ "type": "string"
+ },
+ "source_refs": {
+ "description": "References to source knowledge IDs that contributed to this page.\nFormat matches the legacy \"\u003cknowledge_id\u003e|\u003cdoc_title\u003e\" convention used\nacross the ingest pipeline, so retract / display code can split on `|`\nto recover the title. Document-level granularity.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "status": {
+ "description": "Page status: draft, published, archived",
+ "type": "string"
+ },
+ "summary": {
+ "description": "One-line summary for index listing",
+ "type": "string"
+ },
+ "tenant_id": {
+ "description": "Tenant ID for multi-tenant isolation",
+ "type": "integer"
+ },
+ "title": {
+ "description": "Human-readable title",
+ "type": "string"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "updated_at": {
+ "description": "Last update time",
+ "type": "string"
},
- "role": {
- "description": "Optional: role to assign when approving; overrides applicant's requested role",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- ]
+ "version": {
+ "description": "Version number. Incremented only when a user-visible content field\n(title, content, summary, page_type, status) actually changes; pure\nbookkeeping writes (link maintenance, same-content re-ingest, status\nsync from background jobs) leave it untouched so it can be used as a\nreal \"the page was edited\" signal.",
+ "type": "integer"
}
}
},
- "types.S3EngineConfig": {
+ "github_com_Tencent_WeKnora_internal_types.WikiPageIssue": {
"type": "object",
"properties": {
- "access_key": {
+ "created_at": {
"type": "string"
},
- "bucket_name": {
- "type": "string"
+ "deleted_at": {
+ "$ref": "#/definitions/gorm.DeletedAt"
},
- "endpoint": {
+ "description": {
"type": "string"
},
- "path_prefix": {
+ "id": {
"type": "string"
},
- "region": {
+ "issue_type": {
"type": "string"
},
- "secret_key": {
+ "knowledge_base_id": {
"type": "string"
- }
- }
- },
- "types.SearchParams": {
- "type": "object",
- "properties": {
- "disable_keywords_match": {
- "type": "boolean"
},
- "disable_vector_match": {
- "type": "boolean"
+ "reported_by": {
+ "type": "string"
},
- "keyword_threshold": {
- "type": "number"
+ "slug": {
+ "type": "string"
},
- "knowledge_base_ids": {
- "description": "KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,\nallowing a single retrieval call to span multiple KBs that share the\nsame embedding model. When empty, HybridSearch uses its own id parameter.",
- "type": "array",
- "items": {
- "type": "string"
- }
+ "status": {
+ "type": "string"
},
- "knowledge_ids": {
+ "suspected_knowledge_ids": {
"type": "array",
"items": {
"type": "string"
}
},
- "match_count": {
+ "tenant_id": {
"type": "integer"
},
- "only_recommended": {
- "type": "boolean"
- },
- "query_embedding": {
- "type": "array",
- "items": {
- "type": "number"
- }
- },
- "query_text": {
+ "updated_at": {
"type": "string"
+ }
+ }
+ },
+ "github_com_Tencent_WeKnora_internal_types.WikiPageListResponse": {
+ "type": "object",
+ "properties": {
+ "page": {
+ "type": "integer"
},
- "skip_context_enrichment": {
- "description": "SkipContextEnrichment skips fetching parent, nearby, and relation chunks\nin processSearchResults. Used by the chat pipeline where context assembly\nis handled separately in the merge stage.",
- "type": "boolean"
+ "page_size": {
+ "type": "integer"
},
- "tag_ids": {
- "description": "Tag IDs for filtering (used for FAQ priority filtering)",
+ "pages": {
"type": "array",
"items": {
- "type": "string"
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
}
},
- "vector_threshold": {
- "type": "number"
+ "total": {
+ "type": "integer"
+ },
+ "total_pages": {
+ "type": "integer"
}
}
},
- "types.SearchResult": {
+ "github_com_Tencent_WeKnora_internal_types.WikiStats": {
"type": "object",
"properties": {
- "chunk_index": {
- "description": "Chunk index",
+ "is_active": {
+ "description": "whether wiki ingestion is currently running",
+ "type": "boolean"
+ },
+ "orphan_count": {
+ "description": "pages with no inbound links",
"type": "integer"
},
- "chunk_metadata": {
- "description": "ChunkMetadata stores chunk-level metadata (e.g., generated questions)",
- "type": "array",
- "items": {
- "type": "integer"
+ "pages_by_type": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer",
+ "format": "int64"
}
},
- "chunk_type": {
- "description": "Chunk 类型",
- "type": "string"
+ "pending_issues": {
+ "description": "number of pending wiki issues",
+ "type": "integer"
},
- "content": {
- "description": "Content",
- "type": "string"
+ "pending_tasks": {
+ "description": "number of documents waiting to be ingested",
+ "type": "integer"
},
- "end_at": {
- "description": "End at",
+ "recent_updates": {
+ "description": "last N updated pages",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage"
+ }
+ },
+ "total_links": {
"type": "integer"
},
- "id": {
- "description": "ID",
+ "total_pages": {
+ "type": "integer"
+ }
+ }
+ },
+ "gorm.DeletedAt": {
+ "type": "object",
+ "properties": {
+ "time": {
"type": "string"
},
- "image_info": {
- "description": "图片信息 (JSON 格式)",
+ "valid": {
+ "description": "Valid is true if Time is not NULL",
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.CopyKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "source_id"
+ ],
+ "properties": {
+ "source_id": {
"type": "string"
},
- "knowledge_base_id": {
- "description": "KnowledgeBaseID is the ID of the knowledge base this result belongs to",
+ "target_id": {
"type": "string"
},
- "knowledge_channel": {
- "description": "KnowledgeChannel indicates through which channel the knowledge was ingested (web, api, wechat, etc.)",
+ "task_id": {
"type": "string"
- },
- "knowledge_description": {
- "description": "KnowledgeDescription is the description of the knowledge document",
+ }
+ }
+ },
+ "internal_handler.CreateAgentRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "avatar": {
"type": "string"
},
- "knowledge_filename": {
- "description": "Knowledge file name\nUsed for file type knowledge, contains the original file name",
- "type": "string"
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
},
- "knowledge_id": {
- "description": "Knowledge ID",
+ "description": {
"type": "string"
},
- "knowledge_source": {
- "description": "Knowledge source\nUsed to indicate the source of the knowledge, such as \"url\"",
+ "name": {
"type": "string"
- },
- "knowledge_title": {
- "description": "Knowledge title",
+ }
+ }
+ },
+ "internal_handler.CreateModelRequest": {
+ "type": "object",
+ "required": [
+ "name",
+ "parameters",
+ "source",
+ "type"
+ ],
+ "properties": {
+ "description": {
"type": "string"
},
- "match_type": {
- "description": "Match type",
- "allOf": [
- {
- "$ref": "#/definitions/types.MatchType"
- }
- ]
- },
- "matched_content": {
- "description": "MatchedContent is the actual content that was matched in vector search\nFor FAQ: this is the matched question text (standard or similar question)",
+ "name": {
"type": "string"
},
- "metadata": {
- "description": "Metadata",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
},
- "parent_chunk_id": {
- "description": "父 Chunk ID",
- "type": "string"
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
},
- "score": {
- "description": "Score",
- "type": "number"
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
+ }
+ }
+ },
+ "internal_handler.CreateStoreRequest": {
+ "type": "object",
+ "required": [
+ "connection_config",
+ "engine_type",
+ "name"
+ ],
+ "properties": {
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
},
- "seq": {
- "description": "Seq",
- "type": "integer"
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
},
- "start_at": {
- "description": "Start at",
- "type": "integer"
+ "index_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig"
},
- "sub_chunk_id": {
- "description": "SubChunkIndex",
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.DeleteTagRequest": {
+ "type": "object",
+ "properties": {
+ "exclude_ids": {
+ "description": "Chunk seq_ids to exclude from deletion",
"type": "array",
"items": {
- "type": "string"
+ "type": "integer"
}
}
}
},
- "types.Session": {
+ "internal_handler.EvaluationRequest": {
"type": "object",
"properties": {
- "created_at": {
- "type": "string"
- },
- "deleted_at": {
- "$ref": "#/definitions/gorm.DeletedAt"
- },
- "description": {
- "description": "Description",
+ "chat_id": {
+ "description": "ID of chat model to use",
"type": "string"
},
- "id": {
- "description": "ID",
+ "dataset_id": {
+ "description": "ID of dataset to evaluate",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
- },
- "title": {
- "description": "Title",
+ "knowledge_base_id": {
+ "description": "ID of knowledge base to use",
"type": "string"
},
- "updated_at": {
+ "rerank_id": {
+ "description": "ID of rerank model to use",
"type": "string"
}
}
},
- "types.ShareKnowledgeBaseRequest": {
+ "internal_handler.FabriTextRequest": {
"type": "object",
"required": [
- "organization_id",
- "permission"
+ "model_id"
],
"properties": {
- "organization_id": {
+ "model_id": {
"type": "string"
},
- "permission": {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
},
- "types.StorageConfig": {
+ "internal_handler.GetStorageEngineStatusResponse": {
"type": "object",
"properties": {
- "app_id": {
- "type": "string"
+ "engines": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler.StorageEngineStatusItem"
+ }
},
- "bucket_name": {
+ "minio_env_available": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.GetSystemInfoResponse": {
+ "type": "object",
+ "properties": {
+ "build_time": {
"type": "string"
},
- "path_prefix": {
+ "commit_id": {
"type": "string"
},
- "provider": {
+ "db_version": {
"type": "string"
},
- "region": {
+ "edition": {
"type": "string"
},
- "secret_id": {
+ "go_version": {
"type": "string"
},
- "secret_key": {
+ "graph_database_engine": {
"type": "string"
- }
- }
- },
- "types.StorageEngineConfig": {
- "type": "object",
- "properties": {
- "cos": {
- "$ref": "#/definitions/types.COSEngineConfig"
},
- "default_provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "keyword_index_engine": {
"type": "string"
},
- "local": {
- "$ref": "#/definitions/types.LocalEngineConfig"
- },
- "minio": {
- "$ref": "#/definitions/types.MinIOEngineConfig"
- },
- "oss": {
- "$ref": "#/definitions/types.OSSEngineConfig"
+ "minio_enabled": {
+ "type": "boolean"
},
- "s3": {
- "$ref": "#/definitions/types.S3EngineConfig"
+ "vector_store_engine": {
+ "type": "string"
},
- "tos": {
- "$ref": "#/definitions/types.TOSEngineConfig"
- }
- }
- },
- "types.StorageProviderConfig": {
- "type": "object",
- "properties": {
- "provider": {
- "description": "\"local\", \"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
+ "version": {
"type": "string"
}
}
},
- "types.SubmitJoinRequestRequest": {
+ "internal_handler.KBModelConfigRequest": {
"type": "object",
"required": [
- "invite_code"
+ "llmModelId"
],
"properties": {
- "invite_code": {
- "type": "string",
- "maxLength": 32,
- "minLength": 8
+ "asr_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig"
},
- "message": {
- "type": "string",
- "maxLength": 500
+ "documentSplitting": {
+ "description": "文档分块配置",
+ "type": "object",
+ "properties": {
+ "childChunkSize": {
+ "type": "integer"
+ },
+ "chunkOverlap": {
+ "type": "integer"
+ },
+ "chunkSize": {
+ "type": "integer"
+ },
+ "enableParentChild": {
+ "type": "boolean"
+ },
+ "parentChunkSize": {
+ "type": "integer"
+ },
+ "parserEngineRules": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule"
+ }
+ },
+ "separators": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
},
- "role": {
- "description": "Optional: role the applicant requests (admin/editor/viewer); default viewer",
- "allOf": [
- {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "embeddingModelId": {
+ "description": "optional when RAG indexing is disabled",
+ "type": "string"
+ },
+ "llmModelId": {
+ "type": "string"
+ },
+ "multimodal": {
+ "description": "多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
}
- ]
+ }
+ },
+ "nodeExtract": {
+ "description": "知识图谱配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode"
+ }
+ },
+ "relations": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "questionGeneration": {
+ "description": "问题生成配置",
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "questionCount": {
+ "type": "integer"
+ }
+ }
+ },
+ "storageProvider": {
+ "description": "存储引擎选择(\"local\" | \"minio\" | \"cos\"),影响文档上传与文档内图片存储,参数从全局设置读取",
+ "type": "string"
+ },
+ "vlm_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig"
}
}
},
- "types.SyncLog": {
+ "internal_handler.RemoteModelCheckRequest": {
"type": "object",
+ "required": [
+ "modelName"
+ ],
"properties": {
- "created_at": {
- "description": "Creation timestamp (usually same as StartedAt)",
+ "apiKey": {
"type": "string"
},
- "data_source_id": {
- "description": "Reference to the data source",
+ "baseUrl": {
"type": "string"
},
- "error_message": {
- "description": "Error details if status is \"failed\"",
- "type": "string"
+ "customHeaders": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "finished_at": {
- "description": "Sync completion time",
- "type": "string"
+ "dimension": {
+ "type": "integer"
},
- "id": {
- "description": "Unique identifier",
- "type": "string"
+ "extraConfig": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
- "items_created": {
- "description": "New items created in knowledge base",
- "type": "integer"
+ "interfaceType": {
+ "type": "string"
},
- "items_deleted": {
- "description": "Items deleted from knowledge base",
- "type": "integer"
+ "modelName": {
+ "type": "string"
},
- "items_failed": {
- "description": "Items that failed to sync",
- "type": "integer"
+ "provider": {
+ "type": "string"
},
- "items_skipped": {
- "description": "Items skipped (no changes detected)",
+ "source": {
+ "description": "为空时按需默认为 \"remote\"",
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.SearchMessagesRequest": {
+ "type": "object",
+ "required": [
+ "query"
+ ],
+ "properties": {
+ "limit": {
+ "description": "Maximum number of results to return (default: 20)",
"type": "integer"
},
- "items_total": {
- "description": "Total items fetched from source",
- "type": "integer"
+ "mode": {
+ "description": "Search mode: \"keyword\", \"vector\", \"hybrid\" (default: \"hybrid\")",
+ "type": "string"
},
- "items_updated": {
- "description": "Existing items updated",
- "type": "integer"
+ "query": {
+ "description": "Query text for search",
+ "type": "string"
},
- "result": {
- "description": "Detailed sync result (JSON-encoded)",
+ "session_ids": {
+ "description": "Filter by specific session IDs (optional)",
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
+ }
+ }
+ },
+ "internal_handler.StorageCheckRequest": {
+ "type": "object",
+ "properties": {
+ "cos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig"
},
- "started_at": {
- "description": "Sync start time",
- "type": "string"
+ "minio": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig"
},
- "status": {
- "description": "Sync status: running, success, partial, failed, canceled",
+ "oss": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig"
+ },
+ "provider": {
+ "description": "\"minio\", \"cos\", \"tos\", \"s3\", \"oss\"",
"type": "string"
},
- "tenant_id": {
- "description": "Tenant ID",
- "type": "integer"
+ "s3": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig"
},
- "updated_at": {
- "description": "Last update timestamp",
- "type": "string"
+ "tos": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig"
}
}
},
- "types.TOSEngineConfig": {
+ "internal_handler.StorageCheckResponse": {
"type": "object",
"properties": {
- "access_key": {
- "type": "string"
- },
- "bucket_name": {
- "type": "string"
+ "bucket_created": {
+ "type": "boolean"
},
- "endpoint": {
+ "message": {
"type": "string"
},
- "path_prefix": {
- "type": "string"
+ "ok": {
+ "type": "boolean"
+ }
+ }
+ },
+ "internal_handler.StorageEngineStatusItem": {
+ "type": "object",
+ "properties": {
+ "available": {
+ "description": "whether the engine can be used",
+ "type": "boolean"
},
- "region": {
+ "description": {
+ "description": "short description for UI",
"type": "string"
},
- "secret_key": {
+ "name": {
+ "description": "\"local\", \"minio\", \"cos\", \"tos\"",
"type": "string"
}
}
},
- "types.Tenant": {
+ "internal_handler.TestStoreRequest": {
"type": "object",
+ "required": [
+ "connection_config",
+ "engine_type"
+ ],
"properties": {
- "agent_config": {
- "description": "Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/types.AgentConfig"
- }
- ]
- },
- "api_key": {
- "description": "API key",
- "type": "string"
+ "connection_config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig"
},
- "business": {
- "description": "Business",
+ "engine_type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType"
+ }
+ }
+ },
+ "internal_handler.TextRelationExtractionRequest": {
+ "type": "object",
+ "required": [
+ "model_id",
+ "tags",
+ "text"
+ ],
+ "properties": {
+ "model_id": {
"type": "string"
},
- "chat_history_config": {
- "description": "Chat history config: knowledge base configuration for indexing and searching chat messages via vector search",
- "allOf": [
- {
- "$ref": "#/definitions/types.ChatHistoryConfig"
- }
- ]
- },
- "context_config": {
- "description": "Global Context configuration for this tenant (default for all sessions)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ContextConfig"
- }
- ]
- },
- "conversation_config": {
- "description": "Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.\nThis field is kept for backward compatibility and will be removed in future versions.",
- "allOf": [
- {
- "$ref": "#/definitions/types.ConversationConfig"
- }
- ]
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "created_at": {
- "description": "Creation time",
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateAgentRequest": {
+ "type": "object",
+ "properties": {
+ "avatar": {
"type": "string"
},
- "credentials": {
- "description": "Credentials config: third-party provider credentials (e.g. WeKnoraCloud AppID/AppSecret)",
- "allOf": [
- {
- "$ref": "#/definitions/types.CredentialsConfig"
- }
- ]
- },
- "deleted_at": {
- "description": "Deletion time",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig"
},
"description": {
- "description": "Description",
"type": "string"
},
- "id": {
- "description": "ID",
- "type": "integer"
- },
"name": {
- "description": "Name",
"type": "string"
+ }
+ }
+ },
+ "internal_handler.UpdateChunkRequest": {
+ "type": "object",
+ "properties": {
+ "chunk_index": {
+ "type": "integer"
},
- "parser_engine_config": {
- "description": "Parser engine config overrides (MinerU endpoint, API key, etc.). Used when parsing documents; overrides env.",
- "allOf": [
- {
- "$ref": "#/definitions/types.ParserEngineConfig"
- }
- ]
+ "content": {
+ "type": "string"
},
- "retrieval_config": {
- "description": "Retrieval config: global search/retrieval parameters shared by knowledge search and message search",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrievalConfig"
- }
- ]
+ "embedding": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ }
},
- "retriever_engines": {
- "description": "Retriever engines",
- "allOf": [
- {
- "$ref": "#/definitions/types.RetrieverEngines"
- }
- ]
+ "end_at": {
+ "type": "integer"
},
- "status": {
- "description": "Status",
+ "image_info": {
"type": "string"
},
- "storage_engine_config": {
- "description": "Storage engine config: parameters for Local, MinIO, COS. Used for document/file storage and docreader.",
- "allOf": [
- {
- "$ref": "#/definitions/types.StorageEngineConfig"
- }
- ]
- },
- "storage_quota": {
- "description": "Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.",
- "type": "integer"
+ "is_enabled": {
+ "type": "boolean"
},
- "storage_used": {
- "description": "Storage used (Bytes)",
+ "start_at": {
"type": "integer"
+ }
+ }
+ },
+ "internal_handler.UpdateKnowledgeBaseRequest": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "config": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig"
},
- "updated_at": {
- "description": "Last updated time",
+ "description": {
"type": "string"
},
- "web_search_config": {
- "description": "Global WebSearch configuration for this tenant",
- "allOf": [
- {
- "$ref": "#/definitions/types.WebSearchConfig"
- }
- ]
+ "name": {
+ "type": "string"
}
}
},
- "types.ToolCall": {
+ "internal_handler.UpdateModelRequest": {
"type": "object",
"properties": {
- "args": {
- "description": "Tool arguments",
- "type": "object",
- "additionalProperties": true
- },
- "duration": {
- "description": "Execution time in milliseconds",
- "type": "integer"
- },
- "id": {
- "description": "Function call ID from LLM",
+ "description": {
"type": "string"
},
"name": {
- "description": "Tool name",
"type": "string"
},
- "reflection": {
- "description": "Agent's reflection on this tool call result (if enabled)",
- "type": "string"
+ "parameters": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters"
},
- "result": {
- "description": "Execution result (contains Output)",
- "allOf": [
- {
- "$ref": "#/definitions/types.ToolResult"
- }
- ]
+ "source": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource"
+ },
+ "type": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType"
}
}
},
- "types.ToolResult": {
+ "internal_handler.UpdateStoreRequest": {
"type": "object",
+ "required": [
+ "name"
+ ],
"properties": {
- "data": {
- "description": "Structured data for programmatic use",
- "type": "object",
- "additionalProperties": true
- },
- "error": {
- "description": "Error message if execution failed",
+ "name": {
"type": "string"
- },
- "images": {
- "description": "Base64 data URIs from tool (e.g. MCP image content)",
+ }
+ }
+ },
+ "internal_handler.addSimilarQuestionsRequest": {
+ "type": "object",
+ "required": [
+ "similar_questions"
+ ],
+ "properties": {
+ "similar_questions": {
"type": "array",
- "items": {
- "type": "string"
- }
- },
- "output": {
- "description": "Human-readable output",
- "type": "string"
- },
- "success": {
- "description": "Whether the tool executed successfully",
- "type": "boolean"
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
}
}
},
- "types.UpdateMemberRoleRequest": {
+ "internal_handler.updateLastFAQImportResultDisplayStatusRequest": {
"type": "object",
"required": [
- "role"
+ "display_status"
],
"properties": {
- "role": {
- "$ref": "#/definitions/types.OrgMemberRole"
+ "display_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "close"
+ ]
}
}
},
- "types.UpdateOrganizationRequest": {
+ "internal_handler_session.AttachmentUpload": {
"type": "object",
"properties": {
- "avatar": {
- "description": "optional avatar URL",
- "type": "string",
- "maxLength": 512
- },
- "description": {
- "type": "string",
- "maxLength": 1000
+ "data": {
+ "description": "Base64-encoded file content",
+ "type": "string"
},
- "invite_code_validity_days": {
- "description": "0=never, 1, 7, 30",
- "type": "integer"
+ "file_name": {
+ "description": "Original filename",
+ "type": "string"
},
- "member_limit": {
- "description": "max members; 0=unlimited",
+ "file_size": {
+ "description": "File size in bytes",
"type": "integer"
- },
- "name": {
- "type": "string",
- "maxLength": 255,
- "minLength": 1
- },
- "require_approval": {
- "type": "boolean"
- },
- "searchable": {
- "description": "open for search so others can discover and join",
- "type": "boolean"
}
}
},
- "types.UpdateSharePermissionRequest": {
+ "internal_handler_session.CreateKnowledgeQARequest": {
"type": "object",
"required": [
- "permission"
+ "query"
],
"properties": {
- "permission": {
- "$ref": "#/definitions/types.OrgMemberRole"
- }
- }
- },
- "types.User": {
- "type": "object",
- "properties": {
- "avatar": {
- "description": "Avatar URL of the user",
- "type": "string"
- },
- "can_access_all_tenants": {
- "description": "Whether the user can access all tenants (cross-tenant access)",
+ "agent_enabled": {
+ "description": "Whether agent mode is enabled for this request",
"type": "boolean"
},
- "created_at": {
- "description": "Creation time of the user",
+ "agent_id": {
+ "description": "Selected custom agent ID (backend resolves shared agent and its tenant from share relation)",
"type": "string"
},
- "deleted_at": {
- "description": "Deletion time of the user",
- "allOf": [
- {
- "$ref": "#/definitions/gorm.DeletedAt"
- }
- ]
+ "attachment_uploads": {
+ "description": "Attached files (documents, audio, etc.)",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.AttachmentUpload"
+ }
},
- "email": {
- "description": "Email address of the user",
+ "channel": {
+ "description": "Source channel: \"web\", \"api\", \"im\", etc.",
"type": "string"
},
- "id": {
- "description": "Unique identifier of the user",
- "type": "string"
+ "disable_title": {
+ "description": "Whether to disable auto title generation",
+ "type": "boolean"
},
- "is_active": {
- "description": "Whether the user is active",
+ "enable_memory": {
+ "description": "Whether memory feature is enabled for this request",
"type": "boolean"
},
- "tenant": {
- "description": "Association relationship, not stored in the database",
- "allOf": [
- {
- "$ref": "#/definitions/types.Tenant"
- }
- ]
+ "images": {
+ "description": "Attached images for multimodal chat",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.ImageAttachment"
+ }
},
- "tenant_id": {
- "description": "Tenant ID that the user belongs to",
- "type": "integer"
+ "knowledge_base_ids": {
+ "description": "Selected knowledge base ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "updated_at": {
- "description": "Last updated time of the user",
+ "knowledge_ids": {
+ "description": "Selected knowledge ID for this request",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mentioned_items": {
+ "description": "@mentioned knowledge bases and files",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/internal_handler_session.MentionedItemRequest"
+ }
+ },
+ "query": {
+ "description": "Query text for knowledge base search",
"type": "string"
},
- "username": {
- "description": "Username of the user",
+ "summary_model_id": {
+ "description": "Optional summary model ID for this request (overrides session default)",
"type": "string"
+ },
+ "web_search_enabled": {
+ "description": "Whether web search is enabled for this request",
+ "type": "boolean"
}
}
},
- "types.VLMConfig": {
+ "internal_handler_session.CreateSessionRequest": {
"type": "object",
"properties": {
- "api_key": {
- "description": "API Key",
+ "description": {
+ "description": "Description for the session (optional)",
"type": "string"
},
- "base_url": {
- "description": "Base URL",
+ "title": {
+ "description": "Title for the session (optional)",
"type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "interface_type": {
- "description": "Interface Type: \"ollama\" or \"openai\"",
+ }
+ }
+ },
+ "internal_handler_session.GenerateTitleRequest": {
+ "type": "object",
+ "required": [
+ "messages"
+ ],
+ "properties": {
+ "messages": {
+ "description": "Messages to use as context for title generation",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.Message"
+ }
+ }
+ }
+ },
+ "internal_handler_session.ImageAttachment": {
+ "type": "object",
+ "properties": {
+ "caption": {
+ "description": "VLM analysis result (context-aware, single call)",
"type": "string"
},
- "model_id": {
+ "data": {
+ "description": "base64 data URI from frontend (data:image/png;base64,...)",
"type": "string"
},
- "model_name": {
- "description": "兼容老版本\nModel Name",
+ "url": {
+ "description": "serving URL after saving to storage",
"type": "string"
}
}
},
- "types.WeKnoraCloudCredentials": {
+ "internal_handler_session.MentionedItemRequest": {
"type": "object",
"properties": {
- "app_id": {
+ "id": {
"type": "string"
},
- "app_secret": {
+ "kb_type": {
+ "description": "\"document\" or \"faq\" (only for kb type)",
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
+ "description": "\"kb\" for knowledge base, \"file\" for file",
"type": "string"
}
}
},
- "types.WebSearchConfig": {
+ "internal_handler_session.SearchKnowledgeRequest": {
"type": "object",
+ "required": [
+ "query"
+ ],
"properties": {
- "api_key": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ "knowledge_base_id": {
+ "description": "Single knowledge base ID (for backward compatibility)",
"type": "string"
},
- "blacklist": {
- "description": "黑名单规则列表",
+ "knowledge_base_ids": {
+ "description": "IDs of knowledge bases to search (multi-KB support)",
"type": "array",
"items": {
"type": "string"
}
},
- "compression_method": {
- "description": "压缩方法:none, summary, extract, rag",
- "type": "string"
- },
- "document_fragments": {
- "description": "文档片段数量(用于RAG压缩)",
- "type": "integer"
- },
- "embedding_dimension": {
- "description": "嵌入维度(用于RAG压缩)",
- "type": "integer"
+ "knowledge_ids": {
+ "description": "IDs of specific knowledge (files) to search",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "embedding_model_id": {
- "description": "RAG压缩相关配置",
+ "query": {
+ "description": "Query text to search for",
"type": "string"
- },
- "include_date": {
- "description": "是否包含日期",
- "type": "boolean"
- },
- "max_results": {
- "description": "最大搜索结果数",
- "type": "integer"
- },
- "provider": {
- "description": "Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.",
+ }
+ }
+ },
+ "internal_handler_session.StopSessionRequest": {
+ "type": "object",
+ "required": [
+ "message_id"
+ ],
+ "properties": {
+ "message_id": {
"type": "string"
+ }
+ }
+ },
+ "internal_handler_session.batchDeleteRequest": {
+ "type": "object",
+ "properties": {
+ "delete_all": {
+ "type": "boolean"
},
- "rerank_model_id": {
- "description": "重排模型ID(用于RAG压缩)",
- "type": "string"
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
}
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index ccb6fcdb8..88c48e5ec 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1,6 +1,67 @@
basePath: /api/v1
definitions:
- datasource.ConnectorMetadata:
+ github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue:
+ properties:
+ auto_fixable:
+ type: boolean
+ description:
+ type: string
+ page_slug:
+ type: string
+ severity:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity'
+ target_slug:
+ description: |-
+ TargetSlug identifies the other page involved in the issue (e.g. the
+ broken link target, or the entity slug for a missing cross-ref). It is
+ the structured field used by AutoFix instead of parsing Description.
+ type: string
+ type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType'
+ type: object
+ github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueSeverity:
+ enum:
+ - info
+ - warning
+ - error
+ type: string
+ x-enum-varnames:
+ - SeverityInfo
+ - SeverityWarning
+ - SeverityError
+ github_com_Tencent_WeKnora_internal_application_service.WikiLintIssueType:
+ enum:
+ - orphan_page
+ - broken_link
+ - stale_ref
+ - missing_cross_ref
+ - empty_content
+ - duplicate_slug
+ type: string
+ x-enum-varnames:
+ - LintIssueOrphanPage
+ - LintIssueBrokenLink
+ - LintIssueStaleRef
+ - LintIssueMissingCrossRef
+ - LintIssueEmptyContent
+ - LintIssueDuplicateSlug
+ github_com_Tencent_WeKnora_internal_application_service.WikiLintReport:
+ properties:
+ health_score:
+ description: 0-100
+ type: integer
+ issues:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintIssue'
+ type: array
+ knowledge_base_id:
+ type: string
+ stats:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats'
+ summary:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata:
properties:
auth_type:
description: '"oauth2", "api_key", "token", etc.'
@@ -22,15 +83,15 @@ definitions:
type:
type: string
type: object
- errors.AppError:
+ github_com_Tencent_WeKnora_internal_errors.AppError:
properties:
code:
- $ref: '#/definitions/errors.ErrorCode'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.ErrorCode'
details: {}
message:
type: string
type: object
- errors.ErrorCode:
+ github_com_Tencent_WeKnora_internal_errors.ErrorCode:
enum:
- 1000
- 1001
@@ -74,3071 +135,3389 @@ definitions:
- ErrAgentMissingAllowedTools
- ErrAgentInvalidMaxIterations
- ErrAgentInvalidTemperature
- github_com_Tencent_WeKnora_internal_errors.AppError:
- properties:
- code:
- $ref: '#/definitions/errors.ErrorCode'
- details: {}
- message:
- type: string
- type: object
- gorm.DeletedAt:
+ github_com_Tencent_WeKnora_internal_types.ASRConfig:
properties:
- time:
- type: string
- valid:
- description: Valid is true if Time is not NULL
+ enabled:
type: boolean
- type: object
- handler.CopyKnowledgeBaseRequest:
- properties:
- source_id:
- type: string
- target_id:
- type: string
- task_id:
- type: string
- required:
- - source_id
- type: object
- handler.CreateAgentRequest:
- properties:
- avatar:
- type: string
- config:
- $ref: '#/definitions/types.CustomAgentConfig'
- description:
- type: string
- name:
- type: string
- required:
- - name
- type: object
- handler.CreateModelRequest:
- properties:
- description:
+ language:
+ description: 'optional: language hint for transcription'
type: string
- name:
+ model_id:
type: string
- parameters:
- $ref: '#/definitions/types.ModelParameters'
- source:
- $ref: '#/definitions/types.ModelSource'
- type:
- $ref: '#/definitions/types.ModelType'
- required:
- - name
- - parameters
- - source
- - type
type: object
- handler.CreateStoreRequest:
+ github_com_Tencent_WeKnora_internal_types.AgentConfig:
properties:
- connection_config:
- $ref: '#/definitions/types.ConnectionConfig'
- engine_type:
- $ref: '#/definitions/types.RetrieverEngineType'
- index_config:
- $ref: '#/definitions/types.IndexConfig'
- name:
+ allowed_skills:
+ description: Skill names whitelist (empty = allow all)
+ items:
+ type: string
+ type: array
+ allowed_tools:
+ description: List of allowed tool names
+ items:
+ type: string
+ type: array
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
+ knowledge_bases:
+ description: Accessible knowledge base IDs
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ description: Accessible knowledge IDs (individual documents)
+ items:
+ type: string
+ type: array
+ llm_call_timeout:
+ description: 'LLM call timeout in seconds (default: 120). Controls the maximum
+ time for a single LLM call.'
+ type: integer
+ max_context_tokens:
+ description: |-
+ Maximum context window tokens for the agent (default: 200000).
+ The agent compresses older messages to stay within this limit,
+ preserving tool_call/tool_result pairs.
+ type: integer
+ max_iterations:
+ description: Maximum number of ReAct iterations
+ type: integer
+ max_tool_output_chars:
+ description: |-
+ Maximum character length for tool output (default: 16000).
+ Outputs exceeding this limit are truncated with head + tail preservation.
+ type: integer
+ mcp_selection_mode:
+ description: MCP service selection
type: string
- required:
- - connection_config
- - engine_type
- - name
- type: object
- handler.DeleteTagRequest:
- properties:
- exclude_ids:
- description: Chunk seq_ids to exclude from deletion
+ mcp_services:
+ description: Selected MCP service IDs (when mode is "selected")
items:
- type: integer
+ type: string
type: array
- type: object
- handler.EvaluationRequest:
- properties:
- chat_id:
- description: ID of chat model to use
+ multi_turn_enabled:
+ description: Whether multi-turn conversation is enabled
+ type: boolean
+ parallel_tool_calls:
+ description: |-
+ Whether to execute independent tool calls in parallel (default: false).
+ When enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.
+ type: boolean
+ retain_retrieval_history:
+ description: 'Whether to retain retrieval history (like wiki_read_page results)
+ across turns (default: false)'
+ type: boolean
+ retrieve_kb_only_when_mentioned:
+ description: 'Whether to retrieve knowledge base only when explicitly mentioned
+ with @ (default: false)'
+ type: boolean
+ skill_dirs:
+ description: Directories to search for skills
+ items:
+ type: string
+ type: array
+ skills_enabled:
+ description: Skills configuration (Progressive Disclosure pattern)
+ type: boolean
+ system_prompt:
+ description: Unified system prompt (uses web_search_status placeholder for
+ dynamic behavior)
type: string
- dataset_id:
- description: ID of dataset to evaluate
+ system_prompt_web_disabled:
+ description: 'Deprecated: Custom prompt when web search is disabled'
type: string
- knowledge_base_id:
- description: ID of knowledge base to use
+ system_prompt_web_enabled:
+ description: 'Deprecated: Use SystemPrompt instead. Kept for backward compatibility
+ during migration.'
type: string
- rerank_id:
- description: ID of rerank model to use
+ temperature:
+ description: LLM temperature for agent
+ type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
+ type: boolean
+ use_custom_system_prompt:
+ description: Whether to use custom system prompt instead of default
+ type: boolean
+ web_search_enabled:
+ description: Whether web search tool is enabled
+ type: boolean
+ web_search_max_results:
+ description: 'Maximum number of web search results (default: 5)'
+ type: integer
+ web_search_provider_id:
+ description: WebSearchProviderEntity ID (resolved from agent config)
type: string
type: object
- handler.FabriTextRequest:
+ github_com_Tencent_WeKnora_internal_types.AgentStep:
properties:
- model_id:
+ iteration:
+ description: Iteration number (0-indexed)
+ type: integer
+ thought:
+ description: LLM's reasoning/thinking (Think phase)
type: string
- tags:
- items:
- type: string
- type: array
- required:
- - model_id
- type: object
- handler.GetStorageEngineStatusResponse:
- properties:
- engines:
+ timestamp:
+ description: When this step occurred
+ type: string
+ tool_calls:
+ description: Tools called in this step (Act phase)
items:
- $ref: '#/definitions/handler.StorageEngineStatusItem'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolCall'
type: array
- minio_env_available:
- type: boolean
type: object
- handler.GetSystemInfoResponse:
+ github_com_Tencent_WeKnora_internal_types.AnswerStrategy:
+ enum:
+ - all
+ - random
+ type: string
+ x-enum-varnames:
+ - AnswerStrategyAll
+ - AnswerStrategyRandom
+ github_com_Tencent_WeKnora_internal_types.COSEngineConfig:
properties:
- build_time:
+ app_id:
type: string
- commit_id:
+ bucket_name:
type: string
- db_version:
+ path_prefix:
type: string
- edition:
+ region:
type: string
- go_version:
+ secret_id:
type: string
- graph_database_engine:
+ secret_key:
type: string
- keyword_index_engine:
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig:
+ properties:
+ embedding_model_id:
+ description: |-
+ EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
+ Once messages have been indexed, the model cannot be changed (requires re-indexing).
type: string
- minio_enabled:
+ enabled:
+ description: Enabled controls whether chat history indexing is active
type: boolean
- vector_store_engine:
- type: string
- version:
+ knowledge_base_id:
+ description: |-
+ KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
+ This is set internally when the feature is first enabled; users should not set this directly.
type: string
type: object
- handler.KBModelConfigRequest:
+ github_com_Tencent_WeKnora_internal_types.ChunkingConfig:
properties:
- asr_config:
- $ref: '#/definitions/types.ASRConfig'
- documentSplitting:
- description: 文档分块配置
- properties:
- childChunkSize:
- type: integer
- chunkOverlap:
- type: integer
- chunkSize:
- type: integer
- enableParentChild:
- type: boolean
- parentChunkSize:
- type: integer
- parserEngineRules:
- items:
- $ref: '#/definitions/types.ParserEngineRule'
- type: array
- separators:
- items:
- type: string
- type: array
- type: object
- embeddingModelId:
- type: string
- llmModelId:
- type: string
- multimodal:
- description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
- properties:
- enabled:
- type: boolean
- type: object
- nodeExtract:
- description: 知识图谱配置
- properties:
- enabled:
- type: boolean
- nodes:
- items:
- $ref: '#/definitions/types.GraphNode'
- type: array
- relations:
- items:
- $ref: '#/definitions/types.GraphRelation'
- type: array
- tags:
- items:
- type: string
- type: array
- text:
- type: string
- type: object
- questionGeneration:
- description: 问题生成配置
- properties:
- enabled:
- type: boolean
- questionCount:
- type: integer
- type: object
- storageProvider:
- description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
- type: string
- vlm_config:
- $ref: '#/definitions/types.VLMConfig'
- required:
- - embeddingModelId
- - llmModelId
+ child_chunk_size:
+ description: |-
+ ChildChunkSize is the size of child chunks used for embedding (default: 384).
+ Only used when EnableParentChild is true.
+ type: integer
+ chunk_overlap:
+ description: Chunk overlap
+ type: integer
+ chunk_size:
+ description: Chunk size
+ type: integer
+ enable_multimodal:
+ description: EnableMultimodal (deprecated, kept for backward compatibility
+ with old data)
+ type: boolean
+ enable_parent_child:
+ description: |-
+ EnableParentChild enables two-level parent-child chunking strategy.
+ When enabled, large parent chunks provide context while small child chunks
+ are used for vector matching. Retrieval matches on child but returns parent content.
+ type: boolean
+ parent_chunk_size:
+ description: |-
+ ParentChunkSize is the size of parent chunks (default: 4096).
+ Only used when EnableParentChild is true.
+ type: integer
+ parser_engine_rules:
+ description: |-
+ ParserEngineRules configures which parser engine to use for each file type.
+ When empty, the builtin engine is used for all types.
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule'
+ type: array
+ separators:
+ description: Separators
+ items:
+ type: string
+ type: array
type: object
- handler.RemoteModelCheckRequest:
+ github_com_Tencent_WeKnora_internal_types.ConnectionConfig:
properties:
- apiKey:
+ addr:
+ description: Common
type: string
- baseUrl:
+ api_key:
+ description: AES-GCM encrypted
type: string
- modelName:
+ grpc_address:
+ description: Weaviate
type: string
- provider:
+ host:
+ description: Qdrant
type: string
- required:
- - baseUrl
- - modelName
- type: object
- handler.SearchMessagesRequest:
- properties:
- limit:
- description: 'Maximum number of results to return (default: 20)'
+ password:
+ description: AES-GCM encrypted
+ type: string
+ port:
type: integer
- mode:
- description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")'
+ scheme:
type: string
- query:
- description: Query text for search
+ use_default_connection:
+ description: Postgres
+ type: boolean
+ use_tls:
+ type: boolean
+ username:
+ type: string
+ version:
+ description: |-
+ Version is the detected server version (e.g., "7.10.1", "16.2", "1.12.6").
+ Auto-populated by TestConnection on successful connectivity check.
type: string
- session_ids:
- description: Filter by specific session IDs (optional)
- items:
- type: string
- type: array
- required:
- - query
type: object
- handler.StorageCheckRequest:
+ github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy:
+ enum:
+ - sliding_window
+ - smart
+ type: string
+ x-enum-varnames:
+ - ContextCompressionSlidingWindow
+ - ContextCompressionSmart
+ github_com_Tencent_WeKnora_internal_types.ContextConfig:
properties:
- cos:
- $ref: '#/definitions/types.COSEngineConfig'
- minio:
- $ref: '#/definitions/types.MinIOEngineConfig'
- oss:
- $ref: '#/definitions/types.OSSEngineConfig'
- provider:
- description: '"minio", "cos", "tos", "s3", "oss"'
- type: string
- s3:
- $ref: '#/definitions/types.S3EngineConfig'
- tos:
- $ref: '#/definitions/types.TOSEngineConfig'
+ compression_strategy:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextCompressionStrategy'
+ description: 'Compression strategy: "sliding_window" or "smart"'
+ max_tokens:
+ description: Maximum tokens allowed in LLM context
+ type: integer
+ recent_message_count:
+ description: |-
+ For sliding_window: number of messages to keep
+ For smart: number of recent messages to keep uncompressed
+ type: integer
+ summarize_threshold:
+ description: 'Summarize threshold: number of messages before summarization'
+ type: integer
type: object
- handler.StorageCheckResponse:
+ github_com_Tencent_WeKnora_internal_types.ConversationConfig:
properties:
- bucket_created:
- type: boolean
- message:
+ context_template:
+ description: ContextTemplate is the prompt template for summarizing retrieval
+ results
type: string
- ok:
+ embedding_top_k:
+ type: integer
+ enable_query_expansion:
type: boolean
- type: object
- handler.StorageEngineStatusItem:
- properties:
- available:
- description: whether the engine can be used
+ enable_rewrite:
type: boolean
- description:
- description: short description for UI
+ fallback_prompt:
type: string
- name:
- description: '"local", "minio", "cos", "tos"'
+ fallback_response:
type: string
- type: object
- handler.TestStoreRequest:
- properties:
- connection_config:
- $ref: '#/definitions/types.ConnectionConfig'
- engine_type:
- $ref: '#/definitions/types.RetrieverEngineType'
- required:
- - connection_config
- - engine_type
- type: object
- handler.TextRelationExtractionRequest:
- properties:
- model_id:
+ fallback_strategy:
+ description: Fallback strategy
type: string
- tags:
- items:
- type: string
- type: array
- text:
+ keyword_threshold:
+ type: number
+ max_completion_tokens:
+ description: MaxTokens is the maximum number of tokens to generate
+ type: integer
+ max_rounds:
+ description: Retrieval & strategy parameters
+ type: integer
+ prompt:
+ description: Prompt is the system prompt for normal mode
type: string
- required:
- - model_id
- - tags
- - text
+ rerank_model_id:
+ type: string
+ rerank_threshold:
+ type: number
+ rerank_top_k:
+ type: integer
+ rewrite_prompt_system:
+ description: Rewrite prompts
+ type: string
+ rewrite_prompt_user:
+ type: string
+ summary_model_id:
+ description: Model configuration
+ type: string
+ temperature:
+ description: Temperature controls the randomness of the model output
+ type: number
+ vector_threshold:
+ type: number
type: object
- handler.UpdateAgentRequest:
+ github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest:
properties:
avatar:
+ description: optional avatar URL
+ maxLength: 512
type: string
- config:
- $ref: '#/definitions/types.CustomAgentConfig'
description:
+ maxLength: 1000
type: string
+ invite_code_validity_days:
+ description: 'optional: 0=never, 1, 7, 30; default 7'
+ type: integer
+ member_limit:
+ description: 'optional: max members; 0=unlimited; default 50'
+ type: integer
name:
+ maxLength: 255
+ minLength: 1
type: string
+ required:
+ - name
type: object
- handler.UpdateChunkRequest:
+ github_com_Tencent_WeKnora_internal_types.CredentialsConfig:
properties:
- chunk_index:
- type: integer
- content:
- type: string
- embedding:
+ weknoracloud:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.CustomAgentConfig:
+ properties:
+ agent_mode:
+ description: |-
+ ===== Basic Settings =====
+ Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
+ type: string
+ agent_type:
+ description: |-
+ AgentType is a preset category under smart-reasoning mode that pre-fills
+ system prompt, allowed tools and recommended KB compatibility.
+ Valid values: "rag-qa", "wiki-qa", "hybrid-rag-wiki", "custom".
+ Empty / unknown values are treated as "custom" (no preset applied).
+ Ignored for quick-answer mode.
+ type: string
+ allowed_tools:
+ description: Allowed tools (only for agent type)
items:
- type: number
+ type: string
type: array
- end_at:
- type: integer
- image_info:
+ asr_model_id:
+ description: ASR model ID for audio transcription (optional)
type: string
- is_enabled:
+ audio_upload_enabled:
+ description: 'Whether audio upload (ASR transcription) is enabled for this
+ agent (default: false)'
type: boolean
- start_at:
+ context_template:
+ description: Context template for normal mode (how to format retrieved chunks)
+ type: string
+ context_template_id:
+ description: |-
+ ContextTemplateID references a template ID in prompt_templates/ YAML files.
+ If set and ContextTemplate is empty, the template content will be resolved at startup.
+ type: string
+ embedding_top_k:
+ description: |-
+ ===== Retrieval Strategy Settings (for both modes) =====
+ Embedding/Vector retrieval top K
type: integer
- type: object
- handler.UpdateKnowledgeBaseRequest:
- properties:
- config:
- $ref: '#/definitions/types.KnowledgeBaseConfig'
- description:
+ enable_query_expansion:
+ description: |-
+ ===== Advanced Settings (mainly for normal mode) =====
+ Whether to enable query expansion
+ type: boolean
+ enable_rewrite:
+ description: Whether to enable query rewrite for multi-turn conversations
+ type: boolean
+ fallback_prompt:
+ description: Fallback prompt (when FallbackStrategy is "model")
type: string
- name:
+ fallback_response:
+ description: Fixed fallback response (when FallbackStrategy is "fixed")
type: string
- required:
- - name
- type: object
- handler.UpdateModelRequest:
- properties:
- description:
+ fallback_strategy:
+ description: 'Fallback strategy: "fixed" for fixed response, "model" for model
+ generation'
type: string
- name:
+ faq_direct_answer_threshold:
+ description: FAQ direct answer threshold - if similarity > this value, use
+ FAQ answer directly
+ type: number
+ faq_priority_enabled:
+ description: |-
+ ===== FAQ Strategy Settings =====
+ Whether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)
+ type: boolean
+ faq_score_boost:
+ description: FAQ score boost multiplier - FAQ results score multiplied by
+ this factor
+ type: number
+ history_turns:
+ description: Number of history turns to keep in context
+ type: integer
+ image_storage_provider:
+ description: |-
+ Storage provider for image uploads: "local", "minio", "cos", "tos"
+ Empty means use the global/tenant default provider.
type: string
- parameters:
- $ref: '#/definitions/types.ModelParameters'
- source:
- $ref: '#/definitions/types.ModelSource'
- type:
- $ref: '#/definitions/types.ModelType'
- type: object
- handler.UpdateStoreRequest:
- properties:
- name:
+ image_upload_enabled:
+ description: |-
+ ===== Image Upload / Multimodal Settings =====
+ Whether image upload is enabled for this agent (default: false)
+ type: boolean
+ kb_selection_mode:
+ description: |-
+ ===== Knowledge Base Settings =====
+ Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
type: string
- required:
- - name
- type: object
- handler.addSimilarQuestionsRequest:
- properties:
- similar_questions:
+ keyword_threshold:
+ description: Keyword retrieval threshold
+ type: number
+ knowledge_bases:
+ description: Associated knowledge base IDs (only used when KBSelectionMode
+ is "selected")
items:
type: string
- minItems: 1
type: array
- required:
- - similar_questions
- type: object
- handler.updateLastFAQImportResultDisplayStatusRequest:
- properties:
- display_status:
- enum:
- - open
- - close
- type: string
- required:
- - display_status
- type: object
- handler_session.AttachmentUpload:
- properties:
- data:
- description: Base64-encoded file content
- type: string
- file_name:
- description: Original filename
- type: string
- file_size:
- description: File size in bytes
+ llm_call_timeout:
+ description: Timeout for a single LLM call in seconds (0 = use global default)
type: integer
- type: object
- handler_session.CreateKnowledgeQARequest:
- properties:
- agent_enabled:
- description: Whether agent mode is enabled for this request
- type: boolean
- agent_id:
- description: Selected custom agent ID (backend resolves shared agent and its
- tenant from share relation)
+ max_completion_tokens:
+ description: Maximum completion tokens (only for normal mode)
+ type: integer
+ max_iterations:
+ description: |-
+ ===== Agent Mode Settings =====
+ Maximum iterations for ReAct loop (only for agent type)
+ type: integer
+ mcp_selection_mode:
+ description: 'MCP service selection mode: "all" = all enabled MCP services,
+ "selected" = specific services, "none" = no MCP'
type: string
- attachment_uploads:
- description: Attached files (documents, audio, etc.)
+ mcp_services:
+ description: Selected MCP service IDs (only used when MCPSelectionMode is
+ "selected")
items:
- $ref: '#/definitions/handler_session.AttachmentUpload'
+ type: string
type: array
- channel:
- description: 'Source channel: "web", "api", "im", etc.'
+ model_id:
+ description: |-
+ ===== Model Settings =====
+ Model ID to use for conversations
type: string
- disable_title:
- description: Whether to disable auto title generation
+ multi_turn_enabled:
+ description: |-
+ ===== Multi-turn Conversation Settings =====
+ Whether multi-turn conversation is enabled
type: boolean
- enable_memory:
- description: Whether memory feature is enabled for this request
+ rerank_model_id:
+ description: ReRank model ID for retrieval
+ type: string
+ rerank_threshold:
+ description: Rerank threshold
+ type: number
+ rerank_top_k:
+ description: Rerank top K
+ type: integer
+ retain_retrieval_history:
+ description: Whether to retain retrieval history across turns
type: boolean
- images:
- description: Attached images for multimodal chat
- items:
- $ref: '#/definitions/handler_session.ImageAttachment'
- type: array
- knowledge_base_ids:
- description: Selected knowledge base ID for this request
+ retrieve_kb_only_when_mentioned:
+ description: |-
+ Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
+ When true, knowledge base retrieval only happens if user explicitly mentions KB/files with @
+ When false, knowledge base retrieval happens according to KBSelectionMode
+ type: boolean
+ rewrite_prompt_system:
+ description: Rewrite prompt system message
+ type: string
+ rewrite_prompt_user:
+ description: Rewrite prompt user message template
+ type: string
+ selected_skills:
+ description: Selected skill names (only used when SkillsSelectionMode is "selected")
items:
type: string
type: array
- knowledge_ids:
- description: Selected knowledge ID for this request
+ skills_selection_mode:
+ description: |-
+ ===== Skills Settings (only for smart-reasoning mode) =====
+ Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
+ type: string
+ suggested_prompts:
+ description: |-
+ ===== Suggested Prompts =====
+ 推荐问题列表,用于在前端对话面板展示快捷提问
items:
type: string
type: array
- mentioned_items:
- description: '@mentioned knowledge bases and files'
+ supported_file_types:
+ description: |-
+ ===== File Type Restriction Settings =====
+ Supported file types for this agent (e.g., ["csv", "xlsx", "xls"])
+ Empty means all file types are supported
+ When set, only files with matching extensions can be used with this agent
items:
- $ref: '#/definitions/handler_session.MentionedItemRequest'
+ type: string
type: array
- query:
- description: Query text for knowledge base search
+ system_prompt:
+ description: System prompt for the agent (unified prompt, uses web_search_status
+ placeholder for dynamic behavior)
type: string
- summary_model_id:
- description: Optional summary model ID for this request (overrides session
- default)
+ system_prompt_id:
+ description: |-
+ SystemPromptID references a template ID in prompt_templates/ YAML files.
+ If set and SystemPrompt is empty, the template content will be resolved at startup.
type: string
- web_search_enabled:
- description: Whether web search is enabled for this request
+ temperature:
+ description: Temperature for LLM (0-1)
+ type: number
+ thinking:
+ description: Whether to enable thinking mode (for models that support extended
+ thinking)
type: boolean
- required:
- - query
- type: object
- handler_session.CreateSessionRequest:
- properties:
- description:
- description: Description for the session (optional)
- type: string
- title:
- description: Title for the session (optional)
+ vector_threshold:
+ description: Vector retrieval threshold
+ type: number
+ vlm_model_id:
+ description: VLM model ID for image analysis (optional, falls back to tenant-level
+ VLM)
type: string
- type: object
- handler_session.GenerateTitleRequest:
+ web_fetch_enabled:
+ description: Whether to auto-fetch full page content for reranked web search
+ results
+ type: boolean
+ web_fetch_top_n:
+ description: 'Max number of pages to fetch after rerank (default: 3)'
+ type: integer
+ web_search_enabled:
+ description: |-
+ ===== Web Search Settings =====
+ Whether web search is enabled
+ type: boolean
+ web_search_max_results:
+ description: Maximum web search results
+ type: integer
+ web_search_provider_id:
+ description: |-
+ WebSearchProviderID references a specific WebSearchProviderEntity.
+ If empty, the tenant's default provider (is_default=true) is used.
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.DataSource:
properties:
- messages:
- description: Messages to use as context for title generation
+ config:
+ description: |-
+ Encrypted configuration (API credentials, tokens, etc.)
+ Stored as JSON with AES-256-GCM encryption
items:
- $ref: '#/definitions/types.Message'
+ type: integer
type: array
- required:
- - messages
- type: object
- handler_session.ImageAttachment:
- properties:
- caption:
- description: VLM analysis result (context-aware, single call)
+ conflict_strategy:
+ description: 'Conflict resolution strategy: overwrite or skip'
type: string
- data:
- description: base64 data URI from frontend (data:image/png;base64,...)
+ created_at:
+ description: Creation timestamp
type: string
- url:
- description: serving URL after saving to storage
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Soft delete timestamp
+ error_message:
+ description: Error message if status is "error"
type: string
- type: object
- handler_session.MentionedItemRequest:
- properties:
id:
+ description: Unique identifier
type: string
- kb_type:
- description: '"document" or "faq" (only for kb type)'
+ knowledge_base_id:
+ description: Target knowledge base ID
+ type: string
+ last_sync_at:
+ description: Last successful sync timestamp
type: string
+ last_sync_cursor:
+ description: Cursor or state for incremental sync (connector-specific)
+ items:
+ type: integer
+ type: array
+ last_sync_result:
+ description: Summary of last sync result
+ items:
+ type: integer
+ type: array
+ latest_sync_log:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ description: Latest sync log (not stored in DB, populated on query)
name:
+ description: User-friendly name
+ type: string
+ status:
+ description: 'Current status: active, paused, error'
+ type: string
+ sync_deletions:
+ description: Whether to sync deletions from source
+ type: boolean
+ sync_log_retention_days:
+ description: 'Number of days to keep sync logs (default: 30)'
+ type: integer
+ sync_mode:
+ description: 'Sync mode: "incremental" (recommended) or "full"'
+ type: string
+ sync_schedule:
+ description: Cron expression for scheduled syncs (e.g., "0 */6 * * *" = every
+ 6 hours)
type: string
+ tenant_id:
+ description: Tenant ID for multi-tenancy
+ type: integer
+ total_items_synced:
+ description: Total items synced (not stored in DB, calculated on query)
+ type: integer
type:
- description: '"kb" for knowledge base, "file" for file'
+ description: Connector type (feishu, notion, confluence, etc.)
+ type: string
+ updated_at:
+ description: Last update timestamp
type: string
type: object
- handler_session.SearchKnowledgeRequest:
+ github_com_Tencent_WeKnora_internal_types.EmbeddingParameters:
properties:
- knowledge_base_id:
- description: Single knowledge base ID (for backward compatibility)
- type: string
- knowledge_base_ids:
- description: IDs of knowledge bases to search (multi-KB support)
+ dimension:
+ type: integer
+ truncate_prompt_tokens:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ExtractConfig:
+ properties:
+ enabled:
+ type: boolean
+ nodes:
items:
- type: string
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
type: array
- knowledge_ids:
- description: IDs of specific knowledge (files) to search
+ relations:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
+ type: array
+ tags:
items:
type: string
type: array
- query:
- description: Query text to search for
+ text:
type: string
- required:
- - query
type: object
- handler_session.StopSessionRequest:
+ github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload:
properties:
- message_id:
+ dry_run:
+ description: 仅验证,不实际导入
+ type: boolean
+ entries:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
+ type: array
+ knowledge_id:
+ type: string
+ mode:
+ enum:
+ - append
+ - replace
+ type: string
+ task_id:
+ description: 可选,如果不传则自动生成UUID
type: string
required:
- - message_id
+ - entries
type: object
- handler_session.batchDeleteRequest:
+ github_com_Tencent_WeKnora_internal_types.FAQConfig:
properties:
- delete_all:
- type: boolean
- ids:
+ index_mode:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQIndexMode'
+ question_index_mode:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate:
+ properties:
+ by_id:
+ additionalProperties:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
+ description: ByID 按条目ID更新,key为条目ID (seq_id)
+ type: object
+ by_tag:
+ additionalProperties:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate'
+ description: ByTag 按Tag批量更新,key为TagID (seq_id)
+ type: object
+ exclude_ids:
+ description: ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)
items:
- type: string
+ type: integer
type: array
type: object
- types.ASRConfig:
+ github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsUpdate:
properties:
- enabled:
+ is_enabled:
type: boolean
- language:
- description: 'optional: language hint for transcription'
- type: string
- model_id:
- type: string
+ is_recommended:
+ type: boolean
+ tag_id:
+ type: integer
type: object
- types.AgentConfig:
+ github_com_Tencent_WeKnora_internal_types.FAQEntryPayload:
properties:
- allowed_skills:
- description: Skill names whitelist (empty = allow all)
- items:
- type: string
- type: array
- allowed_tools:
- description: List of allowed tool names
+ answer_strategy:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AnswerStrategy'
+ answers:
items:
type: string
type: array
- history_turns:
- description: Number of history turns to keep in context
+ id:
+ description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
type: integer
- knowledge_bases:
- description: Accessible knowledge base IDs
+ is_enabled:
+ type: boolean
+ is_recommended:
+ type: boolean
+ negative_questions:
items:
type: string
type: array
- knowledge_ids:
- description: Accessible knowledge IDs (individual documents)
+ similar_questions:
items:
type: string
type: array
- llm_call_timeout:
- description: 'LLM call timeout in seconds (default: 120). Controls the maximum
- time for a single LLM call.'
- type: integer
- max_context_tokens:
- description: |-
- Maximum context window tokens for the agent (default: 200000).
- The agent compresses older messages to stay within this limit,
- preserving tool_call/tool_result pairs.
- type: integer
- max_iterations:
- description: Maximum number of ReAct iterations
- type: integer
- max_tool_output_chars:
- description: |-
- Maximum character length for tool output (default: 16000).
- Outputs exceeding this limit are truncated with head + tail preservation.
+ standard_question:
+ type: string
+ tag_id:
type: integer
- mcp_selection_mode:
- description: MCP service selection
+ tag_name:
type: string
- mcp_services:
- description: Selected MCP service IDs (when mode is "selected")
+ required:
+ - standard_question
+ type: object
+ github_com_Tencent_WeKnora_internal_types.FAQIndexMode:
+ enum:
+ - question_only
+ - question_answer
+ type: string
+ x-enum-varnames:
+ - FAQIndexModeQuestionOnly
+ - FAQIndexModeQuestionAnswer
+ github_com_Tencent_WeKnora_internal_types.FAQQuestionIndexMode:
+ enum:
+ - combined
+ - separate
+ type: string
+ x-enum-varnames:
+ - FAQQuestionIndexModeCombined
+ - FAQQuestionIndexModeSeparate
+ github_com_Tencent_WeKnora_internal_types.FAQSearchRequest:
+ properties:
+ first_priority_tag_ids:
+ description: 第一优先级标签ID列表,限定命中范围,优先级最高
items:
- type: string
+ type: integer
type: array
- multi_turn_enabled:
- description: Whether multi-turn conversation is enabled
- type: boolean
- parallel_tool_calls:
- description: |-
- Whether to execute independent tool calls in parallel (default: false).
- When enabled and the LLM returns multiple tool calls, they run concurrently via errgroup.
+ match_count:
+ type: integer
+ only_recommended:
+ description: 是否仅返回推荐的条目
type: boolean
- retrieve_kb_only_when_mentioned:
- description: 'Whether to retrieve knowledge base only when explicitly mentioned
- with @ (default: false)'
- type: boolean
- skill_dirs:
- description: Directories to search for skills
+ query_text:
+ type: string
+ second_priority_tag_ids:
+ description: 第二优先级标签ID列表,限定命中范围,优先级低于第一优先级
items:
- type: string
+ type: integer
type: array
- skills_enabled:
- description: Skills configuration (Progressive Disclosure pattern)
- type: boolean
- system_prompt:
- description: Unified system prompt (uses web_search_status placeholder for
- dynamic behavior)
- type: string
- system_prompt_web_disabled:
- description: 'Deprecated: Custom prompt when web search is disabled'
- type: string
- system_prompt_web_enabled:
- description: 'Deprecated: Use SystemPrompt instead. Kept for backward compatibility
- during migration.'
- type: string
- temperature:
- description: LLM temperature for agent
+ vector_threshold:
type: number
- thinking:
- description: Whether to enable thinking mode (for models that support extended
- thinking)
- type: boolean
- use_custom_system_prompt:
- description: Whether to use custom system prompt instead of default
- type: boolean
- web_search_enabled:
- description: Whether web search tool is enabled
- type: boolean
- web_search_max_results:
- description: 'Maximum number of web search results (default: 5)'
- type: integer
- web_search_provider_id:
- description: WebSearchProviderEntity ID (resolved from agent config)
- type: string
+ required:
+ - query_text
type: object
- types.AgentStep:
+ github_com_Tencent_WeKnora_internal_types.GraphNode:
properties:
- iteration:
- description: Iteration number (0-indexed)
- type: integer
- thought:
- description: LLM's reasoning/thinking (Think phase)
- type: string
- timestamp:
- description: When this step occurred
- type: string
- tool_calls:
- description: Tools called in this step (Act phase)
+ attributes:
+ items:
+ type: string
+ type: array
+ chunks:
items:
- $ref: '#/definitions/types.ToolCall'
+ type: string
type: array
+ name:
+ type: string
type: object
- types.AnswerStrategy:
- enum:
- - all
- - random
- type: string
- x-enum-varnames:
- - AnswerStrategyAll
- - AnswerStrategyRandom
- types.COSEngineConfig:
+ github_com_Tencent_WeKnora_internal_types.GraphRelation:
properties:
- app_id:
- type: string
- bucket_name:
- type: string
- path_prefix:
- type: string
- region:
+ node1:
type: string
- secret_id:
+ node2:
type: string
- secret_key:
+ type:
type: string
type: object
- types.ChatHistoryConfig:
+ github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig:
properties:
- embedding_model_id:
- description: |-
- EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages.
- Once messages have been indexed, the model cannot be changed (requires re-indexing).
- type: string
- enabled:
- description: Enabled controls whether chat history indexing is active
- type: boolean
- knowledge_base_id:
- description: |-
- KnowledgeBaseID is the auto-managed hidden knowledge base for chat history.
- This is set internally when the feature is first enabled; users should not set this directly.
+ model_id:
+ description: Model ID
type: string
type: object
- types.ChunkingConfig:
+ github_com_Tencent_WeKnora_internal_types.IndexConfig:
properties:
- child_chunk_size:
- description: |-
- ChildChunkSize is the size of child chunks used for embedding (default: 384).
- Only used when EnableParentChild is true.
+ collection_name:
+ description: Milvus
+ type: string
+ collection_prefix:
+ description: Qdrant, Weaviate
+ type: string
+ desired_shard_count:
+ description: 'Weaviate: number of shards per collection'
type: integer
- chunk_overlap:
- description: Chunk overlap
+ index_name:
+ description: '--- Existing fields ---'
+ type: string
+ number_of_replicas:
+ description: ES, OpenSearch
type: integer
- chunk_size:
- description: Chunk size
+ number_of_shards:
+ description: ES, OpenSearch
type: integer
- enable_multimodal:
- description: EnableMultimodal (deprecated, kept for backward compatibility
- with old data)
- type: boolean
- enable_parent_child:
- description: |-
- EnableParentChild enables two-level parent-child chunking strategy.
- When enabled, large parent chunks provide context while small child chunks
- are used for vector matching. Retrieval matches on child but returns parent content.
- type: boolean
- parent_chunk_size:
- description: |-
- ParentChunkSize is the size of parent chunks (default: 4096).
- Only used when EnableParentChild is true.
+ replica_number:
+ description: 'Milvus: in-memory replica count (LoadCollection)'
+ type: integer
+ replication_factor:
+ description: 'Qdrant, Weaviate: number of replicas'
+ type: integer
+ shard_number:
+ description: '--- Scalability fields ---'
+ type: integer
+ shards_num:
+ description: 'Milvus: number of shards per collection (CreateCollection)'
type: integer
- parser_engine_rules:
- description: |-
- ParserEngineRules configures which parser engine to use for each file type.
- When empty, the builtin engine is used for all types.
- items:
- $ref: '#/definitions/types.ParserEngineRule'
- type: array
- separators:
- description: Separators
- items:
- type: string
- type: array
type: object
- types.ConnectionConfig:
+ github_com_Tencent_WeKnora_internal_types.IndexingStrategy:
properties:
- addr:
- description: Common
- type: string
- api_key:
- description: AES-GCM encrypted
- type: string
- grpc_address:
- description: Weaviate
- type: string
- host:
- description: Qdrant
- type: string
- password:
- description: AES-GCM encrypted
- type: string
- port:
- type: integer
- scheme:
- type: string
- use_default_connection:
- description: Postgres
+ graph_enabled:
+ description: GraphEnabled enables knowledge graph entity/relation extraction
type: boolean
- use_tls:
+ keyword_enabled:
+ description: KeywordEnabled enables keyword-based (BM25) search
+ type: boolean
+ vector_enabled:
+ description: VectorEnabled enables semantic vector embedding and search
+ type: boolean
+ wiki_enabled:
+ description: WikiEnabled enables automatic wiki page generation from documents
type: boolean
- username:
- type: string
- version:
- description: |-
- Version is the detected server version (e.g., "7.10.1", "16.2", "1.12.6").
- Auto-populated by TestConnection on successful connectivity check.
- type: string
type: object
- types.ContextCompressionStrategy:
- enum:
- - sliding_window
- - smart
- type: string
- x-enum-varnames:
- - ContextCompressionSlidingWindow
- - ContextCompressionSmart
- types.ContextConfig:
+ github_com_Tencent_WeKnora_internal_types.InviteMemberRequest:
properties:
- compression_strategy:
+ role:
allOf:
- - $ref: '#/definitions/types.ContextCompressionStrategy'
- description: 'Compression strategy: "sliding_window" or "smart"'
- max_tokens:
- description: Maximum tokens allowed in LLM context
- type: integer
- recent_message_count:
- description: |-
- For sliding_window: number of messages to keep
- For smart: number of recent messages to keep uncompressed
- type: integer
- summarize_threshold:
- description: 'Summarize threshold: number of messages before summarization'
- type: integer
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Role to assign: admin/editor/viewer'
+ user_id:
+ description: User ID to invite
+ type: string
+ required:
+ - role
+ - user_id
type: object
- types.ConversationConfig:
+ github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest:
properties:
- context_template:
- description: ContextTemplate is the prompt template for summarizing retrieval
- results
+ message:
+ description: Optional message for join request
+ maxLength: 500
type: string
- embedding_top_k:
- type: integer
- enable_query_expansion:
- type: boolean
- enable_rewrite:
- type: boolean
- fallback_prompt:
+ organization_id:
type: string
- fallback_response:
+ role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: requested role (admin/editor/viewer); default viewer'
+ required:
+ - organization_id
+ type: object
+ github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest:
+ properties:
+ invite_code:
+ maxLength: 32
+ minLength: 8
type: string
- fallback_strategy:
- description: Fallback strategy
+ required:
+ - invite_code
+ type: object
+ github_com_Tencent_WeKnora_internal_types.Knowledge:
+ properties:
+ channel:
+ description: Channel indicates through which channel the knowledge was ingested
+ (web, api, browser_extension, wechat, etc.)
type: string
- keyword_threshold:
- type: number
- max_completion_tokens:
- description: MaxTokens is the maximum number of tokens to generate
- type: integer
- max_rounds:
- description: Retrieval & strategy parameters
- type: integer
- prompt:
- description: Prompt is the system prompt for normal mode
+ created_at:
+ description: Creation time of the knowledge
type: string
- rerank_model_id:
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge
+ description:
+ description: Description of the knowledge
type: string
- rerank_threshold:
- type: number
- rerank_top_k:
- type: integer
- rewrite_prompt_system:
- description: Rewrite prompts
+ embedding_model_id:
+ description: ID of the embedding model
type: string
- rewrite_prompt_user:
+ enable_status:
+ description: Enable status of the knowledge
type: string
- summary_model_id:
- description: Model configuration
+ error_message:
+ description: Error message of the knowledge
type: string
- temperature:
- description: Temperature controls the randomness of the model output
- type: number
- vector_threshold:
- type: number
- type: object
- types.CreateOrganizationRequest:
- properties:
- avatar:
- description: optional avatar URL
- maxLength: 512
+ file_hash:
+ description: File hash of the knowledge
type: string
- description:
- maxLength: 1000
+ file_name:
+ description: File name of the knowledge
type: string
- invite_code_validity_days:
- description: 'optional: 0=never, 1, 7, 30; default 7'
- type: integer
- member_limit:
- description: 'optional: max members; 0=unlimited; default 50'
+ file_path:
+ description: File path of the knowledge
+ type: string
+ file_size:
+ description: File size of the knowledge
type: integer
- name:
- maxLength: 255
- minLength: 1
+ file_type:
+ description: File type of the knowledge
type: string
- required:
- - name
- type: object
- types.CredentialsConfig:
- properties:
- weknoracloud:
- $ref: '#/definitions/types.WeKnoraCloudCredentials'
- type: object
- types.CustomAgentConfig:
- properties:
- agent_mode:
- description: |-
- ===== Basic Settings =====
- Agent mode: "quick-answer" for RAG mode, "smart-reasoning" for ReAct agent mode
+ id:
+ description: Unique identifier of the knowledge
type: string
- allowed_tools:
- description: Allowed tools (only for agent type)
+ knowledge_base_id:
+ description: ID of the knowledge base
+ type: string
+ knowledge_base_name:
+ description: Knowledge base name (not stored in database, populated on query)
+ type: string
+ last_faq_import_result:
+ description: Last FAQ import result (for FAQ type knowledge only)
items:
- type: string
+ type: integer
type: array
- asr_model_id:
- description: ASR model ID for audio transcription (optional)
+ metadata:
+ description: Metadata of the knowledge
+ items:
+ type: integer
+ type: array
+ parse_status:
+ description: Parse status of the knowledge
type: string
- audio_upload_enabled:
- description: 'Whether audio upload (ASR transcription) is enabled for this
- agent (default: false)'
- type: boolean
- context_template:
- description: Context template for normal mode (how to format retrieved chunks)
+ processed_at:
+ description: Processed time of the knowledge
type: string
- context_template_id:
- description: |-
- ContextTemplateID references a template ID in prompt_templates/ YAML files.
- If set and ContextTemplate is empty, the template content will be resolved at startup.
+ source:
+ description: Source of the knowledge (e.g. URL address for url type, "manual"
+ for manual type)
type: string
- embedding_top_k:
- description: |-
- ===== Retrieval Strategy Settings (for both modes) =====
- Embedding/Vector retrieval top K
+ storage_size:
+ description: Storage size of the knowledge
type: integer
- enable_query_expansion:
- description: |-
- ===== Advanced Settings (mainly for normal mode) =====
- Whether to enable query expansion
- type: boolean
- enable_rewrite:
- description: Whether to enable query rewrite for multi-turn conversations
- type: boolean
- fallback_prompt:
- description: Fallback prompt (when FallbackStrategy is "model")
- type: string
- fallback_response:
- description: Fixed fallback response (when FallbackStrategy is "fixed")
+ summary_status:
+ description: Summary status for async summary generation
type: string
- fallback_strategy:
- description: 'Fallback strategy: "fixed" for fixed response, "model" for model
- generation'
+ tag_id:
+ description: Optional tag ID for categorization within a knowledge base
type: string
- faq_direct_answer_threshold:
- description: FAQ direct answer threshold - if similarity > this value, use
- FAQ answer directly
- type: number
- faq_priority_enabled:
- description: |-
- ===== FAQ Strategy Settings =====
- Whether FAQ priority strategy is enabled (FAQ answers prioritized over document chunks)
- type: boolean
- faq_score_boost:
- description: FAQ score boost multiplier - FAQ results score multiplied by
- this factor
- type: number
- history_turns:
- description: Number of history turns to keep in context
+ tenant_id:
+ description: Tenant ID
type: integer
- image_storage_provider:
- description: |-
- Storage provider for image uploads: "local", "minio", "cos", "tos"
- Empty means use the global/tenant default provider.
+ title:
+ description: Title of the knowledge
type: string
- image_upload_enabled:
- description: |-
- ===== Image Upload / Multimodal Settings =====
- Whether image upload is enabled for this agent (default: false)
- type: boolean
- kb_selection_mode:
- description: |-
- ===== Knowledge Base Settings =====
- Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
+ type:
+ description: Type of the knowledge
type: string
- keyword_threshold:
- description: Keyword retrieval threshold
- type: number
- knowledge_bases:
- description: Associated knowledge base IDs (only used when KBSelectionMode
- is "selected")
- items:
- type: string
- type: array
- llm_call_timeout:
- description: Timeout for a single LLM call in seconds (0 = use global default)
- type: integer
- max_completion_tokens:
- description: Maximum completion tokens (only for normal mode)
- type: integer
- max_iterations:
- description: |-
- ===== Agent Mode Settings =====
- Maximum iterations for ReAct loop (only for agent type)
+ updated_at:
+ description: Last updated time of the knowledge
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeBase:
+ properties:
+ asr_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig'
+ description: ASR config (Automatic Speech Recognition)
+ chunk_count:
+ description: Chunk count (not stored in database, calculated on query)
type: integer
- mcp_selection_mode:
- description: 'MCP service selection mode: "all" = all enabled MCP services,
- "selected" = specific services, "none" = no MCP'
+ chunking_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig'
+ description: Chunking configuration
+ created_at:
+ description: Creation time of the knowledge base
type: string
- mcp_services:
- description: Selected MCP service IDs (only used when MCPSelectionMode is
- "selected")
- items:
- type: string
- type: array
- model_id:
- description: |-
- ===== Model Settings =====
- Model ID to use for conversations
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the knowledge base
+ description:
+ description: Description of the knowledge base
type: string
- multi_turn_enabled:
+ embedding_model_id:
+ description: ID of the embedding model
+ type: string
+ extract_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ExtractConfig'
+ description: Extract config
+ faq_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig'
+ description: FAQConfig stores FAQ specific configuration such as indexing
+ strategy
+ id:
+ description: Unique identifier of the knowledge base
+ type: string
+ image_processing_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
+ description: Image processing configuration
+ indexing_strategy:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy'
description: |-
- ===== Multi-turn Conversation Settings =====
- Whether multi-turn conversation is enabled
+ IndexingStrategy controls which indexing pipelines are active for this knowledge base.
+ Pipelines: vector search, keyword search, wiki generation, knowledge graph extraction.
+ is_pinned:
+ description: Whether this knowledge base is pinned to the top of the list
type: boolean
- rerank_model_id:
- description: ReRank model ID for retrieval
+ is_processing:
+ description: IsProcessing indicates if there is a processing import task (for
+ FAQ type knowledge bases)
+ type: boolean
+ is_temporary:
+ description: Whether this knowledge base is temporary (ephemeral) and should
+ be hidden from UI
+ type: boolean
+ knowledge_count:
+ description: Knowledge count (not stored in database, calculated on query)
+ type: integer
+ name:
+ description: Name of the knowledge base
type: string
- rerank_threshold:
- description: Rerank threshold
- type: number
- rerank_top_k:
- description: Rerank top K
+ pinned_at:
+ description: Time when the knowledge base was pinned (nil if not pinned)
+ type: string
+ processing_count:
+ description: ProcessingCount indicates the number of knowledge items being
+ processed (for document type knowledge bases)
type: integer
- retrieve_kb_only_when_mentioned:
- description: |-
- Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
- When true, knowledge base retrieval only happens if user explicitly mentions KB/files with @
- When false, knowledge base retrieval happens according to KBSelectionMode
- type: boolean
- rewrite_prompt_system:
- description: Rewrite prompt system message
- type: string
- rewrite_prompt_user:
- description: Rewrite prompt user message template
- type: string
- selected_skills:
- description: Selected skill names (only used when SkillsSelectionMode is "selected")
- items:
- type: string
- type: array
- skills_selection_mode:
- description: |-
- ===== Skills Settings (only for smart-reasoning mode) =====
- Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
- type: string
- suggested_prompts:
- description: |-
- ===== Suggested Prompts =====
- 推荐问题列表,用于在前端对话面板展示快捷提问
- items:
- type: string
- type: array
- supported_file_types:
- description: |-
- ===== File Type Restriction Settings =====
- Supported file types for this agent (e.g., ["csv", "xlsx", "xls"])
- Empty means all file types are supported
- When set, only files with matching extensions can be used with this agent
- items:
- type: string
- type: array
- system_prompt:
- description: System prompt for the agent (unified prompt, uses web_search_status
- placeholder for dynamic behavior)
+ question_generation_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig'
+ description: QuestionGenerationConfig stores question generation configuration
+ for document knowledge bases
+ share_count:
+ description: ShareCount indicates the number of organizations this knowledge
+ base is shared with (not stored in database)
+ type: integer
+ storage_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageConfig'
+ description: 'Deprecated: legacy COS config column. Kept for backward compatibility
+ with old data.'
+ storage_provider_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageProviderConfig'
+ description: 'Storage provider config (new): only stores provider selection;
+ credentials from tenant StorageEngineConfig'
+ summary_model_id:
+ description: Summary model ID
type: string
- system_prompt_id:
- description: |-
- SystemPromptID references a template ID in prompt_templates/ YAML files.
- If set and SystemPrompt is empty, the template content will be resolved at startup.
+ tenant_id:
+ description: Tenant ID
+ type: integer
+ type:
+ description: Type of the knowledge base (document, faq, etc.)
type: string
- temperature:
- description: Temperature for LLM (0-1)
- type: number
- thinking:
- description: Whether to enable thinking mode (for models that support extended
- thinking)
- type: boolean
- vector_threshold:
- description: Vector retrieval threshold
- type: number
- vlm_model_id:
- description: VLM model ID for image analysis (optional, falls back to tenant-level
- VLM)
+ updated_at:
+ description: Last updated time of the knowledge base
type: string
- web_fetch_enabled:
- description: Whether to auto-fetch full page content for reranked web search
- results
- type: boolean
- web_fetch_top_n:
- description: 'Max number of pages to fetch after rerank (default: 3)'
- type: integer
- web_search_enabled:
- description: |-
- ===== Web Search Settings =====
- Whether web search is enabled
- type: boolean
- web_search_max_results:
- description: Maximum web search results
- type: integer
- web_search_provider_id:
+ vector_store_id:
description: |-
- WebSearchProviderID references a specific WebSearchProviderEntity.
- If empty, the tenant's default provider (is_default=true) is used.
+ VectorStoreID references the VectorStore this knowledge base is bound to.
+ When nil, the KB falls back to the tenant's effective engines derived from
+ the RETRIEVE_DRIVER environment variable (env store flow).
+ This field is set once at creation time and must not be modified afterwards;
+ enforcement lives at the GORM layer (`<-:create`) plus the service-layer
+ KB update path, which omits this field from its update DTO.
type: string
+ vlm_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
+ description: VLM config
+ wiki_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig'
+ description: WikiConfig stores wiki-specific configuration (only for wiki
+ type knowledge bases)
type: object
- types.DataSource:
+ github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig:
properties:
- config:
+ chunking_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChunkingConfig'
+ description: Chunking configuration
+ faq_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQConfig'
+ description: FAQ configuration (only for FAQ type knowledge bases)
+ image_processing_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ImageProcessingConfig'
+ description: Image processing configuration
+ indexing_strategy:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.IndexingStrategy'
description: |-
- Encrypted configuration (API credentials, tokens, etc.)
- Stored as JSON with AES-256-GCM encryption
- items:
- type: integer
- type: array
- conflict_strategy:
- description: 'Conflict resolution strategy: overwrite or skip'
- type: string
- created_at:
- description: Creation timestamp
- type: string
- deleted_at:
+ IndexingStrategy controls which indexing pipelines are active.
+ nil means "no change" when updating (preserves existing strategy).
+ wiki_config:
allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Soft delete timestamp
- error_message:
- description: Error message if status is "error"
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiConfig'
+ description: Wiki configuration (only for wiki-enabled knowledge bases)
+ type: object
+ github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse:
+ properties:
+ chunk_count:
+ type: integer
+ created_at:
type: string
id:
- description: Unique identifier
type: string
knowledge_base_id:
- description: Target knowledge base ID
- type: string
- last_sync_at:
- description: Last successful sync timestamp
type: string
- last_sync_cursor:
- description: Cursor or state for incremental sync (connector-specific)
- items:
- type: integer
- type: array
- last_sync_result:
- description: Summary of last sync result
- items:
- type: integer
- type: array
- latest_sync_log:
- allOf:
- - $ref: '#/definitions/types.SyncLog'
- description: Latest sync log (not stored in DB, populated on query)
- name:
- description: User-friendly name
+ knowledge_base_name:
type: string
- status:
- description: 'Current status: active, paused, error'
+ knowledge_base_type:
type: string
- sync_deletions:
- description: Whether to sync deletions from source
- type: boolean
- sync_log_retention_days:
- description: 'Number of days to keep sync logs (default: 30)'
+ knowledge_count:
type: integer
- sync_mode:
- description: 'Sync mode: "incremental" (recommended) or "full"'
+ my_permission:
+ description: Effective permission for current user = min(Permission, MyRoleInOrg)
type: string
- sync_schedule:
- description: Cron expression for scheduled syncs (e.g., "0 */6 * * *" = every
- 6 hours)
+ my_role_in_org:
+ description: Current user's role in this organization (admin/editor/viewer)
type: string
- tenant_id:
- description: Tenant ID for multi-tenancy
- type: integer
- total_items_synced:
- description: Total items synced (not stored in DB, calculated on query)
- type: integer
- type:
- description: Connector type (feishu, notion, confluence, etc.)
+ organization_id:
type: string
- updated_at:
- description: Last update timestamp
+ organization_name:
type: string
- type: object
- types.EmbeddingParameters:
- properties:
- dimension:
- type: integer
- truncate_prompt_tokens:
+ permission:
+ description: 'Share permission (what the space was granted: viewer/editor)'
+ type: string
+ require_approval:
+ type: boolean
+ shared_by_user_id:
+ type: string
+ shared_by_username:
+ type: string
+ source_tenant_id:
type: integer
type: object
- types.ExtractConfig:
+ github_com_Tencent_WeKnora_internal_types.ListMembersResponse:
properties:
- enabled:
- type: boolean
- nodes:
- items:
- $ref: '#/definitions/types.GraphNode'
- type: array
- relations:
+ members:
items:
- $ref: '#/definitions/types.GraphRelation'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse'
type: array
- tags:
+ total:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse:
+ properties:
+ organizations:
items:
- type: string
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrganizationResponse'
type: array
- text:
- type: string
+ resource_counts:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse'
+ description: 各空间内知识库/智能体数量,供列表侧栏展示
+ total:
+ type: integer
type: object
- types.FAQBatchUpsertPayload:
+ github_com_Tencent_WeKnora_internal_types.ListSharesResponse:
properties:
- dry_run:
- description: 仅验证,不实际导入
- type: boolean
- entries:
+ shares:
items:
- $ref: '#/definitions/types.FAQEntryPayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseShareResponse'
type: array
- knowledge_id:
+ total:
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.LocalEngineConfig:
+ properties:
+ path_prefix:
type: string
- mode:
- enum:
- - append
- - replace
+ type: object
+ github_com_Tencent_WeKnora_internal_types.LoginRequest:
+ properties:
+ email:
type: string
- task_id:
- description: 可选,如果不传则自动生成UUID
+ password:
+ minLength: 6
type: string
required:
- - entries
- type: object
- types.FAQConfig:
- properties:
- index_mode:
- $ref: '#/definitions/types.FAQIndexMode'
- question_index_mode:
- $ref: '#/definitions/types.FAQQuestionIndexMode'
+ - email
+ - password
type: object
- types.FAQEntryFieldsBatchUpdate:
+ github_com_Tencent_WeKnora_internal_types.LoginResponse:
properties:
- by_id:
- additionalProperties:
- $ref: '#/definitions/types.FAQEntryFieldsUpdate'
- description: ByID 按条目ID更新,key为条目ID (seq_id)
- type: object
- by_tag:
- additionalProperties:
- $ref: '#/definitions/types.FAQEntryFieldsUpdate'
- description: ByTag 按Tag批量更新,key为TagID (seq_id)
- type: object
- exclude_ids:
- description: ExcludeIDs 在ByTag操作中需要排除的ID列表 (seq_id)
- items:
- type: integer
- type: array
+ message:
+ type: string
+ refresh_token:
+ type: string
+ success:
+ type: boolean
+ tenant:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ token:
+ type: string
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
type: object
- types.FAQEntryFieldsUpdate:
+ github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig:
properties:
- is_enabled:
- type: boolean
- is_recommended:
- type: boolean
- tag_id:
+ retry_count:
+ description: 'Number of retries, default: 3'
+ type: integer
+ retry_delay:
+ description: 'Delay between retries in seconds, default: 1'
+ type: integer
+ timeout:
+ description: 'Timeout in seconds, default: 30'
type: integer
type: object
- types.FAQEntryPayload:
+ github_com_Tencent_WeKnora_internal_types.MCPAuthConfig:
properties:
- answer_strategy:
- $ref: '#/definitions/types.AnswerStrategy'
- answers:
- items:
+ api_key:
+ type: string
+ custom_headers:
+ additionalProperties:
type: string
- type: array
- id:
- description: ID 可选,用于数据迁移时指定 seq_id(必须小于自增起始值 100000000)
- type: integer
- is_enabled:
+ type: object
+ token:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MCPEnvVars:
+ additionalProperties:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MCPHeaders:
+ additionalProperties:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.MCPService:
+ properties:
+ advanced_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAdvancedConfig'
+ auth_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPAuthConfig'
+ created_at:
+ type: string
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ type: string
+ enabled:
type: boolean
- is_recommended:
+ env_vars:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPEnvVars'
+ description: Environment variables for stdio
+ headers:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPHeaders'
+ id:
+ type: string
+ is_builtin:
+ description: Whether this is a builtin MCP service (visible to all tenants)
type: boolean
- negative_questions:
- items:
- type: string
- type: array
- similar_questions:
- items:
- type: string
- type: array
- standard_question:
+ name:
type: string
- tag_id:
+ stdio_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPStdioConfig'
+ description: Required for stdio transport
+ tenant_id:
type: integer
- tag_name:
+ transport_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPTransportType'
+ updated_at:
type: string
- required:
- - standard_question
- type: object
- types.FAQIndexMode:
- enum:
- - question_only
- - question_answer
- type: string
- x-enum-varnames:
- - FAQIndexModeQuestionOnly
- - FAQIndexModeQuestionAnswer
- types.FAQQuestionIndexMode:
- enum:
- - combined
- - separate
- type: string
- x-enum-varnames:
- - FAQQuestionIndexModeCombined
- - FAQQuestionIndexModeSeparate
- types.FAQSearchRequest:
- properties:
- first_priority_tag_ids:
- description: 第一优先级标签ID列表,限定命中范围,优先级最高
- items:
- type: integer
- type: array
- match_count:
- type: integer
- only_recommended:
- description: 是否仅返回推荐的条目
- type: boolean
- query_text:
+ url:
+ description: 'Optional: required for SSE/HTTP Streamable'
type: string
- second_priority_tag_ids:
- description: 第二优先级标签ID列表,限定命中范围,优先级低于第一优先级
- items:
- type: integer
- type: array
- vector_threshold:
- type: number
- required:
- - query_text
type: object
- types.GraphNode:
+ github_com_Tencent_WeKnora_internal_types.MCPStdioConfig:
properties:
- attributes:
- items:
- type: string
- type: array
- chunks:
+ args:
+ description: Command arguments array
items:
type: string
type: array
- name:
+ command:
+ description: 'Command: "uvx" or "npx"'
type: string
type: object
- types.GraphRelation:
+ github_com_Tencent_WeKnora_internal_types.MCPTransportType:
+ enum:
+ - sse
+ - http-streamable
+ - stdio
+ type: string
+ x-enum-comments:
+ MCPTransportHTTPStreamable: HTTP Streamable
+ MCPTransportSSE: Server-Sent Events
+ MCPTransportStdio: Stdio (Standard Input/Output)
+ x-enum-descriptions:
+ - Server-Sent Events
+ - HTTP Streamable
+ - Stdio (Standard Input/Output)
+ x-enum-varnames:
+ - MCPTransportSSE
+ - MCPTransportHTTPStreamable
+ - MCPTransportStdio
+ github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload:
properties:
- node1:
- type: string
- node2:
- type: string
- type:
+ channel:
type: string
- type: object
- types.ImageProcessingConfig:
- properties:
- model_id:
- description: Model ID
+ content:
type: string
- type: object
- types.IndexConfig:
- properties:
- collection_name:
- description: Milvus
+ status:
type: string
- collection_prefix:
- description: Qdrant
+ tag_id:
type: string
- index_name:
- description: ES, OpenSearch
+ title:
type: string
- number_of_replicas:
- description: ES, OpenSearch
- type: integer
- number_of_shards:
- description: ES, OpenSearch
- type: integer
type: object
- types.InviteMemberRequest:
+ github_com_Tencent_WeKnora_internal_types.MatchType:
+ enum:
+ - 0
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+ - 6
+ - 7
+ - 8
+ - 9
+ type: integer
+ x-enum-comments:
+ MatchTypeDataAnalysis: 数据分析匹配类型
+ MatchTypeDirectLoad: 直接加载匹配类型
+ MatchTypeParentChunk: 父Chunk匹配类型
+ MatchTypeRelationChunk: 关系Chunk匹配类型
+ MatchTypeWebSearch: 网络搜索匹配类型
+ x-enum-descriptions:
+ - ""
+ - ""
+ - ""
+ - ""
+ - 父Chunk匹配类型
+ - 关系Chunk匹配类型
+ - ""
+ - 网络搜索匹配类型
+ - 直接加载匹配类型
+ - 数据分析匹配类型
+ x-enum-varnames:
+ - MatchTypeEmbedding
+ - MatchTypeKeywords
+ - MatchTypeNearByChunk
+ - MatchTypeHistory
+ - MatchTypeParentChunk
+ - MatchTypeRelationChunk
+ - MatchTypeGraph
+ - MatchTypeWebSearch
+ - MatchTypeDirectLoad
+ - MatchTypeDataAnalysis
+ github_com_Tencent_WeKnora_internal_types.MentionedItem:
properties:
- role:
- allOf:
- - $ref: '#/definitions/types.OrgMemberRole'
- description: 'Role to assign: admin/editor/viewer'
- user_id:
- description: User ID to invite
+ id:
type: string
- required:
- - role
- - user_id
- type: object
- types.JoinByOrganizationIDRequest:
- properties:
- message:
- description: Optional message for join request
- maxLength: 500
+ kb_type:
+ description: '"document" or "faq" (only for kb type)'
type: string
- organization_id:
+ name:
+ type: string
+ type:
+ description: '"kb" for knowledge base, "file" for file'
type: string
- role:
- allOf:
- - $ref: '#/definitions/types.OrgMemberRole'
- description: 'Optional: requested role (admin/editor/viewer); default viewer'
- required:
- - organization_id
type: object
- types.JoinOrganizationRequest:
- properties:
- invite_code:
- maxLength: 32
- minLength: 8
- type: string
- required:
- - invite_code
- type: object
- types.Knowledge:
+ github_com_Tencent_WeKnora_internal_types.Message:
properties:
+ agent_duration_ms:
+ description: Agent total execution duration in milliseconds (from query start
+ to answer start)
+ type: integer
+ agent_steps:
+ description: |-
+ Agent execution steps (only for assistant messages generated by agent)
+ This contains the detailed reasoning process and tool calls made by the agent
+ Stored for user history display, but NOT included in LLM context to avoid redundancy
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentStep'
+ type: array
+ attachments:
+ description: Attached files (documents, audio, etc., for user messages)
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageAttachment'
+ type: array
channel:
- description: Channel indicates through which channel the knowledge was ingested
- (web, api, browser_extension, wechat, etc.)
+ description: Channel indicates the source channel of this message (e.g., "web",
+ "api", "im")
+ type: string
+ content:
+ description: Message text content
type: string
created_at:
- description: Creation time of the knowledge
+ description: Message creation timestamp
type: string
deleted_at:
allOf:
- $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the knowledge
- description:
- description: Description of the knowledge
- type: string
- embedding_model_id:
- description: ID of the embedding model
- type: string
- enable_status:
- description: Enable status of the knowledge
- type: string
- error_message:
- description: Error message of the knowledge
- type: string
- file_hash:
- description: File hash of the knowledge
- type: string
- file_name:
- description: File name of the knowledge
- type: string
- file_path:
- description: File path of the knowledge
- type: string
- file_size:
- description: File size of the knowledge
- type: integer
- file_type:
- description: File type of the knowledge
- type: string
+ description: Soft delete timestamp
id:
- description: Unique identifier of the knowledge
- type: string
- knowledge_base_id:
- description: ID of the knowledge base
+ description: Unique identifier for the message
type: string
- knowledge_base_name:
- description: Knowledge base name (not stored in database, populated on query)
+ images:
+ description: Attached images with OCR/Caption text (for user messages)
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MessageImage'
+ type: array
+ is_completed:
+ description: Whether message generation is complete
+ type: boolean
+ is_fallback:
+ description: Whether this response is a fallback (no knowledge base match
+ found)
+ type: boolean
+ knowledge_id:
+ description: |-
+ KnowledgeID links this message to a Knowledge entry in the chat history knowledge base
+ Used for vector search indexing: when set, the message content has been indexed as a Knowledge passage
type: string
- last_faq_import_result:
- description: Last FAQ import result (for FAQ type knowledge only)
+ knowledge_references:
+ description: References to knowledge chunks used in the response
items:
- type: integer
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchResult'
type: array
- metadata:
- description: Metadata of the knowledge
+ mentioned_items:
+ description: |-
+ Mentioned knowledge bases and files (for user messages)
+ Stores the @mentioned items when user sends a message
items:
- type: integer
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem'
type: array
- parse_status:
- description: Parse status of the knowledge
- type: string
- processed_at:
- description: Processed time of the knowledge
- type: string
- source:
- description: Source of the knowledge (e.g. URL address for url type, "manual"
- for manual type)
- type: string
- storage_size:
- description: Storage size of the knowledge
- type: integer
- summary_status:
- description: Summary status for async summary generation
- type: string
- tag_id:
- description: Optional tag ID for categorization within a knowledge base
+ request_id:
+ description: Request identifier for tracking API requests
type: string
- tenant_id:
- description: Tenant ID
- type: integer
- title:
- description: Title of the knowledge
+ role:
+ description: 'Message role: "user", "assistant", "system"'
type: string
- type:
- description: Type of the knowledge
+ session_id:
+ description: ID of the session this message belongs to
type: string
updated_at:
- description: Last updated time of the knowledge
+ description: Last update timestamp
type: string
type: object
- types.KnowledgeBase:
+ github_com_Tencent_WeKnora_internal_types.MessageAttachment:
properties:
- asr_config:
- allOf:
- - $ref: '#/definitions/types.ASRConfig'
- description: ASR config (Automatic Speech Recognition)
- chunk_count:
- description: Chunk count (not stored in database, calculated on query)
- type: integer
- chunking_config:
- allOf:
- - $ref: '#/definitions/types.ChunkingConfig'
- description: Chunking configuration
- created_at:
- description: Creation time of the knowledge base
- type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the knowledge base
- description:
- description: Description of the knowledge base
- type: string
- embedding_model_id:
- description: ID of the embedding model
- type: string
- extract_config:
- allOf:
- - $ref: '#/definitions/types.ExtractConfig'
- description: Extract config
- faq_config:
- allOf:
- - $ref: '#/definitions/types.FAQConfig'
- description: FAQConfig stores FAQ specific configuration such as indexing
- strategy
- id:
- description: Unique identifier of the knowledge base
- type: string
- image_processing_config:
- allOf:
- - $ref: '#/definitions/types.ImageProcessingConfig'
- description: Image processing configuration
- is_pinned:
- description: Whether this knowledge base is pinned to the top of the list
- type: boolean
- is_processing:
- description: IsProcessing indicates if there is a processing import task (for
- FAQ type knowledge bases)
- type: boolean
- is_temporary:
- description: Whether this knowledge base is temporary (ephemeral) and should
- be hidden from UI
- type: boolean
- knowledge_count:
- description: Knowledge count (not stored in database, calculated on query)
- type: integer
- name:
- description: Name of the knowledge base
+ content:
+ description: Extracted text content (for small text files)
type: string
- pinned_at:
- description: Time when the knowledge base was pinned (nil if not pinned)
+ file_name:
+ description: Original filename
type: string
- processing_count:
- description: ProcessingCount indicates the number of knowledge items being
- processed (for document type knowledge bases)
- type: integer
- question_generation_config:
- allOf:
- - $ref: '#/definitions/types.QuestionGenerationConfig'
- description: QuestionGenerationConfig stores question generation configuration
- for document knowledge bases
- share_count:
- description: ShareCount indicates the number of organizations this knowledge
- base is shared with (not stored in database)
+ file_size:
+ description: File size in bytes
type: integer
- storage_config:
- allOf:
- - $ref: '#/definitions/types.StorageConfig'
- description: 'Deprecated: legacy COS config column. Kept for backward compatibility
- with old data.'
- storage_provider_config:
- allOf:
- - $ref: '#/definitions/types.StorageProviderConfig'
- description: 'Storage provider config (new): only stores provider selection;
- credentials from tenant StorageEngineConfig'
- summary_model_id:
- description: Summary model ID
+ file_type:
+ description: File extension (e.g., ".pdf", ".docx")
type: string
- tenant_id:
- description: Tenant ID
+ is_truncated:
+ description: Whether content was truncated
+ type: boolean
+ line_count:
+ description: Total line count (for text files)
type: integer
- type:
- description: Type of the knowledge base (document, faq, etc.)
- type: string
- updated_at:
- description: Last updated time of the knowledge base
+ url:
+ description: Storage URL (provider://path)
type: string
- vlm_config:
- allOf:
- - $ref: '#/definitions/types.VLMConfig'
- description: VLM config
type: object
- types.KnowledgeBaseConfig:
+ github_com_Tencent_WeKnora_internal_types.MessageImage:
properties:
- chunking_config:
- allOf:
- - $ref: '#/definitions/types.ChunkingConfig'
- description: Chunking configuration
- faq_config:
- allOf:
- - $ref: '#/definitions/types.FAQConfig'
- description: FAQ configuration (only for FAQ type knowledge bases)
- image_processing_config:
- allOf:
- - $ref: '#/definitions/types.ImageProcessingConfig'
- description: Image processing configuration
+ caption:
+ type: string
+ url:
+ type: string
type: object
- types.KnowledgeBaseShareResponse:
+ github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig:
properties:
- chunk_count:
- type: integer
- created_at:
+ access_key_id:
type: string
- id:
+ bucket_name:
type: string
- knowledge_base_id:
+ endpoint:
type: string
- knowledge_base_name:
+ mode:
+ description: '"docker" or "remote"'
type: string
- knowledge_base_type:
+ path_prefix:
type: string
- knowledge_count:
- type: integer
- my_permission:
- description: Effective permission for current user = min(Permission, MyRoleInOrg)
+ secret_access_key:
type: string
- my_role_in_org:
- description: Current user's role in this organization (admin/editor/viewer)
+ use_ssl:
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ModelParameters:
+ properties:
+ api_key:
type: string
- organization_id:
+ app_id:
+ description: WeKnoraCloud 厂商专用凭证
type: string
- organization_name:
+ app_secret:
+ description: AES-256 加密存储,实际承载上游 API Key
type: string
- permission:
- description: 'Share permission (what the space was granted: viewer/editor)'
+ base_url:
type: string
- require_approval:
- type: boolean
- shared_by_user_id:
+ custom_headers:
+ additionalProperties:
+ type: string
+ description: |-
+ CustomHeaders 允许在调用远程模型 API 时附加自定义 HTTP 请求头,
+ 用途类似 Python OpenAI SDK 的 extra_headers 参数,
+ 常见场景包括透传企业网关鉴权信息、追踪 ID、路由标识等。
+ 保留字段(Authorization、api-key、Content-Type、Accept 等)会在运行期被忽略以避免破坏签名/鉴权流程。
+ type: object
+ embedding_parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.EmbeddingParameters'
+ extra_config:
+ additionalProperties:
+ type: string
+ description: Provider-specific configuration
+ type: object
+ interface_type:
type: string
- shared_by_username:
+ parameter_size:
+ description: Ollama model parameter size (e.g., "7B", "13B", "70B")
type: string
- source_tenant_id:
- type: integer
- type: object
- types.ListMembersResponse:
- properties:
- members:
- items:
- $ref: '#/definitions/types.OrganizationMemberResponse'
- type: array
- total:
- type: integer
+ provider:
+ description: 'Provider identifier: openai, aliyun, zhipu, generic'
+ type: string
+ supports_vision:
+ description: Whether the model accepts image/multimodal input
+ type: boolean
type: object
- types.ListOrganizationsResponse:
+ github_com_Tencent_WeKnora_internal_types.ModelSource:
+ enum:
+ - local
+ - remote
+ - aliyun
+ - zhipu
+ - volcengine
+ - deepseek
+ - hunyuan
+ - minimax
+ - openai
+ - gemini
+ - mimo
+ - siliconflow
+ - jina
+ - openrouter
+ - nvidia
+ - novita
+ - azure_openai
+ type: string
+ x-enum-comments:
+ ModelSourceAliyun: Aliyun DashScope model
+ ModelSourceAzureOpenAI: Azure OpenAI model
+ ModelSourceDeepseek: Deepseek model
+ ModelSourceGemini: Gemini model
+ ModelSourceHunyuan: Hunyuan model
+ ModelSourceJina: Jina AI model
+ ModelSourceLocal: Local model
+ ModelSourceMimo: Mimo model
+ ModelSourceMinimax: Minimax mode
+ ModelSourceNovita: Novita AI model
+ ModelSourceNvidia: NVIDIA model
+ ModelSourceOpenAI: OpenAI model
+ ModelSourceOpenRouter: OpenRouter model
+ ModelSourceRemote: Remote model
+ ModelSourceSiliconFlow: SiliconFlow model
+ ModelSourceVolcengine: Volcengine model
+ ModelSourceZhipu: Zhipu model
+ x-enum-descriptions:
+ - Local model
+ - Remote model
+ - Aliyun DashScope model
+ - Zhipu model
+ - Volcengine model
+ - Deepseek model
+ - Hunyuan model
+ - Minimax mode
+ - OpenAI model
+ - Gemini model
+ - Mimo model
+ - SiliconFlow model
+ - Jina AI model
+ - OpenRouter model
+ - NVIDIA model
+ - Novita AI model
+ - Azure OpenAI model
+ x-enum-varnames:
+ - ModelSourceLocal
+ - ModelSourceRemote
+ - ModelSourceAliyun
+ - ModelSourceZhipu
+ - ModelSourceVolcengine
+ - ModelSourceDeepseek
+ - ModelSourceHunyuan
+ - ModelSourceMinimax
+ - ModelSourceOpenAI
+ - ModelSourceGemini
+ - ModelSourceMimo
+ - ModelSourceSiliconFlow
+ - ModelSourceJina
+ - ModelSourceOpenRouter
+ - ModelSourceNvidia
+ - ModelSourceNovita
+ - ModelSourceAzureOpenAI
+ github_com_Tencent_WeKnora_internal_types.ModelType:
+ enum:
+ - Embedding
+ - Rerank
+ - KnowledgeQA
+ - VLLM
+ - ASR
+ type: string
+ x-enum-comments:
+ ModelTypeASR: ASR (Automatic Speech Recognition) model
+ ModelTypeEmbedding: Embedding model
+ ModelTypeKnowledgeQA: KnowledgeQA model
+ ModelTypeRerank: Rerank model
+ ModelTypeVLLM: VLLM model
+ x-enum-descriptions:
+ - Embedding model
+ - Rerank model
+ - KnowledgeQA model
+ - VLLM model
+ - ASR (Automatic Speech Recognition) model
+ x-enum-varnames:
+ - ModelTypeEmbedding
+ - ModelTypeRerank
+ - ModelTypeKnowledgeQA
+ - ModelTypeVLLM
+ - ModelTypeASR
+ github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse:
properties:
- organizations:
- items:
- $ref: '#/definitions/types.OrganizationResponse'
- type: array
- resource_counts:
- allOf:
- - $ref: '#/definitions/types.ResourceCountsByOrgResponse'
- description: 各空间内知识库/智能体数量,供列表侧栏展示
- total:
- type: integer
+ authorization_url:
+ type: string
+ provider_display_name:
+ type: string
+ state:
+ type: string
+ success:
+ type: boolean
type: object
- types.ListSharesResponse:
+ github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse:
properties:
- shares:
- items:
- $ref: '#/definitions/types.KnowledgeBaseShareResponse'
- type: array
- total:
- type: integer
+ enabled:
+ type: boolean
+ provider_display_name:
+ type: string
+ success:
+ type: boolean
type: object
- types.LocalEngineConfig:
+ github_com_Tencent_WeKnora_internal_types.OSSEngineConfig:
properties:
+ access_key:
+ type: string
+ bucket_name:
+ type: string
+ endpoint:
+ type: string
path_prefix:
type: string
- type: object
- types.LoginRequest:
- properties:
- email:
+ region:
type: string
- password:
- minLength: 6
+ secret_key:
type: string
- required:
- - email
- - password
- type: object
- types.LoginResponse:
- properties:
- message:
+ temp_bucket_name:
type: string
- refresh_token:
+ temp_region:
type: string
- success:
+ use_temp_bucket:
type: boolean
- tenant:
- $ref: '#/definitions/types.Tenant'
- token:
- type: string
- user:
- $ref: '#/definitions/types.User'
type: object
- types.MCPAdvancedConfig:
+ github_com_Tencent_WeKnora_internal_types.OrgMemberRole:
+ enum:
+ - admin
+ - editor
+ - viewer
+ type: string
+ x-enum-varnames:
+ - OrgRoleAdmin
+ - OrgRoleEditor
+ - OrgRoleViewer
+ github_com_Tencent_WeKnora_internal_types.OrganizationMemberResponse:
properties:
- retry_count:
- description: 'Number of retries, default: 3'
- type: integer
- retry_delay:
- description: 'Delay between retries in seconds, default: 1'
- type: integer
- timeout:
- description: 'Timeout in seconds, default: 30'
+ avatar:
+ type: string
+ email:
+ type: string
+ id:
+ type: string
+ joined_at:
+ type: string
+ role:
+ type: string
+ tenant_id:
type: integer
- type: object
- types.MCPAuthConfig:
- properties:
- api_key:
+ user_id:
type: string
- custom_headers:
- additionalProperties:
- type: string
- type: object
- token:
+ username:
type: string
type: object
- types.MCPEnvVars:
- additionalProperties:
- type: string
- type: object
- types.MCPHeaders:
- additionalProperties:
- type: string
- type: object
- types.MCPService:
+ github_com_Tencent_WeKnora_internal_types.OrganizationResponse:
properties:
- advanced_config:
- $ref: '#/definitions/types.MCPAdvancedConfig'
- auth_config:
- $ref: '#/definitions/types.MCPAuthConfig'
+ agent_share_count:
+ description: 共享到该组织的智能体数量
+ type: integer
+ avatar:
+ type: string
created_at:
type: string
- deleted_at:
- $ref: '#/definitions/gorm.DeletedAt'
description:
type: string
- enabled:
- type: boolean
- env_vars:
- allOf:
- - $ref: '#/definitions/types.MCPEnvVars'
- description: Environment variables for stdio
- headers:
- $ref: '#/definitions/types.MCPHeaders'
+ has_pending_upgrade:
+ description: 当前用户是否有待处理的权限升级申请
+ type: boolean
id:
type: string
- is_builtin:
- description: Whether this is a builtin MCP service (visible to all tenants)
+ invite_code:
+ type: string
+ invite_code_expires_at:
+ type: string
+ invite_code_validity_days:
+ type: integer
+ is_owner:
type: boolean
+ member_count:
+ type: integer
+ member_limit:
+ description: 0 = unlimited
+ type: integer
+ my_role:
+ type: string
name:
type: string
- stdio_config:
- allOf:
- - $ref: '#/definitions/types.MCPStdioConfig'
- description: Required for stdio transport
- tenant_id:
+ owner_id:
+ type: string
+ pending_join_request_count:
+ description: 待审批加入申请数(仅管理员可见)
+ type: integer
+ require_approval:
+ type: boolean
+ searchable:
+ type: boolean
+ share_count:
+ description: 共享到该组织的知识库数量
type: integer
- transport_type:
- $ref: '#/definitions/types.MCPTransportType'
updated_at:
type: string
- url:
- description: 'Optional: required for SSE/HTTP Streamable'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.ParserEngineConfig:
+ properties:
+ mineru_api_key:
+ description: MinerU 云 API Key
+ type: string
+ mineru_cloud_enable_formula:
+ type: boolean
+ mineru_cloud_enable_ocr:
+ type: boolean
+ mineru_cloud_enable_table:
+ type: boolean
+ mineru_cloud_language:
+ type: string
+ mineru_cloud_model:
+ description: MinerU 云 API 解析参数
+ type: string
+ mineru_enable_formula:
+ type: boolean
+ mineru_enable_ocr:
+ type: boolean
+ mineru_enable_table:
+ type: boolean
+ mineru_endpoint:
+ description: MinerU 自建服务端点
+ type: string
+ mineru_language:
+ type: string
+ mineru_model:
+ description: MinerU 自建解析参数
type: string
type: object
- types.MCPStdioConfig:
+ github_com_Tencent_WeKnora_internal_types.ParserEngineRule:
properties:
- args:
- description: Command arguments array
+ engine:
+ type: string
+ file_types:
items:
type: string
type: array
- command:
- description: 'Command: "uvx" or "npx"'
- type: string
type: object
- types.MCPTransportType:
- enum:
- - sse
- - http-streamable
- - stdio
- type: string
- x-enum-comments:
- MCPTransportHTTPStreamable: HTTP Streamable
- MCPTransportSSE: Server-Sent Events
- MCPTransportStdio: Stdio (Standard Input/Output)
- x-enum-descriptions:
- - Server-Sent Events
- - HTTP Streamable
- - Stdio (Standard Input/Output)
- x-enum-varnames:
- - MCPTransportSSE
- - MCPTransportHTTPStreamable
- - MCPTransportStdio
- types.ManualKnowledgePayload:
+ github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig:
properties:
- channel:
+ enabled:
+ type: boolean
+ question_count:
+ description: 'Number of questions to generate per chunk (default: 3, max:
+ 10)'
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RegisterRequest:
+ properties:
+ email:
type: string
- content:
+ password:
+ minLength: 6
type: string
- status:
+ username:
+ maxLength: 50
+ minLength: 2
type: string
- tag_id:
+ required:
+ - email
+ - password
+ - username
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RegisterResponse:
+ properties:
+ message:
type: string
- title:
+ success:
+ type: boolean
+ tenant:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ user:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.User'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest:
+ properties:
+ message:
+ description: Optional message explaining the reason
+ maxLength: 500
type: string
+ requested_role:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: The role user wants to upgrade to
+ required:
+ - requested_role
type: object
- types.MatchType:
- enum:
- - 0
- - 1
- - 2
- - 3
- - 4
- - 5
- - 6
- - 7
- - 8
- - 9
- type: integer
- x-enum-comments:
- MatchTypeDataAnalysis: 数据分析匹配类型
- MatchTypeDirectLoad: 直接加载匹配类型
- MatchTypeParentChunk: 父Chunk匹配类型
- MatchTypeRelationChunk: 关系Chunk匹配类型
- MatchTypeWebSearch: 网络搜索匹配类型
- x-enum-descriptions:
- - ""
- - ""
- - ""
- - ""
- - 父Chunk匹配类型
- - 关系Chunk匹配类型
- - ""
- - 网络搜索匹配类型
- - 直接加载匹配类型
- - 数据分析匹配类型
- x-enum-varnames:
- - MatchTypeEmbedding
- - MatchTypeKeywords
- - MatchTypeNearByChunk
- - MatchTypeHistory
- - MatchTypeParentChunk
- - MatchTypeRelationChunk
- - MatchTypeGraph
- - MatchTypeWebSearch
- - MatchTypeDirectLoad
- - MatchTypeDataAnalysis
- types.MentionedItem:
+ github_com_Tencent_WeKnora_internal_types.Resource:
properties:
- id:
+ description:
+ description: Optional description
type: string
- kb_type:
- description: '"document" or "faq" (only for kb type)'
+ external_id:
+ description: Unique identifier in the external system
+ type: string
+ has_children:
+ description: Whether this resource has children that can be expanded
+ type: boolean
+ metadata:
+ additionalProperties: true
+ description: Additional metadata
+ type: object
+ modified_at:
+ description: Last modified time in external system
type: string
name:
+ description: Display name
+ type: string
+ parent_id:
+ description: For hierarchical resources (parent ID if applicable)
type: string
type:
- description: '"kb" for knowledge base, "file" for file'
+ description: Resource type (document, folder, space, page, etc.)
+ type: string
+ url:
+ description: URL to access in external system
type: string
type: object
- types.Message:
+ github_com_Tencent_WeKnora_internal_types.ResourceCountsByOrgResponse:
properties:
- agent_duration_ms:
- description: Agent total execution duration in milliseconds (from query start
- to answer start)
+ agents:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ knowledge_bases:
+ properties:
+ by_organization:
+ additionalProperties:
+ type: integer
+ type: object
+ type: object
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrievalConfig:
+ properties:
+ embedding_top_k:
+ description: 'EmbeddingTopK is the maximum number of chunks returned by vector
+ search (default: 50)'
type: integer
- agent_steps:
- description: |-
- Agent execution steps (only for assistant messages generated by agent)
- This contains the detailed reasoning process and tool calls made by the agent
- Stored for user history display, but NOT included in LLM context to avoid redundancy
- items:
- $ref: '#/definitions/types.AgentStep'
- type: array
- attachments:
- description: Attached files (documents, audio, etc., for user messages)
- items:
- $ref: '#/definitions/types.MessageAttachment'
- type: array
- channel:
- description: Channel indicates the source channel of this message (e.g., "web",
- "api", "im")
- type: string
- content:
- description: Message text content
- type: string
- created_at:
- description: Message creation timestamp
+ keyword_threshold:
+ description: 'KeywordThreshold is the minimum keyword match score (0-1, default:
+ 0.3)'
+ type: number
+ rerank_model_id:
+ description: RerankModelID is the ID of the rerank model to use (required
+ for search)
type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Soft delete timestamp
- id:
- description: Unique identifier for the message
- type: string
- images:
- description: Attached images with OCR/Caption text (for user messages)
+ rerank_threshold:
+ description: 'RerankThreshold is the minimum rerank score (-10 to 10, default:
+ 0.2)'
+ type: number
+ rerank_top_k:
+ description: 'RerankTopK is the maximum number of results after reranking
+ (default: 10)'
+ type: integer
+ vector_threshold:
+ description: 'VectorThreshold is the minimum vector similarity score (0-1,
+ default: 0.15)'
+ type: number
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams:
+ properties:
+ retriever_engine_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
+ description: Retriever engine type
+ retriever_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverType'
+ description: Retriever type
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrieverEngineType:
+ enum:
+ - postgres
+ - elasticsearch
+ - infinity
+ - elasticfaiss
+ - qdrant
+ - milvus
+ - weaviate
+ - sqlite
+ type: string
+ x-enum-varnames:
+ - PostgresRetrieverEngineType
+ - ElasticsearchRetrieverEngineType
+ - InfinityRetrieverEngineType
+ - ElasticFaissRetrieverEngineType
+ - QdrantRetrieverEngineType
+ - MilvusRetrieverEngineType
+ - WeaviateRetrieverEngineType
+ - SQLiteRetrieverEngineType
+ github_com_Tencent_WeKnora_internal_types.RetrieverEngines:
+ properties:
+ engines:
items:
- $ref: '#/definitions/types.MessageImage'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineParams'
type: array
- is_completed:
- description: Whether message generation is complete
- type: boolean
- is_fallback:
- description: Whether this response is a fallback (no knowledge base match
- found)
+ type: object
+ github_com_Tencent_WeKnora_internal_types.RetrieverType:
+ enum:
+ - keywords
+ - vector
+ - websearch
+ type: string
+ x-enum-comments:
+ KeywordsRetrieverType: Keywords retriever
+ VectorRetrieverType: Vector retriever
+ WebSearchRetrieverType: Web search retriever
+ x-enum-descriptions:
+ - Keywords retriever
+ - Vector retriever
+ - Web search retriever
+ x-enum-varnames:
+ - KeywordsRetrieverType
+ - VectorRetrieverType
+ - WebSearchRetrieverType
+ github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest:
+ properties:
+ approved:
type: boolean
- knowledge_id:
- description: |-
- KnowledgeID links this message to a Knowledge entry in the chat history knowledge base
- Used for vector search indexing: when set, the message content has been indexed as a Knowledge passage
- type: string
- knowledge_references:
- description: References to knowledge chunks used in the response
- items:
- $ref: '#/definitions/types.SearchResult'
- type: array
- mentioned_items:
- description: |-
- Mentioned knowledge bases and files (for user messages)
- Stores the @mentioned items when user sends a message
- items:
- $ref: '#/definitions/types.MentionedItem'
- type: array
- request_id:
- description: Request identifier for tracking API requests
+ message:
+ maxLength: 500
type: string
role:
- description: 'Message role: "user", "assistant", "system"'
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: role to assign when approving; overrides applicant''s
+ requested role'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.S3EngineConfig:
+ properties:
+ access_key:
type: string
- session_id:
- description: ID of the session this message belongs to
+ bucket_name:
type: string
- updated_at:
- description: Last update timestamp
+ endpoint:
type: string
- type: object
- types.MessageAttachment:
- properties:
- content:
- description: Extracted text content (for small text files)
+ path_prefix:
type: string
- file_name:
- description: Original filename
+ region:
type: string
- file_size:
- description: File size in bytes
- type: integer
- file_type:
- description: File extension (e.g., ".pdf", ".docx")
+ secret_key:
type: string
- is_truncated:
- description: Whether content was truncated
+ type: object
+ github_com_Tencent_WeKnora_internal_types.SearchParams:
+ properties:
+ disable_keywords_match:
type: boolean
- line_count:
- description: Total line count (for text files)
+ disable_vector_match:
+ type: boolean
+ keyword_threshold:
+ type: number
+ knowledge_base_ids:
+ description: |-
+ KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,
+ allowing a single retrieval call to span multiple KBs that share the
+ same embedding model. When empty, HybridSearch uses its own id parameter.
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ items:
+ type: string
+ type: array
+ match_count:
type: integer
- url:
- description: Storage URL (provider://path)
+ only_recommended:
+ type: boolean
+ query_embedding:
+ items:
+ type: number
+ type: array
+ query_text:
type: string
+ skip_context_enrichment:
+ description: |-
+ SkipContextEnrichment skips fetching parent, nearby, and relation chunks
+ in processSearchResults. Used by the chat pipeline where context assembly
+ is handled separately in the merge stage.
+ type: boolean
+ tag_ids:
+ description: Tag IDs for filtering (used for FAQ priority filtering)
+ items:
+ type: string
+ type: array
+ vector_threshold:
+ type: number
type: object
- types.MessageImage:
+ github_com_Tencent_WeKnora_internal_types.SearchResult:
properties:
- caption:
+ chunk_index:
+ description: Chunk index
+ type: integer
+ chunk_metadata:
+ description: ChunkMetadata stores chunk-level metadata (e.g., generated questions)
+ items:
+ type: integer
+ type: array
+ chunk_type:
+ description: Chunk 类型
type: string
- url:
+ content:
+ description: Content
type: string
- type: object
- types.MinIOEngineConfig:
- properties:
- access_key_id:
+ end_at:
+ description: End at
+ type: integer
+ id:
+ description: ID
type: string
- bucket_name:
+ image_info:
+ description: 图片信息 (JSON 格式)
type: string
- endpoint:
+ knowledge_base_id:
+ description: KnowledgeBaseID is the ID of the knowledge base this result belongs
+ to
type: string
- mode:
- description: '"docker" or "remote"'
+ knowledge_channel:
+ description: KnowledgeChannel indicates through which channel the knowledge
+ was ingested (web, api, wechat, etc.)
type: string
- path_prefix:
+ knowledge_description:
+ description: KnowledgeDescription is the description of the knowledge document
type: string
- secret_access_key:
+ knowledge_filename:
+ description: |-
+ Knowledge file name
+ Used for file type knowledge, contains the original file name
type: string
- use_ssl:
- type: boolean
- type: object
- types.ModelParameters:
- properties:
- api_key:
+ knowledge_id:
+ description: Knowledge ID
type: string
- app_id:
- description: WeKnoraCloud 厂商专用凭证
+ knowledge_source:
+ description: |-
+ Knowledge source
+ Used to indicate the source of the knowledge, such as "url"
type: string
- app_secret:
- description: AES-256 加密存储,实际承载上游 API Key
+ knowledge_title:
+ description: Knowledge title
type: string
- base_url:
+ match_type:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MatchType'
+ description: Match type
+ matched_content:
+ description: |-
+ MatchedContent is the actual content that was matched in vector search
+ For FAQ: this is the matched question text (standard or similar question)
type: string
- embedding_parameters:
- $ref: '#/definitions/types.EmbeddingParameters'
- extra_config:
+ metadata:
additionalProperties:
type: string
- description: Provider-specific configuration
+ description: Metadata
type: object
- interface_type:
- type: string
- parameter_size:
- description: Ollama model parameter size (e.g., "7B", "13B", "70B")
- type: string
- provider:
- description: 'Provider identifier: openai, aliyun, zhipu, generic'
+ parent_chunk_id:
+ description: 父 Chunk ID
type: string
- supports_vision:
- description: Whether the model accepts image/multimodal input
- type: boolean
- type: object
- types.ModelSource:
- enum:
- - local
- - remote
- - aliyun
- - zhipu
- - volcengine
- - deepseek
- - hunyuan
- - minimax
- - openai
- - gemini
- - mimo
- - siliconflow
- - jina
- - openrouter
- - nvidia
- - novita
- - azure_openai
- type: string
- x-enum-comments:
- ModelSourceAliyun: Aliyun DashScope model
- ModelSourceAzureOpenAI: Azure OpenAI model
- ModelSourceDeepseek: Deepseek model
- ModelSourceGemini: Gemini model
- ModelSourceHunyuan: Hunyuan model
- ModelSourceJina: Jina AI model
- ModelSourceLocal: Local model
- ModelSourceMimo: Mimo model
- ModelSourceMinimax: Minimax mode
- ModelSourceNovita: Novita AI model
- ModelSourceNvidia: NVIDIA model
- ModelSourceOpenAI: OpenAI model
- ModelSourceOpenRouter: OpenRouter model
- ModelSourceRemote: Remote model
- ModelSourceSiliconFlow: SiliconFlow model
- ModelSourceVolcengine: Volcengine model
- ModelSourceZhipu: Zhipu model
- x-enum-descriptions:
- - Local model
- - Remote model
- - Aliyun DashScope model
- - Zhipu model
- - Volcengine model
- - Deepseek model
- - Hunyuan model
- - Minimax mode
- - OpenAI model
- - Gemini model
- - Mimo model
- - SiliconFlow model
- - Jina AI model
- - OpenRouter model
- - NVIDIA model
- - Novita AI model
- - Azure OpenAI model
- x-enum-varnames:
- - ModelSourceLocal
- - ModelSourceRemote
- - ModelSourceAliyun
- - ModelSourceZhipu
- - ModelSourceVolcengine
- - ModelSourceDeepseek
- - ModelSourceHunyuan
- - ModelSourceMinimax
- - ModelSourceOpenAI
- - ModelSourceGemini
- - ModelSourceMimo
- - ModelSourceSiliconFlow
- - ModelSourceJina
- - ModelSourceOpenRouter
- - ModelSourceNvidia
- - ModelSourceNovita
- - ModelSourceAzureOpenAI
- types.ModelType:
- enum:
- - Embedding
- - Rerank
- - KnowledgeQA
- - VLLM
- - ASR
- type: string
- x-enum-comments:
- ModelTypeASR: ASR (Automatic Speech Recognition) model
- ModelTypeEmbedding: Embedding model
- ModelTypeKnowledgeQA: KnowledgeQA model
- ModelTypeRerank: Rerank model
- ModelTypeVLLM: VLLM model
- x-enum-descriptions:
- - Embedding model
- - Rerank model
- - KnowledgeQA model
- - VLLM model
- - ASR (Automatic Speech Recognition) model
- x-enum-varnames:
- - ModelTypeEmbedding
- - ModelTypeRerank
- - ModelTypeKnowledgeQA
- - ModelTypeVLLM
- - ModelTypeASR
- types.OIDCAuthURLResponse:
+ score:
+ description: Score
+ type: number
+ seq:
+ description: Seq
+ type: integer
+ start_at:
+ description: Start at
+ type: integer
+ sub_chunk_id:
+ description: SubChunkIndex
+ items:
+ type: string
+ type: array
+ type: object
+ github_com_Tencent_WeKnora_internal_types.Session:
properties:
- authorization_url:
+ created_at:
type: string
- provider_display_name:
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
+ description: Description
type: string
- state:
+ id:
+ description: ID
+ type: string
+ tenant_id:
+ description: Tenant ID
+ type: integer
+ title:
+ description: Title
+ type: string
+ updated_at:
type: string
- success:
- type: boolean
type: object
- types.OIDCConfigResponse:
+ github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest:
properties:
- enabled:
- type: boolean
- provider_display_name:
+ organization_id:
type: string
- success:
- type: boolean
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ required:
+ - organization_id
+ - permission
type: object
- types.OSSEngineConfig:
+ github_com_Tencent_WeKnora_internal_types.StorageConfig:
properties:
- access_key:
+ app_id:
type: string
bucket_name:
type: string
- endpoint:
- type: string
path_prefix:
type: string
- region:
+ provider:
type: string
- secret_key:
+ region:
type: string
- temp_bucket_name:
+ secret_id:
type: string
- temp_region:
+ secret_key:
type: string
- use_temp_bucket:
- type: boolean
type: object
- types.OrgMemberRole:
- enum:
- - admin
- - editor
- - viewer
- type: string
- x-enum-varnames:
- - OrgRoleAdmin
- - OrgRoleEditor
- - OrgRoleViewer
- types.OrganizationMemberResponse:
+ github_com_Tencent_WeKnora_internal_types.StorageEngineConfig:
properties:
- avatar:
+ cos:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
+ default_provider:
+ description: '"local", "minio", "cos", "tos", "s3", "oss"'
type: string
- email:
+ local:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LocalEngineConfig'
+ minio:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig'
+ oss:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig'
+ s3:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig'
+ tos:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig'
+ type: object
+ github_com_Tencent_WeKnora_internal_types.StorageProviderConfig:
+ properties:
+ provider:
+ description: '"local", "minio", "cos", "tos", "s3", "oss"'
type: string
- id:
+ type: object
+ github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest:
+ properties:
+ invite_code:
+ maxLength: 32
+ minLength: 8
type: string
- joined_at:
+ message:
+ maxLength: 500
type: string
role:
- type: string
- tenant_id:
- type: integer
- user_id:
- type: string
- username:
- type: string
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ description: 'Optional: role the applicant requests (admin/editor/viewer);
+ default viewer'
+ required:
+ - invite_code
type: object
- types.OrganizationResponse:
+ github_com_Tencent_WeKnora_internal_types.SyncLog:
properties:
- agent_share_count:
- description: 共享到该组织的智能体数量
- type: integer
- avatar:
- type: string
created_at:
+ description: Creation timestamp (usually same as StartedAt)
type: string
- description:
+ data_source_id:
+ description: Reference to the data source
type: string
- has_pending_upgrade:
- description: 当前用户是否有待处理的权限升级申请
- type: boolean
- id:
+ error_message:
+ description: Error details if status is "failed"
type: string
- invite_code:
+ finished_at:
+ description: Sync completion time
type: string
- invite_code_expires_at:
+ id:
+ description: Unique identifier
type: string
- invite_code_validity_days:
+ items_created:
+ description: New items created in knowledge base
type: integer
- is_owner:
- type: boolean
- member_count:
+ items_deleted:
+ description: Items deleted from knowledge base
type: integer
- member_limit:
- description: 0 = unlimited
+ items_failed:
+ description: Items that failed to sync
type: integer
- my_role:
- type: string
- name:
- type: string
- owner_id:
- type: string
- pending_join_request_count:
- description: 待审批加入申请数(仅管理员可见)
+ items_skipped:
+ description: Items skipped (no changes detected)
type: integer
- require_approval:
- type: boolean
- searchable:
- type: boolean
- share_count:
- description: 共享到该组织的知识库数量
+ items_total:
+ description: Total items fetched from source
type: integer
- updated_at:
+ items_updated:
+ description: Existing items updated
+ type: integer
+ result:
+ description: Detailed sync result (JSON-encoded)
+ items:
+ type: integer
+ type: array
+ started_at:
+ description: Sync start time
type: string
- type: object
- types.ParserEngineConfig:
+ status:
+ description: 'Sync status: running, success, partial, failed, canceled'
+ type: string
+ tenant_id:
+ description: Tenant ID
+ type: integer
+ updated_at:
+ description: Last update timestamp
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.TOSEngineConfig:
properties:
- mineru_api_key:
- description: MinerU 云 API Key
+ access_key:
type: string
- mineru_cloud_enable_formula:
- type: boolean
- mineru_cloud_enable_ocr:
- type: boolean
- mineru_cloud_enable_table:
- type: boolean
- mineru_cloud_language:
+ bucket_name:
type: string
- mineru_cloud_model:
- description: MinerU 云 API 解析参数
+ endpoint:
type: string
- mineru_enable_formula:
- type: boolean
- mineru_enable_ocr:
- type: boolean
- mineru_enable_table:
- type: boolean
- mineru_endpoint:
- description: MinerU 自建服务端点
+ path_prefix:
type: string
- mineru_language:
+ region:
type: string
- mineru_model:
- description: MinerU 自建解析参数
+ secret_key:
type: string
type: object
- types.ParserEngineRule:
+ github_com_Tencent_WeKnora_internal_types.Tenant:
properties:
- engine:
+ agent_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.AgentConfig'
+ description: |-
+ Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
+ api_key:
+ description: API key
type: string
- file_types:
- items:
- type: string
- type: array
- type: object
- types.QuestionGenerationConfig:
- properties:
- enabled:
- type: boolean
- question_count:
- description: 'Number of questions to generate per chunk (default: 3, max:
- 10)'
+ business:
+ description: Business
+ type: string
+ chat_history_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ChatHistoryConfig'
+ description: 'Chat history config: knowledge base configuration for indexing
+ and searching chat messages via vector search'
+ context_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ContextConfig'
+ description: Global Context configuration for this tenant (default for all
+ sessions)
+ conversation_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConversationConfig'
+ description: |-
+ Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.
+ This field is kept for backward compatibility and will be removed in future versions.
+ created_at:
+ description: Creation time
+ type: string
+ credentials:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CredentialsConfig'
+ description: 'Credentials config: third-party provider credentials (e.g. WeKnoraCloud
+ AppID/AppSecret)'
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time
+ description:
+ description: Description
+ type: string
+ id:
+ description: ID
+ type: integer
+ name:
+ description: Name
+ type: string
+ parser_engine_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineConfig'
+ description: Parser engine config overrides (MinerU endpoint, API key, etc.).
+ Used when parsing documents; overrides env.
+ retrieval_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrievalConfig'
+ description: 'Retrieval config: global search/retrieval parameters shared
+ by knowledge search and message search'
+ retriever_engines:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngines'
+ description: Retriever engines
+ status:
+ description: Status
+ type: string
+ storage_engine_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StorageEngineConfig'
+ description: 'Storage engine config: parameters for Local, MinIO, COS. Used
+ for document/file storage and docreader.'
+ storage_quota:
+ description: Storage quota (Bytes), default is 10GB, including vector, original
+ file, text, index, etc.
+ type: integer
+ storage_used:
+ description: Storage used (Bytes)
type: integer
+ updated_at:
+ description: Last updated time
+ type: string
+ web_search_config:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WebSearchConfig'
+ description: Global WebSearch configuration for this tenant
type: object
- types.RegisterRequest:
+ github_com_Tencent_WeKnora_internal_types.ToolCall:
properties:
- email:
+ args:
+ additionalProperties: true
+ description: Tool arguments
+ type: object
+ duration:
+ description: Execution time in milliseconds
+ type: integer
+ id:
+ description: Function call ID from LLM
type: string
- password:
- minLength: 6
+ name:
+ description: Tool name
type: string
- username:
- maxLength: 50
- minLength: 2
+ reflection:
+ description: Agent's reflection on this tool call result (if enabled)
type: string
- required:
- - email
- - password
- - username
+ result:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ToolResult'
+ description: Execution result (contains Output)
type: object
- types.RegisterResponse:
+ github_com_Tencent_WeKnora_internal_types.ToolResult:
properties:
- message:
+ data:
+ additionalProperties: true
+ description: Structured data for programmatic use
+ type: object
+ error:
+ description: Error message if execution failed
+ type: string
+ images:
+ description: Base64 data URIs from tool (e.g. MCP image content)
+ items:
+ type: string
+ type: array
+ output:
+ description: Human-readable output
type: string
success:
+ description: Whether the tool executed successfully
type: boolean
- tenant:
- $ref: '#/definitions/types.Tenant'
- user:
- $ref: '#/definitions/types.User'
type: object
- types.RequestRoleUpgradeRequest:
+ github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest:
properties:
- message:
- description: Optional message explaining the reason
- maxLength: 500
- type: string
- requested_role:
- allOf:
- - $ref: '#/definitions/types.OrgMemberRole'
- description: The role user wants to upgrade to
+ role:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
required:
- - requested_role
+ - role
type: object
- types.Resource:
+ github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest:
properties:
+ avatar:
+ description: optional avatar URL
+ maxLength: 512
+ type: string
description:
- description: Optional description
+ maxLength: 1000
type: string
- external_id:
- description: Unique identifier in the external system
+ invite_code_validity_days:
+ description: 0=never, 1, 7, 30
+ type: integer
+ member_limit:
+ description: max members; 0=unlimited
+ type: integer
+ name:
+ maxLength: 255
+ minLength: 1
type: string
- has_children:
- description: Whether this resource has children that can be expanded
+ require_approval:
type: boolean
- metadata:
- additionalProperties: true
- description: Additional metadata
- type: object
- modified_at:
- description: Last modified time in external system
+ searchable:
+ description: open for search so others can discover and join
+ type: boolean
+ type: object
+ github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest:
+ properties:
+ permission:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OrgMemberRole'
+ required:
+ - permission
+ type: object
+ github_com_Tencent_WeKnora_internal_types.User:
+ properties:
+ avatar:
+ description: Avatar URL of the user
type: string
- name:
- description: Display name
+ can_access_all_tenants:
+ description: Whether the user can access all tenants (cross-tenant access)
+ type: boolean
+ created_at:
+ description: Creation time of the user
type: string
- parent_id:
- description: For hierarchical resources (parent ID if applicable)
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Deletion time of the user
+ email:
+ description: Email address of the user
type: string
- type:
- description: Resource type (document, folder, space, page, etc.)
+ id:
+ description: Unique identifier of the user
type: string
- url:
- description: URL to access in external system
+ is_active:
+ description: Whether the user is active
+ type: boolean
+ tenant:
+ allOf:
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
+ description: Association relationship, not stored in the database
+ tenant_id:
+ description: Tenant ID that the user belongs to
+ type: integer
+ updated_at:
+ description: Last updated time of the user
+ type: string
+ username:
+ description: Username of the user
type: string
type: object
- types.ResourceCountsByOrgResponse:
+ github_com_Tencent_WeKnora_internal_types.VLMConfig:
properties:
- agents:
- properties:
- by_organization:
- additionalProperties:
- type: integer
- type: object
- type: object
- knowledge_bases:
- properties:
- by_organization:
- additionalProperties:
- type: integer
- type: object
- type: object
+ api_key:
+ description: API Key
+ type: string
+ base_url:
+ description: Base URL
+ type: string
+ enabled:
+ type: boolean
+ interface_type:
+ description: 'Interface Type: "ollama" or "openai"'
+ type: string
+ model_id:
+ type: string
+ model_name:
+ description: |-
+ 兼容老版本
+ Model Name
+ type: string
type: object
- types.RetrievalConfig:
+ github_com_Tencent_WeKnora_internal_types.WeKnoraCloudCredentials:
properties:
- embedding_top_k:
- description: 'EmbeddingTopK is the maximum number of chunks returned by vector
- search (default: 50)'
+ app_id:
+ type: string
+ app_secret:
+ type: string
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WebSearchConfig:
+ properties:
+ api_key:
+ description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
+ type: string
+ blacklist:
+ description: 黑名单规则列表
+ items:
+ type: string
+ type: array
+ compression_method:
+ description: 压缩方法:none, summary, extract, rag
+ type: string
+ document_fragments:
+ description: 文档片段数量(用于RAG压缩)
type: integer
- keyword_threshold:
- description: 'KeywordThreshold is the minimum keyword match score (0-1, default:
- 0.3)'
- type: number
- rerank_model_id:
- description: RerankModelID is the ID of the rerank model to use (required
- for search)
+ embedding_dimension:
+ description: 嵌入维度(用于RAG压缩)
+ type: integer
+ embedding_model_id:
+ description: RAG压缩相关配置
type: string
- rerank_threshold:
- description: 'RerankThreshold is the minimum rerank score (-10 to 10, default:
- 0.2)'
- type: number
- rerank_top_k:
- description: 'RerankTopK is the maximum number of results after reranking
- (default: 10)'
+ include_date:
+ description: 是否包含日期
+ type: boolean
+ max_results:
+ description: 最大搜索结果数
type: integer
- vector_threshold:
- description: 'VectorThreshold is the minimum vector similarity score (0-1,
- default: 0.15)'
- type: number
+ provider:
+ description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
+ type: string
+ proxy_url:
+ description: Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url.
+ Merged at call time when set.
+ type: string
+ rerank_model_id:
+ description: 重排模型ID(用于RAG压缩)
+ type: string
type: object
- types.RetrieverEngineParams:
+ github_com_Tencent_WeKnora_internal_types.WikiConfig:
properties:
- retriever_engine_type:
+ extraction_granularity:
allOf:
- - $ref: '#/definitions/types.RetrieverEngineType'
- description: Retriever engine type
- retriever_type:
- allOf:
- - $ref: '#/definitions/types.RetrieverType'
- description: Retriever type
+ - $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity'
+ description: |-
+ ExtractionGranularity controls how many candidate slugs Pass 0 extracts
+ per document. Empty / unknown value is treated as WikiExtractionStandard.
+ max_pages_per_ingest:
+ description: MaxPagesPerIngest limits pages created/updated per ingest operation
+ (0 = no limit)
+ type: integer
+ synthesis_model_id:
+ description: SynthesisModelID is the LLM model ID used for wiki page generation
+ and updates
+ type: string
type: object
- types.RetrieverEngineType:
+ github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity:
enum:
- - postgres
- - elasticsearch
- - infinity
- - elasticfaiss
- - qdrant
- - milvus
- - weaviate
- - sqlite
+ - focused
+ - standard
+ - exhaustive
type: string
x-enum-varnames:
- - PostgresRetrieverEngineType
- - ElasticsearchRetrieverEngineType
- - InfinityRetrieverEngineType
- - ElasticFaissRetrieverEngineType
- - QdrantRetrieverEngineType
- - MilvusRetrieverEngineType
- - WeaviateRetrieverEngineType
- - SQLiteRetrieverEngineType
- types.RetrieverEngines:
+ - WikiExtractionFocused
+ - WikiExtractionStandard
+ - WikiExtractionExhaustive
+ github_com_Tencent_WeKnora_internal_types.WikiGraphData:
properties:
- engines:
+ edges:
items:
- $ref: '#/definitions/types.RetrieverEngineParams'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphEdge'
+ type: array
+ nodes:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphNode'
type: array
type: object
- types.RetrieverType:
- enum:
- - keywords
- - vector
- - websearch
- type: string
- x-enum-comments:
- KeywordsRetrieverType: Keywords retriever
- VectorRetrieverType: Vector retriever
- WebSearchRetrieverType: Web search retriever
- x-enum-descriptions:
- - Keywords retriever
- - Vector retriever
- - Web search retriever
- x-enum-varnames:
- - KeywordsRetrieverType
- - VectorRetrieverType
- - WebSearchRetrieverType
- types.ReviewJoinRequestRequest:
+ github_com_Tencent_WeKnora_internal_types.WikiGraphEdge:
properties:
- approved:
- type: boolean
- message:
- maxLength: 500
+ source:
+ description: source slug
+ type: string
+ target:
+ description: target slug
type: string
- role:
- allOf:
- - $ref: '#/definitions/types.OrgMemberRole'
- description: 'Optional: role to assign when approving; overrides applicant''s
- requested role'
type: object
- types.S3EngineConfig:
+ github_com_Tencent_WeKnora_internal_types.WikiGraphNode:
properties:
- access_key:
- type: string
- bucket_name:
- type: string
- endpoint:
- type: string
- path_prefix:
+ link_count:
+ description: Number of inbound + outbound links
+ type: integer
+ page_type:
type: string
- region:
+ slug:
type: string
- secret_key:
+ title:
type: string
type: object
- types.SearchParams:
+ github_com_Tencent_WeKnora_internal_types.WikiPage:
properties:
- disable_keywords_match:
- type: boolean
- disable_vector_match:
- type: boolean
- keyword_threshold:
- type: number
- knowledge_base_ids:
- description: |-
- KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch,
- allowing a single retrieval call to span multiple KBs that share the
- same embedding model. When empty, HybridSearch uses its own id parameter.
+ aliases:
+ description: Alternate names, abbreviations, acronyms or translated names
items:
type: string
type: array
- knowledge_ids:
+ chunk_refs:
+ description: |-
+ ChunkRefs records the specific source-document chunks this page was
+ built from — one UUID per cited chunk. Populated during ingest from
+ the chunk-citation pass; refreshed wholesale whenever the page is
+ re-materialized. Empty for summary pages (they are document-level
+ synopses and don't carry chunk-level citations). Use this when you
+ need to surface the underlying evidence for a wiki page, or to
+ retract citations when a source document is deleted.
items:
type: string
type: array
- match_count:
- type: integer
- only_recommended:
- type: boolean
- query_embedding:
+ content:
+ description: Full markdown content
+ type: string
+ created_at:
+ description: Creation time
+ type: string
+ deleted_at:
+ allOf:
+ - $ref: '#/definitions/gorm.DeletedAt'
+ description: Soft delete
+ id:
+ description: Unique identifier (UUID)
+ type: string
+ in_links:
+ description: Slugs of pages that link TO this page (backlinks)
items:
- type: number
+ type: string
type: array
- query_text:
+ knowledge_base_id:
+ description: Knowledge base this page belongs to
type: string
- skip_context_enrichment:
- description: |-
- SkipContextEnrichment skips fetching parent, nearby, and relation chunks
- in processSearchResults. Used by the chat pipeline where context assembly
- is handled separately in the merge stage.
- type: boolean
- tag_ids:
- description: Tag IDs for filtering (used for FAQ priority filtering)
+ out_links:
+ description: Slugs of pages this page links to (outbound links)
items:
type: string
type: array
- vector_threshold:
- type: number
- type: object
- types.SearchResult:
- properties:
- chunk_index:
- description: Chunk index
- type: integer
- chunk_metadata:
- description: ChunkMetadata stores chunk-level metadata (e.g., generated questions)
+ page_metadata:
+ description: Arbitrary metadata (tags, categories, dates, etc.)
items:
type: integer
type: array
- chunk_type:
- description: Chunk 类型
+ page_type:
+ description: 'Page type: summary, entity, concept, index, log, synthesis,
+ comparison'
type: string
- content:
- description: Content
- type: string
- end_at:
- description: End at
- type: integer
- id:
- description: ID
+ slug:
+ description: |-
+ URL-friendly slug for addressing, e.g. "entity/acme-corp", "concept/rag"
+ Unique within a knowledge base
type: string
- image_info:
- description: 图片信息 (JSON 格式)
+ source_refs:
+ description: |-
+ References to source knowledge IDs that contributed to this page.
+ Format matches the legacy "<knowledge_id>|<doc_title>" convention used
+ across the ingest pipeline, so retract / display code can split on `|`
+ to recover the title. Document-level granularity.
+ items:
+ type: string
+ type: array
+ status:
+ description: 'Page status: draft, published, archived'
type: string
- knowledge_base_id:
- description: KnowledgeBaseID is the ID of the knowledge base this result belongs
- to
+ summary:
+ description: One-line summary for index listing
type: string
- knowledge_channel:
- description: KnowledgeChannel indicates through which channel the knowledge
- was ingested (web, api, wechat, etc.)
+ tenant_id:
+ description: Tenant ID for multi-tenant isolation
+ type: integer
+ title:
+ description: Human-readable title
type: string
- knowledge_description:
- description: KnowledgeDescription is the description of the knowledge document
+ updated_at:
+ description: Last update time
type: string
- knowledge_filename:
+ version:
description: |-
- Knowledge file name
- Used for file type knowledge, contains the original file name
+ Version number. Incremented only when a user-visible content field
+ (title, content, summary, page_type, status) actually changes; pure
+ bookkeeping writes (link maintenance, same-content re-ingest, status
+ sync from background jobs) leave it untouched so it can be used as a
+ real "the page was edited" signal.
+ type: integer
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiPageIssue:
+ properties:
+ created_at:
type: string
- knowledge_id:
- description: Knowledge ID
+ deleted_at:
+ $ref: '#/definitions/gorm.DeletedAt'
+ description:
type: string
- knowledge_source:
- description: |-
- Knowledge source
- Used to indicate the source of the knowledge, such as "url"
+ id:
type: string
- knowledge_title:
- description: Knowledge title
+ issue_type:
type: string
- match_type:
- allOf:
- - $ref: '#/definitions/types.MatchType'
- description: Match type
- matched_content:
- description: |-
- MatchedContent is the actual content that was matched in vector search
- For FAQ: this is the matched question text (standard or similar question)
+ knowledge_base_id:
type: string
- metadata:
- additionalProperties:
+ reported_by:
+ type: string
+ slug:
+ type: string
+ status:
+ type: string
+ suspected_knowledge_ids:
+ items:
type: string
- description: Metadata
- type: object
- parent_chunk_id:
- description: 父 Chunk ID
+ type: array
+ tenant_id:
+ type: integer
+ updated_at:
type: string
- score:
- description: Score
- type: number
- seq:
- description: Seq
+ type: object
+ github_com_Tencent_WeKnora_internal_types.WikiPageListResponse:
+ properties:
+ page:
type: integer
- start_at:
- description: Start at
+ page_size:
type: integer
- sub_chunk_id:
- description: SubChunkIndex
+ pages:
items:
- type: string
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
type: array
+ total:
+ type: integer
+ total_pages:
+ type: integer
type: object
- types.Session:
+ github_com_Tencent_WeKnora_internal_types.WikiStats:
properties:
- created_at:
- type: string
- deleted_at:
- $ref: '#/definitions/gorm.DeletedAt'
- description:
- description: Description
- type: string
- id:
- description: ID
- type: string
- tenant_id:
- description: Tenant ID
+ is_active:
+ description: whether wiki ingestion is currently running
+ type: boolean
+ orphan_count:
+ description: pages with no inbound links
+ type: integer
+ pages_by_type:
+ additionalProperties:
+ format: int64
+ type: integer
+ type: object
+ pending_issues:
+ description: number of pending wiki issues
+ type: integer
+ pending_tasks:
+ description: number of documents waiting to be ingested
+ type: integer
+ recent_updates:
+ description: last N updated pages
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ type: array
+ total_links:
+ type: integer
+ total_pages:
type: integer
- title:
- description: Title
- type: string
- updated_at:
- type: string
type: object
- types.ShareKnowledgeBaseRequest:
+ gorm.DeletedAt:
properties:
- organization_id:
+ time:
type: string
- permission:
- $ref: '#/definitions/types.OrgMemberRole'
- required:
- - organization_id
- - permission
+ valid:
+ description: Valid is true if Time is not NULL
+ type: boolean
type: object
- types.StorageConfig:
+ internal_handler.CopyKnowledgeBaseRequest:
properties:
- app_id:
- type: string
- bucket_name:
+ source_id:
type: string
- path_prefix:
+ target_id:
type: string
- provider:
+ task_id:
type: string
- region:
+ required:
+ - source_id
+ type: object
+ internal_handler.CreateAgentRequest:
+ properties:
+ avatar:
type: string
- secret_id:
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
+ description:
type: string
- secret_key:
+ name:
type: string
+ required:
+ - name
type: object
- types.StorageEngineConfig:
+ internal_handler.CreateModelRequest:
properties:
- cos:
- $ref: '#/definitions/types.COSEngineConfig'
- default_provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ description:
type: string
- local:
- $ref: '#/definitions/types.LocalEngineConfig'
- minio:
- $ref: '#/definitions/types.MinIOEngineConfig'
- oss:
- $ref: '#/definitions/types.OSSEngineConfig'
- s3:
- $ref: '#/definitions/types.S3EngineConfig'
- tos:
- $ref: '#/definitions/types.TOSEngineConfig'
- type: object
- types.StorageProviderConfig:
- properties:
- provider:
- description: '"local", "minio", "cos", "tos", "s3", "oss"'
+ name:
type: string
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters'
+ source:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource'
+ type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ required:
+ - name
+ - parameters
+ - source
+ - type
type: object
- types.SubmitJoinRequestRequest:
+ internal_handler.CreateStoreRequest:
properties:
- invite_code:
- maxLength: 32
- minLength: 8
- type: string
- message:
- maxLength: 500
+ connection_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig'
+ engine_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
+ index_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.IndexConfig'
+ name:
type: string
- role:
- allOf:
- - $ref: '#/definitions/types.OrgMemberRole'
- description: 'Optional: role the applicant requests (admin/editor/viewer);
- default viewer'
required:
- - invite_code
+ - connection_config
+ - engine_type
+ - name
type: object
- types.SyncLog:
+ internal_handler.DeleteTagRequest:
properties:
- created_at:
- description: Creation timestamp (usually same as StartedAt)
+ exclude_ids:
+ description: Chunk seq_ids to exclude from deletion
+ items:
+ type: integer
+ type: array
+ type: object
+ internal_handler.EvaluationRequest:
+ properties:
+ chat_id:
+ description: ID of chat model to use
type: string
- data_source_id:
- description: Reference to the data source
+ dataset_id:
+ description: ID of dataset to evaluate
type: string
- error_message:
- description: Error details if status is "failed"
+ knowledge_base_id:
+ description: ID of knowledge base to use
type: string
- finished_at:
- description: Sync completion time
+ rerank_id:
+ description: ID of rerank model to use
type: string
- id:
- description: Unique identifier
+ type: object
+ internal_handler.FabriTextRequest:
+ properties:
+ model_id:
type: string
- items_created:
- description: New items created in knowledge base
- type: integer
- items_deleted:
- description: Items deleted from knowledge base
- type: integer
- items_failed:
- description: Items that failed to sync
- type: integer
- items_skipped:
- description: Items skipped (no changes detected)
- type: integer
- items_total:
- description: Total items fetched from source
- type: integer
- items_updated:
- description: Existing items updated
- type: integer
- result:
- description: Detailed sync result (JSON-encoded)
+ tags:
items:
- type: integer
+ type: string
type: array
- started_at:
- description: Sync start time
+ required:
+ - model_id
+ type: object
+ internal_handler.GetStorageEngineStatusResponse:
+ properties:
+ engines:
+ items:
+ $ref: '#/definitions/internal_handler.StorageEngineStatusItem'
+ type: array
+ minio_env_available:
+ type: boolean
+ type: object
+ internal_handler.GetSystemInfoResponse:
+ properties:
+ build_time:
type: string
- status:
- description: 'Sync status: running, success, partial, failed, canceled'
+ commit_id:
type: string
- tenant_id:
- description: Tenant ID
- type: integer
- updated_at:
- description: Last update timestamp
+ db_version:
type: string
- type: object
- types.TOSEngineConfig:
- properties:
- access_key:
+ edition:
type: string
- bucket_name:
+ go_version:
type: string
- endpoint:
+ graph_database_engine:
type: string
- path_prefix:
+ keyword_index_engine:
type: string
- region:
+ minio_enabled:
+ type: boolean
+ vector_store_engine:
type: string
- secret_key:
+ version:
type: string
type: object
- types.Tenant:
+ internal_handler.KBModelConfigRequest:
properties:
- agent_config:
- allOf:
- - $ref: '#/definitions/types.AgentConfig'
- description: |-
- Deprecated: AgentConfig is deprecated, use CustomAgent (builtin-smart-reasoning) config instead.
- This field is kept for backward compatibility and will be removed in future versions.
- api_key:
- description: API key
+ asr_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ASRConfig'
+ documentSplitting:
+ description: 文档分块配置
+ properties:
+ childChunkSize:
+ type: integer
+ chunkOverlap:
+ type: integer
+ chunkSize:
+ type: integer
+ enableParentChild:
+ type: boolean
+ parentChunkSize:
+ type: integer
+ parserEngineRules:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ParserEngineRule'
+ type: array
+ separators:
+ items:
+ type: string
+ type: array
+ type: object
+ embeddingModelId:
+ description: optional when RAG indexing is disabled
type: string
- business:
- description: Business
+ llmModelId:
type: string
- chat_history_config:
- allOf:
- - $ref: '#/definitions/types.ChatHistoryConfig'
- description: 'Chat history config: knowledge base configuration for indexing
- and searching chat messages via vector search'
- context_config:
- allOf:
- - $ref: '#/definitions/types.ContextConfig'
- description: Global Context configuration for this tenant (default for all
- sessions)
- conversation_config:
- allOf:
- - $ref: '#/definitions/types.ConversationConfig'
- description: |-
- Deprecated: ConversationConfig is deprecated, use CustomAgent (builtin-quick-answer) config instead.
- This field is kept for backward compatibility and will be removed in future versions.
- created_at:
- description: Creation time
+ multimodal:
+ description: 多模态配置(仅模型相关;存储引擎在 storageProvider 中配置)
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ nodeExtract:
+ description: 知识图谱配置
+ properties:
+ enabled:
+ type: boolean
+ nodes:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphNode'
+ type: array
+ relations:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.GraphRelation'
+ type: array
+ tags:
+ items:
+ type: string
+ type: array
+ text:
+ type: string
+ type: object
+ questionGeneration:
+ description: 问题生成配置
+ properties:
+ enabled:
+ type: boolean
+ questionCount:
+ type: integer
+ type: object
+ storageProvider:
+ description: 存储引擎选择("local" | "minio" | "cos"),影响文档上传与文档内图片存储,参数从全局设置读取
type: string
- credentials:
- allOf:
- - $ref: '#/definitions/types.CredentialsConfig'
- description: 'Credentials config: third-party provider credentials (e.g. WeKnoraCloud
- AppID/AppSecret)'
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time
- description:
- description: Description
+ vlm_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.VLMConfig'
+ required:
+ - llmModelId
+ type: object
+ internal_handler.RemoteModelCheckRequest:
+ properties:
+ apiKey:
type: string
- id:
- description: ID
+ baseUrl:
+ type: string
+ customHeaders:
+ additionalProperties:
+ type: string
+ type: object
+ dimension:
type: integer
- name:
- description: Name
+ extraConfig:
+ additionalProperties:
+ type: string
+ type: object
+ interfaceType:
type: string
- parser_engine_config:
- allOf:
- - $ref: '#/definitions/types.ParserEngineConfig'
- description: Parser engine config overrides (MinerU endpoint, API key, etc.).
- Used when parsing documents; overrides env.
- retrieval_config:
- allOf:
- - $ref: '#/definitions/types.RetrievalConfig'
- description: 'Retrieval config: global search/retrieval parameters shared
- by knowledge search and message search'
- retriever_engines:
- allOf:
- - $ref: '#/definitions/types.RetrieverEngines'
- description: Retriever engines
- status:
- description: Status
+ modelName:
type: string
- storage_engine_config:
- allOf:
- - $ref: '#/definitions/types.StorageEngineConfig'
- description: 'Storage engine config: parameters for Local, MinIO, COS. Used
- for document/file storage and docreader.'
- storage_quota:
- description: Storage quota (Bytes), default is 10GB, including vector, original
- file, text, index, etc.
- type: integer
- storage_used:
- description: Storage used (Bytes)
- type: integer
- updated_at:
- description: Last updated time
+ provider:
type: string
- web_search_config:
- allOf:
- - $ref: '#/definitions/types.WebSearchConfig'
- description: Global WebSearch configuration for this tenant
+ source:
+ description: 为空时按需默认为 "remote"
+ type: string
+ required:
+ - modelName
type: object
- types.ToolCall:
+ internal_handler.SearchMessagesRequest:
properties:
- args:
- additionalProperties: true
- description: Tool arguments
- type: object
- duration:
- description: Execution time in milliseconds
+ limit:
+ description: 'Maximum number of results to return (default: 20)'
type: integer
- id:
- description: Function call ID from LLM
+ mode:
+ description: 'Search mode: "keyword", "vector", "hybrid" (default: "hybrid")'
type: string
- name:
- description: Tool name
+ query:
+ description: Query text for search
type: string
- reflection:
- description: Agent's reflection on this tool call result (if enabled)
+ session_ids:
+ description: Filter by specific session IDs (optional)
+ items:
+ type: string
+ type: array
+ required:
+ - query
+ type: object
+ internal_handler.StorageCheckRequest:
+ properties:
+ cos:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.COSEngineConfig'
+ minio:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MinIOEngineConfig'
+ oss:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OSSEngineConfig'
+ provider:
+ description: '"minio", "cos", "tos", "s3", "oss"'
type: string
- result:
- allOf:
- - $ref: '#/definitions/types.ToolResult'
- description: Execution result (contains Output)
+ s3:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.S3EngineConfig'
+ tos:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.TOSEngineConfig'
type: object
- types.ToolResult:
+ internal_handler.StorageCheckResponse:
properties:
- data:
- additionalProperties: true
- description: Structured data for programmatic use
- type: object
- error:
- description: Error message if execution failed
+ bucket_created:
+ type: boolean
+ message:
type: string
- images:
- description: Base64 data URIs from tool (e.g. MCP image content)
+ ok:
+ type: boolean
+ type: object
+ internal_handler.StorageEngineStatusItem:
+ properties:
+ available:
+ description: whether the engine can be used
+ type: boolean
+ description:
+ description: short description for UI
+ type: string
+ name:
+ description: '"local", "minio", "cos", "tos"'
+ type: string
+ type: object
+ internal_handler.TestStoreRequest:
+ properties:
+ connection_config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ConnectionConfig'
+ engine_type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RetrieverEngineType'
+ required:
+ - connection_config
+ - engine_type
+ type: object
+ internal_handler.TextRelationExtractionRequest:
+ properties:
+ model_id:
+ type: string
+ tags:
items:
type: string
type: array
- output:
- description: Human-readable output
+ text:
type: string
- success:
- description: Whether the tool executed successfully
- type: boolean
- type: object
- types.UpdateMemberRoleRequest:
- properties:
- role:
- $ref: '#/definitions/types.OrgMemberRole'
required:
- - role
+ - model_id
+ - tags
+ - text
type: object
- types.UpdateOrganizationRequest:
+ internal_handler.UpdateAgentRequest:
properties:
avatar:
- description: optional avatar URL
- maxLength: 512
type: string
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CustomAgentConfig'
description:
- maxLength: 1000
type: string
- invite_code_validity_days:
- description: 0=never, 1, 7, 30
+ name:
+ type: string
+ type: object
+ internal_handler.UpdateChunkRequest:
+ properties:
+ chunk_index:
type: integer
- member_limit:
- description: max members; 0=unlimited
+ content:
+ type: string
+ embedding:
+ items:
+ type: number
+ type: array
+ end_at:
type: integer
- name:
- maxLength: 255
- minLength: 1
+ image_info:
type: string
- require_approval:
- type: boolean
- searchable:
- description: open for search so others can discover and join
+ is_enabled:
type: boolean
+ start_at:
+ type: integer
type: object
- types.UpdateSharePermissionRequest:
+ internal_handler.UpdateKnowledgeBaseRequest:
properties:
- permission:
- $ref: '#/definitions/types.OrgMemberRole'
+ config:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBaseConfig'
+ description:
+ type: string
+ name:
+ type: string
required:
- - permission
+ - name
type: object
- types.User:
+ internal_handler.UpdateModelRequest:
properties:
- avatar:
- description: Avatar URL of the user
+ description:
type: string
- can_access_all_tenants:
- description: Whether the user can access all tenants (cross-tenant access)
- type: boolean
- created_at:
- description: Creation time of the user
+ name:
type: string
- deleted_at:
- allOf:
- - $ref: '#/definitions/gorm.DeletedAt'
- description: Deletion time of the user
- email:
- description: Email address of the user
+ parameters:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelParameters'
+ source:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelSource'
+ type:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ModelType'
+ type: object
+ internal_handler.UpdateStoreRequest:
+ properties:
+ name:
type: string
- id:
- description: Unique identifier of the user
+ required:
+ - name
+ type: object
+ internal_handler.addSimilarQuestionsRequest:
+ properties:
+ similar_questions:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - similar_questions
+ type: object
+ internal_handler.updateLastFAQImportResultDisplayStatusRequest:
+ properties:
+ display_status:
+ enum:
+ - open
+ - close
type: string
- is_active:
- description: Whether the user is active
- type: boolean
- tenant:
- allOf:
- - $ref: '#/definitions/types.Tenant'
- description: Association relationship, not stored in the database
- tenant_id:
- description: Tenant ID that the user belongs to
- type: integer
- updated_at:
- description: Last updated time of the user
+ required:
+ - display_status
+ type: object
+ internal_handler_session.AttachmentUpload:
+ properties:
+ data:
+ description: Base64-encoded file content
type: string
- username:
- description: Username of the user
+ file_name:
+ description: Original filename
type: string
+ file_size:
+ description: File size in bytes
+ type: integer
type: object
- types.VLMConfig:
+ internal_handler_session.CreateKnowledgeQARequest:
properties:
- api_key:
- description: API Key
+ agent_enabled:
+ description: Whether agent mode is enabled for this request
+ type: boolean
+ agent_id:
+ description: Selected custom agent ID (backend resolves shared agent and its
+ tenant from share relation)
type: string
- base_url:
- description: Base URL
+ attachment_uploads:
+ description: Attached files (documents, audio, etc.)
+ items:
+ $ref: '#/definitions/internal_handler_session.AttachmentUpload'
+ type: array
+ channel:
+ description: 'Source channel: "web", "api", "im", etc.'
type: string
- enabled:
+ disable_title:
+ description: Whether to disable auto title generation
type: boolean
- interface_type:
- description: 'Interface Type: "ollama" or "openai"'
+ enable_memory:
+ description: Whether memory feature is enabled for this request
+ type: boolean
+ images:
+ description: Attached images for multimodal chat
+ items:
+ $ref: '#/definitions/internal_handler_session.ImageAttachment'
+ type: array
+ knowledge_base_ids:
+ description: Selected knowledge base ID for this request
+ items:
+ type: string
+ type: array
+ knowledge_ids:
+ description: Selected knowledge ID for this request
+ items:
+ type: string
+ type: array
+ mentioned_items:
+ description: '@mentioned knowledge bases and files'
+ items:
+ $ref: '#/definitions/internal_handler_session.MentionedItemRequest'
+ type: array
+ query:
+ description: Query text for knowledge base search
type: string
- model_id:
+ summary_model_id:
+ description: Optional summary model ID for this request (overrides session
+ default)
type: string
- model_name:
- description: |-
- 兼容老版本
- Model Name
+ web_search_enabled:
+ description: Whether web search is enabled for this request
+ type: boolean
+ required:
+ - query
+ type: object
+ internal_handler_session.CreateSessionRequest:
+ properties:
+ description:
+ description: Description for the session (optional)
+ type: string
+ title:
+ description: Title for the session (optional)
type: string
type: object
- types.WeKnoraCloudCredentials:
+ internal_handler_session.GenerateTitleRequest:
properties:
- app_id:
+ messages:
+ description: Messages to use as context for title generation
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Message'
+ type: array
+ required:
+ - messages
+ type: object
+ internal_handler_session.ImageAttachment:
+ properties:
+ caption:
+ description: VLM analysis result (context-aware, single call)
type: string
- app_secret:
+ data:
+ description: base64 data URI from frontend (data:image/png;base64,...)
+ type: string
+ url:
+ description: serving URL after saving to storage
type: string
type: object
- types.WebSearchConfig:
+ internal_handler_session.MentionedItemRequest:
properties:
- api_key:
- description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
+ id:
type: string
- blacklist:
- description: 黑名单规则列表
+ kb_type:
+ description: '"document" or "faq" (only for kb type)'
+ type: string
+ name:
+ type: string
+ type:
+ description: '"kb" for knowledge base, "file" for file'
+ type: string
+ type: object
+ internal_handler_session.SearchKnowledgeRequest:
+ properties:
+ knowledge_base_id:
+ description: Single knowledge base ID (for backward compatibility)
+ type: string
+ knowledge_base_ids:
+ description: IDs of knowledge bases to search (multi-KB support)
items:
type: string
type: array
- compression_method:
- description: 压缩方法:none, summary, extract, rag
+ knowledge_ids:
+ description: IDs of specific knowledge (files) to search
+ items:
+ type: string
+ type: array
+ query:
+ description: Query text to search for
type: string
- document_fragments:
- description: 文档片段数量(用于RAG压缩)
- type: integer
- embedding_dimension:
- description: 嵌入维度(用于RAG压缩)
- type: integer
- embedding_model_id:
- description: RAG压缩相关配置
+ required:
+ - query
+ type: object
+ internal_handler_session.StopSessionRequest:
+ properties:
+ message_id:
type: string
- include_date:
- description: 是否包含日期
+ required:
+ - message_id
+ type: object
+ internal_handler_session.batchDeleteRequest:
+ properties:
+ delete_all:
type: boolean
- max_results:
- description: 最大搜索结果数
- type: integer
- provider:
- description: 'Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.'
- type: string
- rerank_model_id:
- description: 重排模型ID(用于RAG压缩)
- type: string
+ ids:
+ items:
+ type: string
+ type: array
type: object
info:
contact:
@@ -3165,7 +3544,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -3182,68 +3561,445 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.CreateAgentRequest'
+ $ref: '#/definitions/internal_handler.CreateAgentRequest'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: 创建的智能体
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 创建智能体
+ tags:
+ - 智能体
+ /agents/{id}:
+ delete:
+ consumes:
+ - application/json
+ description: 删除指定的智能体
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除成功
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 无法删除内置智能体
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 删除智能体
+ tags:
+ - 智能体
+ get:
+ consumes:
+ - application/json
+ description: 根据ID获取智能体详情
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 智能体详情
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取智能体详情
+ tags:
+ - 智能体
+ put:
+ consumes:
+ - application/json
+ description: 更新智能体的名称、描述和配置
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 更新请求
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/internal_handler.UpdateAgentRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新后的智能体
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "403":
+ description: 无法修改内置智能体
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 更新智能体
+ tags:
+ - 智能体
+ /agents/{id}/copy:
+ post:
+ consumes:
+ - application/json
+ description: 复制指定的智能体
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: 复制成功
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 复制智能体
+ tags:
+ - 智能体
+ /agents/{id}/suggested-questions:
+ get:
+ consumes:
+ - application/json
+ description: 基于智能体关联的知识库,返回推荐问题供用户快捷提问
+ parameters:
+ - description: 智能体ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: 知识库ID列表(逗号分隔),覆盖智能体默认配置
+ in: query
+ name: knowledge_base_ids
+ type: string
+ - description: 知识ID列表(逗号分隔),限定到具体文档
+ in: query
+ name: knowledge_ids
+ type: string
+ - description: 返回数量上限(默认6)
+ in: query
+ name: limit
+ type: integer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 推荐问题列表
+ schema:
+ additionalProperties: true
+ type: object
+ "400":
+ description: 请求参数错误
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ "404":
+ description: 智能体不存在
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取推荐问题
+ tags:
+ - 智能体
+ /agents/placeholders:
+ get:
+ consumes:
+ - application/json
+ description: 获取所有可用的提示词占位符定义,按字段类型分组
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 占位符定义
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取占位符定义
+ tags:
+ - 智能体
+ /agents/type-presets:
+ get:
+ consumes:
+ - application/json
+ description: 返回所有 smart-reasoning 下可用的智能体类型预设(RAG/Wiki/Hybrid/Custom),用于编辑器自动填充系统提示词、工具和
+ KB 兼容性
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 预设列表
+ schema:
+ additionalProperties: true
+ type: object
+ security:
+ - Bearer: []
+ - ApiKeyAuth: []
+ summary: 获取智能体类型预设列表
+ tags:
+ - 智能体
+ /api/v1/datasource:
+ get:
+ description: List all data sources for a specific knowledge base
+ parameters:
+ - description: Knowledge base ID
+ in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ type: array
+ "400":
+ description: Bad Request
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ summary: List data sources for a knowledge base
+ tags:
+ - DataSource
+ post:
+ consumes:
+ - application/json
+ description: Create a new data source configuration for a knowledge base
+ parameters:
+ - description: Data source configuration
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: Created
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ "400":
+ description: Bad Request
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ summary: Create a new data source
+ tags:
+ - DataSource
+ /api/v1/datasource/{id}:
+ delete:
+ description: Delete a data source (soft delete)
+ parameters:
+ - description: Data source ID
+ in: path
+ name: id
+ required: true
+ type: string
+ responses:
+ "204":
+ description: No Content
+ "404":
+ description: Not Found
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ summary: Delete a data source
+ tags:
+ - DataSource
+ get:
+ description: Retrieve a data source configuration by ID
+ parameters:
+ - description: Data source ID
+ in: path
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
+ "404":
+ description: Not Found
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ summary: Get a data source by ID
+ tags:
+ - DataSource
+ put:
+ consumes:
+ - application/json
+ description: Update an existing data source configuration
+ parameters:
+ - description: Data source ID
+ in: path
+ name: id
+ required: true
+ type: string
+ - description: Updated configuration
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
produces:
- application/json
responses:
- "201":
- description: 创建的智能体
+ "200":
+ description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.DataSource'
"400":
- description: 请求参数错误
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 创建智能体
+ additionalProperties:
+ type: string
+ type: object
+ summary: Update a data source
tags:
- - 智能体
- /agents/{id}:
- delete:
- consumes:
- - application/json
- description: 删除指定的智能体
+ - DataSource
+ /api/v1/datasource/{id}/logs:
+ get:
+ description: Retrieve sync history for a data source
parameters:
- - description: 智能体ID
+ - description: Data source ID
in: path
name: id
required: true
type: string
+ - description: 'Limit (default: 10)'
+ in: query
+ name: limit
+ type: integer
+ - description: 'Offset (default: 0)'
+ in: query
+ name: offset
+ type: integer
produces:
- application/json
responses:
"200":
- description: 删除成功
+ description: OK
schema:
- additionalProperties: true
- type: object
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ type: array
"400":
- description: 请求参数错误
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- "403":
- description: 无法删除内置智能体
+ additionalProperties:
+ type: string
+ type: object
+ summary: Get sync logs
+ tags:
+ - DataSource
+ /api/v1/datasource/{id}/pause:
+ post:
+ description: Pause a data source's scheduled syncs
+ parameters:
+ - description: Data source ID
+ in: path
+ name: id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
schema:
- $ref: '#/definitions/errors.AppError'
- "404":
- description: 智能体不存在
+ additionalProperties:
+ type: string
+ type: object
+ "400":
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 删除智能体
+ additionalProperties:
+ type: string
+ type: object
+ summary: Pause data source
tags:
- - 智能体
+ - DataSource
+ /api/v1/datasource/{id}/resources:
get:
- consumes:
- - application/json
- description: 根据ID获取智能体详情
+ description: List resources available for sync in the external system
parameters:
- - description: 智能体ID
+ - description: Data source ID
in: path
name: id
required: true
@@ -3252,168 +4008,121 @@ paths:
- application/json
responses:
"200":
- description: 智能体详情
+ description: OK
schema:
- additionalProperties: true
- type: object
+ items:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Resource'
+ type: array
"400":
- description: 请求参数错误
- schema:
- $ref: '#/definitions/errors.AppError'
- "404":
- description: 智能体不存在
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 获取智能体详情
+ additionalProperties:
+ type: string
+ type: object
+ summary: List available resources in data source
tags:
- - 智能体
- put:
- consumes:
- - application/json
- description: 更新智能体的名称、描述和配置
+ - DataSource
+ /api/v1/datasource/{id}/resume:
+ post:
+ description: Resume a paused data source
parameters:
- - description: 智能体ID
+ - description: Data source ID
in: path
name: id
required: true
type: string
- - description: 更新请求
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/handler.UpdateAgentRequest'
- produces:
- - application/json
responses:
"200":
- description: 更新后的智能体
+ description: OK
schema:
- additionalProperties: true
+ additionalProperties:
+ type: string
type: object
"400":
- description: 请求参数错误
- schema:
- $ref: '#/definitions/errors.AppError'
- "403":
- description: 无法修改内置智能体
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 更新智能体
+ additionalProperties:
+ type: string
+ type: object
+ summary: Resume data source
tags:
- - 智能体
- /agents/{id}/copy:
+ - DataSource
+ /api/v1/datasource/{id}/sync:
post:
- consumes:
- - application/json
- description: 复制指定的智能体
+ description: Trigger an immediate sync for a data source
parameters:
- - description: 智能体ID
+ - description: Data source ID
in: path
name: id
required: true
type: string
- produces:
- - application/json
responses:
- "201":
- description: 复制成功
+ "200":
+ description: OK
schema:
- additionalProperties: true
- type: object
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
"400":
- description: 请求参数错误
- schema:
- $ref: '#/definitions/errors.AppError'
- "404":
- description: 智能体不存在
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 复制智能体
+ additionalProperties:
+ type: string
+ type: object
+ summary: Trigger immediate sync
tags:
- - 智能体
- /agents/{id}/suggested-questions:
- get:
- consumes:
- - application/json
- description: 基于智能体关联的知识库,返回推荐问题供用户快捷提问
+ - DataSource
+ /api/v1/datasource/{id}/validate:
+ post:
+ description: Validate the connection to an external data source
parameters:
- - description: 智能体ID
+ - description: Data source ID
in: path
name: id
required: true
type: string
- - description: 知识库ID列表(逗号分隔),覆盖智能体默认配置
- in: query
- name: knowledge_base_ids
- type: string
- - description: 知识ID列表(逗号分隔),限定到具体文档
- in: query
- name: knowledge_ids
- type: string
- - description: 返回数量上限(默认6)
- in: query
- name: limit
- type: integer
- produces:
- - application/json
responses:
"200":
- description: 推荐问题列表
+ description: OK
schema:
- additionalProperties: true
+ additionalProperties:
+ type: string
type: object
"400":
- description: 请求参数错误
- schema:
- $ref: '#/definitions/errors.AppError'
- "404":
- description: 智能体不存在
+ description: Bad Request
schema:
- $ref: '#/definitions/errors.AppError'
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 获取推荐问题
+ additionalProperties:
+ type: string
+ type: object
+ summary: Test data source connection
tags:
- - 智能体
- /agents/placeholders:
+ - DataSource
+ /api/v1/datasource/logs/{log_id}:
get:
- consumes:
- - application/json
- description: 获取所有可用的提示词占位符定义,按字段类型分组
+ description: Retrieve a specific sync log entry
+ parameters:
+ - description: Sync log ID
+ in: path
+ name: log_id
+ required: true
+ type: string
produces:
- application/json
responses:
"200":
- description: 占位符定义
+ description: OK
schema:
- additionalProperties: true
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SyncLog'
+ "404":
+ description: Not Found
+ schema:
+ additionalProperties:
+ type: string
type: object
- security:
- - Bearer: []
- - ApiKeyAuth: []
- summary: 获取占位符定义
+ summary: Get specific sync log
tags:
- - 智能体
- /api/v1/datasource:
- get:
- description: List all data sources for a specific knowledge base
- parameters:
- - description: Knowledge base ID
- in: query
- name: kb_id
- required: true
- type: string
+ - DataSource
+ /api/v1/datasource/types:
+ get:
+ description: Get list of available data source connectors
produces:
- application/json
responses:
@@ -3421,71 +4130,70 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/types.DataSource'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_datasource.ConnectorMetadata'
type: array
- "400":
- description: Bad Request
- schema:
- additionalProperties:
- type: string
- type: object
- summary: List data sources for a knowledge base
+ summary: Get available connectors
tags:
- DataSource
+ /api/v1/datasource/validate-credentials:
post:
consumes:
- application/json
- description: Create a new data source configuration for a knowledge base
+ description: Validate connectivity to an external data source using type + credentials
parameters:
- - description: Data source configuration
+ - description: type and credentials
in: body
name: request
required: true
schema:
- $ref: '#/definitions/types.DataSource'
+ type: object
produces:
- application/json
responses:
- "201":
- description: Created
+ "200":
+ description: OK
schema:
- $ref: '#/definitions/types.DataSource'
+ additionalProperties:
+ type: string
+ type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
- summary: Create a new data source
+ summary: Test connection with raw credentials (no persistence)
tags:
- DataSource
- /api/v1/datasource/{id}:
- delete:
- description: Delete a data source (soft delete)
+ /api/v1/knowledgebase/{kb_id}/wiki/auto-fix:
+ post:
+ description: Automatically fix fixable wiki issues (broken links, etc.)
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
+ produces:
+ - application/json
responses:
- "204":
- description: No Content
- "404":
- description: Not Found
+ "200":
+ description: OK
schema:
- additionalProperties:
- type: string
+ additionalProperties: true
type: object
- summary: Delete a data source
+ security:
+ - Bearer: []
+ summary: Auto-fix wiki issues
tags:
- - DataSource
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/graph:
get:
- description: Retrieve a data source configuration by ID
+ description: Returns the wiki link graph data for visualization
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
produces:
@@ -3494,65 +4202,50 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.DataSource'
- "404":
- description: Not Found
- schema:
- additionalProperties:
- type: string
- type: object
- summary: Get a data source by ID
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiGraphData'
+ security:
+ - Bearer: []
+ summary: Get wiki link graph
tags:
- - DataSource
- put:
- consumes:
- - application/json
- description: Update an existing data source configuration
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/index:
+ get:
+ description: Returns the wiki index page (creates default if not exists)
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
- - description: Updated configuration
- in: body
- name: request
- required: true
- schema:
- $ref: '#/definitions/types.DataSource'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/types.DataSource'
- "400":
- description: Bad Request
- schema:
- additionalProperties:
- type: string
- type: object
- summary: Update a data source
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ security:
+ - Bearer: []
+ summary: Get wiki index page
tags:
- - DataSource
- /api/v1/datasource/{id}/logs:
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/issues:
get:
- description: Retrieve sync history for a data source
+ description: List issues flagged on wiki pages with optional filtering
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
- - description: 'Limit (default: 10)'
+ - description: Filter by page slug
in: query
- name: limit
- type: integer
- - description: 'Offset (default: 0)'
+ name: slug
+ type: string
+ - description: Filter by status (pending, ignored, resolved)
in: query
- name: offset
- type: integer
+ name: status
+ type: string
produces:
- application/json
responses:
@@ -3560,26 +4253,37 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/types.SyncLog'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageIssue'
type: array
- "400":
- description: Bad Request
- schema:
- additionalProperties:
- type: string
- type: object
- summary: Get sync logs
+ security:
+ - Bearer: []
+ summary: List wiki page issues
tags:
- - DataSource
- /api/v1/datasource/{id}/pause:
- post:
- description: Pause a data source's scheduled syncs
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/issues/{issue_id}/status:
+ put:
+ consumes:
+ - application/json
+ description: Update the status of a flagged wiki page issue
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
+ required: true
+ type: string
+ - description: Issue ID
+ in: path
+ name: issue_id
required: true
type: string
+ - description: 'New status {''status'': ''ignored''}'
+ in: body
+ name: status
+ required: true
+ schema:
+ type: object
+ produces:
+ - application/json
responses:
"200":
description: OK
@@ -3590,19 +4294,19 @@ paths:
"400":
description: Bad Request
schema:
- additionalProperties:
- type: string
- type: object
- summary: Pause data source
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: Update wiki page issue status
tags:
- - DataSource
- /api/v1/datasource/{id}/resources:
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/lint:
get:
- description: List resources available for sync in the external system
+ description: Perform a comprehensive health check on the wiki
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
produces:
@@ -3611,119 +4315,249 @@ paths:
"200":
description: OK
schema:
- items:
- $ref: '#/definitions/types.Resource'
- type: array
- "400":
- description: Bad Request
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_application_service.WikiLintReport'
+ security:
+ - Bearer: []
+ summary: Run wiki lint
+ tags:
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/log:
+ get:
+ description: Returns the wiki operation log page (creates default if not exists)
+ parameters:
+ - description: Knowledge base ID
+ in: path
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
schema:
- additionalProperties:
- type: string
- type: object
- summary: List available resources in data source
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ security:
+ - Bearer: []
+ summary: Get wiki operation log
tags:
- - DataSource
- /api/v1/datasource/{id}/resume:
- post:
- description: Resume a paused data source
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/pages:
+ get:
+ description: List wiki pages with optional filtering and pagination
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
required: true
type: string
+ - description: Filter by page type
+ in: query
+ name: page_type
+ type: string
+ - description: Filter by status
+ in: query
+ name: status
+ type: string
+ - description: Full-text search
+ in: query
+ name: query
+ type: string
+ - description: Page number
+ in: query
+ name: page
+ type: integer
+ - description: Page size
+ in: query
+ name: page_size
+ type: integer
+ - description: Sort field
+ in: query
+ name: sort_by
+ type: string
+ - description: Sort order (asc/desc)
+ in: query
+ name: sort_order
+ type: string
+ produces:
+ - application/json
responses:
"200":
description: OK
schema:
- additionalProperties:
- type: string
- type: object
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPageListResponse'
"400":
description: Bad Request
schema:
- additionalProperties:
- type: string
- type: object
- summary: Resume data source
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: List wiki pages
tags:
- - DataSource
- /api/v1/datasource/{id}/sync:
+ - Wiki
post:
- description: Trigger an immediate sync for a data source
+ consumes:
+ - application/json
+ description: Create a new wiki page in the knowledge base
+ parameters:
+ - description: Knowledge base ID
+ in: path
+ name: kb_id
+ required: true
+ type: string
+ - description: Wiki page data
+ in: body
+ name: page
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ produces:
+ - application/json
+ responses:
+ "201":
+ description: Created
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ "400":
+ description: Bad Request
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: Create a wiki page
+ tags:
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/pages/{slug}:
+ delete:
+ description: Soft-delete a wiki page by slug
+ parameters:
+ - description: Knowledge base ID
+ in: path
+ name: kb_id
+ required: true
+ type: string
+ - description: Page slug
+ in: path
+ name: slug
+ required: true
+ type: string
+ responses:
+ "204":
+ description: No Content
+ "404":
+ description: Not Found
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: Delete a wiki page
+ tags:
+ - Wiki
+ get:
+ description: Retrieve a wiki page by its slug
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
+ required: true
+ type: string
+ - description: Page slug
+ in: path
+ name: slug
required: true
type: string
+ produces:
+ - application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/types.SyncLog'
- "400":
- description: Bad Request
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ "404":
+ description: Not Found
schema:
- additionalProperties:
- type: string
- type: object
- summary: Trigger immediate sync
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: Get a wiki page by slug
tags:
- - DataSource
- /api/v1/datasource/{id}/validate:
- post:
- description: Validate the connection to an external data source
+ - Wiki
+ put:
+ consumes:
+ - application/json
+ description: Update an existing wiki page by slug
parameters:
- - description: Data source ID
+ - description: Knowledge base ID
in: path
- name: id
+ name: kb_id
+ required: true
+ type: string
+ - description: Page slug
+ in: path
+ name: slug
required: true
type: string
+ - description: Updated wiki page data
+ in: body
+ name: page
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ produces:
+ - application/json
responses:
"200":
description: OK
schema:
- additionalProperties:
- type: string
- type: object
- "400":
- description: Bad Request
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
+ "404":
+ description: Not Found
schema:
- additionalProperties:
- type: string
- type: object
- summary: Test data source connection
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
+ security:
+ - Bearer: []
+ summary: Update a wiki page
tags:
- - DataSource
- /api/v1/datasource/logs/{log_id}:
- get:
- description: Retrieve a specific sync log entry
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/rebuild-links:
+ post:
+ description: Re-parse all pages and rebuild bidirectional link references
parameters:
- - description: Sync log ID
+ - description: Knowledge base ID
in: path
- name: log_id
+ name: kb_id
required: true
type: string
- produces:
- - application/json
responses:
"200":
description: OK
- schema:
- $ref: '#/definitions/types.SyncLog'
- "404":
- description: Not Found
schema:
additionalProperties:
type: string
type: object
- summary: Get specific sync log
+ security:
+ - Bearer: []
+ summary: Rebuild wiki links
tags:
- - DataSource
- /api/v1/datasource/types:
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/search:
get:
- description: Get list of available data source connectors
+ description: Full-text search over wiki pages
+ parameters:
+ - description: Knowledge base ID
+ in: path
+ name: kb_id
+ required: true
+ type: string
+ - description: Search query
+ in: query
+ name: q
+ required: true
+ type: string
+ - description: Max results (default 10)
+ in: query
+ name: limit
+ type: integer
produces:
- application/json
responses:
@@ -3731,41 +4565,34 @@ paths:
description: OK
schema:
items:
- $ref: '#/definitions/datasource.ConnectorMetadata'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiPage'
type: array
- summary: Get available connectors
+ security:
+ - Bearer: []
+ summary: Search wiki pages
tags:
- - DataSource
- /api/v1/datasource/validate-credentials:
- post:
- consumes:
- - application/json
- description: Validate connectivity to an external data source using type + credentials
+ - Wiki
+ /api/v1/knowledgebase/{kb_id}/wiki/stats:
+ get:
+ description: Returns aggregate statistics about the wiki
parameters:
- - description: type and credentials
- in: body
- name: request
+ - description: Knowledge base ID
+ in: path
+ name: kb_id
required: true
- schema:
- type: object
+ type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
- additionalProperties:
- type: string
- type: object
- "400":
- description: Bad Request
- schema:
- additionalProperties:
- type: string
- type: object
- summary: Test connection with raw credentials (no persistence)
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiStats'
+ security:
+ - Bearer: []
+ summary: Get wiki statistics
tags:
- - DataSource
+ - Wiki
/auth/auto-setup:
post:
consumes:
@@ -3777,11 +4604,11 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.LoginResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse'
"403":
description: 非 Lite 版本
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
summary: 自动初始化(Lite 桌面版)
tags:
- 认证
@@ -3813,7 +4640,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 修改密码
@@ -3830,18 +4657,18 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.LoginRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/types.LoginResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.LoginResponse'
"401":
description: 认证失败
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
summary: 用户登录
tags:
- 认证
@@ -3861,7 +4688,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 用户登出
@@ -3883,7 +4710,7 @@ paths:
"401":
description: 未授权
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 获取当前用户信息
@@ -3926,7 +4753,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.OIDCConfigResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCConfigResponse'
summary: 获取OIDC登录配置
tags:
- 认证
@@ -3947,15 +4774,15 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.OIDCAuthURLResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.OIDCAuthURLResponse'
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"403":
description: OIDC未启用
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
summary: 获取OIDC授权地址
tags:
- 认证
@@ -3985,7 +4812,7 @@ paths:
"401":
description: 令牌无效
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
summary: 刷新令牌
tags:
- 认证
@@ -4000,22 +4827,22 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.RegisterRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
- $ref: '#/definitions/types.RegisterResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RegisterResponse'
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"403":
description: 注册功能已禁用
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
summary: 用户注册
tags:
- 认证
@@ -4035,7 +4862,7 @@ paths:
"401":
description: 令牌无效
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 验证令牌
@@ -4063,7 +4890,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4101,7 +4928,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4135,11 +4962,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4166,7 +4993,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.UpdateChunkRequest'
+ $ref: '#/definitions/internal_handler.UpdateChunkRequest'
produces:
- application/json
responses:
@@ -4178,11 +5005,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4211,11 +5038,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4253,11 +5080,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 分块不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4286,7 +5113,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4303,7 +5130,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.EvaluationRequest'
+ $ref: '#/definitions/internal_handler.EvaluationRequest'
produces:
- application/json
responses:
@@ -4315,7 +5142,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4344,7 +5171,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4362,7 +5189,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.TextRelationExtractionRequest'
+ $ref: '#/definitions/internal_handler.TextRelationExtractionRequest'
produces:
- application/json
responses:
@@ -4374,7 +5201,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4408,7 +5235,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.FabriTextRequest'
+ $ref: '#/definitions/internal_handler.FabriTextRequest'
produces:
- application/json
responses:
@@ -4420,7 +5247,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4455,7 +5282,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4484,7 +5311,7 @@ paths:
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4506,7 +5333,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.KBModelConfigRequest'
+ $ref: '#/definitions/internal_handler.KBModelConfigRequest'
produces:
- application/json
responses:
@@ -4518,11 +5345,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4552,7 +5379,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4582,7 +5409,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4600,7 +5427,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.RemoteModelCheckRequest'
+ $ref: '#/definitions/internal_handler.RemoteModelCheckRequest'
produces:
- application/json
responses:
@@ -4612,7 +5439,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4642,7 +5469,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4694,7 +5521,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4723,7 +5550,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4765,7 +5592,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4800,7 +5627,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4833,7 +5660,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4877,7 +5704,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4894,7 +5721,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.KnowledgeBase'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.KnowledgeBase'
produces:
- application/json
responses:
@@ -4906,7 +5733,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4935,7 +5762,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4967,11 +5794,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -4993,7 +5820,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.UpdateKnowledgeBaseRequest'
+ $ref: '#/definitions/internal_handler.UpdateKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -5005,7 +5832,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5045,7 +5872,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5098,7 +5925,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5123,7 +5950,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.FAQBatchUpsertPayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQBatchUpsertPayload'
produces:
- application/json
responses:
@@ -5135,7 +5962,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5169,11 +5996,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 条目不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5200,7 +6027,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.FAQEntryPayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
produces:
- application/json
responses:
@@ -5212,7 +6039,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5240,7 +6067,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.addSimilarQuestionsRequest'
+ $ref: '#/definitions/internal_handler.addSimilarQuestionsRequest'
produces:
- application/json
responses:
@@ -5252,11 +6079,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 条目不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5284,7 +6111,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5307,7 +6134,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.FAQEntryFieldsBatchUpdate'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryFieldsBatchUpdate'
produces:
- application/json
responses:
@@ -5319,7 +6146,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5354,7 +6181,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5377,7 +6204,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.FAQEntryPayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQEntryPayload'
produces:
- application/json
responses:
@@ -5389,7 +6216,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5412,7 +6239,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.updateLastFAQImportResultDisplayStatusRequest'
+ $ref: '#/definitions/internal_handler.updateLastFAQImportResultDisplayStatusRequest'
produces:
- application/json
responses:
@@ -5424,11 +6251,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 知识库不存在或无导入记录
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5451,7 +6278,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.FAQSearchRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FAQSearchRequest'
produces:
- application/json
responses:
@@ -5463,7 +6290,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5486,7 +6313,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.SearchParams'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SearchParams'
produces:
- application/json
responses:
@@ -5498,7 +6325,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5527,11 +6354,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"403":
description: 权限不足
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5579,7 +6406,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5625,7 +6452,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"409":
description: 文件重复
schema:
@@ -5653,7 +6480,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.ManualKnowledgePayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload'
produces:
- application/json
responses:
@@ -5665,7 +6492,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5713,7 +6540,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"409":
description: URL重复
schema:
@@ -5747,7 +6574,7 @@ paths:
"404":
description: 知识库不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5769,7 +6596,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.ListSharesResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
security:
- Bearer: []
summary: 获取知识库的共享列表
@@ -5790,7 +6617,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.ShareKnowledgeBaseRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ShareKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -5857,7 +6684,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.UpdateSharePermissionRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateSharePermissionRequest'
produces:
- application/json
responses:
@@ -5909,7 +6736,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5950,7 +6777,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -5985,7 +6812,7 @@ paths:
in: body
name: body
schema:
- $ref: '#/definitions/handler.DeleteTagRequest'
+ $ref: '#/definitions/internal_handler.DeleteTagRequest'
produces:
- application/json
responses:
@@ -5997,7 +6824,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6036,7 +6863,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6054,7 +6881,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.CopyKnowledgeBaseRequest'
+ $ref: '#/definitions/internal_handler.CopyKnowledgeBaseRequest'
produces:
- application/json
responses:
@@ -6066,7 +6893,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6095,7 +6922,7 @@ paths:
"404":
description: 任务不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6124,7 +6951,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6152,11 +6979,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 知识不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6178,7 +7005,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.Knowledge'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Knowledge'
produces:
- application/json
responses:
@@ -6190,7 +7017,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6218,7 +7045,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6249,7 +7076,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6278,11 +7105,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"403":
description: 权限不足
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6322,7 +7149,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6365,7 +7192,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6388,7 +7215,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.ManualKnowledgePayload'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ManualKnowledgePayload'
produces:
- application/json
responses:
@@ -6400,7 +7227,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6445,7 +7272,7 @@ paths:
"400":
description: Invalid request
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6475,7 +7302,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6498,7 +7325,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6515,7 +7342,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.MCPService'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MCPService'
produces:
- application/json
responses:
@@ -6527,7 +7354,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6556,7 +7383,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6584,7 +7411,7 @@ paths:
"404":
description: 服务不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6618,7 +7445,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6647,7 +7474,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6676,7 +7503,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6705,7 +7532,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6739,7 +7566,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6777,7 +7604,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6814,7 +7641,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.SearchMessagesRequest'
+ $ref: '#/definitions/internal_handler.SearchMessagesRequest'
produces:
- application/json
responses:
@@ -6826,7 +7653,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6849,7 +7676,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6866,7 +7693,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.CreateModelRequest'
+ $ref: '#/definitions/internal_handler.CreateModelRequest'
produces:
- application/json
responses:
@@ -6878,7 +7705,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6907,7 +7734,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6935,7 +7762,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -6957,7 +7784,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.UpdateModelRequest'
+ $ref: '#/definitions/internal_handler.UpdateModelRequest'
produces:
- application/json
responses:
@@ -6969,7 +7796,7 @@ paths:
"404":
description: 模型不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7009,7 +7836,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.ListOrganizationsResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListOrganizationsResponse'
security:
- Bearer: []
summary: 获取我的组织列表
@@ -7025,7 +7852,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.CreateOrganizationRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.CreateOrganizationRequest'
produces:
- application/json
responses:
@@ -7107,7 +7934,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.UpdateOrganizationRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateOrganizationRequest'
produces:
- application/json
responses:
@@ -7141,7 +7968,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.InviteMemberRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.InviteMemberRequest'
produces:
- application/json
responses:
@@ -7236,7 +8063,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.ReviewJoinRequestRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ReviewJoinRequestRequest'
produces:
- application/json
responses:
@@ -7293,7 +8120,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.ListMembersResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListMembersResponse'
security:
- Bearer: []
summary: 获取组织成员列表
@@ -7348,7 +8175,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.UpdateMemberRoleRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.UpdateMemberRoleRequest'
produces:
- application/json
responses:
@@ -7382,7 +8209,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.RequestRoleUpgradeRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.RequestRoleUpgradeRequest'
produces:
- application/json
responses:
@@ -7495,7 +8322,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/types.ListSharesResponse'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.ListSharesResponse'
security:
- Bearer: []
summary: 获取组织的共享知识库列表
@@ -7512,7 +8339,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.JoinOrganizationRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinOrganizationRequest'
produces:
- application/json
responses:
@@ -7541,7 +8368,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.JoinByOrganizationIDRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.JoinByOrganizationIDRequest'
produces:
- application/json
responses:
@@ -7570,7 +8397,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.SubmitJoinRequestRequest'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SubmitJoinRequestRequest'
produces:
- application/json
responses:
@@ -7665,7 +8492,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7682,7 +8509,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.CreateSessionRequest'
+ $ref: '#/definitions/internal_handler_session.CreateSessionRequest'
produces:
- application/json
responses:
@@ -7694,7 +8521,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7723,7 +8550,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7751,7 +8578,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7773,7 +8600,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.Session'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Session'
produces:
- application/json
responses:
@@ -7785,7 +8612,7 @@ paths:
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7814,11 +8641,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 会话不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7841,7 +8668,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.CreateKnowledgeQARequest'
+ $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
produces:
- text/event-stream
responses:
@@ -7853,7 +8680,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7887,7 +8714,7 @@ paths:
"404":
description: 会话或消息不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7910,7 +8737,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.CreateKnowledgeQARequest'
+ $ref: '#/definitions/internal_handler_session.CreateKnowledgeQARequest'
produces:
- text/event-stream
responses:
@@ -7922,7 +8749,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7945,7 +8772,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.StopSessionRequest'
+ $ref: '#/definitions/internal_handler_session.StopSessionRequest'
produces:
- application/json
responses:
@@ -7957,7 +8784,7 @@ paths:
"404":
description: 会话或消息不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -7980,7 +8807,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.GenerateTitleRequest'
+ $ref: '#/definitions/internal_handler_session.GenerateTitleRequest'
produces:
- application/json
responses:
@@ -7992,7 +8819,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8010,7 +8837,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.batchDeleteRequest'
+ $ref: '#/definitions/internal_handler_session.batchDeleteRequest'
produces:
- application/json
responses:
@@ -8022,7 +8849,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8040,7 +8867,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler_session.SearchKnowledgeRequest'
+ $ref: '#/definitions/internal_handler_session.SearchKnowledgeRequest'
produces:
- application/json
responses:
@@ -8052,7 +8879,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8091,7 +8918,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8128,7 +8955,7 @@ paths:
"200":
description: 系统信息
schema:
- $ref: '#/definitions/handler.GetSystemInfoResponse'
+ $ref: '#/definitions/internal_handler.GetSystemInfoResponse'
summary: 获取系统信息
tags:
- 系统
@@ -8175,14 +9002,14 @@ paths:
name: body
required: true
schema:
- $ref: '#/definitions/handler.StorageCheckRequest'
+ $ref: '#/definitions/internal_handler.StorageCheckRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
- $ref: '#/definitions/handler.StorageCheckResponse'
+ $ref: '#/definitions/internal_handler.StorageCheckResponse'
summary: 测试存储引擎连通性
tags:
- 系统
@@ -8195,7 +9022,7 @@ paths:
"200":
description: OK
schema:
- $ref: '#/definitions/handler.GetStorageEngineStatusResponse'
+ $ref: '#/definitions/internal_handler.GetStorageEngineStatusResponse'
summary: 获取存储引擎状态
tags:
- 系统
@@ -8215,7 +9042,7 @@ paths:
"500":
description: 服务器错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 获取租户列表
@@ -8231,7 +9058,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.Tenant'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
produces:
- application/json
responses:
@@ -8243,7 +9070,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 创建租户
@@ -8271,7 +9098,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 删除租户
@@ -8298,11 +9125,11 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"404":
description: 租户不存在
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8324,7 +9151,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/types.Tenant'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.Tenant'
produces:
- application/json
responses:
@@ -8336,7 +9163,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 更新租户
@@ -8358,7 +9185,7 @@ paths:
"403":
description: 权限不足
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
summary: 获取所有租户列表
@@ -8386,7 +9213,7 @@ paths:
"400":
description: 不支持的键
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8420,7 +9247,7 @@ paths:
"400":
description: 不支持的键
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8443,7 +9270,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8466,7 +9293,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8489,7 +9316,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8512,7 +9339,7 @@ paths:
"400":
description: 请求参数错误
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8554,7 +9381,7 @@ paths:
"403":
description: 权限不足
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8594,7 +9421,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.CreateStoreRequest'
+ $ref: '#/definitions/internal_handler.CreateStoreRequest'
produces:
- application/json
responses:
@@ -8606,7 +9433,7 @@ paths:
"400":
description: Invalid request or validation error
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"401":
description: Unauthorized
schema:
@@ -8615,7 +9442,7 @@ paths:
"409":
description: Duplicate endpoint and index
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
security:
- Bearer: []
- ApiKeyAuth: []
@@ -8709,7 +9536,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.UpdateStoreRequest'
+ $ref: '#/definitions/internal_handler.UpdateStoreRequest'
produces:
- application/json
responses:
@@ -8785,7 +9612,7 @@ paths:
name: request
required: true
schema:
- $ref: '#/definitions/handler.TestStoreRequest'
+ $ref: '#/definitions/internal_handler.TestStoreRequest'
produces:
- application/json
responses:
@@ -8797,7 +9624,7 @@ paths:
"400":
description: Invalid request
schema:
- $ref: '#/definitions/errors.AppError'
+ $ref: '#/definitions/github_com_Tencent_WeKnora_internal_errors.AppError'
"401":
description: Unauthorized
schema:
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index f6f33385f..0daaa624d 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "knowledage-base",
- "version": "0.4.0",
+ "version": "0.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "knowledage-base",
- "version": "0.4.0",
+ "version": "0.5.0",
"dependencies": {
"@microsoft/fetch-event-source": "^2.0.1",
"@types/dompurify": "^3.0.5",
diff --git a/frontend/package.json b/frontend/package.json
index baaab4362..55722a4f1 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,6 +1,6 @@
{
"name": "knowledage-base",
- "version": "0.4.0",
+ "version": "0.5.0",
"private": true,
"type": "module",
"scripts": {
diff --git a/helm/Chart.yaml b/helm/Chart.yaml
index 787444cc1..086e36539 100644
--- a/helm/Chart.yaml
+++ b/helm/Chart.yaml
@@ -5,7 +5,7 @@ description: |
with document parsing, vector search, and LLM integration.
type: application
version: 0.1.0
-appVersion: "v0.4.0"
+appVersion: "v0.5.0"
kubeVersion: ">=1.25.0-0"
home: https://github.com/Tencent/WeKnora
icon: https://raw.githubusercontent.com/Tencent/WeKnora/main/docs/images/logo.png