feat(pricing): add qwen hunyuan and huawei maas payg importers
Some checks failed
CI / go-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / docker-build (push) Has been cancelled

This commit is contained in:
phamnazage-jpg
2026-05-22 12:13:54 +08:00
parent d9c552cba5
commit 6c3569fb65
20 changed files with 1032 additions and 16 deletions

View File

@@ -106,10 +106,16 @@ func parseTencentCatalog(raw string) (tencentCatalog, error) {
}
switch line {
case "### 套餐详情":
case "### 套餐详情", "套餐详情":
if currentSeries == "" {
continue
}
currentMode = "plans"
continue
case "### 可用模型":
case "### 可用模型", "可用模型":
if currentSeries == "" {
continue
}
currentMode = "models"
continue
}
@@ -159,7 +165,7 @@ func normalizeTencentCatalogLines(raw string) []string {
rawLines := strings.Split(text, "\n")
lines := make([]string, 0, len(rawLines))
for _, rawLine := range rawLines {
line := strings.TrimSpace(rawLine)
line := strings.Trim(strings.TrimSpace(rawLine), "\uFEFF")
if line == "" {
continue
}
@@ -178,6 +184,13 @@ func extractUpdatedAt(line string) string {
func extractSeriesHeading(line string) string {
if !strings.HasPrefix(line, "## ") {
trimmed := strings.Trim(line, "\uFEFF ")
switch trimmed {
case "通用 Token Plan 套餐":
return "通用 Token Plan"
case "Hy Token Plan 套餐":
return "Hy Token Plan"
}
return ""
}
series := strings.TrimSpace(strings.TrimPrefix(line, "## "))