feat: v1.2.0 - 图片去重与管理、微信机器人优化、搜索设置可配置
主要功能: - 图片上传时 OCR 内容去重(3个上传端点统一使用公共函数 _check_ocr_duplicate) - 图片管理 Tab:展示所有图片、手动删除、一键去重 - 搜索结果详情弹窗增加删除按钮(带确认弹窗) - 图片管理卡片点击查看详情(复用 showOcrDetailModal) - 搜索限制和 LLM 批量判断数量可通过网站设置 - MiniMax API 调用添加 reasoning_split=True - 企业微信机器人:WebSocket 长连接、图片搜索、配置化搜索数量 - 版本号升级至 1.2.0
This commit is contained in:
30
app/api/v1/search.py
Normal file
30
app/api/v1/search.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""
|
||||
语义搜索 API 路由
|
||||
提供向量搜索 + 全文搜索混合查询接口
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.database import get_db
|
||||
from app.schemas.search import SearchRequest, SearchResponse
|
||||
from app.services.search_service import SearchService
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("", response_model=SearchResponse, summary="语义搜索")
|
||||
async def semantic_search(
|
||||
request: SearchRequest,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""
|
||||
对知识库进行语义搜索。
|
||||
|
||||
支持向量相似度搜索和中文全文搜索的混合排序。
|
||||
可按课程名称、讲师名称、直播日期范围过滤结果。
|
||||
"""
|
||||
service = SearchService(db)
|
||||
return await service.search(request)
|
||||
Reference in New Issue
Block a user