fix: reminder platform 改用 AdapterName(唯一标识符),不再硬编码 obv11
- ProcessParams/SynthesizeParams 新增 AdapterName - main.go 传递 req.Source.AdapterName - reminder_create 自动注入使用 adapter 名而非平台类型 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1086,6 +1086,7 @@ func handleChat(
|
|||||||
ChannelType: req.Source.ChannelType,
|
ChannelType: req.Source.ChannelType,
|
||||||
ChannelID: req.Source.ChannelID,
|
ChannelID: req.Source.ChannelID,
|
||||||
BotUID: req.Source.BotUID,
|
BotUID: req.Source.BotUID,
|
||||||
|
AdapterName: req.Source.AdapterName,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fallback := getFallbackMessage()
|
fallback := getFallbackMessage()
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ type ProcessParams struct {
|
|||||||
ChannelType string // direct / group
|
ChannelType string // direct / group
|
||||||
ChannelID string // platform channel ID (group ID or private OBv11 number)
|
ChannelID string // platform channel ID (group ID or private OBv11 number)
|
||||||
BotUID string // bot's own platform UID (e.g., OBv11 account)
|
BotUID string // bot's own platform UID (e.g., OBv11 account)
|
||||||
|
AdapterName string // adapter config name for routing
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProcessResult 处理结果
|
// ProcessResult 处理结果
|
||||||
@@ -430,6 +431,7 @@ func (o *Orchestrator) ProcessInput(
|
|||||||
Mode: params.Mode,
|
Mode: params.Mode,
|
||||||
ChannelType: params.ChannelType,
|
ChannelType: params.ChannelType,
|
||||||
ChannelID: params.ChannelID,
|
ChannelID: params.ChannelID,
|
||||||
|
AdapterName: params.AdapterName,
|
||||||
}
|
}
|
||||||
if prevEnrichment != nil {
|
if prevEnrichment != nil {
|
||||||
synthParams.MemorySummary = prevEnrichment.MemorySummary
|
synthParams.MemorySummary = prevEnrichment.MemorySummary
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ type SynthesizeParams struct {
|
|||||||
Mode string // text / voice_assistant
|
Mode string // text / voice_assistant
|
||||||
ChannelType string // direct / group
|
ChannelType string // direct / group
|
||||||
ChannelID string // platform channel ID
|
ChannelID string // platform channel ID
|
||||||
|
AdapterName string // adapter config name
|
||||||
}
|
}
|
||||||
|
|
||||||
// Synthesize 综合所有子会话结果,流式生成最终回复。
|
// Synthesize 综合所有子会话结果,流式生成最终回复。
|
||||||
@@ -97,7 +98,7 @@ func (s *Synthesizer) Synthesize(ctx context.Context, params SynthesizeParams, e
|
|||||||
// 自动注入当前会话的平台信息(reminder_create 需要知道来源)
|
// 自动注入当前会话的平台信息(reminder_create 需要知道来源)
|
||||||
if tc.Name == "reminder_create" && params.ChannelType != "" {
|
if tc.Name == "reminder_create" && params.ChannelType != "" {
|
||||||
if _, ok := args["platform"]; !ok || args["platform"] == "" {
|
if _, ok := args["platform"]; !ok || args["platform"] == "" {
|
||||||
args["platform"] = "obv11"
|
args["platform"] = params.AdapterName
|
||||||
}
|
}
|
||||||
if _, ok := args["channel_type"]; !ok || args["channel_type"] == "" {
|
if _, ok := args["channel_type"]; !ok || args["channel_type"] == "" {
|
||||||
args["channel_type"] = params.ChannelType
|
args["channel_type"] = params.ChannelType
|
||||||
|
|||||||
Reference in New Issue
Block a user