fix: update somark.tech to somark.cn/somark.ai with purchase URLs (#16892)

## Summary

Update all `somark.tech` references to `somark.cn` (default for China) /
`somark.ai` (for overseas including Taiwan, China; Hong Kong, China;
Macau, China). Users fill in `base_url` manually — default is
`somark.cn`.

### Changes

| File | Change |
|------|--------|
| `constants.py` | Default → `somark.cn` |
| `somark_parser.py` | SAAS_BASE_URL + fallback → `somark.cn` |
| `ocr_model.py` | Default → `somark.cn` |
| `pdf_parser_common.go` | Go default → `somark.cn` |
| `llm.ts` | API key URL → `somark.cn` |
| `en.ts` | Base URL descriptions + purchase URLs |
| `zh.ts` | Base URL descriptions + purchase URLs |

### Purchase URLs
- China: `https://somark.cn/workbench/purchase`
- Overseas: `https://somark.ai/studio/purchase`

---------

Co-authored-by: justinychuang <huangyicheng@soulcode.cn>
Co-authored-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
maybehokori
2026-07-16 19:18:05 +08:00
committed by GitHub
parent 101155bdc7
commit f3a2fb7a10
7 changed files with 12 additions and 8 deletions

View File

@@ -345,7 +345,7 @@ SOMARK_ENV_KEYS = [
"SOMARK_KEEP_HEADER_FOOTER",
]
SOMARK_DEFAULT_CONFIG = {
"SOMARK_BASE_URL": "https://somark.tech/api/v1",
"SOMARK_BASE_URL": "https://somark.cn/api/v1",
"SOMARK_API_KEY": "",
"SOMARK_IMAGE_FORMAT": "url",
"SOMARK_FORMULA_FORMAT": "latex",

View File

@@ -121,7 +121,7 @@ class SoMarkParser(RAGFlowPdfParser):
# /usage quota check only works in SaaS; private deployments fall back
# to a generic HEAD health check.
SAAS_BASE_URL = "https://somark.tech/api/v1"
SAAS_BASE_URL = "https://somark.cn/api/v1"
USAGE_REQUEST_TIMEOUT = 10 # /usage request timeout
# SoMark error codes
@@ -749,7 +749,7 @@ class SoMarkParser(RAGFlowPdfParser):
if __name__ == "__main__":
parser = SoMarkParser(
base_url=os.environ.get("SOMARK_BASE_URL", "https://somark.tech/api/v1"),
base_url=os.environ.get("SOMARK_BASE_URL", "https://somark.cn/api/v1"),
api_key=os.environ.get("SOMARK_API_KEY", ""),
)
ok, reason = parser.check_installation()

View File

@@ -109,7 +109,7 @@ func NewPDFParser() *PDFParser {
MinerUPollTimeout: minerUPollTimeout,
PaddleOCRAlgorithm: "PaddleOCR-VL",
OpenDataLoaderTimeout: 600,
SoMarkBaseURL: "https://somark.tech/api/v1",
SoMarkBaseURL: "https://somark.cn/api/v1",
SoMarkImageFormat: "url",
SoMarkFormulaFormat: "latex",
SoMarkTableFormat: "html",

View File

@@ -262,7 +262,7 @@ class SoMarkOcrModel(Base, SoMarkParser):
base_url = _resolve(
"somark_base_url",
"SOMARK_BASE_URL",
kwargs.get("base_url", "https://somark.tech/api/v1"),
kwargs.get("base_url", "https://somark.cn/api/v1"),
)
api_key = _resolve("api_key", "SOMARK_API_KEY", key_as_secret)
image_format = _resolve("somark_image_format", "SOMARK_IMAGE_FORMAT", "url")

View File

@@ -217,7 +217,7 @@ export const APIMapUrl = {
[LLMFactory.TokenPony]: 'https://www.tokenpony.cn/#/user/keys',
[LLMFactory.DeepInfra]: 'https://deepinfra.com/dash/api_keys',
[LLMFactory.PaddleOCR]: 'https://www.paddleocr.ai/latest/',
[LLMFactory.SoMark]: 'https://somark.tech/workbench/apikey',
[LLMFactory.SoMark]: 'https://somark.cn/workbench/apikey',
[LLMFactory.N1n]: 'https://docs.n1n.ai',
[LLMFactory.Avian]: 'https://avian.io',
[LLMFactory.Perplexity]:

View File

@@ -2005,7 +2005,7 @@ Example: Virtual Hosted Style`,
baseUrl: 'Base URL',
baseUrlMessage: 'Please input the Base URL',
baseUrlPlaceholder:
'For SoMark API, fill in https://somark.tech/api/v1; for self-hosted deployment, fill in your local Base URL',
'For SoMark API, use https://somark.cn/api/v1 in mainland China; use https://somark.ai/api/v1 outside mainland China (including Taiwan, China; Hong Kong, China; Macau, China; and overseas). For self-hosted deployment, use your local Base URL',
apiKey: 'API Key',
apiKeyPlaceholder:
'Required for SoMark API; leave blank for self-hosted deployment',
@@ -2024,6 +2024,8 @@ Example: Virtual Hosted Style`,
enableTextCrossPage: 'Enable Text Cross Page',
enableTableCrossPage: 'Enable Table Cross Page',
keepHeaderFooter: 'Keep Header Footer',
purchaseUrl:
'Purchase API: mainland China — https://somark.cn/workbench/purchase; overseas (including Taiwan, China; Hong Kong, China; Macau, China) — https://somark.ai/studio/purchase',
},
modelTypes: {
chat: 'Chat',

View File

@@ -1656,7 +1656,7 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
baseUrl: 'Base URL',
baseUrlMessage: '请输入 Base URL',
baseUrlPlaceholder:
'使用 SoMark API 时填写 https://somark.tech/api/v1私有化部署时填写本地部署的 Base URL',
'使用 SoMark API 时中国大陆填写 https://somark.cn/api/v1中国大陆外含中国台湾、中国香港、中国澳门及海外填写 https://somark.ai/api/v1私有化部署时填写本地部署的 Base URL',
apiKey: 'API Key',
apiKeyPlaceholder: '使用 SoMark API 时填写;私有化部署无需填写',
verifyPassed: '验证通过',
@@ -1674,6 +1674,8 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
enableTextCrossPage: '文字跨页合并',
enableTableCrossPage: '表格跨页合并',
keepHeaderFooter: '保留页眉页脚',
purchaseUrl:
'购买 API中国大陆 https://somark.cn/workbench/purchase海外含中国台湾、中国香港、中国澳门https://somark.ai/studio/purchase',
},
paddleocr: {
apiUrl: 'PaddleOCR API URL',