Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zhouhui.jiang
/
Test_LangGraph
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zhouhui.jiang
2025-11-15 23:11:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ba6553577b83c15b01413f937f267fe7fd7da47f
ba655357
1 parent
a4fe6f10
update
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
API/paperless_api.py
langgraph_examples/api_agent.py
API/paperless_api.py
View file @
ba65535
...
...
@@ -81,7 +81,7 @@ def upload_clearance_file(
headers
.
pop
(
"Content-Type"
,
None
)
try
:
resp
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
data
,
files
=
files
,
timeout
=
6
0
)
resp
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
data
,
files
=
files
,
timeout
=
12
0
)
# 确保文件句柄尽快关闭
try
:
files
[
"fileUpload"
][
1
]
.
close
()
...
...
@@ -150,7 +150,7 @@ def upload_file_for_ocr(
headers
.
pop
(
"Content-Type"
,
None
)
try
:
resp
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
data
,
files
=
files
,
timeout
=
6
0
)
resp
=
requests
.
post
(
url
,
headers
=
headers
,
data
=
data
,
files
=
files
,
timeout
=
12
0
)
# 确保文件句柄尽快关闭
try
:
files
[
"file"
][
1
]
.
close
()
...
...
langgraph_examples/api_agent.py
View file @
ba65535
...
...
@@ -249,7 +249,7 @@ def _create_system_prompt(state: Dict[str, Any], config: RunnableConfig) -> List
- 如果用户选择上传清关文件(回复"1"或明确表示上传清关文件):使用上下文中的 slip_id 和 pdf_path,加上用户输入的 code,调用 upload_clearance_file 工具,不再询问其他参数
- **上传清关文件**:当用户明确需要上传清关文件并关联运单信息(code、slip_id)时,使用 upload_clearance_file 工具
- **上传文件图文识别**:当用户需要进行图文识别时,使用 upload_file_for_ocr 工具,即使有 slip_id 也可以使用此工具进行图文识别
- **图文识别后修改运单流程**:当 upload_file_for_ocr 工具返回"图文识别成功,请确认是否使用该运单编号:
{consignmentCode_str},运单ID:{consignmentId_str}
"的提示时,如果用户回答"是"、"确认"、"使用"等肯定回答,必须立即调用 create_waybill_d_with_id 工具,使用返回的 chmCode 映射为 consignmentCode,chmId 映射为 consignmentId,加上提示词中的 loginName 和 userId,直接修改运单,不需要再次询问用户
- **图文识别后修改运单流程**:当 upload_file_for_ocr 工具返回"图文识别成功,请确认是否使用该运单编号:
******,运单ID:******
"的提示时,如果用户回答"是"、"确认"、"使用"等肯定回答,必须立即调用 create_waybill_d_with_id 工具,使用返回的 chmCode 映射为 consignmentCode,chmId 映射为 consignmentId,加上提示词中的 loginName 和 userId,直接修改运单,不需要再次询问用户
5. **业务咨询**:解答用户关于出口物流流程、运单状态、操作规范等问题
6. **您当前访问工具Authorization的传参为 Authorization= {token}
...
...
@@ -299,7 +299,7 @@ def _create_system_prompt(state: Dict[str, Any], config: RunnableConfig) -> List
- **使用场景**:当用户需要进行图文识别时,使用此工具。即使有 slip_id,如果用户需要进行图文识别,也应使用此工具
- **重要说明**:如果用户意图不明确(同时有 slip_id 和 pdf_path 但未明确表示要进行图文识别),需要询问用户选择。如果用户已明确表示要进行图文识别或选择图文识别,则直接使用上下文中的 pdf_path 调用此工具,不再询问参数
- **返回参数**:此工具会返回 chmCode(运单编号)和 chmId(运单ID),这些参数可以用于后续的 create_waybill_d_with_id 工具调用
- **后续流程**:当此工具返回"图文识别成功,请确认是否使用该运单编号:
{consignmentCode_str},运单ID:{consignmentId_str}
"的提示时,如果用户回答"是"、"确认"、"使用"等肯定回答,必须立即调用 create_waybill_d_with_id 工具,使用返回的 chmCode 映射为 consignmentCode,chmId 映射为 consignmentId,加上提示词中的 loginName 和 userId,直接修改运单,不需要再次询问用户
- **后续流程**:当此工具返回"图文识别成功,请确认是否使用该运单编号:
******,运单ID:******
"的提示时,如果用户回答"是"、"确认"、"使用"等肯定回答,必须立即调用 create_waybill_d_with_id 工具,使用返回的 chmCode 映射为 consignmentCode,chmId 映射为 consignmentId,加上提示词中的 loginName 和 userId,直接修改运单,不需要再次询问用户
- push_waybill_for_ocr: 根据运单ID推送OCR进行识别,需要提供运单ID(waybill_id、Authorization)参数
## query_waybill_list数据展示说明:
...
...
Please
register
or
login
to post a comment