Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ccran
/
lufa-contract
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
90d2b5ad
authored
Jul 29, 2026
by
ccran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update main conf;
parent
a76f1b8c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
44 deletions
+9
-44
core/config.py
+1
-1
main.py
+1
-1
mock.py
+4
-40
utils/http_util.py
+3
-1
utils/spire_pdf_util.py
+0
-1
No files found.
core/config.py
View file @
90d2b5ad
...
...
@@ -73,7 +73,7 @@ elif platform == "luchuan":
model
=
"Qwen2-72B-Instruct"
outer_backend_url
=
"http://nas.hnluchuan.com:14124"
base_fastgpt_url
=
"http://nas.hnluchuan.com:14125"
base_backend_url
=
"http://192.168.0.70:112
2
"
base_backend_url
=
"http://192.168.0.70:112
3
"
ocr_url
=
"http://192.168.0.70:8202/openapi/ocrUploadFile"
segment_review_api_key
=
(
"fastgpt-oZs0FUIgkiCmJtNcsHqaQRPI93RHhevq0i3CNGSsJlzdw9hLzyeLeaPepiitb3Hy"
...
...
main.py
View file @
90d2b5ad
...
...
@@ -833,7 +833,7 @@ def export_facts_memory(payload: FactsMemoryExportRequest) -> FactsMemoryExportR
if
__name__
==
"__main__"
:
if
platform
==
"lufa"
or
platform
==
"luchuan"
:
if
platform
==
"lufa"
:
port
=
18168
else
:
port
=
18169
...
...
mock.py
View file @
90d2b5ad
import
asyncio
import
json
import
sys
import
types
from
utils.http_util
import
upload_file
,
download_file
,
url_replace_fastgpt
from
fastapi
import
HTTPException
from
main
import
DocumentParseRequest
,
parse_document
PAYLOAD
=
{
"urls"
:
[
"http://192.168.252.71:48080/admin-api/infra/file/24/get/d7ade63d9599ec4a81b2671df2d8fa48a117cfda96d0396cc8e405d0b9c1a89b.docx"
],
"conversation_id"
:
"0edb7152426b4c298270434f2f8810cd"
,
"ruleset_id"
:
"金盘"
,
}
async
def
main
()
->
None
:
try
:
result
=
await
parse_document
(
DocumentParseRequest
(
**
PAYLOAD
))
except
HTTPException
as
exc
:
print
(
json
.
dumps
(
{
"type"
:
"HTTPException"
,
"status_code"
:
exc
.
status_code
,
"detail"
:
exc
.
detail
,
},
ensure_ascii
=
False
,
indent
=
2
,
)
)
return
print
(
result
.
model_dump_json
(
indent
=
2
))
if
__name__
==
"__main__"
:
asyncio
.
run
(
main
())
res
=
upload_file
(
"mock.py"
)
print
(
res
)
\ No newline at end of file
utils/http_util.py
View file @
90d2b5ad
...
...
@@ -59,7 +59,7 @@ def fastgpt_openai_chat(url, token, model, chat_id, file_url, text, stream=True)
def
upload_file
(
path
,
input_url_to_inner
=
True
,
output_url_to_inner
=
False
)
->
str
:
# 登录获取token
if
platform
==
"luchuan"
:
login_data
=
{
"username"
:
"
chenran"
,
"password"
:
"CR@lgfz2026
"
}
login_data
=
{
"username"
:
"
admin"
,
"password"
:
"admin123094
"
}
else
:
login_data
=
{
"username"
:
"admin"
,
"password"
:
"admin@jpai.com"
}
login_url
=
f
"{base_backend_url}/admin-api/system/auth/login"
...
...
@@ -69,6 +69,7 @@ def upload_file(path, input_url_to_inner=True, output_url_to_inner=False) -> str
data
=
json
.
dumps
(
login_data
),
)
try
:
logger
.
info
(
f
"后端登录成功:{response.text}"
)
token
=
json
.
loads
(
response
.
text
)
.
get
(
"data"
)
.
get
(
"accessToken"
)
except
Exception
as
e
:
logger
.
error
(
f
"后端登录异常:{e}"
)
...
...
@@ -81,6 +82,7 @@ def upload_file(path, input_url_to_inner=True, output_url_to_inner=False) -> str
headers
=
{
"Content-Type"
:
m
.
content_type
,
"Authorization"
:
token
},
data
=
m
,
)
logger
.
info
(
upload_url
+
':上传文件成功:'
+
response
.
text
)
res
=
json
.
loads
(
response
.
text
)
.
get
(
"data"
)
if
res
:
return
res
...
...
utils/spire_pdf_util.py
View file @
90d2b5ad
import
asyncio
from
core.config
import
root_path
from
utils.doc_util
import
DocBase
from
spire.pdf
import
PdfDocument
,
PdfTextExtractOptions
,
PdfTextExtractor
,
License
,
PdfTextFinder
,
TextFindParameter
,
\
PdfTextMarkupAnnotation
,
PdfRGBColor
,
Color
,
PdfPolyLineAnnotation
,
PointF
,
RectangleF
,
PdfPopupAnnotation
,
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment