summaryrefslogtreecommitdiff
path: root/notebooks/testing.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'notebooks/testing.ipynb')
-rw-r--r--notebooks/testing.ipynb87
1 files changed, 3 insertions, 84 deletions
diff --git a/notebooks/testing.ipynb b/notebooks/testing.ipynb
index f8ef78f..806e3fb 100644
--- a/notebooks/testing.ipynb
+++ b/notebooks/testing.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 9,
"id": "c1f56ae3-a056-4b31-bcab-27c2c97c00f1",
"metadata": {},
"outputs": [],
@@ -12,94 +12,13 @@
"from importlib.util import find_spec\n",
"if find_spec(\"rag\") is None:\n",
" import sys\n",
- " sys.path.append('..')\n",
- "from rag.rag import RAG"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "id": "6b5cb12e-df7e-4532-b78b-216e11ed6161",
- "metadata": {},
- "outputs": [],
- "source": [
- "path = Path(\"/home/aktersnurra/projects/library/quant/math/a-signal-processing-perspective-on-financial-engineering.pdf\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "b8382795-9610-4b24-80b7-31397b2faf90",
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "\u001b[32m2024-04-08 22:07:11.286\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mrag.db.vector\u001b[0m:\u001b[36m__configure\u001b[0m:\u001b[36m37\u001b[0m - \u001b[34m\u001b[1mConfiguring collection knowledge-base...\u001b[0m\n",
- "\u001b[32m2024-04-08 22:07:11.543\u001b[0m | \u001b[34m\u001b[1mDEBUG \u001b[0m | \u001b[36mrag.db.document\u001b[0m:\u001b[36m__configure\u001b[0m:\u001b[36m25\u001b[0m - \u001b[34m\u001b[1mCreating documents table if it does not exist...\u001b[0m\n"
- ]
- }
- ],
- "source": [
- "rag = RAG()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "ac57e50d-1fc3-4fc9-90e5-5bdb97bd2f5e",
- "metadata": {},
- "outputs": [],
- "source": [
- "rag.add_pdf(path)\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "1c6b48d2-eb04-4a7c-8224-78aabfc7c887",
- "metadata": {},
- "outputs": [],
- "source": [
- "query = \"What is a factor model?\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "a95c8250-00b2-4cbc-a9c6-a76d14ef2da5",
- "metadata": {},
- "outputs": [],
- "source": [
- "rag.rag(query, \"quant researcher\", limit=5)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "id": "2c28db8c-c2bb-4092-b1d3-fd3f8bb060b5",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "True"
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "rag.vector_db.client.delete_collection(\"knowledge-base\")"
+ " sys.path.append('..')"
]
},
{
"cell_type": "code",
"execution_count": null,
- "id": "0e664d3d-a787-45e5-8b71-8e5e0f348443",
+ "id": "240df289-d9d6-424b-a5b9-e09dcfefd57e",
"metadata": {},
"outputs": [],
"source": []