fix: update cognee notebook

This commit is contained in:
Boris Arzentar 2024-03-21 10:23:17 +01:00
parent a727cce00f
commit 49b80ec898

View file

@ -253,11 +253,6 @@
"from cognee.utils import render_graph\n", "from cognee.utils import render_graph\n",
"from cognee.infrastructure import infrastructure_config\n", "from cognee.infrastructure import infrastructure_config\n",
"\n", "\n",
"# text = \"\"\"In the nicest possible way, Britons have always been a bit silly about animals. “Keeping pets, for the English, is not so much a leisure activity as it is an entire way of life,” wrote the anthropologist Kate Fox in Watching the English, nearly 20 years ago. Our dogs, in particular, have been an acceptable outlet for emotions and impulses we otherwise keep strictly controlled our latent desire to be demonstratively affectionate, to be silly and chat to strangers. If this seems like an exaggeration, consider the different reactions youd get if you struck up a conversation with someone in a park with a dog, versus someone on the train.\n",
"# Indeed, British society has been set up to accommodate these four-legged ambassadors. In the UK unlike Australia, say, or New Zealand dogs are not just permitted on public transport but often openly encouraged. Many pubs and shops display waggish signs, reading, “Dogs welcome, people tolerated”, and have treat jars on their counters. The other day, as I was waiting outside a cafe with a friends dog, the barista urged me to bring her inside.\n",
"# For years, Britons non-partisan passion for animals has been consistent amid dwindling common ground. But lately, rather than bringing out the best in us, our relationship with dogs is increasingly revealing us at our worst and our supposed “best friends” are paying the price.\n",
"# As with so many latent traits in the national psyche, it all came unleashed with the pandemic, when many people thought they might as well make the most of all that time at home and in local parks with a dog. Between 2019 and 2022, the number of pet dogs in the UK rose from about nine million to 13 million. But theres long been a seasonal surge around this time of year, substantial enough for the Dogs Trust charity to coin its famous slogan back in 1978: “A dog is for life, not just for Christmas.”\"\"\"\n",
"\n",
"vector_engine = infrastructure_config.get_config()[\"vector_engine\"] \n", "vector_engine = infrastructure_config.get_config()[\"vector_engine\"] \n",
"\n", "\n",
"await vector_engine.prune()\n", "await vector_engine.prune()\n",
@ -270,17 +265,6 @@
"print(graph_url)\n" "print(graph_url)\n"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "a228fb2c-5bbc-48b4-af3d-4a26e840a79e",
"metadata": {},
"outputs": [],
"source": [
"from cognee import search\n",
"from cognee.api.v1.search import SearchType"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
@ -290,22 +274,17 @@
"source": [ "source": [
"from cognee import search\n", "from cognee import search\n",
"from cognee.api.v1.search.search import SearchType\n", "from cognee.api.v1.search.search import SearchType\n",
"\n",
"query_params = {\n", "query_params = {\n",
" SearchType.SIMILARITY: {'query': 'Ministarstvo'}\n", " SearchType.SIMILARITY: {'query': 'Ministarstvo'}\n",
"}\n", "}\n",
"\n",
"results = await search(graph, query_params)\n", "results = await search(graph, query_params)\n",
"\n",
"for result in results[0]:\n", "for result in results[0]:\n",
" print(result)" " print(result)"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "779115ef-df8e-48a2-a01b-79d9660d1f3f",
"metadata": {},
"outputs": [],
"source": []
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "b149c4df-1665-408b-8fb9-735ac2a3770f", "id": "b149c4df-1665-408b-8fb9-735ac2a3770f",
@ -335,47 +314,23 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "id": "ffaf695f",
"id": "0bbecaeb-20b7-4fda-a482-ca7f016f9e95",
"metadata": {}, "metadata": {},
"outputs": [],
"source": [] "source": []
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "id": "c0d1187d",
"id": "6144fe5f-8fac-46c1-a1c3-49e616ab7ebf",
"metadata": {}, "metadata": {},
"outputs": [],
"source": [] "source": []
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null, "id": "144d67aa",
"id": "9a8bab3c-9456-4ef4-b7f6-cc2c849848c7",
"metadata": {}, "metadata": {},
"outputs": [],
"source": [] "source": []
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "d594c19d-0b20-487f-a612-47fe89132efc",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3041df86-609a-4b8a-a594-6e1cba43051e",
"metadata": {},
"outputs": [],
"source": [
"#delete collections to st"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
@ -435,4 +390,4 @@
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 5 "nbformat_minor": 5
} }