File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111from app .utils .readPDF import read_pdf
1212from fastapi import HTTPException
1313from app .curd .articleDB import update_article_intro
14- from app .models .model import ArticleDB
14+ from app .models .model import ArticleDB , Article
1515
1616router = APIRouter ()
1717redis_client = get_redis_client ()
@@ -57,8 +57,13 @@ async def clear_notes(
5757@router .get ("/review" , response_model = dict )
5858async def review_notes (
5959 article_id : int ,
60+ db : AsyncSession = Depends (get_db ),
6061):
61- path = f"/lhcos-data/{ article_id } .pdf"
62+ from sqlalchemy .future import select
63+ # 查找文献path
64+ result = await db .execute (select (Article ).where (Article .id == article_id ))
65+ article = result .scalars ().first ()
66+ path = article .url
6267 text = await read_pdf (path )
6368 text += "\n \n 请根据以上内容生成文章综述。"
6469 async def ai_stream ():
You can’t perform that action at this time.
0 commit comments