{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# lakeFS\n",
    "\n",
    ">[lakeFS](https://docs.lakefs.io/) provides scalable version control over the data lake, and uses Git-like semantics to create and access those versions.\n",
    "\n",
    "This notebooks covers how to load document objects from a `lakeFS` path (whether it's an object or a prefix).\n"
   ]
  },
  {
   "cell_type": "markdown",
   "source": [
    "## Initializing the lakeFS loader\n",
    "\n",
    "Replace `ENDPOINT`, `LAKEFS_ACCESS_KEY`, and `LAKEFS_SECRET_KEY` values with your own."
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain.document_loaders import LakeFSLoader"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ENDPOINT = \"\"\n",
    "LAKEFS_ACCESS_KEY = \"\"\n",
    "LAKEFS_SECRET_KEY = \"\"\n",
    "\n",
    "lakefs_loader = LakeFSLoader(\n",
    "    lakefs_access_key=LAKEFS_ACCESS_KEY,\n",
    "    lakefs_secret_key=LAKEFS_SECRET_KEY,\n",
    "    lakefs_endpoint=ENDPOINT,\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "source": [
    "## Specifying a path\n",
    "You can specify a prefix or a complete object path to control which files to load.\n",
    "\n",
    "Specify the repository, reference (branch, commit id, or tag), and path in the corresponding `REPO`, `REF`, and `PATH` to load the documents from:"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "REPO = \"\"\n",
    "REF = \"\"\n",
    "PATH = \"\"\n",
    "\n",
    "lakefs_loader.set_repo(REPO)\n",
    "lakefs_loader.set_ref(REF)\n",
    "lakefs_loader.set_path(PATH)\n",
    "\n",
    "docs = lakefs_loader.load()\n",
    "docs"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
