Fix URL handling in add-src
This commit is contained in:
parent
ff42224de3
commit
9648cb97cb
2 changed files with 4 additions and 4 deletions
|
|
@ -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]"
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue