feat(pricing): add qwen hunyuan and huawei maas payg importers
This commit is contained in:
@@ -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, "## "))
|
||||
|
||||
Reference in New Issue
Block a user