From 08d5e37d0e7969f6dde8256e92b5e89b27606daa Mon Sep 17 00:00:00 2001 From: yoge Date: Sat, 20 Dec 2025 22:15:56 +0800 Subject: [PATCH] fix: udpate app_id --- config/config_dev.yaml | 2 +- config/config_prod.yaml | 2 +- internal/service/recognition_service.go | 15 +++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/config_dev.yaml b/config/config_dev.yaml index b3bd074..339b63d 100644 --- a/config/config_dev.yaml +++ b/config/config_dev.yaml @@ -46,5 +46,5 @@ aliyun: bucket_name: texpixel-doc mathpix: - app_id: "576157025515297792" + app_id: "ocr_eede6f_ea9b5c" app_key: "683f7133391a1039383161653531396234343536393263346632613437343332" diff --git a/config/config_prod.yaml b/config/config_prod.yaml index d43816d..dda41bc 100644 --- a/config/config_prod.yaml +++ b/config/config_prod.yaml @@ -46,5 +46,5 @@ aliyun: mathpix: - app_id: "576157025515297792" + app_id: "ocr_eede6f_ea9b5c" app_key: "fb72d251e33ac85c929bfd4eec40d78368d08d82fb2ee1cffb04a8bb967d1db5" \ No newline at end of file diff --git a/internal/service/recognition_service.go b/internal/service/recognition_service.go index 54abe52..bed9a40 100644 --- a/internal/service/recognition_service.go +++ b/internal/service/recognition_service.go @@ -236,13 +236,13 @@ type MathpixRequest struct { // 输出格式列表:text, data, html, latex_styled Formats []string `json:"formats"` // 数据选项 - DataOptions *MathpixDataOptions `json:"data_options"` + DataOptions *MathpixDataOptions `json:"data_options,omitempty"` // 返回检测到的字母表 - IncludeDetectedAlphabets bool `json:"include_detected_alphabets"` + IncludeDetectedAlphabets *bool `json:"include_detected_alphabets,omitempty"` // 允许的字母表 - AlphabetsAllowed *MathpixAlphabetsAllowed `json:"alphabets_allowed"` + AlphabetsAllowed *MathpixAlphabetsAllowed `json:"alphabets_allowed,omitempty"` // 指定图片区域 - Region *MathpixRegion `json:"region"` + Region *MathpixRegion `json:"region,omitempty"` // 蓝色HSV过滤模式 EnableBlueHsvFilter bool `json:"enable_blue_hsv_filter"` // 置信度阈值 @@ -264,11 +264,11 @@ type MathpixRequest struct { // 图表文本提取 IncludeDiagramText bool `json:"include_diagram_text"` // 页面信息,默认true - IncludePageInfo *bool `json:"include_page_info"` + IncludePageInfo *bool `json:"include_page_info,omitempty"` // 自动旋转置信度阈值,默认0.99 AutoRotateConfidenceThreshold float64 `json:"auto_rotate_confidence_threshold"` // 移除多余空格,默认true - RmSpaces *bool `json:"rm_spaces"` + RmSpaces *bool `json:"rm_spaces,omitempty"` // 移除字体命令,默认false RmFonts bool `json:"rm_fonts"` // 使用aligned/gathered/cases代替array,默认false @@ -719,6 +719,9 @@ func (s *RecognitionService) processMathpixTask(ctx context.Context, taskID int6 IncludeLatex: true, IncludeTsv: true, }, + MathInlineDelimiters: []string{"$", "$"}, + MathDisplayDelimiters: []string{"$$", "$$"}, + RmSpaces: &[]bool{true}[0], } jsonData, err := json.Marshal(mathpixReq)