feat(intent): 增强目标市场槽位意图匹配与上下文兼容推断
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
weichen
co-authored by
Cursor
parent
2597a4555b
commit
e2ca8ad55a
@@ -256,6 +256,12 @@ func (a *ContextAssembler) AssembleFromWorkspace(workDir string, user UserInfo)
|
||||
ctx.Project.TargetMarket = wsMeta.TargetMarket
|
||||
ctx.Project.CurrentWorkflow = wsMeta.TaskKey
|
||||
}
|
||||
} else {
|
||||
// 备选:从目录名推断
|
||||
baseName := filepath.Base(workDir)
|
||||
if strings.HasPrefix(baseName, "intake_") {
|
||||
ctx.Project.CurrentWorkflow = "intake"
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 尝试读取 blackboard.json
|
||||
@@ -275,7 +281,7 @@ func (a *ContextAssembler) AssembleFromWorkspace(workDir string, user UserInfo)
|
||||
}
|
||||
|
||||
// 3. 尝试提取阶段与文档
|
||||
if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.1") {
|
||||
if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.1") || ctx.Project.CurrentWorkflow == "intake" {
|
||||
ctx.Project.CurrentStage = bizdev.StageV01_Triage
|
||||
} else if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.5") {
|
||||
ctx.Project.CurrentStage = bizdev.StageV05_Feasibility
|
||||
|
||||
@@ -305,6 +305,7 @@ func extractFactSlots(input string) map[string]string {
|
||||
|
||||
// 目标市场
|
||||
marketPrefixes := []string{
|
||||
"目标市场不仅是", "目标市场不仅有", "目标市场还包括", "目标市场确定为", "目标市场确定是",
|
||||
"目标市场改成", "目标市场改为", "目标市场是", "目标市场为",
|
||||
"市场改成", "市场改为", "市场是", "市场为", "目标市场除了国内还想考虑",
|
||||
}
|
||||
@@ -400,8 +401,8 @@ func matchAdvanceStage(input string, currentStage bizdev.MaturityStage) *Candida
|
||||
|
||||
func matchSupplementInfo(input string) *CandidateIntent {
|
||||
patterns := []string{
|
||||
"补充", "更新", "客户说", "客户反馈", "修改为", "改为", "增加",
|
||||
"市场是", "参数是", "用途是", "设备是", "预算是", "时间是", "资料", "附件",
|
||||
"补充", "更新", "客户说", "客户反馈", "客户确定", "修改为", "改为", "增加",
|
||||
"目标市场", "市场是", "参数是", "用途是", "设备是", "预算是", "时间是", "资料", "附件",
|
||||
}
|
||||
|
||||
matchedAny := false
|
||||
|
||||
Reference in New Issue
Block a user