Commit 0b37ae6f by ccran

feat: add tesseract ocr;

parent 5e91ed5f
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
!**/*.pdf !**/*.pdf
!**/*.xls !**/*.xls
!workflow/** !workflow/**
!demo/**
!README.md !README.md
......
...@@ -46,7 +46,7 @@ FILE_SUFFIX = "-审核批注" ...@@ -46,7 +46,7 @@ FILE_SUFFIX = "-审核批注"
## 关键参数** ## 关键参数**
use_non_fastgpt_llm = False use_non_fastgpt_llm = False
use_lufa = True use_lufa = False
use_jp_machine = True use_jp_machine = True
## 关键参数** ## 关键参数**
......
for _ in range(input()): from PIL import Image
try: import pytesseract
eval(raw_input())
print("YES") img = Image.open("ocr.png")
except TypeError:
print("NO") text = pytesseract.image_to_string(img,lang="chi_sim+eng")
except:
print("NO") print(text)
\ No newline at end of file
...@@ -42,6 +42,7 @@ openpyxl==3.1.5 ...@@ -42,6 +42,7 @@ openpyxl==3.1.5
packaging==26.0 packaging==26.0
pandas==3.0.0 pandas==3.0.0
pathlib==1.0.1 pathlib==1.0.1
Pillow==12.0.0
plum-dispatch==1.7.4 plum-dispatch==1.7.4
propcache==0.4.1 propcache==0.4.1
prov==2.1.1 prov==2.1.1
...@@ -52,6 +53,7 @@ pydantic_core==2.41.5 ...@@ -52,6 +53,7 @@ pydantic_core==2.41.5
pydot==4.0.1 pydot==4.0.1
PyMuPDF==1.26.7 PyMuPDF==1.26.7
pyparsing==3.3.2 pyparsing==3.3.2
pytesseract==0.3.13
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
pyxnat==1.6.4 pyxnat==1.6.4
RapidFuzz==3.14.3 RapidFuzz==3.14.3
......
...@@ -6,7 +6,7 @@ from spire.pdf import PdfDocument, PdfTextExtractOptions, PdfTextExtractor, Lice ...@@ -6,7 +6,7 @@ from spire.pdf import PdfDocument, PdfTextExtractOptions, PdfTextExtractor, Lice
PdfPopupIcon PdfPopupIcon
from loguru import logger from loguru import logger
from rapidfuzz import process from rapidfuzz import process
from utils.ocr_util import OCRUtil from utils.tesseract_ocr_util import TesseractOCRUtil
import copy import copy
from utils.common_util import adjust_single_chunk_size from utils.common_util import adjust_single_chunk_size
import re import re
...@@ -174,7 +174,7 @@ class SpirePdfDoc(DocBase): ...@@ -174,7 +174,7 @@ class SpirePdfDoc(DocBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(SpirePdfDoc, self).__init__(**kwargs) super(SpirePdfDoc, self).__init__(**kwargs)
self.ocr_util = OCRUtil() self.ocr_util = TesseractOCRUtil()
def load(self,doc_path): def load(self,doc_path):
self._doc_path = doc_path self._doc_path = doc_path
......
import asyncio
import os
import re
from urllib import parse
from urllib.parse import urlparse
import fitz
from loguru import logger
from utils.common_util import random_str
from utils.http_util import download_file, url_replace_fastgpt
class TesseractOCRUtil:
def __init__(self, lang='chi_sim+eng'):
self.lang = lang
def ocr_image(self, file_path):
import pytesseract
from PIL import Image
with Image.open(file_path) as img:
return pytesseract.image_to_string(img, lang=self.lang)
async def ocr_image_async(self, path_list):
tasks = [asyncio.to_thread(self.ocr_image, file_path) for file_path in path_list]
responses = await asyncio.gather(*tasks)
res_dict = {}
for file_path, content in zip(path_list, responses):
page_num = int(self.get_pdf_2_img_page_num(file_path))
res_dict[page_num] = content
logger.info(f'tesseract ocr_image_async finish. all pages:{len(res_dict)}')
return [res_dict[key] for key in sorted(res_dict)]
def set_pdf_2_img_page(self, path, page_idx):
return f'{path}_{page_idx + 1}.png'
def get_pdf_2_img_page_num(self, path):
match = re.search(r'_(\d+)\.png$', path)
if not match:
raise ValueError(f'Invalid pdf page image path: {path}')
return match.group(1)
def pdf_2_img(self, path, zoom_x=2, zoom_y=2):
pdf = fitz.open(path)
pdf_list = []
for pg in range(0, pdf.page_count):
page = pdf[pg]
trans = fitz.Matrix(zoom_x, zoom_y)
pm = page.get_pixmap(matrix=trans, alpha=False)
dest_png = self.set_pdf_2_img_page(path, pg)
pm.save(dest_png)
pdf_list.append(dest_png)
pdf.close()
return pdf_list
def ocr_download_path(self, url):
logger.info(f'tesseract ocr url:{url}')
url = url_replace_fastgpt(url)
url_parsed = urlparse(url)
query_dict = parse.parse_qs(url_parsed.query)
if 'filename' in query_dict:
filename = query_dict.get('filename')[0]
else:
filename = f'{random_str()}.pdf'
dest_path = f'ocr/{filename}'
download_file(url, dest_path)
return dest_path
async def ocr_result_pdf(self, dest_path):
pdf_list = self.pdf_2_img(dest_path)
try:
return await self.ocr_image_async(pdf_list)
finally:
for pdf in pdf_list:
if os.path.exists(pdf):
os.remove(pdf)
if __name__ == '__main__':
ocr_util = TesseractOCRUtil()
result = asyncio.run(ocr_util.ocr_result_pdf('../demo/2020100593中建大成建筑(B类).pdf'))
print(f'len(result):{len(result)}')
print(result)
{ {
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"avatar": "core/workflow/template/systemConfig", "avatar": "core/workflow/template/systemConfig",
"flowNodeType": "userGuide", "flowNodeType": "userGuide",
"position": { "position": {
"x": -1830.6752840119775, "x": -3052.9050978053997,
"y": -773.8134339439673 "y": -775.6849266713408
}, },
"version": "481", "version": "481",
"inputs": [ "inputs": [
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
"avatar": "core/workflow/template/workflowStart", "avatar": "core/workflow/template/workflowStart",
"flowNodeType": "workflowStart", "flowNodeType": "workflowStart",
"position": { "position": {
"x": -1341.9918261676994, "x": -2406.2705093256454,
"y": -720.3035540606256 "y": -675.1304350810863
}, },
"version": "481", "version": "481",
"inputs": [ "inputs": [
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/conversations/new", "value": "http://172.21.107.80:18169/conversations/new",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/documents/parse", "value": "http://172.21.107.80:18169/documents/parse",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1010,7 +1010,7 @@ ...@@ -1010,7 +1010,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/memory/facts/export", "value": "http://172.21.107.80:18169/memory/facts/export",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1255,7 +1255,7 @@ ...@@ -1255,7 +1255,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts", "value": "http://172.21.107.80:18169/segments/summary/facts",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1538,7 +1538,7 @@ ...@@ -1538,7 +1538,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/rule-router", "value": "http://172.21.107.80:18169/segments/review/rule-router",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1852,7 +1852,7 @@ ...@@ -1852,7 +1852,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts/merger", "value": "http://172.21.107.80:18169/segments/summary/facts/merger",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2053,8 +2053,8 @@ ...@@ -2053,8 +2053,8 @@
"flowNodeType": "httpRequest468", "flowNodeType": "httpRequest468",
"showStatus": true, "showStatus": true,
"position": { "position": {
"x": -804.8826015635359, "x": -878.9665166899803,
"y": -701.6010115448964 "y": -775.6849266713408
}, },
"version": "481", "version": "481",
"inputs": [ "inputs": [
...@@ -2127,7 +2127,7 @@ ...@@ -2127,7 +2127,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/rulesets/route", "value": "http://172.21.107.80:18169/rulesets/route",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2163,7 +2163,7 @@ ...@@ -2163,7 +2163,7 @@
"hidden" "hidden"
], ],
"valueType": "any", "valueType": "any",
"value": "{\n\"question\":\"{{$448745.userChatInput$}}\"\n}", "value": "{\n\"question\":\"{{$anKdljJd5pCGBRhB.system_text$}}\"\n}",
"label": "", "label": "",
"required": false, "required": false,
"debugLabel": "", "debugLabel": "",
...@@ -2359,6 +2359,45 @@ ...@@ -2359,6 +2359,45 @@
} }
], ],
"outputs": [] "outputs": []
},
{
"nodeId": "anKdljJd5pCGBRhB",
"name": "增加合同提取前缀",
"intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",
"avatar": "core/workflow/template/textConcat",
"flowNodeType": "textEditor",
"position": {
"x": -1848.542944082165,
"y": -652.5650477390293
},
"version": "4813",
"inputs": [
{
"key": "system_textareaInput",
"renderTypeList": [
"textarea"
],
"valueType": "string",
"required": true,
"label": "拼接文本",
"placeholder": "workflow:input_variable_list",
"value": "帮我做合同信息提取;\n{{$448745.userChatInput$}}",
"valueDesc": "",
"description": "",
"debugLabel": "",
"toolDescription": ""
}
],
"outputs": [
{
"id": "system_text",
"key": "system_text",
"label": "workflow:concatenation_result",
"type": "static",
"valueType": "string",
"description": ""
}
]
} }
], ],
"edges": [ "edges": [
...@@ -2447,12 +2486,6 @@ ...@@ -2447,12 +2486,6 @@
"targetHandle": "v7v3dWPFEySgk5Wk-target-left" "targetHandle": "v7v3dWPFEySgk5Wk-target-left"
}, },
{ {
"source": "448745",
"target": "yR4fA3XTHyjYMN3j",
"sourceHandle": "448745-source-right",
"targetHandle": "yR4fA3XTHyjYMN3j-target-left"
},
{
"source": "yR4fA3XTHyjYMN3j", "source": "yR4fA3XTHyjYMN3j",
"target": "rNHAaQ4A2NNI0PCE", "target": "rNHAaQ4A2NNI0PCE",
"sourceHandle": "yR4fA3XTHyjYMN3j-source-right", "sourceHandle": "yR4fA3XTHyjYMN3j-source-right",
...@@ -2469,6 +2502,18 @@ ...@@ -2469,6 +2502,18 @@
"target": "o7b0axI8mmI9pA2A", "target": "o7b0axI8mmI9pA2A",
"sourceHandle": "te1XPVi9S4GFi6Jx-source-right", "sourceHandle": "te1XPVi9S4GFi6Jx-source-right",
"targetHandle": "o7b0axI8mmI9pA2A-target-left" "targetHandle": "o7b0axI8mmI9pA2A-target-left"
},
{
"source": "448745",
"target": "anKdljJd5pCGBRhB",
"sourceHandle": "448745-source-right",
"targetHandle": "anKdljJd5pCGBRhB-target-left"
},
{
"source": "anKdljJd5pCGBRhB",
"target": "yR4fA3XTHyjYMN3j",
"sourceHandle": "anKdljJd5pCGBRhB-source-right",
"targetHandle": "yR4fA3XTHyjYMN3j-target-left"
} }
], ],
"chatConfig": { "chatConfig": {
......
{ {
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/conversations/new", "value": "http://172.21.107.80:18169/conversations/new",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/documents/parse", "value": "http://172.21.107.80:18169/documents/parse",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -976,7 +976,7 @@ ...@@ -976,7 +976,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/findings", "value": "http://172.21.107.80:18169/segments/review/findings",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1288,7 +1288,7 @@ ...@@ -1288,7 +1288,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/memory/export", "value": "http://172.21.107.80:18169/memory/export",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1540,7 +1540,7 @@ ...@@ -1540,7 +1540,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts", "value": "http://172.21.107.80:18169/segments/summary/facts",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2024,7 +2024,7 @@ ...@@ -2024,7 +2024,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/reflect", "value": "http://172.21.107.80:18169/segments/review/reflect",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2306,7 +2306,7 @@ ...@@ -2306,7 +2306,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/rule-router", "value": "http://172.21.107.80:18169/segments/review/rule-router",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2791,7 +2791,7 @@ ...@@ -2791,7 +2791,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/merger", "value": "http://172.21.107.80:18169/segments/review/merger",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
......
{ {
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/conversations/new", "value": "http://172.21.107.80:18169/conversations/new",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/documents/parse", "value": "http://172.21.107.80:18169/documents/parse",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -976,7 +976,7 @@ ...@@ -976,7 +976,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/findings", "value": "http://172.21.107.80:18169/segments/review/findings",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1288,7 +1288,7 @@ ...@@ -1288,7 +1288,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/memory/export", "value": "http://172.21.107.80:18169/memory/export",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1540,7 +1540,7 @@ ...@@ -1540,7 +1540,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts", "value": "http://172.21.107.80:18169/segments/summary/facts",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2024,7 +2024,7 @@ ...@@ -2024,7 +2024,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/reflect", "value": "http://172.21.107.80:18169/segments/review/reflect",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2306,7 +2306,7 @@ ...@@ -2306,7 +2306,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/rule-router", "value": "http://172.21.107.80:18169/segments/review/rule-router",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2791,7 +2791,7 @@ ...@@ -2791,7 +2791,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/merger", "value": "http://172.21.107.80:18169/segments/review/merger",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"avatar": "core/workflow/template/systemConfig", "avatar": "core/workflow/template/systemConfig",
"flowNodeType": "userGuide", "flowNodeType": "userGuide",
"position": { "position": {
"x": -1830.6752840119775, "x": -2626.6230836832283,
"y": -773.8134339439673 "y": -718.7305346936864
}, },
"version": "481", "version": "481",
"inputs": [ "inputs": [
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
"avatar": "core/workflow/template/workflowStart", "avatar": "core/workflow/template/workflowStart",
"flowNodeType": "workflowStart", "flowNodeType": "workflowStart",
"position": { "position": {
"x": -1341.9918261676994, "x": -2076.59187052832,
"y": -720.3035540606256 "y": -648.1183530689627
}, },
"version": "481", "version": "481",
"inputs": [ "inputs": [
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/conversations/new", "value": "http://172.21.107.80:18169/conversations/new",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/documents/parse", "value": "http://172.21.107.80:18169/documents/parse",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1010,7 +1010,7 @@ ...@@ -1010,7 +1010,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/memory/facts/export", "value": "http://172.21.107.80:18169/memory/facts/export",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1255,7 +1255,7 @@ ...@@ -1255,7 +1255,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts", "value": "http://172.21.107.80:18169/segments/summary/facts",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1538,7 +1538,7 @@ ...@@ -1538,7 +1538,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/review/rule-router", "value": "http://172.21.107.80:18169/segments/review/rule-router",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1852,7 +1852,7 @@ ...@@ -1852,7 +1852,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/segments/summary/facts/merger", "value": "http://172.21.107.80:18169/segments/summary/facts/merger",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2127,7 +2127,7 @@ ...@@ -2127,7 +2127,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://172.21.107.45:18169/rulesets/route", "value": "http://172.21.107.80:18169/rulesets/route",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2163,7 +2163,7 @@ ...@@ -2163,7 +2163,7 @@
"hidden" "hidden"
], ],
"valueType": "any", "valueType": "any",
"value": "{\n\"question\":\"{{$448745.userChatInput$}}\"\n}", "value": "{\n\"question\":\"{{$txeKu3Wg4PktWwrs.system_text$}}\"\n}",
"label": "", "label": "",
"required": false, "required": false,
"debugLabel": "", "debugLabel": "",
...@@ -2359,6 +2359,45 @@ ...@@ -2359,6 +2359,45 @@
} }
], ],
"outputs": [] "outputs": []
},
{
"nodeId": "txeKu3Wg4PktWwrs",
"name": "文本拼接",
"intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",
"avatar": "core/workflow/template/textConcat",
"flowNodeType": "textEditor",
"position": {
"x": -1591.7611113168862,
"y": -566.1422308841376
},
"version": "4813",
"inputs": [
{
"key": "system_textareaInput",
"renderTypeList": [
"textarea"
],
"valueType": "string",
"required": true,
"label": "拼接文本",
"placeholder": "workflow:input_variable_list",
"value": "帮我进行技术协议提取;\n{{$448745.userChatInput$}}",
"valueDesc": "",
"description": "",
"debugLabel": "",
"toolDescription": ""
}
],
"outputs": [
{
"id": "system_text",
"key": "system_text",
"label": "workflow:concatenation_result",
"type": "static",
"valueType": "string",
"description": ""
}
]
} }
], ],
"edges": [ "edges": [
...@@ -2447,12 +2486,6 @@ ...@@ -2447,12 +2486,6 @@
"targetHandle": "v7v3dWPFEySgk5Wk-target-left" "targetHandle": "v7v3dWPFEySgk5Wk-target-left"
}, },
{ {
"source": "448745",
"target": "yR4fA3XTHyjYMN3j",
"sourceHandle": "448745-source-right",
"targetHandle": "yR4fA3XTHyjYMN3j-target-left"
},
{
"source": "yR4fA3XTHyjYMN3j", "source": "yR4fA3XTHyjYMN3j",
"target": "rNHAaQ4A2NNI0PCE", "target": "rNHAaQ4A2NNI0PCE",
"sourceHandle": "yR4fA3XTHyjYMN3j-source-right", "sourceHandle": "yR4fA3XTHyjYMN3j-source-right",
...@@ -2469,6 +2502,18 @@ ...@@ -2469,6 +2502,18 @@
"target": "o7b0axI8mmI9pA2A", "target": "o7b0axI8mmI9pA2A",
"sourceHandle": "te1XPVi9S4GFi6Jx-source-right", "sourceHandle": "te1XPVi9S4GFi6Jx-source-right",
"targetHandle": "o7b0axI8mmI9pA2A-target-left" "targetHandle": "o7b0axI8mmI9pA2A-target-left"
},
{
"source": "448745",
"target": "txeKu3Wg4PktWwrs",
"sourceHandle": "448745-source-right",
"targetHandle": "txeKu3Wg4PktWwrs-target-left"
},
{
"source": "txeKu3Wg4PktWwrs",
"target": "yR4fA3XTHyjYMN3j",
"sourceHandle": "txeKu3Wg4PktWwrs-source-right",
"targetHandle": "yR4fA3XTHyjYMN3j-target-left"
} }
], ],
"chatConfig": { "chatConfig": {
......
{ {
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/conversations/new", "value": "http://172.21.107.80:18169/conversations/new",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/documents/parse", "value": "http://172.21.107.80:18169/documents/parse",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -969,7 +969,7 @@ ...@@ -969,7 +969,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/segments/review/findings", "value": "http://172.21.107.80:18169/segments/review/findings",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1281,7 +1281,7 @@ ...@@ -1281,7 +1281,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/memory/export", "value": "http://172.21.107.80:18169/memory/export",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -1533,7 +1533,7 @@ ...@@ -1533,7 +1533,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/segments/summary/facts", "value": "http://172.21.107.80:18169/segments/summary/facts",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2017,7 +2017,7 @@ ...@@ -2017,7 +2017,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/segments/review/reflect", "value": "http://172.21.107.80:18169/segments/review/reflect",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2299,7 +2299,7 @@ ...@@ -2299,7 +2299,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/segments/review/rule-router", "value": "http://172.21.107.80:18169/segments/review/rule-router",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
...@@ -2784,7 +2784,7 @@ ...@@ -2784,7 +2784,7 @@
"description": "common:core.module.input.description.Http Request Url", "description": "common:core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory", "placeholder": "https://api.ai.com/getInventory",
"required": false, "required": false,
"value": "http://192.168.252.71:18169/segments/review/merger", "value": "http://172.21.107.80:18169/segments/review/merger",
"debugLabel": "", "debugLabel": "",
"toolDescription": "" "toolDescription": ""
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment