INNER CODE UNIT · Python

delete_index

kaito-project/kaito · presets/ragengine/main.py:892

async def delete_index(index_name: str):
    """
    Deletes an index by its name.

    This function is not exposed via an API endpoint but can be used internally.
    """
    start_time = time.perf_counter()
    status = STATUS_FAILURE  # Default status

    try:
        await rag_ops.delete_index(index_name)
        status = STATUS_SUCCESS
        return {"message": f"Successfully deleted index {index_name}."}
    except HTTPException as http_exc:
        raise http_exc
    except Exception as e:
        logger.error("Delete index failed for '%s'", index_name, exc_info=True)
        raise HTTPException(status_code=500, detail=f"Deletion failed: {str(e)}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…