mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 08:16:56 +08:00
change v1
This commit is contained in:
42
agent/llm_flow_extractor_test.go
Normal file
42
agent/llm_flow_extractor_test.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package agent
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSanitizeLLMExtractionForSkillSessionDoesNotInventModelProvider(t *testing.T) {
|
||||
session := skillSession{Name: "model_management", Action: "create"}
|
||||
result := llmFlowExtractionResult{
|
||||
Intent: "continue",
|
||||
Tasks: []llmFlowExtractionTask{{
|
||||
Skill: "model_management",
|
||||
Action: "create",
|
||||
Fields: map[string]string{
|
||||
"provider": "claw402",
|
||||
},
|
||||
}},
|
||||
}
|
||||
|
||||
sanitized := sanitizeLLMExtractionForSkillSession("新建一个模型", session, result)
|
||||
if got := sanitized.Tasks[0].Fields["provider"]; got != "" {
|
||||
t.Fatalf("expected provider guess to be stripped, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSanitizeLLMExtractionForSkillSessionKeepsExplicitModelProvider(t *testing.T) {
|
||||
session := skillSession{Name: "model_management", Action: "create"}
|
||||
result := llmFlowExtractionResult{
|
||||
Intent: "continue",
|
||||
Tasks: []llmFlowExtractionTask{{
|
||||
Skill: "model_management",
|
||||
Action: "create",
|
||||
Fields: map[string]string{
|
||||
"provider": "claw402",
|
||||
},
|
||||
}},
|
||||
}
|
||||
|
||||
sanitized := sanitizeLLMExtractionForSkillSession("新建一个 claw402 模型", session, result)
|
||||
if got := sanitized.Tasks[0].Fields["provider"]; got != "claw402" {
|
||||
t.Fatalf("expected explicit provider to remain, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user