feat(agent): add question suggestions with after-answer follow-ups
Enable agents to configure starter prompts and async follow-up questions after completed answers, with durable caching, analytics events, and chat/embed UI integration.
This commit is contained in:
+19
-1
@@ -493,9 +493,27 @@ curl --location 'http://localhost:8080/api/v1/agents/placeholders' \
|
||||
|
||||
### 推荐问题设置
|
||||
|
||||
`question_suggestions` 是智能体拥有的统一策略。网页嵌入等渠道只能关闭展示,不能覆盖内容或生成规则。
|
||||
|
||||
| 参数 | 类型 | 默认值 | 说明 |
|
||||
|------|------|--------|------|
|
||||
| `suggested_prompts` | []string | - | 推荐问题列表,用于在前端对话面板展示快捷提问 |
|
||||
| `question_suggestions.starters.enabled` | bool | true | 是否在首次提问前展示开场问题 |
|
||||
| `question_suggestions.starters.mode` | string | `hybrid` | `curated`、`knowledge` 或 `hybrid` |
|
||||
| `question_suggestions.starters.items` | []string | `[]` | 运营配置的开场问题 |
|
||||
| `question_suggestions.starters.count` | int | 6 | 展示数量,范围 1-8 |
|
||||
| `question_suggestions.follow_ups.enabled` | bool | false | 是否在每次完整回答后异步生成追问 |
|
||||
| `question_suggestions.follow_ups.mode` | string | `hybrid` | `generated`、`knowledge` 或 `hybrid` |
|
||||
| `question_suggestions.follow_ups.count` | int | 3 | 生成数量,范围 1-5 |
|
||||
| `question_suggestions.follow_ups.model_id` | string | - | 独立生成模型;为空使用本轮对话模型 |
|
||||
| `question_suggestions.follow_ups.categories` | []string | `clarify,deepen,action` | 允许的问题类型 |
|
||||
| `question_suggestions.follow_ups.max_context_turns` | int | 2 | 生成时使用的最近对话轮数,范围 1-5 |
|
||||
| `question_suggestions.follow_ups.additional_instruction` | string | - | 智能体作者的附加生成要求 |
|
||||
| `question_suggestions.follow_ups.suppress_on_fallback` | bool | true | 兜底回答后不展示 |
|
||||
| `question_suggestions.follow_ups.suppress_when_answer_asks_question` | bool | true | 回答本身以问题结尾时不展示 |
|
||||
| `question_suggestions.follow_ups.knowledge_fallback` | bool | true | 模型失败时使用知识库候选补位 |
|
||||
| `question_suggestions.follow_ups.allow_regenerate` | bool | false | 是否允许用户换一批 |
|
||||
|
||||
旧 `suggested_prompts` 会在数据库迁移时一次性写入 `starters.items`,API 不再接受该字段。
|
||||
|
||||
### 高级设置
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
| POST | `/knowledge-chat/:session_id` | 基于知识库的问答 |
|
||||
| POST | `/agent-chat/:session_id` | 基于 Agent 的智能问答 |
|
||||
| POST | `/knowledge-search` | 基于知识库的搜索知识 |
|
||||
| GET | `/sessions/:session_id/messages/:message_id/suggestions` | 获取已生成的回答后推荐 |
|
||||
| POST | `/sessions/:session_id/messages/:message_id/suggestions` | 确保生成或换一批推荐 |
|
||||
| POST | `/sessions/:session_id/suggestion-events` | 上报曝光、点击、关闭事件 |
|
||||
|
||||
## POST `/knowledge-chat/:session_id` - 基于知识库的问答
|
||||
|
||||
@@ -26,6 +29,7 @@
|
||||
| `enable_memory` | bool | 否 | 是否启用记忆功能 |
|
||||
| `images` | object[] | 否 | 附带的图片(base64 格式),需要 Agent 启用图片上传 |
|
||||
| `channel` | string | 否 | 来源渠道标识:`web`、`api`、`im`、`browser_extension` |
|
||||
| `suggestion_attribution` | object | 否 | 用户从推荐问题发起本轮时传入 `{suggestion_set_id, question_id}`;服务端会校验归属 |
|
||||
|
||||
**请求**:
|
||||
|
||||
@@ -76,6 +80,33 @@ Agent 模式支持更智能的问答,包括工具调用、网络搜索、多
|
||||
| `enable_memory` | bool | 否 | 是否启用记忆功能 |
|
||||
| `images` | object[] | 否 | 附带的图片(base64 格式),需要 Agent 启用图片上传 |
|
||||
| `channel` | string | 否 | 来源渠道标识:`web`、`api`、`im`、`browser_extension` |
|
||||
| `suggestion_attribution` | object | 否 | 用户从推荐问题发起本轮时传入 `{suggestion_set_id, question_id}`;服务端会校验归属 |
|
||||
|
||||
## 回答后推荐问题
|
||||
|
||||
回答主消息完成后,服务端会异步生成推荐问题,不阻塞 SSE 的 `complete`/`done` 事件。生成结果按“租户、助手消息、位置、配置快照、语言”持久化并去重。
|
||||
|
||||
```http
|
||||
POST /api/v1/sessions/{session_id}/messages/{message_id}/suggestions
|
||||
Content-Type: application/json
|
||||
|
||||
{"regenerate": false}
|
||||
```
|
||||
|
||||
状态包括 `generating`、`ready`、`suppressed`、`failed`。`ready` 时的每个问题都有稳定 `id`,点击后应先上报事件,并在下一次聊天请求中携带 `suggestion_attribution`。
|
||||
|
||||
```http
|
||||
POST /api/v1/sessions/{session_id}/suggestion-events
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"suggestion_set_id": "...",
|
||||
"question_id": "...",
|
||||
"event_type": "click"
|
||||
}
|
||||
```
|
||||
|
||||
网页嵌入提供同构接口:`/api/v1/embed/{channel_id}/sessions/{session_id}/...`,继续使用嵌入令牌和 `X-Embed-Session`。
|
||||
|
||||
**mentioned_items 结构**:
|
||||
|
||||
|
||||
+276
-7
@@ -10674,6 +10674,111 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/messages/{message_id}/suggestions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"会话"
|
||||
],
|
||||
"summary": "获取回答后推荐问题",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "会话 ID",
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "助手消息 ID",
|
||||
"name": "message_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "对已完成的助手消息异步生成或重新生成推荐问题;相同配置快照会复用持久化结果",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"会话"
|
||||
],
|
||||
"summary": "确保生成回答后推荐问题",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "会话 ID",
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "助手消息 ID",
|
||||
"name": "message_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "生成选项",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_handler.EnsureMessageSuggestionsRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"202": {
|
||||
"description": "Accepted",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/pin": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -10774,6 +10879,49 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/suggestion-events": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "记录曝光、点击或关闭事件",
|
||||
"consumes": [
|
||||
"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.SuggestionEventRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No Content"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/title": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -14481,6 +14629,14 @@ const docTemplate = `{
|
||||
"description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
|
||||
"type": "string"
|
||||
},
|
||||
"question_suggestions": {
|
||||
"description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rerank_model_id": {
|
||||
"description": "ReRank model ID for retrieval",
|
||||
"type": "string"
|
||||
@@ -14520,13 +14676,6 @@ const docTemplate = `{
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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",
|
||||
@@ -14921,6 +15070,47 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"additional_instruction": {
|
||||
"type": "string"
|
||||
},
|
||||
"allow_regenerate": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"categories": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"knowledge_fallback": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"max_context_turns": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
},
|
||||
"model_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suppress_on_fallback": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"suppress_when_answer_asks_question": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.GraphNode": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -16123,6 +16313,10 @@ const docTemplate = `{
|
||||
"description": "Agent total execution duration in milliseconds (from query start to answer start)",
|
||||
"type": "integer"
|
||||
},
|
||||
"agent_id": {
|
||||
"description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
|
||||
"type": "string"
|
||||
},
|
||||
"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",
|
||||
@@ -16194,6 +16388,10 @@ const docTemplate = `{
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
|
||||
}
|
||||
},
|
||||
"model_id": {
|
||||
"description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
|
||||
"type": "string"
|
||||
},
|
||||
"request_id": {
|
||||
"description": "Request identifier for tracking API requests",
|
||||
"type": "string"
|
||||
@@ -16784,6 +16982,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"follow_ups": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
|
||||
},
|
||||
"starters": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.QueueStat": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -17424,6 +17633,26 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.StorageConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -17536,6 +17765,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suggestion_set_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.SyncLog": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -19060,6 +19300,14 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.EnsureMessageSuggestionsRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"regenerate": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.EvaluationRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -20015,6 +20263,24 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.SuggestionEventRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"event_type",
|
||||
"suggestion_set_id"
|
||||
],
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suggestion_set_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.TestProviderRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -20533,6 +20799,9 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"suggestion_attribution": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionAttribution"
|
||||
},
|
||||
"summary_model_id": {
|
||||
"description": "Optional summary model ID for this request (overrides session default)",
|
||||
"type": "string"
|
||||
|
||||
+276
-7
@@ -10667,6 +10667,111 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/messages/{message_id}/suggestions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"会话"
|
||||
],
|
||||
"summary": "获取回答后推荐问题",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "会话 ID",
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "助手消息 ID",
|
||||
"name": "message_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "对已完成的助手消息异步生成或重新生成推荐问题;相同配置快照会复用持久化结果",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"会话"
|
||||
],
|
||||
"summary": "确保生成回答后推荐问题",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "会话 ID",
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "助手消息 ID",
|
||||
"name": "message_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "生成选项",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_handler.EnsureMessageSuggestionsRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"202": {
|
||||
"description": "Accepted",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/pin": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -10767,6 +10872,49 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/suggestion-events": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
},
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "记录曝光、点击或关闭事件",
|
||||
"consumes": [
|
||||
"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.SuggestionEventRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No Content"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sessions/{session_id}/title": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -14474,6 +14622,14 @@
|
||||
"description": "Dedicated chat model ID for the query-understanding (rewrite + intent) step.\nWhen empty, the main conversation ModelID is used as a fallback.",
|
||||
"type": "string"
|
||||
},
|
||||
"question_suggestions": {
|
||||
"description": "===== Conversation Question Suggestions =====\nQuestionSuggestions owns both the static/knowledge-backed prompts shown\nbefore the first user turn and the contextual follow-up questions shown\nafter a completed assistant answer.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rerank_model_id": {
|
||||
"description": "ReRank model ID for retrieval",
|
||||
"type": "string"
|
||||
@@ -14513,13 +14669,6 @@
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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",
|
||||
@@ -14914,6 +15063,47 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"additional_instruction": {
|
||||
"type": "string"
|
||||
},
|
||||
"allow_regenerate": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"categories": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"knowledge_fallback": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"max_context_turns": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
},
|
||||
"model_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suppress_on_fallback": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"suppress_when_answer_asks_question": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.GraphNode": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -16116,6 +16306,10 @@
|
||||
"description": "Agent total execution duration in milliseconds (from query start to answer start)",
|
||||
"type": "integer"
|
||||
},
|
||||
"agent_id": {
|
||||
"description": "AgentID is the agent used for this individual assistant turn. Unlike the\nsession's last_request_state it remains stable when users switch agents.",
|
||||
"type": "string"
|
||||
},
|
||||
"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",
|
||||
@@ -16187,6 +16381,10 @@
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem"
|
||||
}
|
||||
},
|
||||
"model_id": {
|
||||
"description": "ModelID is the requested/effective chat model binding captured for this\nturn. It is useful for reproducibility and suggestion generation.",
|
||||
"type": "string"
|
||||
},
|
||||
"request_id": {
|
||||
"description": "Request identifier for tracking API requests",
|
||||
"type": "string"
|
||||
@@ -16777,6 +16975,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"follow_ups": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig"
|
||||
},
|
||||
"starters": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.QueueStat": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -17417,6 +17626,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"mode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.StorageConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -17529,6 +17758,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.SuggestionAttribution": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suggestion_set_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github_com_Tencent_WeKnora_internal_types.SyncLog": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -19053,6 +19293,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.EnsureMessageSuggestionsRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"regenerate": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.EvaluationRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -20008,6 +20256,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.SuggestionEventRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"event_type",
|
||||
"suggestion_set_id"
|
||||
],
|
||||
"properties": {
|
||||
"event_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"question_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"suggestion_set_id": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handler.TestProviderRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -20526,6 +20792,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"suggestion_attribution": {
|
||||
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionAttribution"
|
||||
},
|
||||
"summary_model_id": {
|
||||
"description": "Optional summary model ID for this request (overrides session default)",
|
||||
"type": "string"
|
||||
|
||||
+183
-7
@@ -713,6 +713,14 @@ definitions:
|
||||
Dedicated chat model ID for the query-understanding (rewrite + intent) step.
|
||||
When empty, the main conversation ModelID is used as a fallback.
|
||||
type: string
|
||||
question_suggestions:
|
||||
allOf:
|
||||
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig'
|
||||
description: |-
|
||||
===== Conversation Question Suggestions =====
|
||||
QuestionSuggestions owns both the static/knowledge-backed prompts shown
|
||||
before the first user turn and the contextual follow-up questions shown
|
||||
after a completed assistant answer.
|
||||
rerank_model_id:
|
||||
description: ReRank model ID for retrieval
|
||||
type: string
|
||||
@@ -747,13 +755,6 @@ definitions:
|
||||
===== 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 =====
|
||||
@@ -1045,6 +1046,33 @@ definitions:
|
||||
required:
|
||||
- query_text
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig:
|
||||
properties:
|
||||
additional_instruction:
|
||||
type: string
|
||||
allow_regenerate:
|
||||
type: boolean
|
||||
categories:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
count:
|
||||
type: integer
|
||||
enabled:
|
||||
type: boolean
|
||||
knowledge_fallback:
|
||||
type: boolean
|
||||
max_context_turns:
|
||||
type: integer
|
||||
mode:
|
||||
type: string
|
||||
model_id:
|
||||
type: string
|
||||
suppress_on_fallback:
|
||||
type: boolean
|
||||
suppress_when_answer_asks_question:
|
||||
type: boolean
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.GraphNode:
|
||||
properties:
|
||||
attributes:
|
||||
@@ -1938,6 +1966,11 @@ definitions:
|
||||
description: Agent total execution duration in milliseconds (from query start
|
||||
to answer start)
|
||||
type: integer
|
||||
agent_id:
|
||||
description: |-
|
||||
AgentID is the agent used for this individual assistant turn. Unlike the
|
||||
session's last_request_state it remains stable when users switch agents.
|
||||
type: string
|
||||
agent_steps:
|
||||
description: |-
|
||||
Agent execution steps (only for assistant messages generated by agent)
|
||||
@@ -1997,6 +2030,11 @@ definitions:
|
||||
items:
|
||||
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.MentionedItem'
|
||||
type: array
|
||||
model_id:
|
||||
description: |-
|
||||
ModelID is the requested/effective chat model binding captured for this
|
||||
turn. It is useful for reproducibility and suggestion generation.
|
||||
type: string
|
||||
request_id:
|
||||
description: Request identifier for tracking API requests
|
||||
type: string
|
||||
@@ -2447,6 +2485,13 @@ definitions:
|
||||
10)'
|
||||
type: integer
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.QuestionSuggestionConfig:
|
||||
properties:
|
||||
follow_ups:
|
||||
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.FollowUpSuggestionConfig'
|
||||
starters:
|
||||
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig'
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.QueueStat:
|
||||
properties:
|
||||
active:
|
||||
@@ -2928,6 +2973,19 @@ definitions:
|
||||
- organization_id
|
||||
- permission
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.StarterSuggestionConfig:
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
enabled:
|
||||
type: boolean
|
||||
items:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
mode:
|
||||
type: string
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.StorageConfig:
|
||||
properties:
|
||||
app_id:
|
||||
@@ -3006,6 +3064,13 @@ definitions:
|
||||
required:
|
||||
- invite_code
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.SuggestionAttribution:
|
||||
properties:
|
||||
question_id:
|
||||
type: string
|
||||
suggestion_set_id:
|
||||
type: string
|
||||
type: object
|
||||
github_com_Tencent_WeKnora_internal_types.SyncLog:
|
||||
properties:
|
||||
created_at:
|
||||
@@ -4179,6 +4244,11 @@ definitions:
|
||||
type: integer
|
||||
type: array
|
||||
type: object
|
||||
internal_handler.EnsureMessageSuggestionsRequest:
|
||||
properties:
|
||||
regenerate:
|
||||
type: boolean
|
||||
type: object
|
||||
internal_handler.EvaluationRequest:
|
||||
properties:
|
||||
chat_id:
|
||||
@@ -4848,6 +4918,18 @@ definitions:
|
||||
description: '"local", "minio", "cos", "tos", "s3", "oss", "ks3"'
|
||||
type: string
|
||||
type: object
|
||||
internal_handler.SuggestionEventRequest:
|
||||
properties:
|
||||
event_type:
|
||||
type: string
|
||||
question_id:
|
||||
type: string
|
||||
suggestion_set_id:
|
||||
type: string
|
||||
required:
|
||||
- event_type
|
||||
- suggestion_set_id
|
||||
type: object
|
||||
internal_handler.TestProviderRequest:
|
||||
properties:
|
||||
parameters:
|
||||
@@ -5213,6 +5295,8 @@ definitions:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
suggestion_attribution:
|
||||
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SuggestionAttribution'
|
||||
summary_model_id:
|
||||
description: Optional summary model ID for this request (overrides session
|
||||
default)
|
||||
@@ -12017,6 +12101,72 @@ paths:
|
||||
summary: 知识问答
|
||||
tags:
|
||||
- 问答
|
||||
/sessions/{session_id}/messages/{message_id}/suggestions:
|
||||
get:
|
||||
parameters:
|
||||
- description: 会话 ID
|
||||
in: path
|
||||
name: session_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 助手消息 ID
|
||||
in: path
|
||||
name: message_id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
security:
|
||||
- Bearer: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 获取回答后推荐问题
|
||||
tags:
|
||||
- 会话
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 对已完成的助手消息异步生成或重新生成推荐问题;相同配置快照会复用持久化结果
|
||||
parameters:
|
||||
- description: 会话 ID
|
||||
in: path
|
||||
name: session_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 助手消息 ID
|
||||
in: path
|
||||
name: message_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 生成选项
|
||||
in: body
|
||||
name: request
|
||||
schema:
|
||||
$ref: '#/definitions/internal_handler.EnsureMessageSuggestionsRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
"202":
|
||||
description: Accepted
|
||||
schema:
|
||||
additionalProperties: true
|
||||
type: object
|
||||
security:
|
||||
- Bearer: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 确保生成回答后推荐问题
|
||||
tags:
|
||||
- 会话
|
||||
/sessions/{session_id}/pin:
|
||||
post:
|
||||
description: 将指定会话置顶(用户维度)
|
||||
@@ -12079,6 +12229,32 @@ paths:
|
||||
summary: 停止生成
|
||||
tags:
|
||||
- 问答
|
||||
/sessions/{session_id}/suggestion-events:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 记录曝光、点击或关闭事件
|
||||
parameters:
|
||||
- description: 会话 ID
|
||||
in: path
|
||||
name: session_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 事件
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/internal_handler.SuggestionEventRequest'
|
||||
responses:
|
||||
"204":
|
||||
description: No Content
|
||||
security:
|
||||
- Bearer: []
|
||||
- ApiKeyAuth: []
|
||||
summary: 上报推荐问题事件
|
||||
tags:
|
||||
- 会话
|
||||
/sessions/{session_id}/title:
|
||||
post:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user