mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-19 10:07:24 +00:00
添加插件:Doc2X 图片/文档识别 (#2097)
* Init the requrest part * Finish the img deal part * For test only one plugin * Finish img2text part * Finish pdf ocr part * Change vscode setting back * Change `for` into` for await` type
This commit is contained in:
@@ -15,7 +15,10 @@ const packagePluginList = [
|
|||||||
'duckduckgo/search',
|
'duckduckgo/search',
|
||||||
'duckduckgo/searchImg',
|
'duckduckgo/searchImg',
|
||||||
'duckduckgo/searchNews',
|
'duckduckgo/searchNews',
|
||||||
'duckduckgo/searchVideo'
|
'duckduckgo/searchVideo',
|
||||||
|
'Doc2X',
|
||||||
|
'Doc2X/URLPDF2text',
|
||||||
|
'Doc2X/URLImg2text'
|
||||||
];
|
];
|
||||||
|
|
||||||
const list = [...staticPluginList, ...packagePluginList];
|
const list = [...staticPluginList, ...packagePluginList];
|
||||||
|
158
packages/plugins/src/Doc2X/URLImg2text/index.ts
Normal file
158
packages/plugins/src/Doc2X/URLImg2text/index.ts
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
import { delay } from '@fastgpt/global/common/system/utils';
|
||||||
|
import { addLog } from '@fastgpt/service/common/system/log';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
apikey: string;
|
||||||
|
url: string;
|
||||||
|
img_correction: boolean;
|
||||||
|
formula: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Response type same as HTTP outputs
|
||||||
|
type Response = Promise<{
|
||||||
|
result: string;
|
||||||
|
success: boolean;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
const main = async ({ apikey, url, img_correction, formula }: Props): Response => {
|
||||||
|
// Check the apikey
|
||||||
|
if (!apikey) {
|
||||||
|
return {
|
||||||
|
result: `API key is required`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
let real_api_key = apikey;
|
||||||
|
if (!apikey.startsWith('sk-')) {
|
||||||
|
const response = await fetch('https://api.doc2x.noedgeai.com/api/token/refresh', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${apikey}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (response.status !== 200) {
|
||||||
|
return {
|
||||||
|
result: `Get token failed: ${await response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const data = await response.json();
|
||||||
|
real_api_key = data.data.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Get the image binary from the URL
|
||||||
|
const extension = url.split('.').pop()?.toLowerCase();
|
||||||
|
const name = url.split('/').pop()?.split('.').shift();
|
||||||
|
let mini = '';
|
||||||
|
switch (extension) {
|
||||||
|
case 'jpg':
|
||||||
|
case 'jpeg':
|
||||||
|
mini = 'image/jpeg';
|
||||||
|
break;
|
||||||
|
case 'png':
|
||||||
|
mini = 'image/png';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return {
|
||||||
|
result: `Not supported image format, only support jpg/jpeg/png`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(url);
|
||||||
|
if (!response.ok) {
|
||||||
|
return {
|
||||||
|
result: `Failed to fetch image from URL: ${url}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = await response.blob();
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', new Blob([blob], { type: mini }), name + '.' + extension);
|
||||||
|
formData.append('img_correction', img_correction ? '1' : '0');
|
||||||
|
formData.append('equation', formula ? '1' : '0');
|
||||||
|
|
||||||
|
let upload_url = 'https://api.doc2x.noedgeai.com/api/platform/async/img';
|
||||||
|
if (real_api_key.startsWith('sk-')) {
|
||||||
|
upload_url = 'https://api.doc2x.noedgeai.com/api/v1/async/img';
|
||||||
|
}
|
||||||
|
|
||||||
|
let uuid;
|
||||||
|
const uploadAttempts = [1, 2, 3];
|
||||||
|
for await (const attempt of uploadAttempts) {
|
||||||
|
const upload_response = await fetch(upload_url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${real_api_key}`
|
||||||
|
},
|
||||||
|
body: formData
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!upload_response.ok) {
|
||||||
|
// Rate limit, wait for 10s and retry at most 3 times
|
||||||
|
if (upload_response.status === 429 && attempt < 3) {
|
||||||
|
await delay(10000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
result: `Failed to upload image: ${await upload_response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const upload_data = await upload_response.json();
|
||||||
|
uuid = upload_data.data.uuid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the result by uuid
|
||||||
|
let result_url = 'https://api.doc2x.noedgeai.com/api/platform/async/status?uuid=' + uuid;
|
||||||
|
if (real_api_key.startsWith('sk-')) {
|
||||||
|
result_url = 'https://api.doc2x.noedgeai.com/api/v1/async/status?uuid=' + uuid;
|
||||||
|
}
|
||||||
|
const maxAttempts = 100;
|
||||||
|
// Wait for the result, at most 100s
|
||||||
|
for await (const _ of Array(maxAttempts).keys()) {
|
||||||
|
const result_response = await fetch(result_url, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${real_api_key}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!result_response.ok) {
|
||||||
|
return {
|
||||||
|
result: `Failed to get result: ${await result_response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const result_data = await result_response.json();
|
||||||
|
if (['ready', 'processing'].includes(result_data.data.status)) {
|
||||||
|
await delay(1000);
|
||||||
|
} else if (result_data.data.status === 'pages limit exceeded') {
|
||||||
|
return {
|
||||||
|
result: 'Doc2X Pages limit exceeded',
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
} else if (result_data.data.status === 'success') {
|
||||||
|
let result = result_data.data.result.pages[0].md;
|
||||||
|
result = result.replace(/\\[\(\)]/g, '$').replace(/\\[\[\]]/g, '$$');
|
||||||
|
return {
|
||||||
|
result: result,
|
||||||
|
success: true
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
result: `Failed to get result: ${await result_data.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
result: 'Timeout waiting for result',
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default main;
|
470
packages/plugins/src/Doc2X/URLImg2text/template.json
Normal file
470
packages/plugins/src/Doc2X/URLImg2text/template.json
Normal file
@@ -0,0 +1,470 @@
|
|||||||
|
{
|
||||||
|
"author": "",
|
||||||
|
"version": "486",
|
||||||
|
"name": "Doc2X 图像(URL)识别",
|
||||||
|
"avatar": "/imgs/workflow/textEditor.svg",
|
||||||
|
"intro": "将传入的图片(URL)发送至Doc2X进行解析,返回带LaTeX公式的markdown格式的文本",
|
||||||
|
"showStatus": true,
|
||||||
|
"weight": 10,
|
||||||
|
|
||||||
|
"isTool": true,
|
||||||
|
"templateType": "tools",
|
||||||
|
|
||||||
|
"workflow": {
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"nodeId": "pluginInput",
|
||||||
|
"name": "自定义插件输入",
|
||||||
|
"intro": "可以配置插件需要哪些输入,利用这些输入来运行插件",
|
||||||
|
"avatar": "core/workflow/template/workflowStart",
|
||||||
|
"flowNodeType": "pluginInput",
|
||||||
|
"showStatus": false,
|
||||||
|
"position": {
|
||||||
|
"x": 388.243055058894,
|
||||||
|
"y": -75.09744210499466
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"input"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"description": "Doc2X的验证密匙,对于个人用户可以从Doc2X官网 - 个人信息 - 身份令牌获得",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "Doc2X的验证密匙,对于个人用户可以从Doc2X官网 - 个人信息 - 身份令牌获得",
|
||||||
|
"defaultValue": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"description": "待处理图片的URL",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "待处理图片的URL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"switch"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "img_correction",
|
||||||
|
"label": "img_correction",
|
||||||
|
"description": "是否启用图形矫正功能",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "是否启用图形矫正功能",
|
||||||
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"switch"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "formula",
|
||||||
|
"label": "formula",
|
||||||
|
"description": "是否开启纯公式识别(仅适用于图片内容仅有公式时)",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "是否开启纯公式识别(仅适用于图片内容仅有公式时)",
|
||||||
|
"defaultValue": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"id": "apikey",
|
||||||
|
"valueType": "string",
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "url",
|
||||||
|
"valueType": "string",
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "img_correction",
|
||||||
|
"valueType": "boolean",
|
||||||
|
"key": "img_correction",
|
||||||
|
"label": "img_correction",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "formula",
|
||||||
|
"valueType": "boolean",
|
||||||
|
"key": "formula",
|
||||||
|
"label": "formula",
|
||||||
|
"type": "hidden"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nodeId": "pluginOutput",
|
||||||
|
"name": "自定义插件输出",
|
||||||
|
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
|
||||||
|
"avatar": "core/workflow/template/pluginOutput",
|
||||||
|
"flowNodeType": "pluginOutput",
|
||||||
|
"showStatus": false,
|
||||||
|
"position": {
|
||||||
|
"x": 1654.8021754314786,
|
||||||
|
"y": -22.243376051504086
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "result",
|
||||||
|
"label": "result",
|
||||||
|
"description": "处理结果(或者是报错信息)",
|
||||||
|
"value": [
|
||||||
|
"zHG5jJBkXmjB",
|
||||||
|
"xWQuEf50F3mr"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "success",
|
||||||
|
"label": "success",
|
||||||
|
"description": "是否处理成功",
|
||||||
|
"value": [
|
||||||
|
"zHG5jJBkXmjB",
|
||||||
|
"m6CJJj7GFud5"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nodeId": "zHG5jJBkXmjB",
|
||||||
|
"name": "HTTP 请求",
|
||||||
|
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||||
|
"avatar": "core/workflow/template/httpRequest",
|
||||||
|
"flowNodeType": "httpRequest468",
|
||||||
|
"showStatus": true,
|
||||||
|
"position": {
|
||||||
|
"x": 1081.967607938733,
|
||||||
|
"y": -426.08028677656125
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"key": "system_addInputParam",
|
||||||
|
"renderTypeList": [
|
||||||
|
"addInputParam"
|
||||||
|
],
|
||||||
|
"valueType": "dynamic",
|
||||||
|
"label": "",
|
||||||
|
"required": false,
|
||||||
|
"description": "core.module.input.description.HTTP Dynamic Input",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpMethod",
|
||||||
|
"renderTypeList": [
|
||||||
|
"custom"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"label": "",
|
||||||
|
"value": "POST",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpReqUrl",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"label": "",
|
||||||
|
"description": "core.module.input.description.Http Request Url",
|
||||||
|
"placeholder": "https://api.ai.com/getInventory",
|
||||||
|
"required": false,
|
||||||
|
"value": "Doc2X/URLImg2text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpHeader",
|
||||||
|
"renderTypeList": [
|
||||||
|
"custom"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": [],
|
||||||
|
"label": "",
|
||||||
|
"description": "core.module.input.description.Http Request Header",
|
||||||
|
"placeholder": "core.module.input.description.Http Request Header",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpParams",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": [],
|
||||||
|
"label": "",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpJsonBody",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": "{\n \"apikey\": \"{{apikey}}\",\n \"url\": \"{{url}}\",\n \"img_correction\": \"{{img_correction}}\",\n \"formula\": \"{{img_correction}}\"\n}",
|
||||||
|
"label": "",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"apikey"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "img_correction",
|
||||||
|
"label": "img_correction",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"img_correction"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "formula",
|
||||||
|
"label": "formula",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"formula"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"id": "error",
|
||||||
|
"key": "error",
|
||||||
|
"label": "请求错误",
|
||||||
|
"description": "HTTP请求错误信息,成功时返回空",
|
||||||
|
"valueType": "object",
|
||||||
|
"type": "static"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "httpRawResponse",
|
||||||
|
"key": "httpRawResponse",
|
||||||
|
"label": "原始响应",
|
||||||
|
"required": true,
|
||||||
|
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||||
|
"valueType": "any",
|
||||||
|
"type": "static"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "system_addOutputParam",
|
||||||
|
"key": "system_addOutputParam",
|
||||||
|
"type": "dynamic",
|
||||||
|
"valueType": "dynamic",
|
||||||
|
"label": "",
|
||||||
|
"customFieldConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "xWQuEf50F3mr",
|
||||||
|
"valueType": "string",
|
||||||
|
"type": "dynamic",
|
||||||
|
"key": "result",
|
||||||
|
"label": "result"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "m6CJJj7GFud5",
|
||||||
|
"valueType": "boolean",
|
||||||
|
"type": "dynamic",
|
||||||
|
"key": "success",
|
||||||
|
"label": "success"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"source": "pluginInput",
|
||||||
|
"target": "zHG5jJBkXmjB",
|
||||||
|
"sourceHandle": "pluginInput-source-right",
|
||||||
|
"targetHandle": "zHG5jJBkXmjB-target-left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "zHG5jJBkXmjB",
|
||||||
|
"target": "pluginOutput",
|
||||||
|
"sourceHandle": "zHG5jJBkXmjB-source-right",
|
||||||
|
"targetHandle": "pluginOutput-target-left"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
130
packages/plugins/src/Doc2X/URLPDF2text/index.ts
Normal file
130
packages/plugins/src/Doc2X/URLPDF2text/index.ts
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
import { delay } from '@fastgpt/global/common/system/utils';
|
||||||
|
import { addLog } from '@fastgpt/service/common/system/log';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
apikey: string;
|
||||||
|
url: string;
|
||||||
|
ocr: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Response type same as HTTP outputs
|
||||||
|
type Response = Promise<{
|
||||||
|
result: string;
|
||||||
|
success: boolean;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
const main = async ({ apikey, url, ocr }: Props): Response => {
|
||||||
|
// Check the apikey
|
||||||
|
if (!apikey) {
|
||||||
|
return {
|
||||||
|
result: `API key is required`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
let real_api_key = apikey;
|
||||||
|
if (!apikey.startsWith('sk-')) {
|
||||||
|
const response = await fetch('https://api.doc2x.noedgeai.com/api/token/refresh', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${apikey}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (response.status !== 200) {
|
||||||
|
return {
|
||||||
|
result: `Get token failed: ${await response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const data = await response.json();
|
||||||
|
real_api_key = data.data.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Get the image binary from the URL
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('pdf_url', url);
|
||||||
|
formData.append('ocr', ocr ? '1' : '0');
|
||||||
|
|
||||||
|
let upload_url = 'https://api.doc2x.noedgeai.com/api/platform/async/pdf';
|
||||||
|
if (real_api_key.startsWith('sk-')) {
|
||||||
|
upload_url = 'https://api.doc2x.noedgeai.com/api/v1/async/pdf';
|
||||||
|
}
|
||||||
|
|
||||||
|
let uuid;
|
||||||
|
const uploadAttempts = [1, 2, 3];
|
||||||
|
for await (const attempt of uploadAttempts) {
|
||||||
|
const upload_response = await fetch(upload_url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${real_api_key}`
|
||||||
|
},
|
||||||
|
body: formData
|
||||||
|
});
|
||||||
|
if (!upload_response.ok) {
|
||||||
|
if (upload_response.status === 429 && attempt < 3) {
|
||||||
|
await delay(10000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
result: `Failed to upload file: ${await upload_response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const upload_data = await upload_response.json();
|
||||||
|
uuid = upload_data.data.uuid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the result by uuid
|
||||||
|
let result_url = 'https://api.doc2x.noedgeai.com/api/platform/async/status?uuid=' + uuid;
|
||||||
|
if (real_api_key.startsWith('sk-')) {
|
||||||
|
result_url = 'https://api.doc2x.noedgeai.com/api/v1/async/status?uuid=' + uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = '';
|
||||||
|
// Wait for the result, at most 100s
|
||||||
|
const maxAttempts = 100;
|
||||||
|
for await (const _ of Array(maxAttempts).keys()) {
|
||||||
|
const result_response = await fetch(result_url, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${real_api_key}`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!result_response.ok) {
|
||||||
|
return {
|
||||||
|
result: `Failed to get result: ${await result_response.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const result_data = await result_response.json();
|
||||||
|
if (['ready', 'processing'].includes(result_data.data.status)) {
|
||||||
|
await delay(1000);
|
||||||
|
} else if (result_data.data.status === 'pages limit exceeded') {
|
||||||
|
return {
|
||||||
|
result: 'Doc2X Pages limit exceeded',
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
} else if (result_data.data.status === 'success') {
|
||||||
|
result = await Promise.all(
|
||||||
|
result_data.data.result.pages.map((page: { md: any }) => page.md)
|
||||||
|
).then((pages) => pages.join('\n'));
|
||||||
|
result = result.replace(/\\[\(\)]/g, '$').replace(/\\[\[\]]/g, '$$');
|
||||||
|
return {
|
||||||
|
result: result,
|
||||||
|
success: true
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
result: `Failed to get result: ${await result_data.text()}`,
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
result: 'Timeout waiting for result',
|
||||||
|
success: false
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default main;
|
415
packages/plugins/src/Doc2X/URLPDF2text/template.json
Normal file
415
packages/plugins/src/Doc2X/URLPDF2text/template.json
Normal file
@@ -0,0 +1,415 @@
|
|||||||
|
{
|
||||||
|
"author": "",
|
||||||
|
"version": "486",
|
||||||
|
"name": "Doc2X PDF文件(URL)识别",
|
||||||
|
"avatar": "/imgs/workflow/textEditor.svg",
|
||||||
|
"intro": "将传入的PDF文件(URL)发送至Doc2X进行解析,返回带LaTeX公式的markdown格式的文本",
|
||||||
|
"showStatus": true,
|
||||||
|
"weight": 10,
|
||||||
|
|
||||||
|
"isTool": true,
|
||||||
|
"templateType": "tools",
|
||||||
|
|
||||||
|
"workflow": {
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"nodeId": "pluginInput",
|
||||||
|
"name": "自定义插件输入",
|
||||||
|
"intro": "可以配置插件需要哪些输入,利用这些输入来运行插件",
|
||||||
|
"avatar": "core/workflow/template/workflowStart",
|
||||||
|
"flowNodeType": "pluginInput",
|
||||||
|
"showStatus": false,
|
||||||
|
"position": {
|
||||||
|
"x": 388.243055058894,
|
||||||
|
"y": -75.09744210499466
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"input"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"description": "Doc2X的验证密匙,对于个人用户可以从Doc2X官网 - 个人信息 - 身份令牌获得",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "Doc2X的验证密匙,对于个人用户可以从Doc2X官网 - 个人信息 - 身份令牌获得",
|
||||||
|
"defaultValue": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"description": "待处理PDF文件的URL",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "待处理PDF文件的URL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"switch"
|
||||||
|
],
|
||||||
|
"selectedTypeIndex": 0,
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "ocr",
|
||||||
|
"label": "ocr",
|
||||||
|
"description": "是否开启对PDF文件内图片的OCR识别,建议开启",
|
||||||
|
"required": true,
|
||||||
|
"toolDescription": "是否开启对PDF文件内图片的OCR识别,建议开启",
|
||||||
|
"defaultValue": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"id": "apikey",
|
||||||
|
"valueType": "string",
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "url",
|
||||||
|
"valueType": "string",
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "formula",
|
||||||
|
"valueType": "boolean",
|
||||||
|
"key": "ocr",
|
||||||
|
"label": "ocr",
|
||||||
|
"type": "hidden"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nodeId": "pluginOutput",
|
||||||
|
"name": "自定义插件输出",
|
||||||
|
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
|
||||||
|
"avatar": "core/workflow/template/pluginOutput",
|
||||||
|
"flowNodeType": "pluginOutput",
|
||||||
|
"showStatus": false,
|
||||||
|
"position": {
|
||||||
|
"x": 1654.8021754314786,
|
||||||
|
"y": -22.243376051504086
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "result",
|
||||||
|
"label": "result",
|
||||||
|
"description": "处理结果(或者是报错信息)",
|
||||||
|
"value": [
|
||||||
|
"zHG5jJBkXmjB",
|
||||||
|
"xWQuEf50F3mr"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "success",
|
||||||
|
"label": "success",
|
||||||
|
"description": "是否处理成功",
|
||||||
|
"value": [
|
||||||
|
"zHG5jJBkXmjB",
|
||||||
|
"m6CJJj7GFud5"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nodeId": "zHG5jJBkXmjB",
|
||||||
|
"name": "HTTP 请求",
|
||||||
|
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||||
|
"avatar": "core/workflow/template/httpRequest",
|
||||||
|
"flowNodeType": "httpRequest468",
|
||||||
|
"showStatus": true,
|
||||||
|
"position": {
|
||||||
|
"x": 1081.967607938733,
|
||||||
|
"y": -426.08028677656125
|
||||||
|
},
|
||||||
|
"version": "481",
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"key": "system_addInputParam",
|
||||||
|
"renderTypeList": [
|
||||||
|
"addInputParam"
|
||||||
|
],
|
||||||
|
"valueType": "dynamic",
|
||||||
|
"label": "",
|
||||||
|
"required": false,
|
||||||
|
"description": "core.module.input.description.HTTP Dynamic Input",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpMethod",
|
||||||
|
"renderTypeList": [
|
||||||
|
"custom"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"label": "",
|
||||||
|
"value": "POST",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpReqUrl",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"label": "",
|
||||||
|
"description": "core.module.input.description.Http Request Url",
|
||||||
|
"placeholder": "https://api.ai.com/getInventory",
|
||||||
|
"required": false,
|
||||||
|
"value": "Doc2X/URLPDF2text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpHeader",
|
||||||
|
"renderTypeList": [
|
||||||
|
"custom"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": [],
|
||||||
|
"label": "",
|
||||||
|
"description": "core.module.input.description.Http Request Header",
|
||||||
|
"placeholder": "core.module.input.description.Http Request Header",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpParams",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": [],
|
||||||
|
"label": "",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system_httpJsonBody",
|
||||||
|
"renderTypeList": [
|
||||||
|
"hidden"
|
||||||
|
],
|
||||||
|
"valueType": "any",
|
||||||
|
"value": "{\n \"apikey\": \"{{apikey}}\",\n \"url\": \"{{url}}\",\n \"ocr\": \"{{ocr}}\"\n}",
|
||||||
|
"label": "",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "apikey",
|
||||||
|
"label": "apikey",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"apikey"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "string",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "url",
|
||||||
|
"label": "url",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"renderTypeList": [
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"valueType": "boolean",
|
||||||
|
"canEdit": true,
|
||||||
|
"key": "ocr",
|
||||||
|
"label": "ocr",
|
||||||
|
"customInputConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": true
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"value": [
|
||||||
|
"pluginInput",
|
||||||
|
"formula"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"id": "error",
|
||||||
|
"key": "error",
|
||||||
|
"label": "请求错误",
|
||||||
|
"description": "HTTP请求错误信息,成功时返回空",
|
||||||
|
"valueType": "object",
|
||||||
|
"type": "static"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "httpRawResponse",
|
||||||
|
"key": "httpRawResponse",
|
||||||
|
"label": "原始响应",
|
||||||
|
"required": true,
|
||||||
|
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||||
|
"valueType": "any",
|
||||||
|
"type": "static"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "system_addOutputParam",
|
||||||
|
"key": "system_addOutputParam",
|
||||||
|
"type": "dynamic",
|
||||||
|
"valueType": "dynamic",
|
||||||
|
"label": "",
|
||||||
|
"customFieldConfig": {
|
||||||
|
"selectValueTypeList": [
|
||||||
|
"string",
|
||||||
|
"number",
|
||||||
|
"boolean",
|
||||||
|
"object",
|
||||||
|
"arrayString",
|
||||||
|
"arrayNumber",
|
||||||
|
"arrayBoolean",
|
||||||
|
"arrayObject",
|
||||||
|
"any",
|
||||||
|
"chatHistory",
|
||||||
|
"datasetQuote",
|
||||||
|
"dynamic",
|
||||||
|
"selectApp",
|
||||||
|
"selectDataset"
|
||||||
|
],
|
||||||
|
"showDescription": false,
|
||||||
|
"showDefaultValue": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "xWQuEf50F3mr",
|
||||||
|
"valueType": "string",
|
||||||
|
"type": "dynamic",
|
||||||
|
"key": "result",
|
||||||
|
"label": "result"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "m6CJJj7GFud5",
|
||||||
|
"valueType": "boolean",
|
||||||
|
"type": "dynamic",
|
||||||
|
"key": "success",
|
||||||
|
"label": "success"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"source": "pluginInput",
|
||||||
|
"target": "zHG5jJBkXmjB",
|
||||||
|
"sourceHandle": "pluginInput-source-right",
|
||||||
|
"targetHandle": "zHG5jJBkXmjB-target-left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "zHG5jJBkXmjB",
|
||||||
|
"target": "pluginOutput",
|
||||||
|
"sourceHandle": "zHG5jJBkXmjB-source-right",
|
||||||
|
"targetHandle": "pluginOutput-target-left"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
17
packages/plugins/src/Doc2X/template.json
Normal file
17
packages/plugins/src/Doc2X/template.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"author": "",
|
||||||
|
"version": "486",
|
||||||
|
"name": "Doc2X服务",
|
||||||
|
"avatar": "/imgs/workflow/textEditor.svg",
|
||||||
|
"intro": "传入的URL形式的图片或PDF文件发送至Doc2X进行解析,返回带LaTeX公式的markdown格式的文本。",
|
||||||
|
"showStatus": true,
|
||||||
|
"weight": 10,
|
||||||
|
|
||||||
|
"isTool": true,
|
||||||
|
"templateType": "tools",
|
||||||
|
|
||||||
|
"workflow": {
|
||||||
|
"nodes": [],
|
||||||
|
"edges": []
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user