Repository navigation
fix: update somark.tech to somark.cn/somark.ai with purchase URLs - #16892
Conversation
- SoMarkParser: add _REGION_BASE_URLS dict (china→somark.cn, overseas→somark.ai); base_url now defaults to empty and auto-resolves from region - SoMarkOcrModel: resolve somark_region/SOMARK_REGION from config/env - Update all somark.tech references to somark.cn (default) or somark.ai (overseas) - Update locale base URL descriptions with both China and overseas endpoints - Add purchaseUrl locale entries: somark.cn/workbench/purchase (China), somark.ai/studio/purchase (overseas including Taiwan, China; Hong Kong, China; Macau, China) - Update Go pdf_parser_common.go default URL
- Update all somark.tech references to somark.cn (default) or somark.ai - Add locale entries for both China and overseas base URLs - Add purchaseUrl locale entries - Update Go pdf_parser_common.go default URL
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughSoMark default API endpoints are changed from ChangesSoMark endpoint configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deepdoc/parser/somark_parser.py`:
- Line 124: Update the endpoint classification used by check_installation() so
both https://somark.cn/api/v1 and https://somark.ai/api/v1 use the SaaS /usage
validation path, including API-key and quota checks. Treat the hosted endpoints
as equivalent SaaS URLs rather than sending somark.ai through the
private-deployment HEAD probe.
In `@web/src/constants/llm.ts`:
- Line 219: Update the SoMark entry in the LLM API-key URL mapping to derive its
link from the selected SoMark region or base-URL configuration rather than
hardcoding https://somark.cn/workbench/apikey. Reuse the existing region-aware
SoMark URL mechanism and preserve the /workbench/apikey path for each region.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0a461b68-dff5-433c-8a33-d23478e01cd2
📒 Files selected for processing (7)
common/constants.pydeepdoc/parser/somark_parser.pyinternal/parser/parser/pdf_parser_common.gorag/llm/ocr_model.pyweb/src/constants/llm.tsweb/src/locales/en.tsweb/src/locales/zh.ts
| # /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" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## File outline\n'
ast-grep outline deepdoc/parser/somark_parser.py --view expanded || true
printf '\n## Relevant line ranges\n'
sed -n '100,170p' deepdoc/parser/somark_parser.py
printf '\n---\n'
sed -n '720,780p' deepdoc/parser/somark_parser.py
printf '\n## Endpoint references\n'
rg -n "somark\.(ai|cn)|check_installation|SAAS_BASE_URL" deepdoc -SRepository: infiniflow/ragflow
Length of output: 8687
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## check_installation implementation\n'
sed -n '190,215p' deepdoc/parser/somark_parser.py
printf '\n## somark.ai references in repo\n'
rg -n "somark\.ai" -S .
printf '\n## SOMARK_BASE_URL references\n'
rg -n "SOMARK_BASE_URL|somark\.cn|somark\.ai" -S deepdoc README* docs* .github* 2>/dev/null || trueRepository: infiniflow/ragflow
Length of output: 2697
🌐 Web query:
Somark API hosted endpoint somark.ai somark.cn documentation
💡 Result:
SoMark is a document intelligence platform that transforms unstructured documents like PDFs, scans, tables, and formulas into structured data formats such as Markdown and JSON for use in RAG (Retrieval-Augmented Generation) and AI agents [1][2]. The official documentation for the SoMark API is hosted at docs.somark.ai and docs.somark.tech [3][4]. Key API details: Base URL: https://somark.ai/api/v1 (or https://somark.tech/api/v1) [3][4] Authentication: API requests require an api_key passed in the request body, formatted as sk-* [3][4]. Primary Endpoints: - Sync parsing: POST /parse/sync (for immediate results) [3][4] - Async parsing: POST /parse/async (to submit tasks) and POST /parse/async_check (to poll results using task_id) [3][4] - Usage query: POST /usage (to check quota and account info) [3][4] Migration Notice: Previous endpoint paths (e.g., /extract/) have been migrated to /parse/. The older paths will be discontinued on December 31, 2026 [3][4]. Regarding somark.cn: While some internal or testing documentation may exist on subdomains associated with soulcode.cn (such as docs.somark-sit.soulcode.cn), official documentation and service access are centralized under somark.ai and somark.tech [3][4][5]. Users are advised to rely on the official documentation at docs.somark.ai [4].
Citations:
- 1: https://somark.ai/
- 2: https://github.com/SoMarkAI
- 3: https://docs.somark.tech/en/api-reference/index
- 4: https://docs.somark.ai/api-reference
- 5: https://docs.somark-sit.soulcode.cn/api-reference/endpoint/async-check
Recognize both hosted SaaS endpoints. check_installation() only routes https://somark.cn/api/v1 through the SaaS /usage check, so the hosted https://somark.ai/api/v1 path falls back to the private-deployment HEAD probe and skips API-key/quota validation. Treat hosted URLs as a set, or classify them by host/region.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deepdoc/parser/somark_parser.py` at line 124, Update the endpoint
classification used by check_installation() so both https://somark.cn/api/v1 and
https://somark.ai/api/v1 use the SaaS /usage validation path, including API-key
and quota checks. Treat the hosted endpoints as equivalent SaaS URLs rather than
sending somark.ai through the private-deployment HEAD probe.
| [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', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the relevant constant and nearby context.
sed -n '180,250p' web/src/constants/llm.ts
# Inspect the locale text that references somark.ai.
rg -n "somark\.ai|somark\.cn|API-key|apikey|region" web/src/locales/en.ts web/src/constants/llm.ts web/src -g '!**/dist/**' -g '!**/build/**'
# Find the region/base-url selection logic used by the app.
rg -n "region.*base url|base url.*region|somark.*region|LLMFactory\.SoMark|workbench/apikey|api[- ]?key" web/src -g '!**/dist/**' -g '!**/build/**'Repository: infiniflow/ragflow
Length of output: 18729
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the structure of the llm constants file.
ast-grep outline web/src/constants/llm.ts --view expanded
# Read the top and surrounding provider/link definitions.
sed -n '1,180p' web/src/constants/llm.ts
# Find all references to the SoMark constant and the API-key URL map.
rg -n "LLMFactory\.SoMark|API_KEY|api[- ]?key|apikey" web/src -g '!**/dist/**' -g '!**/build/**'
# Inspect the component(s) that consume the provider icon/list entries if they expose links.
sed -n '1,220p' web/src/components/svg-icon.tsxRepository: infiniflow/ragflow
Length of output: 18135
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect provider config for SoMark and any region-aware URL selection.
rg -n "somark\.ai/api/v1|somark\.cn/api/v1|workbench/purchase|workbench/apikey|SoMark|base_url|regionKey|region" \
web/src/pages/user-setting/setting-model -g '!**/dist/**' -g '!**/build/**'
# Read the generic API-key config and provider config map around SoMark-related entries.
sed -n '1,260p' web/src/pages/user-setting/setting-model/provider-schema/field-config/generic-api-key-config.ts
sed -n '1,260p' web/src/pages/user-setting/setting-model/provider-schema/field-config/provider-config-map.ts
# Inspect how APIMapUrl is consumed.
rg -n "APIMapUrl\[" web/src -g '!**/dist/**' -g '!**/build/**'Repository: infiniflow/ragflow
Length of output: 29187
Make the SoMark API-key link region-aware. web/src/constants/llm.ts:219 still hardcodes https://somark.cn/workbench/apikey; use the selected SoMark region/base URL here instead of a single constant so overseas users aren’t sent to the mainland-China portal.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/constants/llm.ts` at line 219, Update the SoMark entry in the LLM
API-key URL mapping to derive its link from the selected SoMark region or
base-URL configuration rather than hardcoding
https://somark.cn/workbench/apikey. Reuse the existing region-aware SoMark URL
mechanism and preserve the /workbench/apikey path for each region.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16892 +/- ##
==========================================
- Coverage 94.56% 93.16% -1.40%
==========================================
Files 10 10
Lines 717 717
Branches 118 118
==========================================
- Hits 678 668 -10
- Misses 25 29 +4
- Partials 14 20 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Update all
somark.techreferences tosomark.cn(default for China) /somark.ai(for overseas including Taiwan, China; Hong Kong, China; Macau, China). Users fill inbase_urlmanually — default issomark.cn.Changes
constants.pysomark.cnsomark_parser.pysomark.cnocr_model.pysomark.cnpdf_parser_common.gosomark.cnllm.tssomark.cnen.tszh.tsPurchase URLs
https://somark.cn/workbench/purchasehttps://somark.ai/studio/purchase