Skip to content

Commit 43a9302

Browse files
committed
lint
1 parent 98742a7 commit 43a9302

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

backend/app/services/paper_service.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ async def summarise_paper(
3232
Retrieves paper specified by id, retrieves its pdf version, and summarises it.
3333
Returns a summary of the specified paper
3434
"""
35+
external_id = "unknown"
3536

3637
try:
3738
pdf_text, external_id = await PaperService._prepare_paper_text(paper_id, session)
@@ -65,9 +66,11 @@ async def get_chat_answer(
6566
"""
6667
Generates an AI response based on paper content and chat history.
6768
"""
68-
pdf_text, external_id = await PaperService._prepare_paper_text(paper_id, session)
69+
external_id = "unknown"
6970

7071
try:
72+
pdf_text, external_id = await PaperService._prepare_paper_text(paper_id, session)
73+
7174
openai_provider = get_openai_provider()
7275
answer = await openai_provider.chat_about_paper(
7376
paper_text=pdf_text, user_query=user_query, chat_history=history
@@ -119,7 +122,7 @@ async def get_paper_pdf(paper_id: int, session: AsyncSession) -> bytes:
119122
) from exc
120123

121124
@staticmethod
122-
async def _prepare_paper_text(paper_id: int, session: AsyncSession) -> (str, str):
125+
async def _prepare_paper_text(paper_id: int, session: AsyncSession) -> tuple[str, str]:
123126
"""
124127
Shared internal logic to fetch paper and prepare text for LLM consumption.
125128
Returns a tuple of (extracted_text, external_id).

0 commit comments

Comments
 (0)