From 515f96a7779f117a7e37f854de2ded99160d0c76 Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sun, 2 Aug 2026 15:50:41 +0900 Subject: scrape_url / pdf_to_text / search_and_fetch はページング(継続トークン方式)に対応 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mypy 6エラー修正 --- src/ollama_web/routes/sessions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ollama_web/routes/sessions.py') diff --git a/src/ollama_web/routes/sessions.py b/src/ollama_web/routes/sessions.py index 64e1bc9..e1e669c 100644 --- a/src/ollama_web/routes/sessions.py +++ b/src/ollama_web/routes/sessions.py @@ -127,7 +127,8 @@ async def upload_file(request: Request) -> JSONResponse: # Images are passed to ollama via Message.images (base64), not as text. text = "" elif content_type == "application/pdf" or name.lower().endswith(".pdf"): - text = extract_pdf_text(data) + # extract_pdf_text now returns (text, has_more, next_page_offset). + text = extract_pdf_text(data)[0] else: # Try decode as text for text-like uploads. try: @@ -171,4 +172,4 @@ async def clear_messages(request: Request) -> JSONResponse: session = store.clear_messages(session_id) if session is None: return JSONResponse({"error": "Session not found"}, status_code=404) - return JSONResponse({"cleared": True, "session": session}) + return JSONResponse({"cleared": True, "session": session}) \ No newline at end of file -- cgit v1.2.3