|
|
@ -15,6 +15,8 @@ from pydantic import BaseModel, Field
|
|
|
|
from starlette.responses import StreamingResponse
|
|
|
|
from starlette.responses import StreamingResponse
|
|
|
|
|
|
|
|
|
|
|
|
from Config.Config import ES_CONFIG
|
|
|
|
from Config.Config import ES_CONFIG
|
|
|
|
|
|
|
|
import warnings
|
|
|
|
|
|
|
|
from elasticsearch import Elasticsearch
|
|
|
|
from Util.ALiYunUtil import ALiYunUtil
|
|
|
|
from Util.ALiYunUtil import ALiYunUtil
|
|
|
|
from Util.EsSearchUtil import EsSearchUtil
|
|
|
|
from Util.EsSearchUtil import EsSearchUtil
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +51,10 @@ def html_to_word_pandoc(html_file, output_file):
|
|
|
|
async def lifespan(app: FastAPI):
|
|
|
|
async def lifespan(app: FastAPI):
|
|
|
|
# 初始化阿里云大模型工具
|
|
|
|
# 初始化阿里云大模型工具
|
|
|
|
app.state.aliyun_util = ALiYunUtil()
|
|
|
|
app.state.aliyun_util = ALiYunUtil()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 抑制HTTPS相关警告
|
|
|
|
|
|
|
|
warnings.filterwarnings('ignore', message='Connecting to .* using TLS with verify_certs=False is insecure')
|
|
|
|
|
|
|
|
warnings.filterwarnings('ignore', message='Unverified HTTPS request is being made to host')
|
|
|
|
yield
|
|
|
|
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|