Skip to content

Commit 4e0a2b5

Browse files
committed
fix(ui): correct web content processing - Fix method name mismatch in vector store - Add proper error handling for empty content - Improve feedback messages
1 parent b5f5e3c commit 4e0a2b5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

agentic_rag/gradio_app.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ def process_pdf(file: tempfile._TemporaryFileWrapper) -> str:
4949
def process_url(url: str) -> str:
5050
"""Process web content from URL"""
5151
try:
52-
content = web_processor.process_url(url)
53-
vector_store.add_web_content(content)
54-
return f"✓ Successfully processed URL and added content to knowledge base"
52+
# Process URL and get chunks
53+
chunks = web_processor.process_url(url)
54+
if not chunks:
55+
return "✗ No content extracted from URL"
56+
57+
# Add chunks to vector store with URL as source ID
58+
vector_store.add_web_chunks(chunks, source_id=url)
59+
return f"✓ Successfully processed URL and added {len(chunks)} chunks to knowledge base"
5560
except Exception as e:
5661
return f"✗ Error processing URL: {str(e)}"
5762

0 commit comments

Comments
 (0)