b743639731
- Introduced a new package `seedlang` to handle language parsing and constants for English and Chinese. - Updated `Init` functions across various modules (kb, quickreply, skill, tag) to accept a language parameter. - Implemented English seed data for FAQs, quick replies, skills, and tags, ensuring no Chinese text is present in English data. - Added tests to verify that English seed data does not contain Chinese characters. - Removed outdated README file from the kb test data directory. - Created new test files for channel and kb to validate the absence of Chinese text in English seed data.
21 lines
533 B
Go
21 lines
533 B
Go
package skill
|
|
|
|
import (
|
|
"agent-desk/cmd/testdata/seedlang"
|
|
"regexp"
|
|
"testing"
|
|
)
|
|
|
|
var hanTextPattern = regexp.MustCompile(`\p{Han}`)
|
|
|
|
func TestEnglishSkillSeedDoesNotContainChineseText(t *testing.T) {
|
|
for _, item := range buildSeedItems(seedlang.English) {
|
|
values := []string{item.Name, item.Description, item.Instruction, item.Examples, item.ToolWhitelist, item.Remark}
|
|
for _, value := range values {
|
|
if hanTextPattern.MatchString(value) {
|
|
t.Fatalf("english skill seed contains Chinese text: %q", value)
|
|
}
|
|
}
|
|
}
|
|
}
|