diff --git a/README.md b/README.md index d74ea257..6da319d7 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ pip install vectorless ```python import asyncio -from vectorless import Engine, IndexContext +from vectorless import Engine, IndexContext, QueryContext async def main(): # Create engine — api_key and model are required @@ -38,11 +38,13 @@ async def main(): ) # Index a document (PDF or Markdown) - result = await engine.index(IndexContext.from_file("./report.pdf")) + result = await engine.index(IndexContext.from_path("./report.pdf")) doc_id = result.doc_id # Query - result = await engine.query(doc_id, "What is the total revenue?") + result = await engine.query( + QueryContext("What is the total revenue?").with_doc_ids([doc_id]) + ) print(result.single().content) asyncio.run(main()) diff --git a/docs/blog/2026-04-12-welcome/index.mdx b/docs/blog/2026-04-12-welcome/index.mdx index 686655cd..aa6e8a95 100644 --- a/docs/blog/2026-04-12-welcome/index.mdx +++ b/docs/blog/2026-04-12-welcome/index.mdx @@ -34,7 +34,7 @@ async def main(): ) # Index a document - result = await engine.index(IndexContext.from_file("./report.pdf")) + result = await engine.index(IndexContext.from_path("./report.pdf")) doc_id = result.doc_id # Query diff --git a/docs/docs/intro.mdx b/docs/docs/intro.mdx index 88fa23fb..fcaed058 100644 --- a/docs/docs/intro.mdx +++ b/docs/docs/intro.mdx @@ -32,7 +32,7 @@ async def main(): model="gpt-4o", ) - result = await engine.index(IndexContext.from_file("./report.pdf")) + result = await engine.index(IndexContext.from_path("./report.pdf")) doc_id = result.doc_id answer = await engine.query(doc_id, "What is the total revenue?") diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx index 3ecc47c7..83e3d697 100644 --- a/docs/src/pages/index.tsx +++ b/docs/src/pages/index.tsx @@ -55,7 +55,7 @@ async def main(): # Index a document result = await engine.index( - IndexContext.from_file("./report.pdf") + IndexContext.from_path("./report.pdf") ) doc_id = result.doc_id