实现酒店上下文单酒店收口

This commit is contained in:
andy
2026-07-10 15:31:51 +08:00
parent 7492c21350
commit d69f3975ef
52 changed files with 1183 additions and 188 deletions

View File

@@ -17,6 +17,7 @@
| 字段 | 默认值 | 中文说明 |
| --- | --- | --- |
| `hotel_id` | 后端解析 | SuperAgent 默认不传;单酒店阶段由 TH Hotel 后端从 `platform_hotel` 唯一 `ACTIVE` 酒店解析,兼容旧调用传入时必须与系统酒店一致。 |
| `source_provider` | `AGENTBUS` | 来源提供方 |
| `source_channel` | `EMAIL` | 来源渠道 |
@@ -65,8 +66,8 @@
"additionalProperties": false,
"properties": {
"hotel_id": {
"type": "string",
"description": "酒店上下文 ID"
"type": ["string", "null"],
"description": "可选酒店上下文 ID;默认由 TH Hotel 后端解析"
},
"group_code": {
"type": ["string", "null"],
@@ -93,7 +94,7 @@
"description": "历史线程 key 是否仅作为证据"
}
},
"required": ["hotel_id"]
"required": []
}
```
@@ -135,8 +136,8 @@ POST /api/ai-query/v1/case-context
"additionalProperties": false,
"properties": {
"hotel_id": {
"type": "string",
"description": "酒店上下文 ID"
"type": ["string", "null"],
"description": "可选酒店上下文 ID;默认由 TH Hotel 后端解析"
},
"object_id": {
"type": "string",
@@ -147,7 +148,7 @@ POST /api/ai-query/v1/case-context
"description": "调用方对象类型提示"
}
},
"required": ["hotel_id", "object_id"]
"required": ["object_id"]
}
```
@@ -193,8 +194,8 @@ SuperAgent 提交任务结果时的外部 `source_message_id`。
"additionalProperties": false,
"properties": {
"hotel_id": {
"type": "string",
"description": "酒店上下文 ID"
"type": ["string", "null"],
"description": "可选酒店上下文 ID;默认由 TH Hotel 后端解析"
},
"source_provider": {
"type": ["string", "null"],
@@ -213,7 +214,7 @@ SuperAgent 提交任务结果时的外部 `source_message_id`。
"description": "外部来源消息 ID可作为锚点反查会话"
}
},
"required": ["hotel_id"]
"required": []
}
```
@@ -221,7 +222,7 @@ SuperAgent 提交任务结果时的外部 `source_message_id`。
- `external_conversation_id``source_message_id` 至少一个非空。
- 两者同时传入时,后端按 `external_conversation_id` 查询为准。
- 查询`hotel_id + source_provider + source_channel + external_conversation_id` 隔离。
- 查询最终按“后端解析出的酒店 ID + source_provider + source_channel + external_conversation_id隔离。
### 5.4 输出
@@ -282,8 +283,8 @@ POST /api/ai-query/v1/message-conversation/tasks
"additionalProperties": false,
"properties": {
"hotel_id": {
"type": "string",
"description": "酒店上下文 ID"
"type": ["string", "null"],
"description": "可选酒店上下文 ID;默认由 TH Hotel 后端解析"
},
"source_provider": {
"type": ["string", "null"],
@@ -302,7 +303,7 @@ POST /api/ai-query/v1/message-conversation/tasks
"description": "外部来源消息 ID可作为锚点反查会话"
}
},
"required": ["hotel_id"]
"required": []
}
```
@@ -334,14 +335,14 @@ POST /api/ai-query/v1/message-conversation/messages
### 7.2 何时使用
- SuperAgent 已完成当前邮件的最终任务拆分。
- 已确认 `hotel_id`外部 `source_message_id` 来自 AgentBus payload。
- 已确认外部 `source_message_id` 来自 AgentBus payload`hotel_id` 由 TH Hotel 后端解析
- 需要把 AI 任务结果交给 TH Hotel 后端进入人工确认流程。
### 7.3 不应使用
- 不应在试探、草稿、未完成推理阶段调用。
- 不应把历史邮件中的外部来源消息 ID 当作当前邮件 ID 提交。
- 不应在缺少 `hotel_id``source_message_id` 时调用。
- 不应在缺少 `source_message_id` 时调用`hotel_id` 不需要 SuperAgent 提供
### 7.4 输入 Schema
@@ -351,8 +352,8 @@ POST /api/ai-query/v1/message-conversation/messages
"additionalProperties": false,
"properties": {
"hotel_id": {
"type": "string",
"description": "酒店上下文 ID"
"type": ["string", "null"],
"description": "可选酒店上下文 ID;默认由 TH Hotel 后端解析"
},
"source_provider": {
"type": ["string", "null"],
@@ -381,7 +382,7 @@ POST /api/ai-query/v1/message-conversation/messages
}
}
},
"required": ["hotel_id", "source_message_id", "ai_task_results"]
"required": ["source_message_id", "ai_task_results"]
}
```