-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for unstructured * Small tweaks * Merge simjak changes * feat: Embeddings pipeline improvements (#33) * feat: Embeddings pipeline improvements * fix: Reranking * fix: Pinecone delete * feat: Added strategy option * chore: Merging * chore: Merging * walkthrough * chore: Merging --------- Co-authored-by: Ismail Pelaseyed <[email protected]> * Fix formatting * fix: Weaviate fix (#36) * fix: Weaviate fix * chore: Change method name * Fix formatting * Fix issue with summarization * Fix qdrant ingestion * Fix support for qdrant * Fix AstraDB querying --------- Co-authored-by: Simonas Jakubonis <[email protected]>
- Loading branch information
Showing
18 changed files
with
3,521 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
from fastapi import APIRouter | ||
|
||
from models.delete import RequestPayload, ResponsePayload | ||
from service.embedding import get_encoder | ||
from service.vector_database import VectorService, get_vector_service | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.delete("/delete", response_model=ResponsePayload) | ||
async def delete(payload: RequestPayload): | ||
encoder = get_encoder(encoder_type=payload.encoder) | ||
vector_service: VectorService = get_vector_service( | ||
index_name=payload.index_name, credentials=payload.vector_database | ||
index_name=payload.index_name, | ||
credentials=payload.vector_database, | ||
encoder=encoder, | ||
) | ||
await vector_service.delete(file_url=payload.file_url) | ||
return {"success": True} | ||
data = await vector_service.delete(file_url=payload.file_url) | ||
return ResponsePayload(success=True, data=data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
from fastapi import APIRouter | ||
|
||
from models.query import RequestPayload, ResponsePayload | ||
from models.query import RequestPayload, ResponseData, ResponsePayload | ||
from service.router import query as _query | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.post("/query", response_model=ResponsePayload) | ||
async def query(payload: RequestPayload): | ||
output = await _query(payload=payload) | ||
return {"success": True, "data": output} | ||
chunks = await _query(payload=payload) | ||
response_data = [ | ||
ResponseData( | ||
content=chunk.content, doc_url=chunk.doc_url, page_number=chunk.page_number | ||
) | ||
for chunk in chunks | ||
] | ||
return {"success": True, "data": response_data} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
from pydantic import BaseModel | ||
|
||
from models.ingest import EncoderEnum | ||
from models.vector_database import VectorDatabase | ||
|
||
|
||
class RequestPayload(BaseModel): | ||
index_name: str | ||
file_url: str | ||
vector_database: VectorDatabase | ||
encoder: EncoderEnum | ||
|
||
|
||
class DeleteResponse(BaseModel): | ||
num_of_deleted_chunks: int | ||
|
||
|
||
class ResponsePayload(BaseModel): | ||
success: bool | ||
data: DeleteResponse |
Oops, something went wrong.