@helloxiaohu/plugin-mineru 0.0.20 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +213 -56
- package/dist/lib/integration.strategy.js +1 -1
- package/dist/lib/mineru-toolset.strategy.d.ts +83 -16
- package/dist/lib/mineru-toolset.strategy.d.ts.map +1 -1
- package/dist/lib/mineru-toolset.strategy.js +131 -41
- package/dist/lib/mineru.client.d.ts +5 -1
- package/dist/lib/mineru.client.d.ts.map +1 -1
- package/dist/lib/mineru.client.js +46 -9
- package/dist/lib/mineru.tool.d.ts +8 -43
- package/dist/lib/mineru.tool.d.ts.map +1 -1
- package/dist/lib/mineru.tool.js +63 -51
- package/dist/lib/mineru.toolset.d.ts +4 -5
- package/dist/lib/mineru.toolset.d.ts.map +1 -1
- package/dist/lib/mineru.toolset.js +52 -9
- package/dist/lib/result-parser.service.d.ts +2 -2
- package/dist/lib/result-parser.service.d.ts.map +1 -1
- package/dist/lib/result-parser.service.js +72 -43
- package/dist/lib/types.d.ts +27 -20
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +62 -62
package/README.md
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MinerU Plugin for XpertAI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A powerful PDF to Markdown conversion plugin for the [XpertAI](https://github.com/xpert-ai/xpert) platform, powered by [MinerU](https://mineru.net). This plugin provides seamless integration with MinerU services to extract and convert PDF documents into structured Markdown format with support for OCR, formula recognition, and table extraction.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📄 **PDF to Markdown Conversion**: Convert PDF documents to clean, structured Markdown format
|
|
8
|
+
- 🔍 **OCR Support**: Extract text from image-based PDFs using OCR technology
|
|
9
|
+
- 📐 **Formula Recognition**: Automatically recognize and preserve mathematical formulas
|
|
10
|
+
- 📊 **Table Extraction**: Extract and structure tables from PDF documents
|
|
11
|
+
- 🤖 **Agent Toolset Integration**: Use as a built-in toolset in XpertAI agent workflows
|
|
12
|
+
- 🔄 **Document Transformer**: Transform documents in knowledge base pipelines
|
|
13
|
+
- 🌐 **Multi-language Support**: Support for English and Chinese documents
|
|
14
|
+
- 🏢 **Self-hosted Support**: Works with both official MinerU API and self-hosted deployments
|
|
4
15
|
|
|
5
16
|
## Installation
|
|
6
17
|
|
|
@@ -10,92 +21,238 @@ pnpm add @xpert-ai/plugin-mineru
|
|
|
10
21
|
npm install @xpert-ai/plugin-mineru
|
|
11
22
|
```
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
### Peer Dependencies
|
|
25
|
+
|
|
26
|
+
This plugin requires the following peer dependencies to be installed in your host project:
|
|
27
|
+
|
|
28
|
+
- `@xpert-ai/plugin-sdk`: ^3.6.2
|
|
29
|
+
- `@nestjs/common`: ^11.1.6
|
|
30
|
+
- `@nestjs/config`: ^4.0.2
|
|
31
|
+
- `@metad/contracts`: ^3.6.2
|
|
32
|
+
- `@langchain/core`: 0.3.72
|
|
33
|
+
- `axios`: 1.12.2
|
|
34
|
+
- `zod`: 3.25.67
|
|
35
|
+
- `uuid`: 8.3.2
|
|
14
36
|
|
|
15
37
|
## Quick Start
|
|
16
38
|
|
|
17
|
-
1.
|
|
18
|
-
Obtain a valid API Key from the MinerU dashboard and confirm the service address (default: `https://mineru.net/api/v4`).
|
|
39
|
+
### 1. Get MinerU API Credentials
|
|
19
40
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- `MINERU_API_BASE_URL`: Optional, defaults to `https://mineru.net/api/v4`.
|
|
24
|
-
- `MINERU_API_TOKEN`: Required, used as a fallback credential if no integration is configured.
|
|
41
|
+
1. Sign up for a MinerU account at [mineru.net](https://mineru.net)
|
|
42
|
+
2. Obtain your API Key from the MinerU dashboard
|
|
43
|
+
3. Note the API base URL (default: `https://mineru.net/api/v4`)
|
|
25
44
|
|
|
26
|
-
|
|
45
|
+
### 2. Configure the Plugin
|
|
27
46
|
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
"provider": "mineru",
|
|
31
|
-
"options": {
|
|
32
|
-
"apiUrl": "https://mineru.net/api/v4",
|
|
33
|
-
"apiKey": "your-mineru-api-key"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
47
|
+
#### Option A: Via XpertAI Console (Recommended)
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
1. Navigate to the Built-in Tools section in XpertAI Console
|
|
50
|
+
2. Find "MinerU PDF Parser" in the toolset list
|
|
51
|
+
3. Click "Authorize" and fill in the configuration:
|
|
52
|
+
- **Base URL**: MinerU API base URL (default: `https://mineru.net/api/v4`)
|
|
53
|
+
- **API Key**: Your MinerU API Key (required)
|
|
54
|
+
- **Enable OCR**: Enable/disable OCR for image-based PDFs (default: Enabled)
|
|
55
|
+
- **Enable Formula Recognition**: Enable/disable formula recognition (default: Enabled)
|
|
56
|
+
- **Enable Table Recognition**: Enable/disable table recognition (default: Enabled)
|
|
57
|
+
- **Document Language**: Select document language - "en" for English, "ch" for Chinese (default: "ch")
|
|
58
|
+
- **Model Version**: Select model version - "pipeline" or "vlm" (default: "pipeline")
|
|
40
59
|
|
|
41
|
-
|
|
42
|
-
PLUGINS=@xpert-ai/plugin-mineru
|
|
43
|
-
```
|
|
60
|
+
#### Option B: Environment Variables
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
Set the following environment variables in your deployment:
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
```bash
|
|
65
|
+
MINERU_API_BASE_URL=https://mineru.net/api/v4 # Optional, defaults to official URL
|
|
66
|
+
MINERU_API_TOKEN=your-api-key-here # Required
|
|
67
|
+
MINERU_SERVER_TYPE=official # Optional: 'official' or 'self-hosted'
|
|
68
|
+
```
|
|
48
69
|
|
|
49
|
-
|
|
50
|
-
| -------- | ------ | ------------------------------------- | -------- | ---------------------------- |
|
|
51
|
-
| apiUrl | string | MinerU API base URL | No | `https://mineru.net/api/v4` |
|
|
52
|
-
| apiKey | string | MinerU service API Key (keep secret) | Yes | — |
|
|
70
|
+
### 3. Register the Plugin
|
|
53
71
|
|
|
54
|
-
|
|
72
|
+
Add the plugin to your XpertAI host service configuration:
|
|
55
73
|
|
|
56
|
-
|
|
74
|
+
```bash
|
|
75
|
+
# .env
|
|
76
|
+
PLUGINS=@xpert-ai/plugin-mineru
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The plugin will automatically register the `MinerUPlugin` NestJS module and be available for use in agent workflows.
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
### As a Toolset in Agent Workflows
|
|
84
|
+
|
|
85
|
+
Once configured, the MinerU toolset is available in your agent workflows. The tool accepts a PDF document URL and returns the converted Markdown content.
|
|
86
|
+
|
|
87
|
+
**Tool Input:**
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"doc_url": "https://example.com/document.pdf"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
59
93
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| `enableTable` | boolean | `true` | Recognize tables and output structured tags. |
|
|
65
|
-
| `language` | string | `"ch"` | Main document language, per MinerU API (`en`/`ch`). |
|
|
66
|
-
| `modelVersion` | string | `"pipeline"` | MinerU model version (`pipeline`, `vlm`, etc.). |
|
|
94
|
+
**Tool Output:**
|
|
95
|
+
- Markdown content with extracted text, formulas, and tables
|
|
96
|
+
- Structured metadata including task ID and document information
|
|
97
|
+
- Image assets extracted from the PDF
|
|
67
98
|
|
|
68
|
-
|
|
99
|
+
### Configuration Options
|
|
100
|
+
|
|
101
|
+
#### Toolset Configuration (Authorization Page)
|
|
102
|
+
|
|
103
|
+
| Field | Type | Default | Description |
|
|
104
|
+
|-------|------|---------|-------------|
|
|
105
|
+
| `apiUrl` | string | `https://mineru.net/api/v4` | MinerU API base URL |
|
|
106
|
+
| `apiKey` | string | - | MinerU API Key (required) |
|
|
107
|
+
| `isOcr` | string enum | `"true"` | Enable OCR for image-based PDFs (`"true"` or `"false"`) |
|
|
108
|
+
| `enableFormula` | string enum | `"true"` | Enable formula recognition (`"true"` or `"false"`) |
|
|
109
|
+
| `enableTable` | string enum | `"true"` | Enable table recognition (`"true"` or `"false"`) |
|
|
110
|
+
| `language` | string enum | `"ch"` | Document language (`"en"` or `"ch"`) |
|
|
111
|
+
| `modelVersion` | string enum | `"pipeline"` | Model version (`"pipeline"` or `"vlm"`) |
|
|
112
|
+
|
|
113
|
+
> **Note**: Configuration values set in the authorization page serve as defaults. They can be overridden when calling the tool programmatically.
|
|
114
|
+
|
|
115
|
+
## Architecture
|
|
116
|
+
|
|
117
|
+
### Components
|
|
118
|
+
|
|
119
|
+
- **MinerUToolsetStrategy**: Implements `IToolsetStrategy` to register MinerU as a built-in toolset
|
|
120
|
+
- **MinerUToolset**: Extends `BuiltinToolset` to provide the PDF parser tool
|
|
121
|
+
- **MinerUClient**: Handles communication with MinerU API (both official and self-hosted)
|
|
122
|
+
- **MinerUResultParserService**: Parses MinerU response and extracts Markdown content
|
|
123
|
+
- **MinerUTransformerStrategy**: Implements document transformation for knowledge base pipelines
|
|
124
|
+
|
|
125
|
+
### Server Types
|
|
126
|
+
|
|
127
|
+
The plugin supports two MinerU deployment types:
|
|
128
|
+
|
|
129
|
+
1. **Official Server** (`https://mineru.net/api/v4`)
|
|
130
|
+
- Requires API Key authentication
|
|
131
|
+
- Uses async task-based workflow
|
|
132
|
+
- Polls for task completion
|
|
133
|
+
|
|
134
|
+
2. **Self-hosted Server**
|
|
135
|
+
- Can work without authentication (depending on your setup)
|
|
136
|
+
- Supports direct file upload and immediate parsing
|
|
137
|
+
- Caches results locally
|
|
138
|
+
|
|
139
|
+
The plugin automatically detects the server type based on the API URL.
|
|
69
140
|
|
|
70
141
|
## Permissions
|
|
71
142
|
|
|
72
|
-
|
|
73
|
-
- **File System**: Perform `read/write/list` on `XpFileSystem` to store image resources from MinerU results.
|
|
143
|
+
The plugin requires the following permissions:
|
|
74
144
|
|
|
75
|
-
|
|
145
|
+
- **File System**: `read`, `write`, `list` operations for storing extracted images and assets
|
|
146
|
+
- **Integration** (for transformer): Access to MinerU integration configuration
|
|
76
147
|
|
|
77
|
-
|
|
148
|
+
Ensure these permissions are granted in your XpertAI authorization policy.
|
|
78
149
|
|
|
79
|
-
|
|
150
|
+
## Output Format
|
|
80
151
|
|
|
81
|
-
|
|
82
|
-
- Structured metadata: Includes MinerU task ID, layout JSON (`layout.json`), content list (`content_list.json`), original PDF filename, etc.
|
|
83
|
-
- Attachment asset list: Records written image resources for easy association by callers.
|
|
152
|
+
The plugin returns structured documents with:
|
|
84
153
|
|
|
85
|
-
|
|
154
|
+
- **Markdown Content**: Full document text in Markdown format with proper formatting
|
|
155
|
+
- **Metadata**: Includes MinerU task ID, backend version, document language, etc.
|
|
156
|
+
- **Assets**: List of extracted images and files with their storage locations
|
|
157
|
+
- **Structured Data**: Layout JSON and content list for advanced processing
|
|
86
158
|
|
|
87
|
-
## Development
|
|
159
|
+
## Development
|
|
88
160
|
|
|
89
|
-
|
|
161
|
+
### Build
|
|
90
162
|
|
|
91
163
|
```bash
|
|
92
|
-
|
|
164
|
+
# Build the plugin
|
|
93
165
|
npx nx build @xpert-ai/plugin-mineru
|
|
166
|
+
|
|
167
|
+
# Build with cache skip
|
|
168
|
+
npx nx build @xpert-ai/plugin-mineru --skip-nx-cache
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Test
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Run all tests
|
|
94
175
|
npx nx test @xpert-ai/plugin-mineru
|
|
176
|
+
|
|
177
|
+
# Run specific test file
|
|
178
|
+
npx nx test @xpert-ai/plugin-mineru --testFile=mineru.client.spec.ts
|
|
95
179
|
```
|
|
96
180
|
|
|
97
|
-
|
|
181
|
+
### Project Structure
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
packages/mineru/
|
|
185
|
+
├── src/
|
|
186
|
+
│ ├── lib/
|
|
187
|
+
│ │ ├── mineru-toolset.strategy.ts # Toolset strategy implementation
|
|
188
|
+
│ │ ├── mineru.toolset.ts # Toolset class
|
|
189
|
+
│ │ ├── mineru.tool.ts # Tool builder
|
|
190
|
+
│ │ ├── mineru.client.ts # MinerU API client
|
|
191
|
+
│ │ ├── result-parser.service.ts # Result parsing service
|
|
192
|
+
│ │ ├── transformer-mineru.strategy.ts # Document transformer
|
|
193
|
+
│ │ └── types.ts # Type definitions
|
|
194
|
+
│ ├── index.ts # Plugin entry point
|
|
195
|
+
│ └── mineru.plugin.ts # NestJS module
|
|
196
|
+
├── package.json
|
|
197
|
+
└── README.md
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Troubleshooting
|
|
201
|
+
|
|
202
|
+
### Common Issues
|
|
203
|
+
|
|
204
|
+
1. **"MinerU apiKey is required"**
|
|
205
|
+
- Ensure you've configured the API Key in the authorization page
|
|
206
|
+
- Check that the credentials are properly saved
|
|
207
|
+
|
|
208
|
+
2. **"MinerU official API requires an access token"**
|
|
209
|
+
- Official MinerU servers require a valid API Key
|
|
210
|
+
- Verify your API Key is correct and has not expired
|
|
211
|
+
|
|
212
|
+
3. **Connection Refused (Self-hosted)**
|
|
213
|
+
- Verify your self-hosted MinerU server is running
|
|
214
|
+
- Check the API URL is correct
|
|
215
|
+
- Ensure network connectivity
|
|
216
|
+
|
|
217
|
+
4. **Task Timeout**
|
|
218
|
+
- Large PDFs may take longer to process
|
|
219
|
+
- Check MinerU server logs for processing status
|
|
220
|
+
- Consider using the VLM model for faster processing
|
|
221
|
+
|
|
222
|
+
## API Reference
|
|
223
|
+
|
|
224
|
+
### MinerUToolsetConfig
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
interface MinerUToolsetConfig {
|
|
228
|
+
apiUrl?: string;
|
|
229
|
+
apiKey?: string;
|
|
230
|
+
isOcr?: boolean | string;
|
|
231
|
+
enableFormula?: boolean | string;
|
|
232
|
+
enableTable?: boolean | string;
|
|
233
|
+
language?: 'en' | 'ch';
|
|
234
|
+
modelVersion?: 'pipeline' | 'vlm';
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Tool Input Schema
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
{
|
|
242
|
+
doc_url: string; // Required: URL of the PDF document to convert
|
|
243
|
+
}
|
|
244
|
+
```
|
|
98
245
|
|
|
99
246
|
## License
|
|
100
247
|
|
|
101
|
-
This project
|
|
248
|
+
This project is licensed under the [AGPL-3.0 License](../../../LICENSE).
|
|
249
|
+
|
|
250
|
+
## Support
|
|
251
|
+
|
|
252
|
+
- **Documentation**: [MinerU API Docs](https://mineru.net/apiManage/docs)
|
|
253
|
+
- **Issues**: [GitHub Issues](https://github.com/xpert-ai/xpert-plugins/issues)
|
|
254
|
+
- **Homepage**: [MinerU Website](https://mineru.net)
|
|
255
|
+
|
|
256
|
+
## Changelog
|
|
257
|
+
|
|
258
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and updates.
|
|
@@ -29,7 +29,7 @@ let MinerUIntegrationStrategy = class MinerUIntegrationStrategy {
|
|
|
29
29
|
en_US: 'Base URL',
|
|
30
30
|
},
|
|
31
31
|
description: {
|
|
32
|
-
en_US: 'https://
|
|
32
|
+
en_US: 'https://mineru.net/api/v4',
|
|
33
33
|
ja_JP: 'MinerUサーバのBase URLを入力してください',
|
|
34
34
|
zh_Hans: '请输入你的 MinerU 服务的 Base URL',
|
|
35
35
|
},
|
|
@@ -25,6 +25,8 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
25
25
|
zh_Hans: string;
|
|
26
26
|
};
|
|
27
27
|
icon: {
|
|
28
|
+
type: string;
|
|
29
|
+
value: string;
|
|
28
30
|
svg: string;
|
|
29
31
|
color: string;
|
|
30
32
|
};
|
|
@@ -64,7 +66,7 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
64
66
|
};
|
|
65
67
|
'x-ui': ISchemaSecretField;
|
|
66
68
|
};
|
|
67
|
-
|
|
69
|
+
isOcr: {
|
|
68
70
|
type: string;
|
|
69
71
|
title: {
|
|
70
72
|
en_US: string;
|
|
@@ -76,18 +78,18 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
76
78
|
};
|
|
77
79
|
enum: string[];
|
|
78
80
|
default: string;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
'x-ui': {
|
|
82
|
+
enumLabels: {
|
|
83
|
+
true: {
|
|
84
|
+
en_US: string;
|
|
85
|
+
zh_Hans: string;
|
|
86
|
+
};
|
|
87
|
+
false: {
|
|
88
|
+
en_US: string;
|
|
89
|
+
zh_Hans: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
89
92
|
};
|
|
90
|
-
default: boolean;
|
|
91
93
|
};
|
|
92
94
|
enableFormula: {
|
|
93
95
|
type: string;
|
|
@@ -99,7 +101,20 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
99
101
|
en_US: string;
|
|
100
102
|
zh_Hans: string;
|
|
101
103
|
};
|
|
102
|
-
|
|
104
|
+
enum: string[];
|
|
105
|
+
default: string;
|
|
106
|
+
'x-ui': {
|
|
107
|
+
enumLabels: {
|
|
108
|
+
true: {
|
|
109
|
+
en_US: string;
|
|
110
|
+
zh_Hans: string;
|
|
111
|
+
};
|
|
112
|
+
false: {
|
|
113
|
+
en_US: string;
|
|
114
|
+
zh_Hans: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
103
118
|
};
|
|
104
119
|
enableTable: {
|
|
105
120
|
type: string;
|
|
@@ -111,7 +126,20 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
111
126
|
en_US: string;
|
|
112
127
|
zh_Hans: string;
|
|
113
128
|
};
|
|
114
|
-
|
|
129
|
+
enum: string[];
|
|
130
|
+
default: string;
|
|
131
|
+
'x-ui': {
|
|
132
|
+
enumLabels: {
|
|
133
|
+
true: {
|
|
134
|
+
en_US: string;
|
|
135
|
+
zh_Hans: string;
|
|
136
|
+
};
|
|
137
|
+
false: {
|
|
138
|
+
en_US: string;
|
|
139
|
+
zh_Hans: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
115
143
|
};
|
|
116
144
|
language: {
|
|
117
145
|
type: string;
|
|
@@ -125,6 +153,18 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
125
153
|
};
|
|
126
154
|
enum: string[];
|
|
127
155
|
default: string;
|
|
156
|
+
'x-ui': {
|
|
157
|
+
enumLabels: {
|
|
158
|
+
en: {
|
|
159
|
+
en_US: string;
|
|
160
|
+
zh_Hans: string;
|
|
161
|
+
};
|
|
162
|
+
ch: {
|
|
163
|
+
en_US: string;
|
|
164
|
+
zh_Hans: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
128
168
|
};
|
|
129
169
|
modelVersion: {
|
|
130
170
|
type: string;
|
|
@@ -138,6 +178,18 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
138
178
|
};
|
|
139
179
|
enum: string[];
|
|
140
180
|
default: string;
|
|
181
|
+
'x-ui': {
|
|
182
|
+
enumLabels: {
|
|
183
|
+
pipeline: {
|
|
184
|
+
en_US: string;
|
|
185
|
+
zh_Hans: string;
|
|
186
|
+
};
|
|
187
|
+
vlm: {
|
|
188
|
+
en_US: string;
|
|
189
|
+
zh_Hans: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
141
193
|
};
|
|
142
194
|
};
|
|
143
195
|
required: string[];
|
|
@@ -155,13 +207,28 @@ export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToo
|
|
|
155
207
|
/**
|
|
156
208
|
* Create MinerU toolset instance
|
|
157
209
|
* Note: config may be null/undefined during authorization phase
|
|
210
|
+
* Modified to read from toolset.credentials (like @searchapi/@email)
|
|
158
211
|
*/
|
|
159
|
-
create(config:
|
|
212
|
+
create(config: any): Promise<BuiltinToolset>;
|
|
160
213
|
/**
|
|
161
214
|
* Create tools for MinerU toolset
|
|
162
215
|
* Tools are created dynamically in MinerUToolset.initTools()
|
|
163
216
|
* based on the toolset credentials/configuration
|
|
164
217
|
*/
|
|
165
|
-
createTools():
|
|
218
|
+
createTools(): import("@langchain/core/tools").DynamicStructuredTool<import("zod").ZodObject<{
|
|
219
|
+
doc_url: import("zod").ZodString;
|
|
220
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
221
|
+
doc_url?: string;
|
|
222
|
+
}, {
|
|
223
|
+
doc_url?: string;
|
|
224
|
+
}>, {
|
|
225
|
+
doc_url?: string;
|
|
226
|
+
}, {
|
|
227
|
+
doc_url?: string;
|
|
228
|
+
}, (string | {
|
|
229
|
+
files: any[];
|
|
230
|
+
taskId: string;
|
|
231
|
+
metadata: any;
|
|
232
|
+
})[]>[];
|
|
166
233
|
}
|
|
167
234
|
//# sourceMappingURL=mineru-toolset.strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineru-toolset.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/mineru-toolset.strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"mineru-toolset.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/mineru-toolset.strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAYzE;;;GAGG;AACH,qBAEa,qBAAsB,YAAW,gBAAgB,CAAC,mBAAmB,CAAC;IAyN/E,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IA1N/B;;OAEG;IACH,IAAI;;;;;;;;;;;;;;;;;;;;;gBAyBE;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;4BAwBQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6IjC;IAEF;;OAEG;IACH,QAAQ,CAAC,WAAW,yBAMlB;gBAIiB,aAAa,EAAE,aAAa,EAE5B,YAAY,EAAE,yBAAyB;IAG1D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7E;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IAyBlD;;;;OAIG;IACH,WAAW;;;;;;;;;;;;;;;CA4BZ"}
|