031855935d
- 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.
22 lines
573 B
Go
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)
|
|
}
|
|
}
|
|
}
|
|
}
|