Commit 90d2b5ad by ccran

feat: update main conf;

parent a76f1b8c
...@@ -73,7 +73,7 @@ elif platform == "luchuan": ...@@ -73,7 +73,7 @@ elif platform == "luchuan":
model = "Qwen2-72B-Instruct" model = "Qwen2-72B-Instruct"
outer_backend_url = "http://nas.hnluchuan.com:14124" outer_backend_url = "http://nas.hnluchuan.com:14124"
base_fastgpt_url = "http://nas.hnluchuan.com:14125" base_fastgpt_url = "http://nas.hnluchuan.com:14125"
base_backend_url = "http://192.168.0.70:1122" base_backend_url = "http://192.168.0.70:1123"
ocr_url = "http://192.168.0.70:8202/openapi/ocrUploadFile" ocr_url = "http://192.168.0.70:8202/openapi/ocrUploadFile"
segment_review_api_key = ( segment_review_api_key = (
"fastgpt-oZs0FUIgkiCmJtNcsHqaQRPI93RHhevq0i3CNGSsJlzdw9hLzyeLeaPepiitb3Hy" "fastgpt-oZs0FUIgkiCmJtNcsHqaQRPI93RHhevq0i3CNGSsJlzdw9hLzyeLeaPepiitb3Hy"
......
...@@ -833,7 +833,7 @@ def export_facts_memory(payload: FactsMemoryExportRequest) -> FactsMemoryExportR ...@@ -833,7 +833,7 @@ def export_facts_memory(payload: FactsMemoryExportRequest) -> FactsMemoryExportR
if __name__ == "__main__": if __name__ == "__main__":
if platform == "lufa" or platform == "luchuan": if platform == "lufa":
port = 18168 port = 18168
else: else:
port = 18169 port = 18169
......
import asyncio from utils.http_util import upload_file, download_file, url_replace_fastgpt
import json
import sys
import types
from fastapi import HTTPException res = upload_file("mock.py")
print(res)
from main import DocumentParseRequest, parse_document \ No newline at end of file
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())
...@@ -59,7 +59,7 @@ def fastgpt_openai_chat(url, token, model, chat_id, file_url, text, stream=True) ...@@ -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: def upload_file(path, input_url_to_inner=True, output_url_to_inner=False) -> str:
# 登录获取token # 登录获取token
if platform == "luchuan": if platform == "luchuan":
login_data = {"username": "chenran", "password": "CR@lgfz2026"} login_data = {"username": "admin", "password": "admin123094"}
else: else:
login_data = {"username": "admin", "password": "admin@jpai.com"} login_data = {"username": "admin", "password": "admin@jpai.com"}
login_url = f"{base_backend_url}/admin-api/system/auth/login" 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 ...@@ -69,6 +69,7 @@ def upload_file(path, input_url_to_inner=True, output_url_to_inner=False) -> str
data=json.dumps(login_data), data=json.dumps(login_data),
) )
try: try:
logger.info(f"后端登录成功:{response.text}")
token = json.loads(response.text).get("data").get("accessToken") token = json.loads(response.text).get("data").get("accessToken")
except Exception as e: except Exception as e:
logger.error(f"后端登录异常:{e}") logger.error(f"后端登录异常:{e}")
...@@ -81,6 +82,7 @@ def upload_file(path, input_url_to_inner=True, output_url_to_inner=False) -> str ...@@ -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}, headers={"Content-Type": m.content_type, "Authorization": token},
data=m, data=m,
) )
logger.info(upload_url + ':上传文件成功:' + response.text)
res = json.loads(response.text).get("data") res = json.loads(response.text).get("data")
if res: if res:
return res return res
......
import asyncio import asyncio
from core.config import root_path
from utils.doc_util import DocBase from utils.doc_util import DocBase
from spire.pdf import PdfDocument, PdfTextExtractOptions, PdfTextExtractor, License, PdfTextFinder, TextFindParameter, \ from spire.pdf import PdfDocument, PdfTextExtractOptions, PdfTextExtractor, License, PdfTextFinder, TextFindParameter, \
PdfTextMarkupAnnotation, PdfRGBColor, Color, PdfPolyLineAnnotation, PointF, RectangleF, PdfPopupAnnotation, \ PdfTextMarkupAnnotation, PdfRGBColor, Color, PdfPolyLineAnnotation, PointF, RectangleF, PdfPopupAnnotation, \
......
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