Merge branch 'COG-adding_html_graph_render' of github.com:topoteretes/cognee into COG-adding_html_graph_render

This commit is contained in:
Igor Ilic 2025-01-08 14:50:38 +01:00
commit 9c2c19458f
4 changed files with 631 additions and 647 deletions

View file

@ -33,7 +33,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11.x'
python-version: '3.12.x'
- name: Install Poetry
uses: snok/install-poetry@v1

View file

@ -13,12 +13,7 @@ import matplotlib.pyplot as plt
import tiktoken
import nltk
import base64
from bokeh.plotting import figure, from_networkx
from bokeh.models import Circle, MultiLine, HoverTool, ColumnDataSource, Range1d
from bokeh.plotting import output_file, show
from bokeh.embed import file_html
from bokeh.resources import CDN
import logging
import sys
@ -364,6 +359,12 @@ def style_and_render_graph(p, G, layout_positions, node_attribute, node_colors,
"""
Apply styling and render the graph into the plot.
"""
from bokeh.plotting import figure, from_networkx
from bokeh.models import Circle, MultiLine, HoverTool, ColumnDataSource, Range1d
from bokeh.plotting import output_file, show
from bokeh.embed import file_html
from bokeh.resources import CDN
graph_renderer = from_networkx(G, layout_positions)
node_radii = [0.02 + 0.1 * centrality[node] for node in G.nodes()]
graph_renderer.node_renderer.data_source.data["radius"] = node_radii
@ -397,6 +398,12 @@ async def create_cognee_style_network_with_logo(
"""
Create a Cognee-inspired network visualization with an embedded logo.
"""
from bokeh.plotting import figure, from_networkx
from bokeh.models import Circle, MultiLine, HoverTool, ColumnDataSource, Range1d
from bokeh.plotting import output_file, show
from bokeh.embed import file_html
from bokeh.resources import CDN
logging.info("Converting graph to serializable format...")
G = await convert_to_serializable_graph(G)

1237
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -18,8 +18,8 @@ classifiers = [
]
[tool.poetry.dependencies]
python = ">=3.10.0,<3.12"
openai = "1.59.4"
python = ">=3.9.0,<3.13"
openai = "1.52.0"
pydantic = "2.8.2"
python-dotenv = "1.0.1"
fastapi = ">=0.109.2,<0.116.0"
@ -34,18 +34,18 @@ falkordb = {version = "1.0.9", optional = true}
boto3 = "^1.26.125"
botocore="^1.35.54"
gunicorn = "^20.1.0"
sqlalchemy = "2.0.36"
instructor = "1.7.2"
sqlalchemy = "2.0.35"
instructor = "1.5.2"
networkx = "^3.2.1"
aiosqlite = "^0.20.0"
pandas = "2.2.3"
pandas = "2.0.3"
filetype = "^1.2.0"
nltk = "^3.8.1"
dlt = {extras = ["sqlalchemy"], version = "^1.4.1"}
aiofiles = "^23.2.1"
qdrant-client = {version = "^1.9.0", optional = true}
graphistry = "^0.33.5"
tenacity = "^9.0.0"
tenacity = "^8.4.1"
weaviate-client = {version = "4.9.6", optional = true}
scikit-learn = "^1.5.0"
pypdf = "^4.1.0"
@ -58,7 +58,7 @@ langsmith = {version = "0.2.3", optional = true}
langdetect = "1.0.9"
posthog = {version = "^3.5.0", optional = true}
lancedb = "0.16.0"
litellm = "1.57.2"
litellm = "1.49.1"
groq = {version = "0.8.0", optional = true}
langfuse = "^2.32.0"
pydantic-settings = "^2.2.1"
@ -69,16 +69,14 @@ alembic = "^1.13.3"
asyncpg = {version = "0.30.0", optional = true}
pgvector = {version = "^0.3.5", optional = true}
psycopg2 = {version = "^2.9.10", optional = true}
llama-index-core = {version = "^0.12.10.post1", optional = true}
llama-index-core = {version = "^0.11.22", optional = true}
deepeval = {version = "^2.0.1", optional = true}
transformers = "^4.46.3"
pymilvus = {version = "^2.5.0", optional = true}
unstructured = { extras = ["csv", "doc", "docx", "epub", "md", "odt", "org", "ppt", "pptx", "rst", "rtf", "tsv", "xlsx"], version = "^0.16.12", optional = true }
unstructured = { extras = ["csv", "doc", "docx", "epub", "md", "odt", "org", "ppt", "pptx", "rst", "rtf", "tsv", "xlsx"], version = "^0.16.10", optional = true }
pre-commit = "^4.0.1"
httpx = "0.27.0"
bokeh="^3.6.2"
svglib = "^1.5.1"
reportlab = "^4.2.5"