Files
ai-agent/cmd/testdata/aiagent/init_test.go
T
mlogclub 031855935d Add quick reply, skill definition, and tag seeds for multilingual support
- Implemented QuickReplySeed structure and seeds for both English and Chinese languages.
- Created SkillDefinitionSeed structure with detailed instructions and examples for the "After-sales Escalation" skill in both languages.
- Added TagSeed structure and corresponding seeds for categorizing inquiries in English and Chinese.
- Refactored skill and tag initialization to utilize the new seed structures, ensuring proper data handling and multilingual support.
- Updated tests to verify that English seeds do not contain Chinese text, ensuring data integrity.
2026-06-01 12:15:41 +08:00

22 lines
573 B
Go

package aiagent
import (
"agent-desk/cmd/testdata/seedlang"
"agent-desk/cmd/testdata/seeds"
"regexp"
"testing"
)
var hanTextPattern = regexp.MustCompile(`\p{Han}`)
func TestEnglishAIAgentSeedDoesNotContainChineseText(t *testing.T) {
for _, item := range seeds.AIAgentSeeds(seedlang.English) {
values := []string{item.Name, item.Description, item.SystemPrompt, item.WelcomeMessage, item.FallbackMessage}
for _, value := range values {
if hanTextPattern.MatchString(value) {
t.Fatalf("english AI agent seed contains Chinese text: %q", value)
}
}
}
}