Go: implement provider: MinerU_Local (#15051)

### What problem does this PR solve?
1. Add model types when add model
---
```
RAGFlow(user)> add model 'pipeline' to provider 'mineru_local' instance 'test' with tokens 131072 doc_parse;
SUCCESS
```

2. implement provider: MinerU_Local
---
**Verified from CLI**
```
RAGFlow(user)> parse with 'pipeline@test@mineru_local' file './internal/test.pdf'
+--------------------------------------+
| task_id                              |
+--------------------------------------+
| c7260e31-b6e2-4b36-955d-e9c60510c669 |
+--------------------------------------+
RAGFlow(user)> show 'test@mineru_local' task 'c7260e31-b6e2-4b36-955d-e9c60510c669'
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
| content                                                                                                                                                                                                                                                          | index |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
| # Repurposing Diffusion-Based Image Generators for Monocular Depth Estimation

Bingxin Ke Anton Obukhov Shengyu Huang Nando Metzger Rodrigo Caye Daudt Konrad Schindler Photogrammetry and Remote Sensing, ETH Zurich ¨

![](images/ae256101419715b544d13722...  | 1     |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Haruko386
2026-05-20 19:21:57 +08:00
committed by GitHub
parent 6ce76e6799
commit 4a91ca5349
6 changed files with 283 additions and 0 deletions

View File

@@ -375,6 +375,8 @@ func (l *Lexer) lookupIdent(ident string) Token {
return Token{Type: TokenDimension, Value: ident}
case "OCR":
return Token{Type: TokenOCR, Value: ident}
case "DOC_PARSE":
return Token{Type: TokenDocParse, Value: ident}
case "ASYNC":
return Token{Type: TokenAsync, Value: ident}
case "SYNC":

View File

@@ -102,6 +102,7 @@ const (
TokenASR
TokenTTS
TokenOCR
TokenDocParse
TokenEmbed
TokenText
TokenQuery

View File

@@ -862,6 +862,9 @@ func (p *Parser) parseAddModel() (*Command, error) {
case TokenOCR:
p.nextToken()
modelTypes = append(modelTypes, "ocr")
case TokenDocParse:
p.nextToken()
modelTypes = append(modelTypes, "doc_parse")
case TokenTTS:
p.nextToken()
modelTypes = append(modelTypes, "tts")