Fix URL handling in add-src

This commit is contained in:
Yiorgis Gozadinos 2025-08-11 11:10:29 +02:00
parent ff42224de3
commit 9648cb97cb
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -32,9 +32,9 @@ class HaikuRAGApp:
f"[b]Document with id [cyan]{doc.id}[/cyan] added successfully.[/b]"
)
async def add_document_from_source(self, file_path: Path):
async def add_document_from_source(self, source: str):
async with HaikuRAG(db_path=self.db_path) as self.client:
doc = await self.client.create_document_from_source(file_path)
doc = await self.client.create_document_from_source(source)
self._rich_print_document(doc, truncate=True)
self.console.print(
f"[b]Document with id [cyan]{doc.id}[/cyan] added successfully.[/b]"

View file

@ -81,7 +81,7 @@ def add_document_text(
@cli.command("add-src", help="Add a document from a file path or URL")
def add_document_src(
file_path: Path = typer.Argument(
source: str = typer.Argument(
help="The file path or URL of the document to add",
),
db: Path = typer.Option(
@ -91,7 +91,7 @@ def add_document_src(
),
):
app = HaikuRAGApp(db_path=db)
asyncio.run(app.add_document_from_source(file_path=file_path))
asyncio.run(app.add_document_from_source(source=source))
@cli.command("get", help="Get and display a document by its ID")