From c747a057179448f39776e46b6bd482de41dcea99 Mon Sep 17 00:00:00 2001 From: lxobr <122801072+lxobr@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:42:53 +0100 Subject: [PATCH 01/15] feat: make tasks a configurable argument in the cognify function --- cognee/api/v1/cognify/cognify_v2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cognee/api/v1/cognify/cognify_v2.py b/cognee/api/v1/cognify/cognify_v2.py index 738f77c5..7f36930f 100644 --- a/cognee/api/v1/cognify/cognify_v2.py +++ b/cognee/api/v1/cognify/cognify_v2.py @@ -160,7 +160,6 @@ async def get_default_tasks( summarization_model=cognee_config.summarization_model, task_config={"batch_size": 10}, ), - Task(add_data_points, only_root=True, task_config={"batch_size": 10}), ] except Exception as error: send_telemetry("cognee.cognify DEFAULT TASKS CREATION ERRORED", user.id) From 1a73779353b48680f898398cf2a7f561eea022fe Mon Sep 17 00:00:00 2001 From: lxobr <122801072+lxobr@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:27:33 +0100 Subject: [PATCH 02/15] fix: add data points task --- cognee/api/v1/cognify/cognify_v2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cognee/api/v1/cognify/cognify_v2.py b/cognee/api/v1/cognify/cognify_v2.py index 7f36930f..738f77c5 100644 --- a/cognee/api/v1/cognify/cognify_v2.py +++ b/cognee/api/v1/cognify/cognify_v2.py @@ -160,6 +160,7 @@ async def get_default_tasks( summarization_model=cognee_config.summarization_model, task_config={"batch_size": 10}, ), + Task(add_data_points, only_root=True, task_config={"batch_size": 10}), ] except Exception as error: send_telemetry("cognee.cognify DEFAULT TASKS CREATION ERRORED", user.id) From 015f0084c8c4420937965e6d9e1f76ea113e6518 Mon Sep 17 00:00:00 2001 From: Rita Aleksziev Date: Mon, 20 Jan 2025 17:47:52 +0100 Subject: [PATCH 03/15] eval on random samples instead of first couple --- evals/eval_on_hotpot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evals/eval_on_hotpot.py b/evals/eval_on_hotpot.py index da102c8e..6fa5748b 100644 --- a/evals/eval_on_hotpot.py +++ b/evals/eval_on_hotpot.py @@ -10,8 +10,10 @@ from evals.qa_dataset_utils import load_qa_dataset from evals.qa_metrics_utils import get_metrics from evals.qa_context_provider_utils import qa_context_providers, valid_pipeline_slices +import random logger = logging.getLogger(__name__) +random.seed(42) async def answer_qa_instance(instance, context_provider): @@ -77,7 +79,7 @@ async def eval_on_QA_dataset( dataset = load_qa_dataset(dataset_name_or_filename) context_provider = qa_context_providers[context_provider_name] eval_metrics = get_metrics(metric_name_list) - instances = dataset if not num_samples else dataset[:num_samples] + instances = dataset if not num_samples else random.sample(dataset, num_samples) if "promptfoo_metrics" in eval_metrics: promptfoo_results = await eval_metrics["promptfoo_metrics"].measure( From 1c16a1744c7999f9a0849454562111f4f3929181 Mon Sep 17 00:00:00 2001 From: Rita Aleksziev Date: Mon, 20 Jan 2025 18:42:09 +0100 Subject: [PATCH 04/15] Save and load contexts and answers --- evals/eval_on_hotpot.py | 60 +++++++++++++++++++++++++++++------ evals/promptfoo_metrics.py | 19 +++++++++-- evals/qa_eval_parameters.json | 6 +++- evals/run_qa_eval.py | 9 ++---- 4 files changed, 74 insertions(+), 20 deletions(-) diff --git a/evals/eval_on_hotpot.py b/evals/eval_on_hotpot.py index 6fa5748b..fd36a751 100644 --- a/evals/eval_on_hotpot.py +++ b/evals/eval_on_hotpot.py @@ -11,13 +11,29 @@ from evals.qa_metrics_utils import get_metrics from evals.qa_context_provider_utils import qa_context_providers, valid_pipeline_slices import random +import os +import json +from pathlib import Path logger = logging.getLogger(__name__) random.seed(42) -async def answer_qa_instance(instance, context_provider): - context = await context_provider(instance) +async def answer_qa_instance(instance, context_provider, contexts_filename): + if os.path.exists(contexts_filename): + with open(contexts_filename, "r") as file: + preloaded_contexts = json.load(file) + else: + preloaded_contexts = {} + + if instance["_id"] in preloaded_contexts: + context = preloaded_contexts[instance["_id"]] + else: + context = await context_provider(instance) + preloaded_contexts[instance["_id"]] = context + + with open(contexts_filename, "w") as file: + json.dump(preloaded_contexts, file) args = { "question": instance["question"], @@ -51,12 +67,27 @@ async def deepeval_answers(instances, answers, eval_metrics): return eval_results -async def deepeval_on_instances(instances, context_provider, eval_metrics): +async def deepeval_on_instances( + instances, context_provider, eval_metrics, answers_filename, contexts_filename +): + if os.path.exists(answers_filename): + with open(answers_filename, "r") as file: + preloaded_answers = json.load(file) + else: + preloaded_answers = {} + answers = [] for instance in tqdm(instances, desc="Getting answers"): - answer = await answer_qa_instance(instance, context_provider) + if instance["_id"] in preloaded_answers: + answer = preloaded_answers[instance["_id"]] + else: + answer = await answer_qa_instance(instance, context_provider, contexts_filename) + preloaded_answers[instance["_id"]] = answer answers.append(answer) + with open(answers_filename, "w") as file: + json.dump(preloaded_answers, file) + eval_results = await deepeval_answers(instances, answers, eval_metrics) score_lists_dict = {} for instance_result in eval_results.test_results: @@ -74,21 +105,32 @@ async def deepeval_on_instances(instances, context_provider, eval_metrics): async def eval_on_QA_dataset( - dataset_name_or_filename: str, context_provider_name, num_samples, metric_name_list + dataset_name_or_filename: str, context_provider_name, num_samples, metric_name_list, out_path ): dataset = load_qa_dataset(dataset_name_or_filename) context_provider = qa_context_providers[context_provider_name] eval_metrics = get_metrics(metric_name_list) instances = dataset if not num_samples else random.sample(dataset, num_samples) + contexts_filename = Path(out_path) / Path( + f"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json" + ) if "promptfoo_metrics" in eval_metrics: promptfoo_results = await eval_metrics["promptfoo_metrics"].measure( - instances, context_provider + instances, context_provider, contexts_filename ) else: promptfoo_results = {} + + answers_filename = Path(out_path) / Path( + f"answers_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json" + ) deepeval_results = await deepeval_on_instances( - instances, context_provider, eval_metrics["deepeval_metrics"] + instances, + context_provider, + eval_metrics["deepeval_metrics"], + answers_filename, + contexts_filename, ) results = promptfoo_results | deepeval_results @@ -97,14 +139,14 @@ async def eval_on_QA_dataset( async def incremental_eval_on_QA_dataset( - dataset_name_or_filename: str, num_samples, metric_name_list + dataset_name_or_filename: str, num_samples, metric_name_list, out_path ): pipeline_slice_names = valid_pipeline_slices.keys() incremental_results = {} for pipeline_slice_name in pipeline_slice_names: results = await eval_on_QA_dataset( - dataset_name_or_filename, pipeline_slice_name, num_samples, metric_name_list + dataset_name_or_filename, pipeline_slice_name, num_samples, metric_name_list, out_path ) incremental_results[pipeline_slice_name] = results diff --git a/evals/promptfoo_metrics.py b/evals/promptfoo_metrics.py index ee0eaf80..f21fab2f 100644 --- a/evals/promptfoo_metrics.py +++ b/evals/promptfoo_metrics.py @@ -29,7 +29,7 @@ def __init__(self, metric_name_list): else: raise Exception(f"{metric_name} is not a valid promptfoo metric") - async def measure(self, instances, context_provider): + async def measure(self, instances, context_provider, contexts_filename): with open(os.path.join(os.getcwd(), "evals/promptfoo_config_template.yaml"), "r") as file: config = yaml.safe_load(file) @@ -40,10 +40,20 @@ async def measure(self, instances, context_provider): ] } - # Fill config file with test cases tests = [] + if os.path.exists(contexts_filename): + with open(contexts_filename, "r") as file: + preloaded_contexts = json.load(file) + else: + preloaded_contexts = {} + for instance in instances: - context = await context_provider(instance) + if instance["_id"] in preloaded_contexts: + context = preloaded_contexts[instance["_id"]] + else: + context = await context_provider(instance) + preloaded_contexts[instance["_id"]] = context + test = { "vars": { "name": instance["question"][:15], @@ -52,7 +62,10 @@ async def measure(self, instances, context_provider): } } tests.append(test) + config["tests"] = tests + with open(contexts_filename, "w") as file: + json.dump(preloaded_contexts, file) # Write the updated YAML back, preserving formatting and structure updated_yaml_file_path = os.path.join(os.getcwd(), "config_with_context.yaml") diff --git a/evals/qa_eval_parameters.json b/evals/qa_eval_parameters.json index 6ae07089..6d60ab56 100644 --- a/evals/qa_eval_parameters.json +++ b/evals/qa_eval_parameters.json @@ -14,6 +14,10 @@ ], "metric_names": [ "Correctness", - "Comprehensiveness" + "Comprehensiveness", + "Directness", + "Diversity", + "Empowerment", + "promptfoo.directness" ] } diff --git a/evals/run_qa_eval.py b/evals/run_qa_eval.py index f9f35d61..26f53ada 100644 --- a/evals/run_qa_eval.py +++ b/evals/run_qa_eval.py @@ -22,17 +22,12 @@ async def run_evals_on_paramset(paramset: dict, out_path: str): if rag_option == "cognee_incremental": result = await incremental_eval_on_QA_dataset( - dataset, - num_samples, - paramset["metric_names"], + dataset, num_samples, paramset["metric_names"], out_path ) results[dataset][num_samples] |= result else: result = await eval_on_QA_dataset( - dataset, - rag_option, - num_samples, - paramset["metric_names"], + dataset, rag_option, num_samples, paramset["metric_names"], out_path ) results[dataset][num_samples][rag_option] = result From 9fec8fd32298a8b33e45ebe11e1f8916891fe217 Mon Sep 17 00:00:00 2001 From: Rita Aleksziev Date: Tue, 21 Jan 2025 17:04:00 +0100 Subject: [PATCH 05/15] Fix random seed usage and handle empty descriptions --- evals/eval_on_hotpot.py | 2 +- evals/qa_context_provider_utils.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/evals/eval_on_hotpot.py b/evals/eval_on_hotpot.py index fd36a751..29c61f97 100644 --- a/evals/eval_on_hotpot.py +++ b/evals/eval_on_hotpot.py @@ -16,7 +16,6 @@ from pathlib import Path logger = logging.getLogger(__name__) -random.seed(42) async def answer_qa_instance(instance, context_provider, contexts_filename): @@ -110,6 +109,7 @@ async def eval_on_QA_dataset( dataset = load_qa_dataset(dataset_name_or_filename) context_provider = qa_context_providers[context_provider_name] eval_metrics = get_metrics(metric_name_list) + random.seed(42) instances = dataset if not num_samples else random.sample(dataset, num_samples) contexts_filename = Path(out_path) / Path( diff --git a/evals/qa_context_provider_utils.py b/evals/qa_context_provider_utils.py index 6397d105..8fe31918 100644 --- a/evals/qa_context_provider_utils.py +++ b/evals/qa_context_provider_utils.py @@ -39,10 +39,22 @@ def _insight_to_string(triplet: tuple) -> str: return "" node1_name = node1["name"] if "name" in node1 else "N/A" - node1_description = node1["description"] if "description" in node1 else node1["text"] + node1_description = ( + node1["description"] + if "description" in node1 + else node1["text"] + if "text" in node1 + else "N/A" + ) node1_string = f"name: {node1_name}, description: {node1_description}" node2_name = node2["name"] if "name" in node2 else "N/A" - node2_description = node2["description"] if "description" in node2 else node2["text"] + node2_description = ( + node2["description"] + if "description" in node2 + else node2["text"] + if "text" in node2 + else "N/A" + ) node2_string = f"name: {node2_name}, description: {node2_description}" edge_string = edge.get("relationship_name", "") From e0980361a1c7cfee22ce55a28750cc379a7299c0 Mon Sep 17 00:00:00 2001 From: Rita Aleksziev Date: Wed, 22 Jan 2025 10:51:08 +0100 Subject: [PATCH 06/15] include insights search in cognee option --- evals/qa_context_provider_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evals/qa_context_provider_utils.py b/evals/qa_context_provider_utils.py index 8fe31918..2cef1e62 100644 --- a/evals/qa_context_provider_utils.py +++ b/evals/qa_context_provider_utils.py @@ -70,7 +70,7 @@ def _insight_to_string(triplet: tuple) -> str: async def get_context_with_cognee( instance: dict, task_indices: list[int] = None, - search_types: list[SearchType] = [SearchType.SUMMARIES, SearchType.CHUNKS], + search_types: list[SearchType] = [SearchType.INSIGHTS, SearchType.SUMMARIES, SearchType.CHUNKS], ) -> str: await cognify_instance(instance, task_indices) From b2f7f733d934ad31870b6ec3041c52607cc5cec9 Mon Sep 17 00:00:00 2001 From: Rita Aleksziev Date: Wed, 22 Jan 2025 10:58:44 +0100 Subject: [PATCH 07/15] create output dir if doesnt exist --- evals/eval_on_hotpot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/evals/eval_on_hotpot.py b/evals/eval_on_hotpot.py index 29c61f97..b0591a1e 100644 --- a/evals/eval_on_hotpot.py +++ b/evals/eval_on_hotpot.py @@ -109,10 +109,15 @@ async def eval_on_QA_dataset( dataset = load_qa_dataset(dataset_name_or_filename) context_provider = qa_context_providers[context_provider_name] eval_metrics = get_metrics(metric_name_list) + + out_path = Path(out_path) + if not out_path.exists(): + out_path.mkdir(parents=True, exist_ok=True) + random.seed(42) instances = dataset if not num_samples else random.sample(dataset, num_samples) - contexts_filename = Path(out_path) / Path( + contexts_filename = out_path / Path( f"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json" ) if "promptfoo_metrics" in eval_metrics: @@ -122,7 +127,7 @@ async def eval_on_QA_dataset( else: promptfoo_results = {} - answers_filename = Path(out_path) / Path( + answers_filename = out_path / Path( f"answers_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json" ) deepeval_results = await deepeval_on_instances( From 343de01d5af23c1c7f763a58e417d7852e73c2d6 Mon Sep 17 00:00:00 2001 From: hande-k Date: Thu, 23 Jan 2025 11:11:51 +0100 Subject: [PATCH 08/15] update notebooks with latest eval --- notebooks/cognee_demo.ipynb | 917 +++++++++-------------- notebooks/cognee_hotpot_eval.ipynb | 1085 ++++++++++++++++++++++++++-- notebooks/hr_demo.ipynb | 363 ++++++++-- 3 files changed, 1679 insertions(+), 686 deletions(-) diff --git a/notebooks/cognee_demo.ipynb b/notebooks/cognee_demo.ipynb index f59f6338..6540d19c 100644 --- a/notebooks/cognee_demo.ipynb +++ b/notebooks/cognee_demo.ipynb @@ -265,6 +265,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "df16431d0f48b006", "metadata": { "ExecuteTime": { @@ -272,6 +273,7 @@ "start_time": "2024-12-24T11:53:59.347420Z" } }, + "outputs": [], "source": [ "job_position = \"\"\"Senior Data Scientist (Machine Learning)\n", "\n", @@ -298,12 +300,11 @@ "Strong problem-solving skills and attention to detail.\n", "Candidate CVs\n", "\"\"\"\n" - ], - "outputs": [], - "execution_count": 1 + ] }, { "cell_type": "code", + "execution_count": null, "id": "9086abf3af077ab4", "metadata": { "ExecuteTime": { @@ -311,6 +312,7 @@ "start_time": "2024-12-24T11:53:59.363662Z" } }, + "outputs": [], "source": [ "job_1 = \"\"\"\n", "CV 1: Relevant\n", @@ -343,12 +345,11 @@ "Big Data Technologies: Hadoop, Spark\n", "Data Visualization: Tableau, Matplotlib\n", "\"\"\"" - ], - "outputs": [], - "execution_count": 2 + ] }, { "cell_type": "code", + "execution_count": null, "id": "a9de0cc07f798b7f", "metadata": { "ExecuteTime": { @@ -356,6 +357,7 @@ "start_time": "2024-12-24T11:53:59.371152Z" } }, + "outputs": [], "source": [ "job_2 = \"\"\"\n", "CV 2: Relevant\n", @@ -387,12 +389,11 @@ "Data Visualization: Seaborn, Plotly\n", "Databases: MySQL, MongoDB\n", "\"\"\"" - ], - "outputs": [], - "execution_count": 3 + ] }, { "cell_type": "code", + "execution_count": null, "id": "185ff1c102d06111", "metadata": { "ExecuteTime": { @@ -400,6 +401,7 @@ "start_time": "2024-12-24T11:53:59.959103Z" } }, + "outputs": [], "source": [ "job_3 = \"\"\"\n", "CV 3: Relevant\n", @@ -431,12 +433,11 @@ "Statistical Analysis: SAS, SPSS\n", "Cloud Platforms: AWS, Azure\n", "\"\"\"" - ], - "outputs": [], - "execution_count": 4 + ] }, { "cell_type": "code", + "execution_count": null, "id": "d55ce4c58f8efb67", "metadata": { "ExecuteTime": { @@ -444,6 +445,7 @@ "start_time": "2024-12-24T11:54:00.654716Z" } }, + "outputs": [], "source": [ "job_4 = \"\"\"\n", "CV 4: Not Relevant\n", @@ -473,12 +475,11 @@ "Web Design: HTML, CSS\n", "Specialties: Branding and Identity, Typography\n", "\"\"\"" - ], - "outputs": [], - "execution_count": 5 + ] }, { "cell_type": "code", + "execution_count": null, "id": "ca4ecc32721ad332", "metadata": { "ExecuteTime": { @@ -486,6 +487,7 @@ "start_time": "2024-12-24T11:54:01.183028Z" } }, + "outputs": [], "source": [ "job_5 = \"\"\"\n", "CV 5: Not Relevant\n", @@ -515,9 +517,7 @@ "CRM Software: Salesforce, Zoho\n", "Negotiation and Relationship Building\n", "\"\"\"" - ], - "outputs": [], - "execution_count": 6 + ] }, { "cell_type": "markdown", @@ -529,6 +529,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "bce39dc6", "metadata": { "ExecuteTime": { @@ -536,6 +537,7 @@ "start_time": "2024-12-24T11:54:04.414132Z" } }, + "outputs": [], "source": [ "import os\n", "\n", @@ -573,12 +575,11 @@ "# os.environ[\"DB_PORT\"]=\"5432\"\n", "# os.environ[\"DB_USERNAME\"]=\"cognee\"\n", "# os.environ[\"DB_PASSWORD\"]=\"cognee\"" - ], - "outputs": [], - "execution_count": 7 + ] }, { "cell_type": "code", + "execution_count": null, "id": "9f1a1dbd", "metadata": { "ExecuteTime": { @@ -586,6 +587,7 @@ "start_time": "2024-12-24T11:54:07.425202Z" } }, + "outputs": [], "source": [ "# Reset the cognee system with the following command:\n", "\n", @@ -593,32 +595,7 @@ "\n", "await cognee.prune.prune_data()\n", "await cognee.prune.prune_system(metadata=True)" - ], - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "File /Users/vasilije/cognee/cognee/.cognee_system/databases/cognee_graph.pkl not found. Initializing an empty graph." - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Database deleted successfully.\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/vasilije/cognee/.venv/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", - " from .autonotebook import tqdm as notebook_tqdm\n" - ] - } - ], - "execution_count": 8 + ] }, { "cell_type": "markdown", @@ -630,6 +607,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "904df61ba484a8e5", "metadata": { "ExecuteTime": { @@ -637,41 +615,12 @@ "start_time": "2024-12-24T11:54:23.756587Z" } }, + "outputs": [], "source": [ "import cognee\n", "\n", "await cognee.add([job_1, job_2, job_3, job_4, job_5, job_position], \"example\")" - ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "User df77f15b-a077-4c86-a3e4-c059bf4cacb9 has registered.\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/vasilije/cognee/.venv/lib/python3.11/site-packages/dlt/destinations/impl/sqlalchemy/merge_job.py:194: SAWarning: Table 'file_metadata' already exists within the given MetaData - not copying.\n", - " staging_table_obj = table_obj.to_metadata(\n", - "/Users/vasilije/cognee/.venv/lib/python3.11/site-packages/dlt/destinations/impl/sqlalchemy/merge_job.py:229: SAWarning: implicitly coercing SELECT object to scalar subquery; please use the .scalar_subquery() method to produce a scalar subquery.\n", - " order_by=order_dir_func(order_by_col),\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Pipeline file_load_from_filesystem load step completed in 0.03 seconds\n", - "1 load package(s) were loaded to destination sqlalchemy and into dataset main\n", - "The sqlalchemy destination used sqlite:////Users/vasilije/cognee/cognee/.cognee_system/databases/cognee_db location to store data\n", - "Load package 1735041267.4777632 is LOADED and contains no failed jobs\n" - ] - } - ], - "execution_count": 9 + ] }, { "cell_type": "markdown", @@ -683,6 +632,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "7c431fdef4921ae0", "metadata": { "ExecuteTime": { @@ -690,6 +640,7 @@ "start_time": "2024-12-24T11:54:44.723877Z" } }, + "outputs": [], "source": [ "from cognee.shared.data_models import KnowledgeGraph\n", "from cognee.modules.data.models import Dataset, Data\n", @@ -728,12 +679,11 @@ " print(result)\n", " except Exception as error:\n", " raise error\n" - ], - "outputs": [], - "execution_count": 10 + ] }, { "cell_type": "code", + "execution_count": null, "id": "f0a91b99c6215e09", "metadata": { "ExecuteTime": { @@ -741,6 +691,7 @@ "start_time": "2024-12-24T11:54:47.384342Z" } }, + "outputs": [], "source": [ "from cognee.modules.users.methods import get_default_user\n", "from cognee.modules.data.methods import get_datasets_by_name\n", @@ -750,27 +701,7 @@ "datasets = await get_datasets_by_name([\"example\"], user.id)\n", "\n", "await run_cognify_pipeline(datasets[0], user)" - ], - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "File /Users/vasilije/cognee/cognee/.cognee_system/databases/cognee_graph.pkl not found. Initializing an empty graph./Users/vasilije/cognee/.venv/lib/python3.11/site-packages/pydantic/main.py:1522: RuntimeWarning: fields may not start with an underscore, ignoring \"_metadata\"\n", - " warnings.warn(f'fields may not start with an underscore, ignoring \"{f_name}\"', RuntimeWarning)\n", - "/Users/vasilije/cognee/.venv/lib/python3.11/site-packages/pydantic/main.py:1522: RuntimeWarning: fields may not start with an underscore, ignoring \"__tablename__\"\n", - " warnings.warn(f'fields may not start with an underscore, ignoring \"{f_name}\"', RuntimeWarning)\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[TextSummary(id=UUID('92b5d0a7-f980-529d-bb5b-48e72825a01a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Experienced Senior Data Scientist with expertise in machine learning and predictive modeling, demonstrating over 8 years in the field.', made_from=DocumentChunk(id=UUID('70b823e2-5b12-57b5-ad8d-798e1d721f8e'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='\\nCV 1: Relevant\\nName: Dr. Emily Carter\\nContact Information:\\n\\nEmail: emily.carter@example.com\\nPhone: (555) 123-4567\\nSummary:\\n\\nSenior Data Scientist with over 8 years of experience in machine learning and predictive analytics. Expertise in developing advanced algorithms and deploying scalable models in production environments.\\n\\nEducation:\\n\\nPh.D. in Computer Science, Stanford University (2014)\\nB.S. in Mathematics, University of California, Berkeley (2010)\\nExperience:\\n\\nSenior Data Scientist, InnovateAI Labs (2016 – Present)\\nLed a team in developing machine learning models for natural language processing applications.\\nImplemented deep learning algorithms that improved prediction accuracy by 25%.\\nCollaborated with cross-functional teams to integrate models into cloud-based platforms.\\nData Scientist, DataWave Analytics (2014 – 2016)\\nDeveloped predictive models for customer segmentation and churn analysis.\\nAnalyzed large datasets using Hadoop and Spark frameworks.\\nSkills:\\n\\nProgramming Languages: Python, R, SQL\\nMachin e Learning: TensorFlow, Keras, Scikit-Learn\\nBig Data Technologies: Hadoop, Spark\\nData Visualization: Tableau, Matplotlib\\n', word_count=133, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('11a2b08a-c160-5961-80b7-b3498eafa973'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_85410f4ad1197f5974aef9aed6f103c8', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_85410f4ad1197f5974aef9aed6f103c8.txt', metadata_id=UUID('11a2b08a-c160-5961-80b7-b3498eafa973'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('29e771c8-4c3f-52de-9511-6b705878e130'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='dr. emily carter', is_a=EntityType(id=UUID('d072ba0f-e1a9-58bf-9974-e1802adc8134'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='person', description='person'), description='Senior Data Scientist with over 8 years of experience in machine learning and predictive analytics.'), Entity(id=UUID('ce8b394a-b30e-52fc-b80a-6352edc60e5b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='stanford university', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='Prestigious university located in Stanford, California.'), Entity(id=UUID('2c02c93c-9cd1-56b8-9cc0-55ff0b290e57'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='university of california, berkeley', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='Public research university located in Berkeley, California.'), Entity(id=UUID('9780afb1-dccc-53eb-9a30-c0d4ce033711'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='innovateai labs', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='A lab focused on artificial intelligence projects.'), Entity(id=UUID('50d0a685-5300-544f-b081-edca4b625886'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='datawave analytics', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='Analytics firm specialized in data-driven insights.'), Entity(id=UUID('c95db510-e2ee-5a00-bded-20bbcb50c492'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='python', is_a=EntityType(id=UUID('80d409bb-e431-5939-a1ad-3acd96267128'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='programming language', description='programming language'), description='A high-level programming language used for general-purpose programming.'), Entity(id=UUID('39bd9707-8098-52ed-9cbf-bbdd26b963fb'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='r', is_a=EntityType(id=UUID('80d409bb-e431-5939-a1ad-3acd96267128'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='programming language', description='programming language'), description='A programming language and environment for statistical computing and graphics.'), Entity(id=UUID('1ff6821a-b207-5050-83e9-37ff67a27d03'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='sql', is_a=EntityType(id=UUID('80d409bb-e431-5939-a1ad-3acd96267128'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='programming language', description='programming language'), description='A domain-specific language used in programming and managing relational databases.'), Entity(id=UUID('6e72f6f5-0452-5d42-a4e8-4aba6a614cb1'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='tensorflow', is_a=EntityType(id=UUID('9ffe9ce7-8938-5a5c-8d03-5f1a4c5210a1'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='machine learning framework', description='machine learning framework'), description='An open-source software library for dataflow and differentiable programming across a range of tasks.'), Entity(id=UUID('ab85cdff-2a98-5c6d-99a3-df1f40f4ec16'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='keras', is_a=EntityType(id=UUID('9ffe9ce7-8938-5a5c-8d03-5f1a4c5210a1'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='machine learning framework', description='machine learning framework'), description='An open-source neural network library written in Python that runs on top of TensorFlow.'), Entity(id=UUID('37eecdcc-fb56-519c-bc18-d0d3afea0c0d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='scikit-learn', is_a=EntityType(id=UUID('9ffe9ce7-8938-5a5c-8d03-5f1a4c5210a1'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='machine learning framework', description='machine learning framework'), description='A free software machine learning library for the Python programming language.'), Entity(id=UUID('f9a0eeca-c9ff-53b3-90eb-347254d7d7eb'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='hadoop', is_a=EntityType(id=UUID('7c2287d0-16fc-53dc-86ce-8d8e61c8642c'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='big data technology', description='big data technology'), description='An open-source framework for storing and processing large datasets in a distributed computing environment.'), Entity(id=UUID('46a235af-5ed5-5023-a4ec-c253e3f93031'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='spark', is_a=EntityType(id=UUID('7c2287d0-16fc-53dc-86ce-8d8e61c8642c'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='big data technology', description='big data technology'), description='An open-source unified analytics engine for large-scale data processing.'), Entity(id=UUID('c55004f3-8a6d-5130-b8bd-ed8278daa9a4'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='tableau', is_a=EntityType(id=UUID('674cc5fa-7849-575a-917f-90b7b77f52b3'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='data visualization software', description='data visualization software'), description='A visual analytics platform transforming the way we use data to solve problems.'), Entity(id=UUID('3c7adf8f-ef23-5330-a3fe-6a0b791cee2b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='matplotlib', is_a=EntityType(id=UUID('3f3619fc-ebd1-50ed-adde-cf94e8bb3c1b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='data visualization library', description='data visualization library'), description='A plotting library for the Python programming language and its numerical mathematics extension NumPy.')])), TextSummary(id=UUID('2f680bef-2edd-566e-b98c-78d549799e77'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Senior Data Scientist specializing in Machine Learning at TechNova Solutions', made_from=DocumentChunk(id=UUID('eb6617b8-c78c-519b-b765-1eefc2e3a0d7'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Senior Data Scientist (Machine Learning)\\n\\nCompany: TechNova Solutions\\nLocation: San Francisco, CA\\n\\nJob Description:\\n\\nTechNova Solutions is seeking a Senior Data Scientist specializing in Machine Learning to join our dynamic analytics team. The ideal candidate will have a strong background in developing and deploying machine learning models, working with large datasets, and translating complex data into actionable insights.\\n\\nResponsibilities:\\n\\nDevelop and implement advanced machine learning algorithms and models.\\nAnalyze large, complex datasets to extract meaningful patterns and insights.\\nCollaborate with cross-functional teams to integrate predictive models into products.\\nStay updated with the latest advancements in machine learning and data science.\\nMentor junior data scientists and provide technical guidance.\\nQualifications:\\n\\nMaster’s or Ph.D. in Data Science, Computer Science, Statistics, or a related field.\\n5+ years of experience in data science and machine learning.\\nProficient in Python, R, and SQL.\\nExpe rience with deep learning frameworks (e.g., TensorFlow, PyTorch).\\nStrong problem-solving skills and attention to detail.\\nCandidate CVs\\n', word_count=153, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('171f3035-4c37-5f7b-97c8-6b222404cc9a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_81a5a96a9a7325d40521ea453778ebe0', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_81a5a96a9a7325d40521ea453778ebe0.txt', metadata_id=UUID('171f3035-4c37-5f7b-97c8-6b222404cc9a'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('453a45c9-14e7-5b73-adb8-55991096fef0'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='technova solutions', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='A technology company specializing in data analytics and machine learning.'), Entity(id=UUID('435dbd37-ab20-503c-9e99-ab8b8a3484e5'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='senior data scientist', is_a=EntityType(id=UUID('524c6bbb-1534-5a51-8068-18dd4ae171eb'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='profession', description='profession'), description='A role focused on advanced data analysis and machine learning.'), Entity(id=UUID('198e2ab8-75e9-5931-97ab-da9a5a8e188c'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='san francisco, ca', is_a=EntityType(id=UUID('19dd7d4d-a966-5ed5-82a0-6ae377761a29'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='location', description='location'), description='A city in California, USA.'), Entity(id=UUID('5187986a-7305-5a63-b057-8f2c097419eb'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='machine learning', is_a=EntityType(id=UUID('0198571b-3e94-50ea-8b9f-19e3a31080c0'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='field', description='field'), description='A subset of artificial intelligence focused on the development of algorithms that enable computers to learn from data.'), Entity(id=UUID('d6545b21-153c-58ba-be47-46e5216521a3'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='data science', is_a=EntityType(id=UUID('0198571b-3e94-50ea-8b9f-19e3a31080c0'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='field', description='field'), description='A multidisciplinary field that uses scientific methods to extract knowledge and insights from data.'), Entity(id=UUID('c0d95499-de6b-5fcf-b0f5-9cbf427ad5c6'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='pytorch', is_a=EntityType(id=UUID('36a32bd3-8880-547a-949b-8447477d1ef5'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='framework', description='framework'), description='An open-source machine learning framework for deep learning.'), Entity(id=UUID('62b4dda1-de4a-5098-a56e-d3fe81f84dbc'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='masters or ph.d. in data science', is_a=EntityType(id=UUID('a49b283a-ce92-50e0-b7fa-ca7c628eb01a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='degree', description='degree'), description='Advanced academic degree in data science or related fields.')])), TextSummary(id=UUID('5c988618-db52-5979-9cf8-db80c0098285'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Data Scientist with expertise in machine learning and statistical analysis, adept at managing extensive datasets and converting data into practical business solutions.', made_from=DocumentChunk(id=UUID('a6e82ac7-e791-5d6b-b4a9-f5e41cbe95bf'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='\\nCV 2: Relevant\\nName: Michael Rodriguez\\nContact Information:\\n\\nEmail: michael.rodriguez@example.com\\nPhone: (555) 234-5678\\nSummary:\\n\\nData Scientist with a strong background in machine learning and statistical modeling. Skilled in handling large datasets and translating data into actionable business insights.\\n\\nEducation:\\n\\nM.S. in Data Science, Carnegie Mellon University (2013)\\nB.S. in Computer Science, University of Michigan (2011)\\nExperience:\\n\\nSenior Data Scientist, Alpha Analytics (2017 – Present)\\nDeveloped machine learning models to optimize marketing strategies.\\nReduced customer acquisition cost by 15% through predictive modeling.\\nData Scientist, TechInsights (2013 – 2017)\\nAnalyzed user behavior data to improve product features.\\nImplemented A/B testing frameworks to evaluate product changes.\\nSkills:\\n\\nProgramming Languages: Python, Java, SQL\\nMachine Learning: Scikit-Learn, XGBoost\\nData Visualization: Seaborn, Plotly\\nDatabases: MySQL, MongoDB\\n', word_count=108, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('1f078b0a-3cc1-57a9-9802-f78565d49f29'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_f0f63a5c88dbbeef1eca23d32848220c', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_f0f63a5c88dbbeef1eca23d32848220c.txt', metadata_id=UUID('1f078b0a-3cc1-57a9-9802-f78565d49f29'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('73ae630f-7b09-5dce-8c18-45d0a57b30f9'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='michael rodriguez', is_a=EntityType(id=UUID('d072ba0f-e1a9-58bf-9974-e1802adc8134'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='person', description='person'), description='Data Scientist with a strong background in machine learning and statistical modeling.'), Entity(id=UUID('5534e0b0-d0c4-5ab9-82e9-91bed36f70bd'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='carnegie mellon university', is_a=EntityType(id=UUID('912b273c-683d-53ea-8ffe-aadef0b84237'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='educational institution', description='educational institution'), description='University known for its data science program.'), Entity(id=UUID('0af613e0-c11b-550d-ada2-2c2aa6550884'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='university of michigan', is_a=EntityType(id=UUID('912b273c-683d-53ea-8ffe-aadef0b84237'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='educational institution', description='educational institution'), description='University known for its computer science program.'), Entity(id=UUID('04a91fef-8a07-5d50-8f1b-46f3afeec497'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='alpha analytics', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='Company where Michael Rodriguez works as a Senior Data Scientist.'), Entity(id=UUID('3f848ed6-902f-5a8e-9577-cb67f8c17acd'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='techinsights', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='Company where Michael Rodriguez worked as a Data Scientist.')])), TextSummary(id=UUID('ee6cb607-27eb-5b87-bf2a-305721534263'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Sales Manager with proven ability to enhance revenue and cultivate effective teams. Strong communicator and leader.', made_from=DocumentChunk(id=UUID('7e35407f-7c59-5429-8824-23f1d17118c0'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text=\"\\nCV 5: Not Relevant\\nName: Jessica Miller\\nContact Information:\\n\\nEmail: jessica.miller@example.com\\nPhone: (555) 567-8901\\nSummary:\\n\\nExperienced Sales Manager with a strong track record in driving sales growth and building high-performing teams. Excellent communication and leadership skills.\\n\\nEducation:\\n\\nB.A. in Business Administration, University of Southern California (2010)\\nExperience:\\n\\nSales Manager, Global Enterprises (2015 – Present)\\nManaged a sales team of 15 members, achieving a 20% increase in annual revenue.\\nDeveloped sales strategies that expanded customer base by 25%.\\nSales Representative, Market Leaders Inc. (2010 – 2015)\\nConsistently exceeded sales targets and received the 'Top Salesperson' award in 2013.\\nSkills:\\n\\nSales Strategy and Planning\\nTeam Leadership and Development\\nCRM Software: Salesforce, Zoho\\nNegotiation and Relationship Building\\n\", word_count=102, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('3c323fc9-9165-52da-a079-2627a9556b08'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_9b35c7df1f5d4dc84e78270c0bf9cac6', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_9b35c7df1f5d4dc84e78270c0bf9cac6.txt', metadata_id=UUID('3c323fc9-9165-52da-a079-2627a9556b08'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('36a5e3c8-c5f5-5ab5-8d59-ea69d8b36932'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='jessica miller', is_a=EntityType(id=UUID('d072ba0f-e1a9-58bf-9974-e1802adc8134'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='person', description='person'), description='An experienced sales manager with a strong track record in driving sales growth and building high-performing teams.'), Entity(id=UUID('5c32691d-c0e4-5378-9aab-dda8b0fa3931'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='global enterprises', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='A company where Jessica Miller worked as a Sales Manager.'), Entity(id=UUID('67544857-983a-5152-801d-4fc9d35d14e4'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='market leaders inc.', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='A company where Jessica Miller worked as a Sales Representative.'), Entity(id=UUID('f39d6c00-689b-5fd2-9021-893b28ac6ff2'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='university of southern california', is_a=EntityType(id=UUID('912b273c-683d-53ea-8ffe-aadef0b84237'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='educational institution', description='educational institution'), description='University where Jessica Miller obtained her degree in Business Administration.'), Entity(id=UUID('0abc801d-38ca-5003-b974-b60f1956c94a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='2010', is_a=EntityType(id=UUID('d61d99ac-b291-5666-9748-3e80e1c8b56a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='date', description='date'), description='Year Jessica Miller graduated from University of Southern California.'), Entity(id=UUID('7c8b43c1-e133-52e6-99aa-239534f1ed45'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='2015', is_a=EntityType(id=UUID('d61d99ac-b291-5666-9748-3e80e1c8b56a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='date', description='date'), description='Year Jessica Miller started working as Sales Manager at Global Enterprises.'), Entity(id=UUID('2f4749e9-e1e4-5af0-be80-2a10d07557ff'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='present', is_a=EntityType(id=UUID('d61d99ac-b291-5666-9748-3e80e1c8b56a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='date', description='date'), description=\"Current time indicative of Jessica Miller's ongoing role.\")])), TextSummary(id=UUID('d8a8668e-b122-5713-b289-932407bb294e'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Creative Graphic Designer with 8+ years of expertise in visual design and branding, skilled in Adobe Creative Suite, dedicated to crafting engaging visuals.', made_from=DocumentChunk(id=UUID('c401b5b1-21d8-5830-8c7b-48e7d94c5b95'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='\\nCV 4: Not Relevant\\nName: David Thompson\\nContact Information:\\n\\nEmail: david.thompson@example.com\\nPhone: (555) 456-7890\\nSummary:\\n\\nCreative Graphic Designer with over 8 years of experience in visual design and branding. Proficient in Adobe Creative Suite and passionate about creating compelling visuals.\\n\\nEducation:\\n\\nB.F.A. in Graphic Design, Rhode Island School of Design (2012)\\nExperience:\\n\\nSenior Graphic Designer, CreativeWorks Agency (2015 – Present)\\nLed design projects for clients in various industries.\\nCreated branding materials that increased client engagement by 30%.\\nGraphic Designer, Visual Innovations (2012 – 2015)\\nDesigned marketing collateral, including brochures, logos, and websites.\\nCollaborated with the marketing team to develop cohesive brand strategies.\\nSkills:\\n\\nDesign Software: Adobe Photoshop, Illustrator, InDesign\\nWeb Design: HTML, CSS\\nSpecialties: Branding and Identity, Typography\\n', word_count=108, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('e71daf63-15a0-50fe-a909-766bc8fd311b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_9abf20fa7defd7e49296c51b4e38edf2', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_9abf20fa7defd7e49296c51b4e38edf2.txt', metadata_id=UUID('e71daf63-15a0-50fe-a909-766bc8fd311b'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('a4777597-06c7-562c-bc44-56f74571a01a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='david thompson', is_a=EntityType(id=UUID('d072ba0f-e1a9-58bf-9974-e1802adc8134'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='person', description='person'), description='Creative Graphic Designer with over 8 years of experience in visual design and branding.'), Entity(id=UUID('ca20272a-3e88-552f-92fe-491e23f117f8'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='creativeworks agency', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='An agency where David Thompson is a Senior Graphic Designer.'), Entity(id=UUID('1e97bb97-4d29-5fb8-863a-15ab51f1dd46'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='visual innovations', is_a=EntityType(id=UUID('d3d7b6b4-9b0d-52e8-9e09-a9e9cf4b5a4d'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='organization', description='organization'), description='An organization where David Thompson worked as a Graphic Designer.'), Entity(id=UUID('60b027fe-7bb4-535d-8a47-19f1a491591b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='rhode island school of design', is_a=EntityType(id=UUID('b5866225-05ad-5cfc-908e-c22916c6a1c6'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='institution', description='institution'), description='Educational institution where David Thompson earned his B.F.A. in Graphic Design.'), Entity(id=UUID('7e3df89c-2691-580b-84dc-378cb1df3db6'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='adobe creative suite', is_a=EntityType(id=UUID('2d66edc2-1e14-55ab-8304-680b514a597a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='software', description='software'), description='A suite of graphic design, video editing, and web development applications.'), Entity(id=UUID('2a0f9b58-c695-5bad-baa2-fd2da02da013'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='html', is_a=EntityType(id=UUID('c90c7d6b-3532-5dcf-91e1-4a0e1f179794'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='language', description='language'), description='A markup language for creating web pages and applications.'), Entity(id=UUID('9b062f3c-fe02-5427-9b44-b287a1cac367'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='css', is_a=EntityType(id=UUID('c90c7d6b-3532-5dcf-91e1-4a0e1f179794'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='language', description='language'), description='A stylesheet language used for describing the presentation of a document written in HTML.')])), TextSummary(id=UUID('8aedca6b-fa78-5987-a79b-3b0bebff8eb1'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='Data Scientist with 6 years of expertise in machine learning, focused on utilizing data for business improvement and product enhancement.', made_from=DocumentChunk(id=UUID('00692e43-9f02-54d0-b695-44bf47342d36'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, text='\\nCV 3: Relevant\\nName: Sarah Nguyen\\nContact Information:\\n\\nEmail: sarah.nguyen@example.com\\nPhone: (555) 345-6789\\nSummary:\\n\\nData Scientist specializing in machine learning with 6 years of experience. Passionate about leveraging data to drive business solutions and improve product performance.\\n\\nEducation:\\n\\nM.S. in Statistics, University of Washington (2014)\\nB.S. in Applied Mathematics, University of Texas at Austin (2012)\\nExperience:\\n\\nData Scientist, QuantumTech (2016 – Present)\\nDesigned and implemented machine learning algorithms for financial forecasting.\\nImproved model efficiency by 20% through algorithm optimization.\\nJunior Data Scientist, DataCore Solutions (2014 – 2016)\\nAssisted in developing predictive models for supply chain optimization.\\nConducted data cleaning and preprocessing on large datasets.\\nSkills:\\n\\nProgramming Languages: Python, R\\nMachine Learning Frameworks: PyTorch, Scikit-Learn\\nStatistical Analysis: SAS, SPSS\\nCloud Platforms: AWS, Azure\\n', word_count=110, chunk_index=0, cut_type='sentence_cut', is_part_of=TextDocument(id=UUID('e7d6246b-e414-5b9d-8daa-6d4434b7fa47'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='text_f8c7482e727f228001b0046ed68d656f', raw_data_location='/Users/vasilije/cognee/cognee/.data_storage/data/text_f8c7482e727f228001b0046ed68d656f.txt', metadata_id=UUID('e7d6246b-e414-5b9d-8daa-6d4434b7fa47'), mime_type='text/plain', type='text'), contains=[Entity(id=UUID('4d8dda57-2681-5264-a2bd-e2ddfe66a785'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='sarah nguyen', is_a=EntityType(id=UUID('d072ba0f-e1a9-58bf-9974-e1802adc8134'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='person', description='person'), description='Data Scientist specializing in machine learning with 6 years of experience.'), Entity(id=UUID('ae74a35b-d5f1-5622-ade1-6703d5e069fb'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='university of washington', is_a=EntityType(id=UUID('912b273c-683d-53ea-8ffe-aadef0b84237'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='educational institution', description='educational institution'), description='University located in Seattle, Washington.'), Entity(id=UUID('301b3cf8-5a5c-585e-80bd-f79901e4368c'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='university of texas at austin', is_a=EntityType(id=UUID('912b273c-683d-53ea-8ffe-aadef0b84237'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='educational institution', description='educational institution'), description='Public research university located in Austin, Texas.'), Entity(id=UUID('0d980f2a-09dd-581e-acc3-cc2d87c1bab4'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='quantumtech', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='Company where Sarah Nguyen works as a Data Scientist from 2016 to present.'), Entity(id=UUID('95ac0551-38fc-5187-a422-533aeb7e8db0'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='datacore solutions', is_a=EntityType(id=UUID('a6ed6bf1-fe31-5dfe-8ab4-484691fdf219'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='company', description='company'), description='Company where Sarah Nguyen worked as a Junior Data Scientist from 2014 to 2016.'), Entity(id=UUID('3edcdf3f-25af-57a3-8878-8008bd7ea05a'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='aws', is_a=EntityType(id=UUID('d84d991a-dab3-5c36-8806-df076ccb731b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='cloud platform', description='cloud platform'), description='Amazon Web Services, a cloud computing platform.'), Entity(id=UUID('8b431923-4aa2-5886-a661-b8de0f888a9b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='azure', is_a=EntityType(id=UUID('d84d991a-dab3-5c36-8806-df076ccb731b'), updated_at=datetime.datetime(2024, 12, 24, 11, 54, 13, 481297, tzinfo=datetime.timezone.utc), topological_rank=0, name='cloud platform', description='cloud platform'), description='Microsoft Azure, a cloud computing service created by Microsoft.')]))]\n" - ] - } - ], - "execution_count": 11 + ] }, { "cell_type": "markdown", @@ -782,6 +713,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "080389e5", "metadata": { "ExecuteTime": { @@ -789,6 +721,7 @@ "start_time": "2024-12-29T16:55:46.922951Z" } }, + "outputs": [], "source": [ "import os\n", "from cognee.shared.utils import render_graph\n", @@ -801,42 +734,23 @@ "\n", "graph_url = await render_graph(graph_engine.graph)\n", "print(graph_url)" - ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Graph is visualized at: https://hub.graphistry.com/graph/graph.html?dataset=cc21b1d2d6074323aa37af53e693b1a4&type=arrow&viztoken=db05565e-79e9-4fe3-99b2-b7a2e6d48eff&usertag=5f822e63-pygraphistry-0.33.9&splashAfter=1735491366&info=true\n", - "https://hub.graphistry.com/graph/graph.html?dataset=cc21b1d2d6074323aa37af53e693b1a4&type=arrow&viztoken=db05565e-79e9-4fe3-99b2-b7a2e6d48eff&usertag=5f822e63-pygraphistry-0.33.9&splashAfter=1735491366&info=true\n" - ] - } - ], - "execution_count": 12 + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "8f69caa0e353a889", "metadata": { "ExecuteTime": { "end_time": "2024-12-29T16:56:06.571404Z", "start_time": "2024-12-29T16:56:06.569280Z" } }, - "cell_type": "code", + "outputs": [], "source": [ "graph_engine = await get_graph_engine()\n", "print(graph_url)" - ], - "id": "8f69caa0e353a889", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "https://hub.graphistry.com/graph/graph.html?dataset=cc21b1d2d6074323aa37af53e693b1a4&type=arrow&viztoken=db05565e-79e9-4fe3-99b2-b7a2e6d48eff&usertag=5f822e63-pygraphistry-0.33.9&splashAfter=1735491366&info=true\n" - ] - } - ], - "execution_count": 13 + ] }, { "cell_type": "markdown", @@ -848,6 +762,7 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e5e7dfc8", "metadata": { "ExecuteTime": { @@ -855,6 +770,7 @@ "start_time": "2024-12-24T13:44:16.047897Z" } }, + "outputs": [], "source": [ "async def search(\n", " vector_engine,\n", @@ -883,26 +799,7 @@ "results = await search(vector_engine, \"entity_name\", \"sarah.nguyen@example.com\")\n", "for result in results:\n", " print(result)" - ], - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'id': '4d8dda57-2681-5264-a2bd-e2ddfe66a785', 'payload': {'id': '4d8dda57-2681-5264-a2bd-e2ddfe66a785', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'sarah nguyen'}, 'score': 0.5708460211753845}\n", - "{'id': '198e2ab8-75e9-5931-97ab-da9a5a8e188c', 'payload': {'id': '198e2ab8-75e9-5931-97ab-da9a5a8e188c', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'san francisco, ca'}, 'score': 1.349550724029541}\n", - "{'id': '435dbd37-ab20-503c-9e99-ab8b8a3484e5', 'payload': {'id': '435dbd37-ab20-503c-9e99-ab8b8a3484e5', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'senior data scientist'}, 'score': 1.3934645652770996}\n", - "{'id': '36a5e3c8-c5f5-5ab5-8d59-ea69d8b36932', 'payload': {'id': '36a5e3c8-c5f5-5ab5-8d59-ea69d8b36932', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'jessica miller'}, 'score': 1.4042469263076782}\n", - "{'id': '73ae630f-7b09-5dce-8c18-45d0a57b30f9', 'payload': {'id': '73ae630f-7b09-5dce-8c18-45d0a57b30f9', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'michael rodriguez'}, 'score': 1.4521806240081787}\n", - "{'id': '29e771c8-4c3f-52de-9511-6b705878e130', 'payload': {'id': '29e771c8-4c3f-52de-9511-6b705878e130', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'dr. emily carter'}, 'score': 1.471205472946167}\n", - "{'id': 'ce8b394a-b30e-52fc-b80a-6352edc60e5b', 'payload': {'id': 'ce8b394a-b30e-52fc-b80a-6352edc60e5b', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'stanford university'}, 'score': 1.4871069192886353}\n", - "{'id': '9780afb1-dccc-53eb-9a30-c0d4ce033711', 'payload': {'id': '9780afb1-dccc-53eb-9a30-c0d4ce033711', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'innovateai labs'}, 'score': 1.498255968093872}\n", - "{'id': '301b3cf8-5a5c-585e-80bd-f79901e4368c', 'payload': {'id': '301b3cf8-5a5c-585e-80bd-f79901e4368c', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'university of texas at austin'}, 'score': 1.5053001642227173}\n", - "{'id': '2c02c93c-9cd1-56b8-9cc0-55ff0b290e57', 'payload': {'id': '2c02c93c-9cd1-56b8-9cc0-55ff0b290e57', 'updated_at': datetime.datetime(2024, 12, 24, 11, 54, 13, 481297), 'topological_rank': 0, 'text': 'university of california, berkeley'}, 'score': 1.5213639736175537}\n" - ] - } - ], - "execution_count": 23 + ] }, { "cell_type": "markdown", @@ -981,485 +878,365 @@ ] }, { + "cell_type": "markdown", + "id": "c9ffa271", + "metadata": {}, + "source": [ + "### Now let's add evals" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "afae18ac6a794925", "metadata": { "ExecuteTime": { "end_time": "2024-12-24T13:46:09.644509Z", "start_time": "2024-12-24T13:46:04.538592Z" } }, - "cell_type": "code", + "outputs": [], "source": [ - "!pip install wget\n", - "!pip install deepeval\n", - "!pip install ujson" - ], - "id": "afae18ac6a794925", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: wget in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (3.2)\r\n", - "\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m23.2.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m24.3.1\u001B[0m\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\r\n", - "Requirement already satisfied: deepeval in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (2.0.9)\r\n", - "Requirement already satisfied: requests in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (2.32.3)\r\n", - "Requirement already satisfied: tqdm in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (4.67.1)\r\n", - "Requirement already satisfied: pytest in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (7.4.4)\r\n", - "Requirement already satisfied: tabulate in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.9.0)\r\n", - "Requirement already satisfied: typer in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.15.1)\r\n", - "Requirement already satisfied: rich in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (13.9.4)\r\n", - "Requirement already satisfied: protobuf in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (4.25.5)\r\n", - "Requirement already satisfied: pydantic in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (2.8.2)\r\n", - "Requirement already satisfied: sentry-sdk in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (2.19.2)\r\n", - "Requirement already satisfied: pytest-repeat in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.9.3)\r\n", - "Requirement already satisfied: pytest-xdist in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (3.6.1)\r\n", - "Requirement already satisfied: portalocker in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (3.0.0)\r\n", - "Requirement already satisfied: langchain in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.3.13)\r\n", - "Requirement already satisfied: langchain-core in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.3.28)\r\n", - "Requirement already satisfied: langchain_openai in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.2.14)\r\n", - "Requirement already satisfied: langchain-community in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.3.13)\r\n", - "Requirement already satisfied: docx2txt~=0.8 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (0.8)\r\n", - "Requirement already satisfied: importlib-metadata>=6.0.2 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (8.4.0)\r\n", - "Requirement already satisfied: tenacity<=9.0.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (8.5.0)\r\n", - "Requirement already satisfied: opentelemetry-api<2.0.0,>=1.24.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (1.27.0)\r\n", - "Requirement already satisfied: opentelemetry-sdk<2.0.0,>=1.24.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (1.27.0)\r\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc<2.0.0,>=1.24.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (1.27.0)\r\n", - "Requirement already satisfied: grpcio==1.60.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (1.60.1)\r\n", - "Requirement already satisfied: nest-asyncio in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deepeval) (1.6.0)\r\n", - "Requirement already satisfied: zipp>=0.5 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from importlib-metadata>=6.0.2->deepeval) (3.21.0)\r\n", - "Requirement already satisfied: deprecated>=1.2.6 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-api<2.0.0,>=1.24.0->deepeval) (1.2.15)\r\n", - "Requirement already satisfied: googleapis-common-protos~=1.52 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-exporter-otlp-proto-grpc<2.0.0,>=1.24.0->deepeval) (1.66.0)\r\n", - "Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.27.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-exporter-otlp-proto-grpc<2.0.0,>=1.24.0->deepeval) (1.27.0)\r\n", - "Requirement already satisfied: opentelemetry-proto==1.27.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-exporter-otlp-proto-grpc<2.0.0,>=1.24.0->deepeval) (1.27.0)\r\n", - "Requirement already satisfied: opentelemetry-semantic-conventions==0.48b0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-sdk<2.0.0,>=1.24.0->deepeval) (0.48b0)\r\n", - "Requirement already satisfied: typing-extensions>=3.7.4 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from opentelemetry-sdk<2.0.0,>=1.24.0->deepeval) (4.12.2)\r\n", - "Requirement already satisfied: PyYAML>=5.3 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (6.0.2)\r\n", - "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (2.0.35)\r\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (3.10.10)\r\n", - "Requirement already satisfied: langchain-text-splitters<0.4.0,>=0.3.3 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (0.3.4)\r\n", - "Requirement already satisfied: langsmith<0.3,>=0.1.17 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (0.2.4)\r\n", - "Requirement already satisfied: numpy<2,>=1.22.4 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain->deepeval) (1.26.4)\r\n", - "Requirement already satisfied: jsonpatch<2.0,>=1.33 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain-core->deepeval) (1.33)\r\n", - "Requirement already satisfied: packaging<25,>=23.2 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain-core->deepeval) (24.2)\r\n", - "Requirement already satisfied: annotated-types>=0.4.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pydantic->deepeval) (0.7.0)\r\n", - "Requirement already satisfied: pydantic-core==2.20.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pydantic->deepeval) (2.20.1)\r\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from requests->deepeval) (3.4.0)\r\n", - "Requirement already satisfied: idna<4,>=2.5 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from requests->deepeval) (3.10)\r\n", - "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from requests->deepeval) (2.2.3)\r\n", - "Requirement already satisfied: certifi>=2017.4.17 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from requests->deepeval) (2024.12.14)\r\n", - "Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain-community->deepeval) (0.6.7)\r\n", - "Requirement already satisfied: httpx-sse<0.5.0,>=0.4.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain-community->deepeval) (0.4.0)\r\n", - "Requirement already satisfied: pydantic-settings<3.0.0,>=2.4.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain-community->deepeval) (2.7.0)\r\n", - "Requirement already satisfied: openai<2.0.0,>=1.58.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain_openai->deepeval) (1.58.1)\r\n", - "Requirement already satisfied: tiktoken<1,>=0.7 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langchain_openai->deepeval) (0.7.0)\r\n", - "Requirement already satisfied: iniconfig in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pytest->deepeval) (2.0.0)\r\n", - "Requirement already satisfied: pluggy<2.0,>=0.12 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pytest->deepeval) (1.5.0)\r\n", - "Requirement already satisfied: execnet>=2.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pytest-xdist->deepeval) (2.1.1)\r\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from rich->deepeval) (3.0.0)\r\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from rich->deepeval) (2.18.0)\r\n", - "Requirement already satisfied: click>=8.0.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from typer->deepeval) (8.1.7)\r\n", - "Requirement already satisfied: shellingham>=1.3.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from typer->deepeval) (1.5.4)\r\n", - "Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (2.4.4)\r\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (1.3.2)\r\n", - "Requirement already satisfied: attrs>=17.3.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (24.3.0)\r\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (1.5.0)\r\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (6.1.0)\r\n", - "Requirement already satisfied: yarl<2.0,>=1.12.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (1.18.3)\r\n", - "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community->deepeval) (3.23.2)\r\n", - "Requirement already satisfied: typing-inspect<1,>=0.4.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community->deepeval) (0.9.0)\r\n", - "Requirement already satisfied: wrapt<2,>=1.10 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from deprecated>=1.2.6->opentelemetry-api<2.0.0,>=1.24.0->deepeval) (1.17.0)\r\n", - "Requirement already satisfied: jsonpointer>=1.9 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from jsonpatch<2.0,>=1.33->langchain-core->deepeval) (3.0.0)\r\n", - "Requirement already satisfied: httpx<1,>=0.23.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langsmith<0.3,>=0.1.17->langchain->deepeval) (0.27.0)\r\n", - "Requirement already satisfied: orjson<4.0.0,>=3.9.14 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langsmith<0.3,>=0.1.17->langchain->deepeval) (3.10.12)\r\n", - "Requirement already satisfied: requests-toolbelt<2.0.0,>=1.0.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from langsmith<0.3,>=0.1.17->langchain->deepeval) (1.0.0)\r\n", - "Requirement already satisfied: mdurl~=0.1 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from markdown-it-py>=2.2.0->rich->deepeval) (0.1.2)\r\n", - "Requirement already satisfied: anyio<5,>=3.5.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from openai<2.0.0,>=1.58.1->langchain_openai->deepeval) (4.7.0)\r\n", - "Requirement already satisfied: distro<2,>=1.7.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from openai<2.0.0,>=1.58.1->langchain_openai->deepeval) (1.9.0)\r\n", - "Requirement already satisfied: jiter<1,>=0.4.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from openai<2.0.0,>=1.58.1->langchain_openai->deepeval) (0.5.0)\r\n", - "Requirement already satisfied: sniffio in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from openai<2.0.0,>=1.58.1->langchain_openai->deepeval) (1.3.1)\r\n", - "Requirement already satisfied: python-dotenv>=0.21.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from pydantic-settings<3.0.0,>=2.4.0->langchain-community->deepeval) (1.0.1)\r\n", - "Requirement already satisfied: regex>=2022.1.18 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from tiktoken<1,>=0.7->langchain_openai->deepeval) (2024.11.6)\r\n", - "Requirement already satisfied: httpcore==1.* in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from httpx<1,>=0.23.0->langsmith<0.3,>=0.1.17->langchain->deepeval) (1.0.7)\r\n", - "Requirement already satisfied: h11<0.15,>=0.13 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->langsmith<0.3,>=0.1.17->langchain->deepeval) (0.14.0)\r\n", - "Requirement already satisfied: mypy-extensions>=0.3.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community->deepeval) (1.0.0)\r\n", - "Requirement already satisfied: propcache>=0.2.0 in /Users/vasilije/cognee/.venv/lib/python3.11/site-packages (from yarl<2.0,>=1.12.0->aiohttp<4.0.0,>=3.8.3->langchain->deepeval) (0.2.1)\r\n", - "\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m23.2.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m24.3.1\u001B[0m\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\r\n", - "Collecting ujson\r\n", - " Obtaining dependency information for ujson from https://files.pythonhosted.org/packages/8d/9f/4731ef0671a0653e9f5ba18db7c4596d8ecbf80c7922dd5fe4150f1aea76/ujson-5.10.0-cp311-cp311-macosx_11_0_arm64.whl.metadata\r\n", - " Downloading ujson-5.10.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (9.3 kB)\r\n", - "Downloading ujson-5.10.0-cp311-cp311-macosx_11_0_arm64.whl (51 kB)\r\n", - "\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m51.8/51.8 kB\u001B[0m \u001B[31m1.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\r\n", - "\u001B[?25hInstalling collected packages: ujson\r\n", - "Successfully installed ujson-5.10.0\r\n", - "\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m23.2.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m24.3.1\u001B[0m\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\r\n" - ] - } - ], - "execution_count": 29 + "!pip install \"cognee[deepeval]\"" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "5f36b67668fdb646", "metadata": { "ExecuteTime": { "end_time": "2024-12-24T15:29:11.123483Z", "start_time": "2024-12-24T15:29:11.120888Z" } }, + "outputs": [], + "source": [ + "from evals.eval_on_hotpot import deepeval_answers, answer_qa_instance\n", + "from evals.qa_dataset_utils import load_qa_dataset\n", + "from evals.qa_metrics_utils import get_metrics\n", + "from evals.qa_context_provider_utils import qa_context_providers\n", + "from pathlib import Path\n", + "from tqdm import tqdm\n", + "import statistics\n", + "import random" + ] + }, + { "cell_type": "code", + "execution_count": null, + "id": "de91ee0a", + "metadata": {}, + "outputs": [], "source": [ - "# from evals.eval_on_hotpot import eval_on_hotpotQA\n", - "# from evals.eval_on_hotpot import answer_with_cognee\n", - "# from evals.eval_on_hotpot import answer_without_cognee\n", - "# from evals.eval_on_hotpot import eval_answers\n", - "# from cognee.base_config import get_base_config\n", - "# from pathlib import Path\n", - "# from tqdm import tqdm\n", - "# import wget\n", - "# import json\n", - "# import statistics" - ], - "id": "5f36b67668fdb646", + "num_samples = 10 # With cognee, it takes ~1m10s per sample\n", + "dataset_name_or_filename = \"hotpotqa\"\n", + "dataset = load_qa_dataset(dataset_name_or_filename)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "04bbea26", + "metadata": {}, "outputs": [], - "execution_count": 2 + "source": [ + "context_provider_name = \"cognee\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-24T15:57:30.764970Z", - "start_time": "2024-12-24T15:57:07.861187Z" - } - }, "cell_type": "code", + "execution_count": null, + "id": "1194d32c", + "metadata": {}, + "outputs": [], "source": [ - "# answer_provider = answer_without_cognee # For native LLM answers use answer_without_cognee\n", - "# num_samples = 10 # With cognee, it takes ~1m10s per sample\n", - "# \n", - "# base_config = get_base_config()\n", - "# data_root_dir = base_config.data_root_directory\n", - "# \n", - "# if not Path(data_root_dir).exists():\n", - "# Path(data_root_dir).mkdir()\n", - "# \n", - "# filepath = data_root_dir / Path(\"hotpot_dev_fullwiki_v1.json\")\n", - "# if not filepath.exists():\n", - "# url = 'http://curtis.ml.cmu.edu/datasets/hotpot/hotpot_dev_fullwiki_v1.json'\n", - "# wget.download(url, out=data_root_dir)\n", - "# \n", - "# with open(filepath, \"r\") as file:\n", - "# dataset = json.load(file)\n", - "# instances = dataset if not num_samples else dataset[:num_samples]\n", - "# answers = []\n", - "# for instance in tqdm(instances, desc=\"Getting answers\"):\n", - "# answer = await answer_provider(instance)\n", - "# answers.append(answer)" - ], - "id": "d5af4b516c6621a3", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Getting answers: 100%|██████████| 10/10 [00:13<00:00, 1.31s/it]\n" - ] - } - ], - "execution_count": 9 + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", + "\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", + "\n", + "answers = []\n", + "for instance in tqdm(instances, desc=\"Getting answers\"):\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", + " answers.append(answer)" + ] + }, + { + "cell_type": "markdown", + "id": "7e8e491a", + "metadata": {}, + "source": [ + "#### Define Metrics for Evaluation and Calculate Score\n", + "**Options**: \n", + "- **Correctness**: Is the actual output factually correct based on the expected output?\n", + "- **Comprehensiveness**: How much detail does the answer provide to cover all aspects and details of the question?\n", + "- **Diversity**: How varied and rich is the answer in providing different perspectives and insights on the question?\n", + "- **Empowerment**: How well does the answer help the reader understand and make informed judgements about the topic?\n", + "- **Directness**: How specifically and clearly does the answer address the question?\n", + "- **F1 Score**: the harmonic mean of the precision and recall, using word-level Exact Match\n", + "- **EM Score**: the rate at which the predicted strings exactly match their references, ignoring white spaces and capitalization." + ] + }, + { + "cell_type": "markdown", + "id": "a65c70dd", + "metadata": {}, + "source": [ + "##### Calculate `\"Correctness\"`" + ] }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-24T15:57:30.787382Z", - "start_time": "2024-12-24T15:57:30.785259Z" - } - }, "cell_type": "code", + "execution_count": null, + "id": "ede84200", + "metadata": {}, + "outputs": [], "source": [ - "# from evals.deepeval_metrics import f1_score_metric\n", - "# from evals.deepeval_metrics import em_score_metric" - ], - "id": "2bf69048a272158c", + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "df790d87", + "metadata": {}, "outputs": [], - "execution_count": 10 + "source": [ + "Correctness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Correctness)" + ] + }, + { + "cell_type": "markdown", + "id": "a3dad48f", + "metadata": {}, + "source": [ + "##### Calculating `\"Comprehensiveness\"`" + ] }, { - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-24T15:57:30.828509Z", - "start_time": "2024-12-24T15:57:30.795197Z" - } - }, "cell_type": "code", + "execution_count": null, + "id": "20f98ae2", + "metadata": {}, + "outputs": [], "source": [ - "# f1_metric = f1_score_metric()\n", - "# eval_results = await eval_answers(instances, answers, f1_metric)\n", - "# avg_f1_score = statistics.mean([result.metrics_data[0].score for result in eval_results.test_results])\n", - "# print(\"F1 score: \", avg_f1_score)" - ], - "id": "72ba5f89cccbee6b", - "outputs": [ - { - "data": { - "text/plain": [ - "✨ You're running DeepEval's latest \u001B[38;2;106;0;255mOfficial hotpot F1 score Metric\u001B[0m! \u001B[1;38;2;55;65;81m(\u001B[0m\u001B[38;2;55;65;81musing \u001B[0m\u001B[3;38;2;55;65;81mNone\u001B[0m\u001B[38;2;55;65;81m, \u001B[0m\u001B[38;2;55;65;81mstrict\u001B[0m\u001B[38;2;55;65;81m=\u001B[0m\u001B[3;38;2;55;65;81mFalse\u001B[0m\u001B[38;2;55;65;81m, \u001B[0m\u001B[38;2;55;65;81masync_mode\u001B[0m\u001B[38;2;55;65;81m=\u001B[0m\u001B[3;38;2;55;65;81mTrue\u001B[0m\u001B[1;38;2;55;65;81m)\u001B[0m\u001B[38;2;55;65;81m...\u001B[0m\n" - ], - "text/html": [ - "
✨ You're running DeepEval's latest Official hotpot F1 score Metric! (using None, strict=False, async_mode=True)...\n",
-       "
\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Event loop is already running. Applying nest_asyncio patch to allow async execution...\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Evaluating 10 test case(s) in parallel: |██████████|100% (10/10) [Time Taken: 00:00, 407.84test case/s]" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.0, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: Were Scott Derrickson and Ed Wood of the same nationality?\n", - " - actual output: Scott Derrickson is described as an American filmmaker in the context. Ed Wood is referenced as a cult filmmaker in the American biographical film \"Ed Wood.\" Therefore, both Scott Derrickson and Ed Wood are of the same nationality: American.\n", - " - expected output: yes\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.04255319148936171, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: What government position was held by the woman who portrayed Corliss Archer in the film Kiss and Tell?\n", - " - actual output: The woman who portrayed Corliss Archer in the film \"Kiss and Tell\" was Shirley Temple. After her acting career, she held the position of U.S. Ambassador to Czechoslovakia from 1989 to 1992, and she was also a member of the U.S. delegation to the United Nations from 1969 to 1970.\n", - " - expected output: Chief of Protocol\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.05882352941176471, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: What science fantasy young adult series, told in first person, has a set of companion books narrating the stories of enslaved worlds and alien species?\n", - " - actual output: The book series that fits the description is \"Animorphs\". It is a science fantasy young adult series told in the first person with multiple narrators, and it deals with themes relevant to enslaved worlds and alien species.\n", - " - expected output: Animorphs\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.0, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: Are the Laleli Mosque and Esma Sultan Mansion located in the same neighborhood?\n", - " - actual output: The Laleli Mosque is located in Laleli, Fatih, Istanbul. The Esma Sultan Mansion is located in the Ortaköy neighborhood of Istanbul. Therefore, they are not located in the same neighborhood.\n", - " - expected output: no\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.22222222222222218, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: The director of the romantic comedy \"Big Stone Gap\" is based in what New York city?\n", - " - actual output: The director of the romantic comedy \"Big Stone Gap\" is Adriana Trigiani, and there is no specific New York city mentioned in the provided context.\n", - " - expected output: Greenwich Village, New York City\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.11764705882352941, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: 2014 S/S is the debut album of a South Korean boy group that was formed by who?\n", - " - actual output: The South Korean boy group that debuted with the album \"2014 S/S\" was formed by FNC Entertainment.\n", - " - expected output: YG Entertainment\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.18181818181818182, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: Who was known by his stage name Aladin and helped organizations improve their performance as a consultant?\n", - " - actual output: Eenasul Fateh, known by his stage name Aladin, is a Bangladeshi-British cultural practitioner, magician, live artist, and former international management consultant.\n", - " - expected output: Eenasul Fateh\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.0, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: The arena where the Lewiston Maineiacs played their home games can seat how many people?\n", - " - actual output: The Lewiston Maineiacs played their home games at the Androscoggin Bank Colisée. The capacity of the arena is not directly stated in the context, but it is implied from the information provided.\n", - " - expected output: 3,677 seated\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.12903225806451613, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: Who is older, Annie Morton or Terry Richardson?\n", - " - actual output: Annie Morton was born on October 8, 1970, while Terry Richardson's birthdate is not provided in the context. Therefore, based on the available information, Annie Morton is older than Terry Richardson.\n", - " - expected output: Terry Richardson\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Metrics Summary\n", - "\n", - " - ❌ Official hotpot F1 score (score: 0.0, threshold: 0.5, strict: False, evaluation model: None, reason: None, error: None)\n", - "\n", - "For test case:\n", - "\n", - " - input: Are Local H and For Against both from the United States?\n", - " - actual output: Yes, Local H is from the United States, specifically mentioned as a band from the Chicago suburbs, and For Against is also a band mentioned as being from the United States, although specific details about For Against's origin are not provided in the context.\n", - " - expected output: yes\n", - " - context: None\n", - " - retrieval context: None\n", - "\n", - "======================================================================\n", - "\n", - "Overall Metric Pass Rates\n", - "\n", - "Official hotpot F1 score: 0.00% pass rate\n", - "\n", - "======================================================================\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\n" - ] - }, - { - "data": { - "text/plain": [ - "\u001B[38;2;5;245;141m✓\u001B[0m Tests finished 🎉! Run \u001B[32m'deepeval login'\u001B[0m to save and analyze evaluation results on Confident AI. \n", - "‼️ Friendly reminder 😇: You can also run evaluations with ALL of deepeval's metrics directly on Confident AI \n", - "instead.\n" - ], - "text/html": [ - "
 Tests finished 🎉! Run 'deepeval login' to save and analyze evaluation results on Confident AI. \n",
-       "‼️  Friendly reminder 😇: You can also run evaluations with ALL of deepeval's metrics directly on Confident AI \n",
-       "instead.\n",
-       "
\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "F1 score: 0.0752096441829576\n" - ] - } - ], - "execution_count": 11 + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] }, { - "metadata": { - "ExecuteTime": { - "end_time": "2025-01-05T19:23:30.332977Z", - "start_time": "2025-01-05T19:23:30.331538Z" - } - }, "cell_type": "code", - "source": "", - "id": "783985c35d1126de", + "execution_count": null, + "id": "b35110d3", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "Comprehensiveness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Comprehensiveness)" + ] }, { "cell_type": "markdown", - "id": "288ab570", + "id": "9020eaaa", "metadata": {}, "source": [ - "# Give us a star if you like it!\n", - "https://github.com/topoteretes/cognee" + "##### Calculating `\"Diversity\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f5aa9c70", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fa460a81", + "metadata": {}, + "outputs": [], + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] + }, + { + "cell_type": "markdown", + "id": "636b37f2", + "metadata": {}, + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a685df3", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "44125ae7", + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "id": "5837fa32", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" ] }, { + "cell_type": "code", + "execution_count": null, + "id": "1f6b32b6", "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { "cell_type": "code", + "execution_count": null, + "id": "91c79165", + "metadata": {}, "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "id": "912293c4", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", "execution_count": null, - "source": "", - "id": "d042efe5d38144fa" + "id": "a80d6f2e", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" + ] }, { + "cell_type": "code", + "execution_count": null, + "id": "4e644f1f", "metadata": {}, + "outputs": [], + "source": [ + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { "cell_type": "code", + "execution_count": null, + "id": "12d00f5e", + "metadata": {}, "outputs": [], + "source": [ + "F1_score = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "id": "68680dd7", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dfe28005", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", "execution_count": null, - "source": "", - "id": "9436af97520e0ae" + "id": "01dffe4d", + "metadata": {}, + "outputs": [], + "source": [ + "EM = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(EM)" + ] + }, + { + "cell_type": "markdown", + "id": "288ab570", + "metadata": {}, + "source": [ + "# Give us a star if you like it!\n", + "https://github.com/topoteretes/cognee" + ] } ], "metadata": { "kernelspec": { - "display_name": ".venv", + "display_name": "cognee-c83GrcRT-py3.11", "language": "python", "name": "python3" }, @@ -1473,7 +1250,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.10" } }, "nbformat": 4, diff --git a/notebooks/cognee_hotpot_eval.ipynb b/notebooks/cognee_hotpot_eval.ipynb index 445a13c1..b57ad436 100644 --- a/notebooks/cognee_hotpot_eval.ipynb +++ b/notebooks/cognee_hotpot_eval.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Evaluation on the hotpotQA dataset" + "# Evaluation on the hotpotQA dataset" ] }, { @@ -13,23 +13,30 @@ "metadata": {}, "outputs": [], "source": [ - "from evals.eval_on_hotpot import eval_on_hotpotQA\n", - "from evals.eval_on_hotpot import answer_with_cognee\n", - "from evals.eval_on_hotpot import answer_without_cognee\n", - "from evals.eval_on_hotpot import eval_answers\n", - "from cognee.base_config import get_base_config\n", + "!pip install \"cognee[deepeval]\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from evals.eval_on_hotpot import deepeval_answers, answer_qa_instance\n", + "from evals.qa_dataset_utils import load_qa_dataset\n", + "from evals.qa_metrics_utils import get_metrics\n", + "from evals.qa_context_provider_utils import qa_context_providers\n", "from pathlib import Path\n", "from tqdm import tqdm\n", - "import wget\n", - "import json\n", - "import statistics" + "import statistics\n", + "import random" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Getting the answers for the first num_samples questions of the dataset" + "## Load Dataset" ] }, { @@ -38,27 +45,69 @@ "metadata": {}, "outputs": [], "source": [ - "answer_provider = answer_with_cognee # For native LLM answers use answer_without_cognee\n", "num_samples = 10 # With cognee, it takes ~1m10s per sample\n", + "dataset_name_or_filename = \"hotpotqa\"\n", + "dataset = load_qa_dataset(dataset_name_or_filename)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Define Context Provider\n", + "**Options**: \n", + "- **no_rag**: raw context \n", + "- **cognee**: context with cognee \n", + "- **simple_rag**: context with simple rag \n", + "- **brute_force**: context with brute force triplet search" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Here, \"no_rag\" is used as context provider\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "context_provider_name = \"no_rag\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Generate Answers for QA Instances\n", + "1. **Random Sampling**: Selects a random subset of the dataset if `num_samples` is defined.\n", + "2. **Context Filename**: Defines the file path for storing contexts generated by the context provider.\n", + "3. **Answer Generation**: Iterates over the QA instances using `tqdm` for progress tracking and generates answers using the `answer_qa_instance` function asynchronously." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", "\n", - "base_config = get_base_config()\n", - "data_root_dir = base_config.data_root_directory\n", - "\n", - "if not Path(data_root_dir).exists():\n", - " Path(data_root_dir).mkdir()\n", - "\n", - "filepath = data_root_dir / Path(\"hotpot_dev_fullwiki_v1.json\")\n", - "if not filepath.exists():\n", - " url = \"http://curtis.ml.cmu.edu/datasets/hotpot/hotpot_dev_fullwiki_v1.json\"\n", - " wget.download(url, out=data_root_dir)\n", - "\n", - "with open(filepath, \"r\") as file:\n", - " dataset = json.load(file)\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", "\n", - "instances = dataset if not num_samples else dataset[:num_samples]\n", "answers = []\n", "for instance in tqdm(instances, desc=\"Getting answers\"):\n", - " answer = await answer_provider(instance)\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", " answers.append(answer)" ] }, @@ -66,7 +115,182 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Calculating the official HotpotQA benchmark metrics: F1 score and EM" + "#### Define Metrics for Evaluation and Calculate Score\n", + "**Options**: \n", + "- **Correctness**: Is the actual output factually correct based on the expected output?\n", + "- **Comprehensiveness**: How much detail does the answer provide to cover all aspects and details of the question?\n", + "- **Diversity**: How varied and rich is the answer in providing different perspectives and insights on the question?\n", + "- **Empowerment**: How well does the answer help the reader understand and make informed judgements about the topic?\n", + "- **Directness**: How specifically and clearly does the answer address the question?\n", + "- **F1 Score**: the harmonic mean of the precision and recall, using word-level Exact Match\n", + "- **EM Score**: the rate at which the predicted strings exactly match their references, ignoring white spaces and capitalization." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Correctness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Correctness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Correctness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Comprehensiveness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Comprehensiveness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Comprehensiveness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Diversity\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" ] }, { @@ -75,8 +299,7 @@ "metadata": {}, "outputs": [], "source": [ - "from evals.deepeval_metrics import f1_score_metric\n", - "from evals.deepeval_metrics import em_score_metric" + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " ] }, { @@ -85,12 +308,28 @@ "metadata": {}, "outputs": [], "source": [ - "f1_metric = f1_score_metric()\n", - "eval_results = await eval_answers(instances, answers, f1_metric)\n", - "avg_f1_score = statistics.mean(\n", + "F1_score = statistics.mean(\n", " [result.metrics_data[0].score for result in eval_results.test_results]\n", ")\n", - "print(\"F1 score: \", avg_f1_score)" + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " ] }, { @@ -99,29 +338,81 @@ "metadata": {}, "outputs": [], "source": [ - "em_metric = em_score_metric()\n", - "eval_results = await eval_answers(instances, answers, em_metric)\n", - "avg_em_score = statistics.mean(\n", + "EM = statistics.mean(\n", " [result.metrics_data[0].score for result in eval_results.test_results]\n", ")\n", - "print(\"EM score: \", avg_em_score)" + "print(EM)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### \"cognee\" as context provider\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "context_provider_name = \"cognee\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Generate Answers for QA Instances" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", + "\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", + "\n", + "answers = []\n", + "for instance in tqdm(instances, desc=\"Getting answers\"):\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", + " answers.append(answer)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Define Metrics for Evaluation and Calculate Score" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Calculating a custom metric called Correctness\n", - "##### Correctness is judged by an LLM" + "##### Calculate `\"Correctness\"`" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from evals.deepeval_metrics import correctness_metric" + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " ] }, { @@ -130,29 +421,28 @@ "metadata": {}, "outputs": [], "source": [ - "eval_results = await eval_answers(\n", - " instances, answers, correctness_metric\n", - ") # note that instantiation is not needed for correctness metric as it is already an instance\n", - "avg_correctness_score = statistics.mean(\n", + "Correctness = statistics.mean(\n", " [result.metrics_data[0].score for result in eval_results.test_results]\n", ")\n", - "print(\"Correctness score: \", avg_correctness_score)" + "print(Correctness)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Using a metric from Deepeval" + "##### Calculating `\"Comprehensiveness\"`" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from deepeval.metrics import AnswerRelevancyMetric" + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " ] }, { @@ -161,21 +451,17 @@ "metadata": {}, "outputs": [], "source": [ - "relevancy_metric = AnswerRelevancyMetric()\n", - "eval_results = await eval_answers(\n", - " instances, answers, relevancy_metric\n", - ") # note that instantiation is not needed for correctness metric as it is already an instance\n", - "avg_relevancy_score = statistics.mean(\n", + "Comprehensiveness = statistics.mean(\n", " [result.metrics_data[0].score for result in eval_results.test_results]\n", ")\n", - "print(\"Relevancy score: \", avg_relevancy_score)" + "print(Comprehensiveness)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Answering and eval in one step" + "##### Calculating `\"Diversity\"`" ] }, { @@ -184,12 +470,9 @@ "metadata": {}, "outputs": [], "source": [ - "answer_provider = answer_without_cognee\n", - "f1_metric = f1_score_metric()\n", - "f1_score = await eval_on_hotpotQA(\n", - " answer_provider, num_samples=10, eval_metric=f1_metric\n", - ") # takes ~1m10s per sample\n", - "print(\"F1 score: \", f1_score)" + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " ] }, { @@ -197,17 +480,687 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] }, { "cell_type": "markdown", "metadata": {}, - "source": [] + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "F1_score = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "EM = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(EM)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### \"simple_rag\" as context provider\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "context_provider_name = \"simple_rag\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Generate Answers for QA Instances" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", + "\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", + "\n", + "answers = []\n", + "for instance in tqdm(instances, desc=\"Getting answers\"):\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", + " answers.append(answer)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Define Metrics for Evaluation and Calculate Score" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculate `\"Correctness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Correctness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Correctness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Comprehensiveness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Comprehensiveness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Comprehensiveness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Diversity\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "F1_score = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "EM = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(EM)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### \"brute_force\" as context provider\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "context_provider_name = \"brute_force\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Generate Answers for QA Instances" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", + "\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", + "\n", + "answers = []\n", + "for instance in tqdm(instances, desc=\"Getting answers\"):\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", + " answers.append(answer)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Define Metrics for Evaluation and Calculate Score" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculate `\"Correctness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Correctness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Correctness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Comprehensiveness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Comprehensiveness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Comprehensiveness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Diversity\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "F1_score = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "EM = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(EM)" + ] } ], "metadata": { "kernelspec": { - "display_name": "myenv", + "display_name": "cognee-c83GrcRT-py3.11", "language": "python", "name": "python3" }, @@ -221,7 +1174,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.20" + "version": "3.11.10" } }, "nbformat": 4, diff --git a/notebooks/hr_demo.ipynb b/notebooks/hr_demo.ipynb index c6c3c3ed..63df7777 100644 --- a/notebooks/hr_demo.ipynb +++ b/notebooks/hr_demo.ipynb @@ -618,76 +618,339 @@ "cell_type": "markdown", "id": "e519e30c0423c2a", "metadata": {}, - "source": "## Let's add evals" + "source": [ + "## Let's add evals" + ] }, { "cell_type": "code", - "execution_count": 3, - "id": "b22ae3d868fa5606", - "metadata": { - "ExecuteTime": { - "end_time": "2024-12-19T18:01:11.387716Z", - "start_time": "2024-12-19T18:01:11.278042Z" - } - }, - "outputs": [ - { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'deepeval'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mevals\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01meval_on_hotpot\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m eval_on_hotpotQA\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mevals\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01meval_on_hotpot\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m answer_with_cognee\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mevals\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01meval_on_hotpot\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m answer_without_cognee\n", - "File \u001b[0;32m~/cognee/evals/eval_on_hotpot.py:7\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mstatistics\u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpathlib\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Path\n\u001b[0;32m----> 7\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdeepeval\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmetrics\u001b[39;00m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwget\u001b[39;00m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdeepeval\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdataset\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m EvaluationDataset\n", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'deepeval'" - ] - } - ], + "execution_count": null, + "id": "3845443e", + "metadata": {}, + "outputs": [], "source": [ - "from evals.eval_on_hotpot import eval_on_hotpotQA\n", - "from evals.eval_on_hotpot import answer_with_cognee\n", - "from evals.eval_on_hotpot import answer_without_cognee\n", - "from evals.eval_on_hotpot import eval_answers\n", - "from cognee.base_config import get_base_config\n", + "!pip install \"cognee[deepeval]\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a2c3c70", + "metadata": {}, + "outputs": [], + "source": [ + "from evals.eval_on_hotpot import deepeval_answers, answer_qa_instance\n", + "from evals.qa_dataset_utils import load_qa_dataset\n", + "from evals.qa_metrics_utils import get_metrics\n", + "from evals.qa_context_provider_utils import qa_context_providers\n", "from pathlib import Path\n", "from tqdm import tqdm\n", - "import wget\n", - "import json\n", - "import statistics" + "import statistics\n", + "import random" ] }, { "cell_type": "code", "execution_count": null, - "id": "728355d390e3a01b", + "id": "53a609d8", "metadata": {}, "outputs": [], "source": [ - "answer_provider = answer_with_cognee # For native LLM answers use answer_without_cognee\n", "num_samples = 10 # With cognee, it takes ~1m10s per sample\n", + "dataset_name_or_filename = \"hotpotqa\"\n", + "dataset = load_qa_dataset(dataset_name_or_filename)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7351ab8f", + "metadata": {}, + "outputs": [], + "source": [ + "context_provider_name = \"cognee\"\n", + "context_provider = qa_context_providers[context_provider_name]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9346115b", + "metadata": {}, + "outputs": [], + "source": [ + "random.seed(42)\n", + "instances = dataset if not num_samples else random.sample(dataset, num_samples)\n", "\n", - "base_config = get_base_config()\n", - "data_root_dir = base_config.data_root_directory\n", - "\n", - "if not Path(data_root_dir).exists():\n", - " Path(data_root_dir).mkdir()\n", - "\n", - "filepath = data_root_dir / Path(\"hotpot_dev_fullwiki_v1.json\")\n", - "if not filepath.exists():\n", - " url = \"http://curtis.ml.cmu.edu/datasets/hotpot/hotpot_dev_fullwiki_v1.json\"\n", - " wget.download(url, out=data_root_dir)\n", - "\n", - "with open(filepath, \"r\") as file:\n", - " dataset = json.load(file)\n", + "out_path = \"out\" \n", + "if not Path(out_path).exists():\n", + " Path(out_path).mkdir()\n", + "contexts_filename = out_path / Path(\n", + " f\"contexts_{dataset_name_or_filename.split('.')[0]}_{context_provider_name}.json\"\n", + " )\n", "\n", - "instances = dataset if not num_samples else dataset[:num_samples]\n", "answers = []\n", "for instance in tqdm(instances, desc=\"Getting answers\"):\n", - " answer = answer_provider(instance)\n", + " answer = await answer_qa_instance(instance, context_provider, contexts_filename)\n", " answers.append(answer)" ] }, + { + "cell_type": "markdown", + "id": "1e7d872d", + "metadata": {}, + "source": [ + "#### Define Metrics for Evaluation and Calculate Score\n", + "**Options**: \n", + "- **Correctness**: Is the actual output factually correct based on the expected output?\n", + "- **Comprehensiveness**: How much detail does the answer provide to cover all aspects and details of the question?\n", + "- **Diversity**: How varied and rich is the answer in providing different perspectives and insights on the question?\n", + "- **Empowerment**: How well does the answer help the reader understand and make informed judgements about the topic?\n", + "- **Directness**: How specifically and clearly does the answer address the question?\n", + "- **F1 Score**: the harmonic mean of the precision and recall, using word-level Exact Match\n", + "- **EM Score**: the rate at which the predicted strings exactly match their references, ignoring white spaces and capitalization." + ] + }, + { + "cell_type": "markdown", + "id": "c81e2b46", + "metadata": {}, + "source": [ + "##### Calculate `\"Correctness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ae728344", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Correctness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "764aac6d", + "metadata": {}, + "outputs": [], + "source": [ + "Correctness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Correctness)" + ] + }, + { + "cell_type": "markdown", + "id": "6d3bbdc5", + "metadata": {}, + "source": [ + "##### Calculating `\"Comprehensiveness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9793ef78", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Comprehensiveness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9add448a", + "metadata": {}, + "outputs": [], + "source": [ + "Comprehensiveness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Comprehensiveness)" + ] + }, + { + "cell_type": "markdown", + "id": "bce2fa25", + "metadata": {}, + "source": [ + "##### Calculating `\"Diversity\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f60a179e", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Diversity\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7ccbd0ab", + "metadata": {}, + "outputs": [], + "source": [ + "Diversity = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Diversity)" + ] + }, + { + "cell_type": "markdown", + "id": "191cab63", + "metadata": {}, + "source": [ + "##### Calculating`\"Empowerment\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "66bec0bf", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Empowerment\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1b043a8f", + "metadata": {}, + "outputs": [], + "source": [ + "Empowerment = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Empowerment)" + ] + }, + { + "cell_type": "markdown", + "id": "2cac3be9", + "metadata": {}, + "source": [ + "##### Calculating `\"Directness\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "adaa17c0", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"Directness\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3a8f97c9", + "metadata": {}, + "outputs": [], + "source": [ + "Directness = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(Directness)" + ] + }, + { + "cell_type": "markdown", + "id": "1ad6feb8", + "metadata": {}, + "source": [ + "##### Calculating `\"F1\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bdc48259", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"F1\"]\n", + "eval_metrics = get_metrics(metric_name_list)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c43c17c8", + "metadata": {}, + "outputs": [], + "source": [ + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8bfcc46d", + "metadata": {}, + "outputs": [], + "source": [ + "F1_score = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(F1_score)" + ] + }, + { + "cell_type": "markdown", + "id": "2583f948", + "metadata": {}, + "source": [ + "##### Calculating `\"EM\"`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "90a8f630", + "metadata": {}, + "outputs": [], + "source": [ + "metric_name_list = [\"EM\"]\n", + "eval_metrics = get_metrics(metric_name_list)\n", + "eval_results = await deepeval_answers(instances, answers, eval_metrics[\"deepeval_metrics\"]) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d1b1ea1", + "metadata": {}, + "outputs": [], + "source": [ + "EM = statistics.mean(\n", + " [result.metrics_data[0].score for result in eval_results.test_results]\n", + ")\n", + "print(EM)" + ] + }, { "cell_type": "markdown", "id": "288ab570", @@ -700,7 +963,7 @@ ], "metadata": { "kernelspec": { - "display_name": ".venv", + "display_name": "cognee-c83GrcRT-py3.11", "language": "python", "name": "python3" }, @@ -714,7 +977,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.10" } }, "nbformat": 4, From cdecf5fb8fd71471dc962630b96bb0f26a8389a1 Mon Sep 17 00:00:00 2001 From: hande-k Date: Thu, 23 Jan 2025 11:17:48 +0100 Subject: [PATCH 09/15] add short decsription in md --- notebooks/cognee_hotpot_eval.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notebooks/cognee_hotpot_eval.ipynb b/notebooks/cognee_hotpot_eval.ipynb index b57ad436..23fc3597 100644 --- a/notebooks/cognee_hotpot_eval.ipynb +++ b/notebooks/cognee_hotpot_eval.ipynb @@ -123,7 +123,9 @@ "- **Empowerment**: How well does the answer help the reader understand and make informed judgements about the topic?\n", "- **Directness**: How specifically and clearly does the answer address the question?\n", "- **F1 Score**: the harmonic mean of the precision and recall, using word-level Exact Match\n", - "- **EM Score**: the rate at which the predicted strings exactly match their references, ignoring white spaces and capitalization." + "- **EM Score**: the rate at which the predicted strings exactly match their references, ignoring white spaces and capitalization.\n", + "\n", + "We can also calculate scores based on the same metrics with promptfoo" ] }, { From 52e5b5c6f470485ffbaa43abf221d24c2b431874 Mon Sep 17 00:00:00 2001 From: hande-k Date: Fri, 24 Jan 2025 13:20:38 +0100 Subject: [PATCH 10/15] edit cognee_hotpot_eval.ipynb --- notebooks/cognee_hotpot_eval.ipynb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/notebooks/cognee_hotpot_eval.ipynb b/notebooks/cognee_hotpot_eval.ipynb index 23fc3597..2ec83cc3 100644 --- a/notebooks/cognee_hotpot_eval.ipynb +++ b/notebooks/cognee_hotpot_eval.ipynb @@ -56,8 +56,8 @@ "source": [ "## Define Context Provider\n", "**Options**: \n", - "- **no_rag**: raw context \n", "- **cognee**: context with cognee \n", + "- **no_rag**: raw context \n", "- **simple_rag**: context with simple rag \n", "- **brute_force**: context with brute force triplet search" ] @@ -66,7 +66,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Here, \"no_rag\" is used as context provider\n" + "### Here, \"cognee\" is used as context provider\n" ] }, { @@ -75,7 +75,7 @@ "metadata": {}, "outputs": [], "source": [ - "context_provider_name = \"no_rag\"\n", + "context_provider_name = \"cognee\"\n", "context_provider = qa_context_providers[context_provider_name]" ] }, @@ -282,7 +282,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"F1\"`" + "##### Calculating `\"F1 Score\"`" ] }, { @@ -320,7 +320,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"EM\"`" + "##### Calculating `\"Exact Match (EM) Score\"`" ] }, { @@ -350,7 +350,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### \"cognee\" as context provider\n" + "### \"no_rag\" as context provider" ] }, { @@ -359,7 +359,7 @@ "metadata": {}, "outputs": [], "source": [ - "context_provider_name = \"cognee\"\n", + "context_provider_name = \"no_rag\"\n", "context_provider = qa_context_providers[context_provider_name]" ] }, @@ -553,7 +553,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"F1\"`" + "##### Calculating `\"F1 Score\"`" ] }, { @@ -591,7 +591,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"EM\"`" + "##### Calculating `\"Exact Match (EM) Score\"`" ] }, { @@ -833,7 +833,7 @@ "metadata": {}, "outputs": [], "source": [ - "metric_name_list = [\"F1\"]\n", + "metric_name_list = [\"F1 Score\"]\n", "eval_metrics = get_metrics(metric_name_list)" ] }, @@ -862,7 +862,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"EM\"`" + "##### Calculating `\"Exact Match (EM) Score\"`" ] }, { @@ -1095,7 +1095,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"F1\"`" + "##### Calculating `\"F1 Score\"`" ] }, { @@ -1133,7 +1133,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Calculating `\"EM\"`" + "##### Calculating `\"Exact Match (EM) Score\"`" ] }, { From 05894e7af05d5fc4b38899d922c9a67123c364b2 Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:09:53 +0100 Subject: [PATCH 11/15] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bd5b30e..f3a72882 100644 --- a/README.md +++ b/README.md @@ -220,8 +220,9 @@ Cognee supports a variety of tools and services for different operations: Check out our demo notebook [here](https://github.com/topoteretes/cognee/blob/main/notebooks/cognee_demo.ipynb) -[](https://www.youtube.com/watch?v=BDFt4xVPmro "Learn about cognee: 55") +[](https://www.youtube.com/watch?v=fI4hDzguN5k "Learn about cognee: 55") +https://youtu.be/fI4hDzguN5k ## Get Started From 459e93e8ee4ac24e86d355286547bcb81d988fa4 Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:11:04 +0100 Subject: [PATCH 12/15] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f3a72882..99412e03 100644 --- a/README.md +++ b/README.md @@ -220,9 +220,9 @@ Cognee supports a variety of tools and services for different operations: Check out our demo notebook [here](https://github.com/topoteretes/cognee/blob/main/notebooks/cognee_demo.ipynb) -[](https://www.youtube.com/watch?v=fI4hDzguN5k "Learn about cognee: 55") +[](https://www.youtube.com/watch?v=fI4hDzguN5k "Learn about cognee: 55") + -https://youtu.be/fI4hDzguN5k ## Get Started From a2998b70ddae9b40586ea93c4e7d805e2edf0b0d Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:12:05 +0100 Subject: [PATCH 13/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99412e03..89dbce2c 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ Cognee supports a variety of tools and services for different operations: ## Demo -Check out our demo notebook [here](https://github.com/topoteretes/cognee/blob/main/notebooks/cognee_demo.ipynb) +Check out our demo notebook [here](https://github.com/topoteretes/cognee/blob/main/notebooks/cognee_demo.ipynb) or watch the Youtube video bellow [](https://www.youtube.com/watch?v=fI4hDzguN5k "Learn about cognee: 55") From 0c2c5870dfcab311cab59c0ff1d6cbb4293feae8 Mon Sep 17 00:00:00 2001 From: Boris Date: Sun, 26 Jan 2025 12:52:48 +0100 Subject: [PATCH 14/15] fix: use low_lever server for cognee mcp server (#470) * fix: revert to older mcp version * fix: use low_level server for the mcp * fix: styling errors * fix: mcp cognify arguments * fix: ruff errors --- cognee-mcp/src/__init__.py | 6 +- cognee-mcp/src/client.py | 13 +- cognee-mcp/src/server.py | 120 +++++- cognee-mcp/uv.lock | 93 +++-- .../infrastructure/engine/models/DataPoint.py | 4 - poetry.lock | 356 +++++++++--------- pyproject.toml | 2 +- 7 files changed, 346 insertions(+), 248 deletions(-) mode change 100644 => 100755 cognee-mcp/src/client.py mode change 100644 => 100755 cognee-mcp/src/server.py diff --git a/cognee-mcp/src/__init__.py b/cognee-mcp/src/__init__.py index 3081d5c2..1939efe9 100644 --- a/cognee-mcp/src/__init__.py +++ b/cognee-mcp/src/__init__.py @@ -1,6 +1,8 @@ -from .server import mcp +from .server import main as server_main def main(): """Main entry point for the package.""" - mcp.run(transport="stdio") + import asyncio + + asyncio.run(server_main()) diff --git a/cognee-mcp/src/client.py b/cognee-mcp/src/client.py old mode 100644 new mode 100755 index 202b109f..46218e1a --- a/cognee-mcp/src/client.py +++ b/cognee-mcp/src/client.py @@ -4,8 +4,8 @@ # Create server parameters for stdio connection server_params = StdioServerParameters( - command="mcp", # Executable - args=["run", "src/server.py"], # Optional command line arguments + command="uv", # Executable + args=["--directory", ".", "run", "cognee"], # Optional command line arguments env=None, # Optional environment variables ) @@ -33,10 +33,15 @@ async def run(): async with ClientSession(read, write, timedelta(minutes=3)) as session: await session.initialize() + toolResult = await session.list_tools() + + toolResult = await session.call_tool("prune", arguments={}) + toolResult = await session.call_tool("cognify", arguments={"text": text}) - # toolResult = await session.call_tool("search", arguments={"search_query": "AI"}) - print(f"Cognify result: {toolResult}") + toolResult = await session.call_tool("search", arguments={"search_query": "AI"}) + + print(f"Cognify result: {toolResult.content}") if __name__ == "__main__": diff --git a/cognee-mcp/src/server.py b/cognee-mcp/src/server.py old mode 100644 new mode 100755 index ed603feb..4cc7440f --- a/cognee-mcp/src/server.py +++ b/cognee-mcp/src/server.py @@ -1,16 +1,97 @@ import os import cognee +import logging import importlib.util +from contextlib import redirect_stderr, redirect_stdout # from PIL import Image as PILImage -from mcp.server.fastmcp import FastMCP +import mcp.types as types +from mcp.server import Server, NotificationOptions +from mcp.server.models import InitializationOptions from cognee.api.v1.search import SearchType from cognee.shared.data_models import KnowledgeGraph -mcp = FastMCP("cognee", timeout=120000) +mcp = Server("cognee") + +logger = logging.getLogger(__name__) + + +@mcp.list_tools() +async def list_tools() -> list[types.Tool]: + return [ + types.Tool( + name="cognify", + description="Cognifies text into knowledge graph", + inputSchema={ + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The text to cognify", + }, + "graph_model_file": { + "type": "string", + "description": "The path to the graph model file", + }, + "graph_model_name": { + "type": "string", + "description": "The name of the graph model", + }, + }, + "required": ["text"], + }, + ), + types.Tool( + name="search", + description="Searches for information in knowledge graph", + inputSchema={ + "type": "object", + "properties": { + "search_query": { + "type": "string", + "description": "The query to search for", + }, + }, + "required": ["search_query"], + }, + ), + types.Tool( + name="prune", + description="Prunes knowledge graph", + inputSchema={ + "type": "object", + "properties": {}, + }, + ), + ] + + +@mcp.call_tool() +async def call_tools(name: str, arguments: dict) -> list[types.TextContent]: + try: + with open(os.devnull, "w") as fnull: + with redirect_stdout(fnull), redirect_stderr(fnull): + if name == "cognify": + await cognify( + text=arguments["text"], + graph_model_file=arguments.get("graph_model_file", None), + graph_model_name=arguments.get("graph_model_name", None), + ) + + return [types.TextContent(type="text", text="Ingested")] + elif name == "search": + search_results = await search(arguments["search_query"]) + + return [types.TextContent(type="text", text=search_results)] + elif name == "prune": + await prune() + + return [types.TextContent(type="text", text="Pruned")] + except Exception as e: + logger.error(f"Error calling tool '{name}': {str(e)}") + return [types.TextContent(type="text", text=f"Error calling tool '{name}': {str(e)}")] -@mcp.tool() async def cognify(text: str, graph_model_file: str = None, graph_model_name: str = None) -> str: """Build knowledge graph from the input text""" if graph_model_file and graph_model_name: @@ -25,10 +106,7 @@ async def cognify(text: str, graph_model_file: str = None, graph_model_name: str except Exception as e: raise ValueError(f"Failed to cognify: {str(e)}") - return "Ingested" - -@mcp.tool() async def search(search_query: str) -> str: """Search the knowledge graph""" search_results = await cognee.search(SearchType.INSIGHTS, query_text=search_query) @@ -38,16 +116,36 @@ async def search(search_query: str) -> str: return results -@mcp.tool() async def prune() -> str: """Reset the knowledge graph""" await cognee.prune.prune_data() await cognee.prune.prune_system(metadata=True) - return "Pruned" + +async def main(): + try: + from mcp.server.stdio import stdio_server + + async with stdio_server() as (read_stream, write_stream): + await mcp.run( + read_stream=read_stream, + write_stream=write_stream, + initialization_options=InitializationOptions( + server_name="cognee", + server_version="0.1.0", + capabilities=mcp.get_capabilities( + notification_options=NotificationOptions(), + experimental_capabilities={}, + ), + ), + raise_exceptions=True, + ) + + except Exception as e: + logger.error(f"Server failed to start: {str(e)}", exc_info=True) + raise -# @mcp.tool() # async def visualize() -> Image: # """Visualize the knowledge graph""" # try: @@ -116,4 +214,6 @@ def load_class(model_file, model_name): if __name__ == "__main__": # Initialize and run the server - mcp.run(transport="stdio") + import asyncio + + asyncio.run(main()) diff --git a/cognee-mcp/uv.lock b/cognee-mcp/uv.lock index b79e6695..e467727f 100644 --- a/cognee-mcp/uv.lock +++ b/cognee-mcp/uv.lock @@ -1,7 +1,9 @@ version = 1 requires-python = ">=3.10" resolution-markers = [ - "python_full_version >= '3.12'", + "python_full_version >= '3.13'", + "python_full_version >= '3.12.4' and python_full_version < '3.13'", + "python_full_version >= '3.12' and python_full_version < '3.12.4'", "python_full_version == '3.11.*'", "python_full_version < '3.11'", ] @@ -534,7 +536,7 @@ requires-dist = [ { name = "deepeval", marker = "extra == 'deepeval'", specifier = ">=2.0.1,<3.0.0" }, { name = "dlt", extras = ["sqlalchemy"], specifier = ">=1.4.1,<2.0.0" }, { name = "falkordb", marker = "extra == 'falkordb'", specifier = "==1.0.9" }, - { name = "fastapi", specifier = ">=0.109.2,<0.116.0" }, + { name = "fastapi", specifier = "==0.115.7" }, { name = "fastapi-users", extras = ["sqlalchemy"], specifier = "==14.0.0" }, { name = "filetype", specifier = ">=1.2.0,<2.0.0" }, { name = "graphistry", specifier = ">=0.33.5,<0.34.0" }, @@ -542,6 +544,7 @@ requires-dist = [ { name = "gunicorn", specifier = ">=20.1.0,<21.0.0" }, { name = "httpx", specifier = "==0.27.0" }, { name = "instructor", specifier = "==1.7.2" }, + { name = "jedi", marker = "extra == 'codegraph'", specifier = ">=0.19.2,<0.20.0" }, { name = "jinja2", specifier = ">=3.1.3,<4.0.0" }, { name = "lancedb", specifier = "==0.16.0" }, { name = "langchain-text-splitters", marker = "extra == 'langchain'", specifier = "==0.3.2" }, @@ -558,6 +561,7 @@ requires-dist = [ { name = "numpy", specifier = "==1.26.4" }, { name = "openai", specifier = "==1.59.4" }, { name = "pandas", specifier = "==2.2.3" }, + { name = "parso", marker = "extra == 'codegraph'", specifier = ">=0.8.4,<0.9.0" }, { name = "pgvector", marker = "extra == 'postgres'", specifier = ">=0.3.5,<0.4.0" }, { name = "posthog", marker = "extra == 'posthog'", specifier = ">=3.5.0,<4.0.0" }, { name = "pre-commit", specifier = ">=4.0.1,<5.0.0" }, @@ -863,16 +867,16 @@ wheels = [ [[package]] name = "fastapi" -version = "0.115.6" +version = "0.115.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pydantic" }, { name = "starlette" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/93/72/d83b98cd106541e8f5e5bfab8ef2974ab45a62e8a6c5b5e6940f26d2ed4b/fastapi-0.115.6.tar.gz", hash = "sha256:9ec46f7addc14ea472958a96aae5b5de65f39721a46aaf5705c480d9a8b76654", size = 301336 } +sdist = { url = "https://files.pythonhosted.org/packages/a2/f5/3f921e59f189e513adb9aef826e2841672d50a399fead4e69afdeb808ff4/fastapi-0.115.7.tar.gz", hash = "sha256:0f106da6c01d88a6786b3248fb4d7a940d071f6f488488898ad5d354b25ed015", size = 293177 } wheels = [ - { url = "https://files.pythonhosted.org/packages/52/b3/7e4df40e585df024fac2f80d1a2d579c854ac37109675db2b0cc22c0bb9e/fastapi-0.115.6-py3-none-any.whl", hash = "sha256:e9240b29e36fa8f4bb7290316988e90c381e5092e0cbe84e7818cc3713bcf305", size = 94843 }, + { url = "https://files.pythonhosted.org/packages/e6/7f/bbd4dcf0faf61bc68a01939256e2ed02d681e9334c1a3cef24d5f77aba9f/fastapi-0.115.7-py3-none-any.whl", hash = "sha256:eb6a8c8bf7f26009e8147111ff15b5177a0e19bb4a45bc3486ab14804539d21e", size = 94777 }, ] [[package]] @@ -2339,44 +2343,34 @@ bcrypt = [ [[package]] name = "pyarrow" -version = "19.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7b/01/fe1fd04744c2aa038e5a11c7a4adb3d62bce09798695e54f7274b5977134/pyarrow-19.0.0.tar.gz", hash = "sha256:8d47c691765cf497aaeed4954d226568563f1b3b74ff61139f2d77876717084b", size = 1129096 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1c/02/1ad80ffd3c558916858a49c83b6e494a9d93009bbebc603cf0cb8263bea7/pyarrow-19.0.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:c318eda14f6627966997a7d8c374a87d084a94e4e38e9abbe97395c215830e0c", size = 30686262 }, - { url = "https://files.pythonhosted.org/packages/1b/f0/adab5f142eb8203db8bfbd3a816816e37a85423ae684567e7f3555658315/pyarrow-19.0.0-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:62ef8360ff256e960f57ce0299090fb86423afed5e46f18f1225f960e05aae3d", size = 32100005 }, - { url = "https://files.pythonhosted.org/packages/94/8b/e674083610e5efc48d2f205c568d842cdfdf683d12f9ff0d546e38757722/pyarrow-19.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2795064647add0f16563e57e3d294dbfc067b723f0fd82ecd80af56dad15f503", size = 41144815 }, - { url = "https://files.pythonhosted.org/packages/d5/fb/2726241a792b7f8a58789e5a63d1be9a5a4059206318fd0ff9485a578952/pyarrow-19.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a218670b26fb1bc74796458d97bcab072765f9b524f95b2fccad70158feb8b17", size = 42180380 }, - { url = "https://files.pythonhosted.org/packages/7d/09/7aef12446d8e7002dfc07bb7bc71f594c1d5844ca78b364a49f07efb65b1/pyarrow-19.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:66732e39eaa2247996a6b04c8aa33e3503d351831424cdf8d2e9a0582ac54b34", size = 40515021 }, - { url = "https://files.pythonhosted.org/packages/31/55/f05fc5608cc96060c2b24de505324d641888bd62d4eed2fa1dacd872a1e1/pyarrow-19.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:e675a3ad4732b92d72e4d24009707e923cab76b0d088e5054914f11a797ebe44", size = 42067488 }, - { url = "https://files.pythonhosted.org/packages/f0/01/097653cec7a944c16313cb748a326771133c142034b252076bd84743b98d/pyarrow-19.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:f094742275586cdd6b1a03655ccff3b24b2610c3af76f810356c4c71d24a2a6c", size = 25276726 }, - { url = "https://files.pythonhosted.org/packages/82/42/fba3a35bef5833bf88ed35e6a810dc1781236e1d4f808d2df824a7d21819/pyarrow-19.0.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:8e3a839bf36ec03b4315dc924d36dcde5444a50066f1c10f8290293c0427b46a", size = 30711936 }, - { url = "https://files.pythonhosted.org/packages/88/7a/0da93a3eaaf251a30e32f3221e874263cdcd366c2cd6b7c05293aad91152/pyarrow-19.0.0-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:ce42275097512d9e4e4a39aade58ef2b3798a93aa3026566b7892177c266f735", size = 32133182 }, - { url = "https://files.pythonhosted.org/packages/2f/df/fe43b1c50d3100d0de53f988344118bc20362d0de005f8a407454fa565f8/pyarrow-19.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9348a0137568c45601b031a8d118275069435f151cbb77e6a08a27e8125f59d4", size = 41145489 }, - { url = "https://files.pythonhosted.org/packages/45/bb/6f73b41b342a0342f2516a02db4aa97a4f9569cc35482a5c288090140cd4/pyarrow-19.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a0144a712d990d60f7f42b7a31f0acaccf4c1e43e957f7b1ad58150d6f639c1", size = 42177823 }, - { url = "https://files.pythonhosted.org/packages/23/7b/f038a96f421e453a71bd7a0f78d62b1b2ae9bcac06ed51179ca532e6a0a2/pyarrow-19.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:2a1a109dfda558eb011e5f6385837daffd920d54ca00669f7a11132d0b1e6042", size = 40530609 }, - { url = "https://files.pythonhosted.org/packages/b8/39/a2a6714b471c000e6dd6af4495dce00d7d1332351b8e3170dfb9f91dad1f/pyarrow-19.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:be686bf625aa7b9bada18defb3a3ea3981c1099697239788ff111d87f04cd263", size = 42081534 }, - { url = "https://files.pythonhosted.org/packages/6c/a3/8396fb06ca05d807e89980c177be26617aad15211ece3184e0caa730b8a6/pyarrow-19.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:239ca66d9a05844bdf5af128861af525e14df3c9591bcc05bac25918e650d3a2", size = 25281090 }, - { url = "https://files.pythonhosted.org/packages/bc/2e/152885f5ef421e80dae68b9c133ab261934f93a6d5e16b61d79c0ed597fb/pyarrow-19.0.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:a7bbe7109ab6198688b7079cbad5a8c22de4d47c4880d8e4847520a83b0d1b68", size = 30667964 }, - { url = "https://files.pythonhosted.org/packages/80/c2/08bbee9a8610a47c9a1466845f405baf53a639ddd947c5133d8ba13544b6/pyarrow-19.0.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:4624c89d6f777c580e8732c27bb8e77fd1433b89707f17c04af7635dd9638351", size = 32125039 }, - { url = "https://files.pythonhosted.org/packages/d2/56/06994df823212f5688d3c8bf4294928b12c9be36681872853655724d28c6/pyarrow-19.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2b6d3ce4288793350dc2d08d1e184fd70631ea22a4ff9ea5c4ff182130249d9b", size = 41140729 }, - { url = "https://files.pythonhosted.org/packages/94/65/38ad577c98140a9db71e9e1e594b6adb58a7478a5afec6456a8ca2df7f70/pyarrow-19.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:450a7d27e840e4d9a384b5c77199d489b401529e75a3b7a3799d4cd7957f2f9c", size = 42202267 }, - { url = "https://files.pythonhosted.org/packages/b6/1f/966b722251a7354114ccbb71cf1a83922023e69efd8945ebf628a851ec4c/pyarrow-19.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:a08e2a8a039a3f72afb67a6668180f09fddaa38fe0d21f13212b4aba4b5d2451", size = 40505858 }, - { url = "https://files.pythonhosted.org/packages/3b/5e/6bc81aa7fc9affc7d1c03b912fbcc984ca56c2a18513684da267715dab7b/pyarrow-19.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:f43f5aef2a13d4d56adadae5720d1fed4c1356c993eda8b59dace4b5983843c1", size = 42084973 }, - { url = "https://files.pythonhosted.org/packages/53/c3/2f56da818b6a4758cbd514957c67bd0f078ebffa5390ee2e2bf0f9e8defc/pyarrow-19.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:2f672f5364b2d7829ef7c94be199bb88bf5661dd485e21d2d37de12ccb78a136", size = 25241976 }, - { url = "https://files.pythonhosted.org/packages/f5/b9/ba07ed3dd6b6e4f379b78e9c47c50c8886e07862ab7fa6339ac38622d755/pyarrow-19.0.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:cf3bf0ce511b833f7bc5f5bb3127ba731e97222023a444b7359f3a22e2a3b463", size = 30651291 }, - { url = "https://files.pythonhosted.org/packages/ad/10/0d304243c8277035298a68a70807efb76199c6c929bb3363c92ac9be6a0d/pyarrow-19.0.0-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:4d8b0c0de0a73df1f1bf439af1b60f273d719d70648e898bc077547649bb8352", size = 32100461 }, - { url = "https://files.pythonhosted.org/packages/8a/61/bcfc5182e11831bca3f849945b9b106e09fd10ded773dff466658e972a45/pyarrow-19.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92aff08e23d281c69835e4a47b80569242a504095ef6a6223c1f6bb8883431d", size = 41132491 }, - { url = "https://files.pythonhosted.org/packages/8e/87/2915a29049ec352dc69a967fbcbd76b0180319233de0daf8bd368df37099/pyarrow-19.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3b78eff5968a1889a0f3bc81ca57e1e19b75f664d9c61a42a604bf9d8402aae", size = 42192529 }, - { url = "https://files.pythonhosted.org/packages/48/18/44e5542b2707a8afaf78b5b88c608f261871ae77787eac07b7c679ca6f0f/pyarrow-19.0.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:b34d3bde38eba66190b215bae441646330f8e9da05c29e4b5dd3e41bde701098", size = 40495363 }, - { url = "https://files.pythonhosted.org/packages/ba/d6/5096deb7599bbd20bc2768058fe23bc725b88eb41bee58303293583a2935/pyarrow-19.0.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:5418d4d0fab3a0ed497bad21d17a7973aad336d66ad4932a3f5f7480d4ca0c04", size = 42074075 }, - { url = "https://files.pythonhosted.org/packages/2c/df/e3c839c04c284c9ec3d62b02a8c452b795d9b07b04079ab91ce33484d4c5/pyarrow-19.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:e82c3d5e44e969c217827b780ed8faf7ac4c53f934ae9238872e749fa531f7c9", size = 25239803 }, - { url = "https://files.pythonhosted.org/packages/6a/d3/a6d4088e906c7b5d47792256212606d2ae679046dc750eee0ae167338e5c/pyarrow-19.0.0-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:f208c3b58a6df3b239e0bb130e13bc7487ed14f39a9ff357b6415e3f6339b560", size = 30695401 }, - { url = "https://files.pythonhosted.org/packages/94/25/70040fd0e397dd1b937f459eaeeec942a76027357491dca0ada09d1322af/pyarrow-19.0.0-cp313-cp313t-macosx_12_0_x86_64.whl", hash = "sha256:c751c1c93955b7a84c06794df46f1cec93e18610dcd5ab7d08e89a81df70a849", size = 32104680 }, - { url = "https://files.pythonhosted.org/packages/4e/f9/92783290cc0d80ca16d34b0c126305bfacca4b87dd889c8f16c6ef2a8fd7/pyarrow-19.0.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b903afaa5df66d50fc38672ad095806443b05f202c792694f3a604ead7c6ea6e", size = 41076754 }, - { url = "https://files.pythonhosted.org/packages/05/46/2c9870f50a495c72e2b8982ae29a9b1680707ea936edc0de444cec48f875/pyarrow-19.0.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22a4bc0937856263df8b94f2f2781b33dd7f876f787ed746608e06902d691a5", size = 42163133 }, - { url = "https://files.pythonhosted.org/packages/7b/2f/437922b902549228fb15814e8a26105bff2787ece466a8d886eb6699efad/pyarrow-19.0.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:5e8a28b918e2e878c918f6d89137386c06fe577cd08d73a6be8dafb317dc2d73", size = 40452210 }, - { url = "https://files.pythonhosted.org/packages/36/ef/1d7975053af9d106da973bac142d0d4da71b7550a3576cc3e0b3f444d21a/pyarrow-19.0.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:29cd86c8001a94f768f79440bf83fee23963af5e7bc68ce3a7e5f120e17edf89", size = 42077618 }, +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b3/1b/bc36a07706f630709bfd5a7936d2875e153e3d084a6d95dae583c3ad9de7/pyarrow-15.0.0.tar.gz", hash = "sha256:876858f549d540898f927eba4ef77cd549ad8d24baa3207cf1b72e5788b50e83", size = 1063077 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/33/de/8d8b373d0af779b5866f88ce2ba3774c7c36f712a1d00ed3251263325a2d/pyarrow-15.0.0-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:0a524532fd6dd482edaa563b686d754c70417c2f72742a8c990b322d4c03a15d", size = 27135268 }, + { url = "https://files.pythonhosted.org/packages/af/f0/f2145665535384d7048b60955aff4d90650e342d2131bfc23e27c4c6ea09/pyarrow-15.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:60a6bdb314affa9c2e0d5dddf3d9cbb9ef4a8dddaa68669975287d47ece67642", size = 24191267 }, + { url = "https://files.pythonhosted.org/packages/a9/e4/151ac8f5cb3fc51c80dbc8bc091a35674a896893eca97af3ed42ca47759f/pyarrow-15.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:66958fd1771a4d4b754cd385835e66a3ef6b12611e001d4e5edfcef5f30391e2", size = 36140271 }, + { url = "https://files.pythonhosted.org/packages/e5/d9/46f20f4ec32211534906eca1cc4156587fb06f6bce99fc73561c8e22a4a6/pyarrow-15.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f500956a49aadd907eaa21d4fff75f73954605eaa41f61cb94fb008cf2e00c6", size = 38391410 }, + { url = "https://files.pythonhosted.org/packages/5e/db/2c843e78e4e5f66c2a477a4f41989726e26e307e87d383928904f370aa3e/pyarrow-15.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:6f87d9c4f09e049c2cade559643424da84c43a35068f2a1c4653dc5b1408a929", size = 35634137 }, + { url = "https://files.pythonhosted.org/packages/d4/ca/ef67abb77f9dd51a0d3ff7fcebff58296068a046d7da352b9548070005ed/pyarrow-15.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:85239b9f93278e130d86c0e6bb455dcb66fc3fd891398b9d45ace8799a871a1e", size = 38313696 }, + { url = "https://files.pythonhosted.org/packages/5d/22/8fa2146c63476c14902c0cbeb34c363fb577745ee1d8bf69bd4a3a42e005/pyarrow-15.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:5b8d43e31ca16aa6e12402fcb1e14352d0d809de70edd185c7650fe80e0769e3", size = 24806824 }, + { url = "https://files.pythonhosted.org/packages/d5/fd/e7865a352e416f34057d6d6241c43d28901a67ce7531dca28c22fd4a6f36/pyarrow-15.0.0-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:fa7cd198280dbd0c988df525e50e35b5d16873e2cdae2aaaa6363cdb64e3eec5", size = 27173202 }, + { url = "https://files.pythonhosted.org/packages/de/33/fce52082865c1ad58ee3673f7cfbd19d24651ac2598244f940db29758da6/pyarrow-15.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8780b1a29d3c8b21ba6b191305a2a607de2e30dab399776ff0aa09131e266340", size = 24212865 }, + { url = "https://files.pythonhosted.org/packages/3b/c5/7f6adcf6dbb286e68b61112ab29236e5fb0fa7aaed9b823ab00bceb77f48/pyarrow-15.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe0ec198ccc680f6c92723fadcb97b74f07c45ff3fdec9dd765deb04955ccf19", size = 36138202 }, + { url = "https://files.pythonhosted.org/packages/05/6d/8ab597e64dccb1fcd820e49cb381af7c25b8ea546a282eb30a1462e4acf7/pyarrow-15.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:036a7209c235588c2f07477fe75c07e6caced9b7b61bb897c8d4e52c4b5f9555", size = 38386862 }, + { url = "https://files.pythonhosted.org/packages/96/9e/00a64865d4e8e25f81db8bee45a101e4316ae1a33d4323e621c5681feab9/pyarrow-15.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:2bd8a0e5296797faf9a3294e9fa2dc67aa7f10ae2207920dbebb785c77e9dbe5", size = 35652300 }, + { url = "https://files.pythonhosted.org/packages/85/55/636f006d963ddf77270fd294163e149b0719aaaf794de0d023aee88f6335/pyarrow-15.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:e8ebed6053dbe76883a822d4e8da36860f479d55a762bd9e70d8494aed87113e", size = 38327834 }, + { url = "https://files.pythonhosted.org/packages/db/1d/e8004776a69b5bad62b857367a9a2dff7c61d9606f341e549a174047349b/pyarrow-15.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:17d53a9d1b2b5bd7d5e4cd84d018e2a45bc9baaa68f7e6e3ebed45649900ba99", size = 24794223 }, + { url = "https://files.pythonhosted.org/packages/c0/54/408eec00be5afcc162f44e22c08d7127d7540e3827f5afaae8c8efaa8acb/pyarrow-15.0.0-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:9950a9c9df24090d3d558b43b97753b8f5867fb8e521f29876aa021c52fda351", size = 27085537 }, + { url = "https://files.pythonhosted.org/packages/a9/42/cf26eb201829c2d7656132a18056cb1d2037752cefc658b5ab9225a7de6f/pyarrow-15.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:003d680b5e422d0204e7287bb3fa775b332b3fce2996aa69e9adea23f5c8f970", size = 24181544 }, + { url = "https://files.pythonhosted.org/packages/4e/bd/194d125b3bc539fcf5fdd7c114a67777e0f2f6411dc29523e900f857b421/pyarrow-15.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f75fce89dad10c95f4bf590b765e3ae98bcc5ba9f6ce75adb828a334e26a3d40", size = 36137717 }, + { url = "https://files.pythonhosted.org/packages/2e/92/35ca0cf2ca392172c8a269bd7b62bcc8fbcff32492c5cd9bcbbf1adf0541/pyarrow-15.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca9cb0039923bec49b4fe23803807e4ef39576a2bec59c32b11296464623dc2", size = 38399733 }, + { url = "https://files.pythonhosted.org/packages/fc/30/51adfac2367587073535dbd87da941d1a7f25d4ec2a71817bfe3e83277a5/pyarrow-15.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:9ed5a78ed29d171d0acc26a305a4b7f83c122d54ff5270810ac23c75813585e4", size = 35630638 }, + { url = "https://files.pythonhosted.org/packages/e7/4e/89fb1a40adbd6b09cc36ea295c1811135a9d9c1cd7f3716c36b5f0988777/pyarrow-15.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6eda9e117f0402dfcd3cd6ec9bfee89ac5071c48fc83a84f3075b60efa96747f", size = 38333186 }, + { url = "https://files.pythonhosted.org/packages/1a/f7/f6df7992ef2339bbf31ba349de19af5b8fd75590129c4e8fcb719f24fe5f/pyarrow-15.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:9a3a6180c0e8f2727e6f1b1c87c72d3254cac909e609f35f22532e4115461177", size = 25263792 }, ] [[package]] @@ -3160,27 +3154,28 @@ wheels = [ [[package]] name = "sse-starlette" -version = "2.2.1" +version = "2.1.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, { name = "starlette" }, + { name = "uvicorn" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/71/a4/80d2a11af59fe75b48230846989e93979c892d3a20016b42bb44edb9e398/sse_starlette-2.2.1.tar.gz", hash = "sha256:54470d5f19274aeed6b2d473430b08b4b379ea851d953b11d7f1c4a2c118b419", size = 17376 } +sdist = { url = "https://files.pythonhosted.org/packages/72/fc/56ab9f116b2133521f532fce8d03194cf04dcac25f583cf3d839be4c0496/sse_starlette-2.1.3.tar.gz", hash = "sha256:9cd27eb35319e1414e3d2558ee7414487f9529ce3b3cf9b21434fd110e017169", size = 19678 } wheels = [ - { url = "https://files.pythonhosted.org/packages/d9/e0/5b8bd393f27f4a62461c5cf2479c75a2cc2ffa330976f9f00f5f6e4f50eb/sse_starlette-2.2.1-py3-none-any.whl", hash = "sha256:6410a3d3ba0c89e7675d4c273a301d64649c03a5ef1ca101f10b47f895fd0e99", size = 10120 }, + { url = "https://files.pythonhosted.org/packages/52/aa/36b271bc4fa1d2796311ee7c7283a3a1c348bad426d37293609ca4300eef/sse_starlette-2.1.3-py3-none-any.whl", hash = "sha256:8ec846438b4665b9e8c560fcdea6bc8081a3abf7942faa95e5a744999d219772", size = 9383 }, ] [[package]] name = "starlette" -version = "0.41.3" +version = "0.45.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/1a/4c/9b5764bd22eec91c4039ef4c55334e9187085da2d8a2df7bd570869aae18/starlette-0.41.3.tar.gz", hash = "sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835", size = 2574159 } +sdist = { url = "https://files.pythonhosted.org/packages/ff/fb/2984a686808b89a6781526129a4b51266f678b2d2b97ab2d325e56116df8/starlette-0.45.3.tar.gz", hash = "sha256:2cbcba2a75806f8a41c722141486f37c28e30a0921c5f6fe4346cb0dcee1302f", size = 2574076 } wheels = [ - { url = "https://files.pythonhosted.org/packages/96/00/2b325970b3060c7cecebab6d295afe763365822b1306a12eeab198f74323/starlette-0.41.3-py3-none-any.whl", hash = "sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7", size = 73225 }, + { url = "https://files.pythonhosted.org/packages/d9/61/f2b52e107b1fc8944b33ef56bf6ac4ebbe16d91b94d2b87ce013bf63fb84/starlette-0.45.3-py3-none-any.whl", hash = "sha256:dfb6d332576f136ec740296c7e8bb8c8a7125044e7c6da30744718880cdd059d", size = 71507 }, ] [[package]] diff --git a/cognee/infrastructure/engine/models/DataPoint.py b/cognee/infrastructure/engine/models/DataPoint.py index 8317f940..85697f89 100644 --- a/cognee/infrastructure/engine/models/DataPoint.py +++ b/cognee/infrastructure/engine/models/DataPoint.py @@ -26,10 +26,6 @@ class DataPoint(BaseModel): topological_rank: Optional[int] = 0 _metadata: Optional[MetaData] = {"index_fields": [], "type": "DataPoint"} - # Override the Pydantic configuration - class Config: - underscore_attrs_are_private = True - @classmethod def get_embeddable_data(self, data_point): if ( diff --git a/poetry.lock b/poetry.lock index fa17d3d5..45d3f821 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiofiles" @@ -452,13 +452,13 @@ test = ["distro (>=1.9.0,<1.10.0)", "flake8 (>=6.1,<7.0)", "flake8-pyi (>=24.1.0 [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.8" files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [package.extras] @@ -609,17 +609,17 @@ xyzservices = ">=2021.09.1" [[package]] name = "boto3" -version = "1.36.2" +version = "1.36.6" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.36.2-py3-none-any.whl", hash = "sha256:76cfc9a705be46e8d22607efacc8d688c064f923d785a01c00b28e9a96425d1a"}, - {file = "boto3-1.36.2.tar.gz", hash = "sha256:fde1c29996b77274a60b7bc9f741525afa6267bb1716eb644a764fb7c124a0d2"}, + {file = "boto3-1.36.6-py3-none-any.whl", hash = "sha256:6d473f0f340d02b4e9ad5b8e68786a09728101a8b950231b89ebdaf72b6dca21"}, + {file = "boto3-1.36.6.tar.gz", hash = "sha256:b36feae061dc0793cf311468956a0a9e99215ce38bc99a1a4e55a5b105f16297"}, ] [package.dependencies] -botocore = ">=1.36.2,<1.37.0" +botocore = ">=1.36.6,<1.37.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.11.0,<0.12.0" @@ -628,13 +628,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.36.2" +version = "1.36.6" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.36.2-py3-none-any.whl", hash = "sha256:bc3b7e3b573a48af2bd7116b80fe24f9a335b0b67314dcb2697a327d009abf29"}, - {file = "botocore-1.36.2.tar.gz", hash = "sha256:a1fe6610983f0214b0c7655fe6990b6a731746baf305b182976fc7b568fc3cb0"}, + {file = "botocore-1.36.6-py3-none-any.whl", hash = "sha256:f77bbbb03fb420e260174650fb5c0cc142ec20a96967734eed2b0ef24334ef34"}, + {file = "botocore-1.36.6.tar.gz", hash = "sha256:4864c53d638da191a34daf3ede3ff1371a3719d952cc0c6bd24ce2836a38dd77"}, ] [package.dependencies] @@ -1246,13 +1246,13 @@ optimize = ["orjson"] [[package]] name = "deepeval" -version = "2.1.9" +version = "2.2.6" description = "The Open-Source LLM Evaluation Framework." optional = true -python-versions = "<3.13,>=3.9" +python-versions = "<3.14,>=3.9" files = [ - {file = "deepeval-2.1.9-py3-none-any.whl", hash = "sha256:c225f8ab6ab910de50026dfd46e2ea38541b3697b189831482a6f02162ead536"}, - {file = "deepeval-2.1.9.tar.gz", hash = "sha256:b6c9e90fd0ab639c5b0af5023f2e3fd20ce1906b05d7dc9bfc0bd2f46d0545e0"}, + {file = "deepeval-2.2.6-py3-none-any.whl", hash = "sha256:0148a3fc05bff9aa4a21b7c4bd23c7b610957469fe55440f5826b4b7c38797a3"}, + {file = "deepeval-2.2.6.tar.gz", hash = "sha256:337b5a8a07dc94e5f72c6db0f5670bc77445edb662a019ccec61f438d150c281"}, ] [package.dependencies] @@ -1297,20 +1297,20 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.17" description = "Python @deprecated decorator to deprecate old python classes, functions or methods." optional = true python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.17-py2.py3-none-any.whl", hash = "sha256:69cdc0a751671183f569495e2efb14baee4344b0236342eec29f1fde25d61818"}, + {file = "deprecated-1.2.17.tar.gz", hash = "sha256:0114a10f0bbb750b90b2c2296c90cf7e9eaeb0abb5cf06c80de2c60138de0a82"}, ] [package.dependencies] wrapt = ">=1.10,<2" [package.extras] -dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "jinja2 (>=3.0.3,<3.1.0)", "setuptools", "sphinx (<2)", "tox"] +dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "setuptools", "tox"] [[package]] name = "deprecation" @@ -1581,13 +1581,13 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] name = "executing" -version = "2.1.0" +version = "2.2.0" description = "Get the currently executing AST node of a frame, and other information" optional = true python-versions = ">=3.8" files = [ - {file = "executing-2.1.0-py2.py3-none-any.whl", hash = "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf"}, - {file = "executing-2.1.0.tar.gz", hash = "sha256:8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab"}, + {file = "executing-2.2.0-py2.py3-none-any.whl", hash = "sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa"}, + {file = "executing-2.2.0.tar.gz", hash = "sha256:5d108c028108fe2551d1a7b2e8b713341e2cb4fc0aa7dcf966fa4327a5226755"}, ] [package.extras] @@ -1608,23 +1608,23 @@ redis = ">=5.0.1,<6.0.0" [[package]] name = "fastapi" -version = "0.115.6" +version = "0.115.7" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.6-py3-none-any.whl", hash = "sha256:e9240b29e36fa8f4bb7290316988e90c381e5092e0cbe84e7818cc3713bcf305"}, - {file = "fastapi-0.115.6.tar.gz", hash = "sha256:9ec46f7addc14ea472958a96aae5b5de65f39721a46aaf5705c480d9a8b76654"}, + {file = "fastapi-0.115.7-py3-none-any.whl", hash = "sha256:eb6a8c8bf7f26009e8147111ff15b5177a0e19bb4a45bc3486ab14804539d21e"}, + {file = "fastapi-0.115.7.tar.gz", hash = "sha256:0f106da6c01d88a6786b3248fb4d7a940d071f6f488488898ad5d354b25ed015"}, ] [package.dependencies] pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -starlette = ">=0.40.0,<0.42.0" +starlette = ">=0.40.0,<0.46.0" typing-extensions = ">=4.8.0" [package.extras] -all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] -standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=2.11.2)", "python-multipart (>=0.0.7)", "uvicorn[standard] (>=0.12.0)"] +all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=3.1.5)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] +standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=3.1.5)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] [[package]] name = "fastapi-users" @@ -1683,18 +1683,18 @@ devel = ["colorama", "json-spec", "jsonschema", "pylint", "pytest", "pytest-benc [[package]] name = "filelock" -version = "3.16.1" +version = "3.17.0" description = "A platform independent file lock." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, - {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, + {file = "filelock-3.17.0-py3-none-any.whl", hash = "sha256:533dc2f7ba78dc2f0f531fc6c4940addf7b70a481e269a5a3b93be94ffbe8338"}, + {file = "filelock-3.17.0.tar.gz", hash = "sha256:ee4e77401ef576ebb38cd7f13b9b28893194acc20a8e68e18730ba9c0e54660e"}, ] [package.extras] -docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] typing = ["typing-extensions (>=4.12.2)"] [[package]] @@ -1710,61 +1710,61 @@ files = [ [[package]] name = "fonttools" -version = "4.55.3" +version = "4.55.6" description = "Tools to manipulate font files" optional = false python-versions = ">=3.8" files = [ - {file = "fonttools-4.55.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:1dcc07934a2165ccdc3a5a608db56fb3c24b609658a5b340aee4ecf3ba679dc0"}, - {file = "fonttools-4.55.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f7d66c15ba875432a2d2fb419523f5d3d347f91f48f57b8b08a2dfc3c39b8a3f"}, - {file = "fonttools-4.55.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e4ae3592e62eba83cd2c4ccd9462dcfa603ff78e09110680a5444c6925d841"}, - {file = "fonttools-4.55.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62d65a3022c35e404d19ca14f291c89cc5890032ff04f6c17af0bd1927299674"}, - {file = "fonttools-4.55.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d342e88764fb201286d185093781bf6628bbe380a913c24adf772d901baa8276"}, - {file = "fonttools-4.55.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:dd68c87a2bfe37c5b33bcda0fba39b65a353876d3b9006fde3adae31f97b3ef5"}, - {file = "fonttools-4.55.3-cp310-cp310-win32.whl", hash = "sha256:1bc7ad24ff98846282eef1cbeac05d013c2154f977a79886bb943015d2b1b261"}, - {file = "fonttools-4.55.3-cp310-cp310-win_amd64.whl", hash = "sha256:b54baf65c52952db65df39fcd4820668d0ef4766c0ccdf32879b77f7c804d5c5"}, - {file = "fonttools-4.55.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8c4491699bad88efe95772543cd49870cf756b019ad56294f6498982408ab03e"}, - {file = "fonttools-4.55.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5323a22eabddf4b24f66d26894f1229261021dacd9d29e89f7872dd8c63f0b8b"}, - {file = "fonttools-4.55.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5480673f599ad410695ca2ddef2dfefe9df779a9a5cda89503881e503c9c7d90"}, - {file = "fonttools-4.55.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da9da6d65cd7aa6b0f806556f4985bcbf603bf0c5c590e61b43aa3e5a0f822d0"}, - {file = "fonttools-4.55.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e894b5bd60d9f473bed7a8f506515549cc194de08064d829464088d23097331b"}, - {file = "fonttools-4.55.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:aee3b57643827e237ff6ec6d28d9ff9766bd8b21e08cd13bff479e13d4b14765"}, - {file = "fonttools-4.55.3-cp311-cp311-win32.whl", hash = "sha256:eb6ca911c4c17eb51853143624d8dc87cdcdf12a711fc38bf5bd21521e79715f"}, - {file = "fonttools-4.55.3-cp311-cp311-win_amd64.whl", hash = "sha256:6314bf82c54c53c71805318fcf6786d986461622dd926d92a465199ff54b1b72"}, - {file = "fonttools-4.55.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:f9e736f60f4911061235603a6119e72053073a12c6d7904011df2d8fad2c0e35"}, - {file = "fonttools-4.55.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7a8aa2c5e5b8b3bcb2e4538d929f6589a5c6bdb84fd16e2ed92649fb5454f11c"}, - {file = "fonttools-4.55.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07f8288aacf0a38d174445fc78377a97fb0b83cfe352a90c9d9c1400571963c7"}, - {file = "fonttools-4.55.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8d5e8916c0970fbc0f6f1bece0063363bb5857a7f170121a4493e31c3db3314"}, - {file = "fonttools-4.55.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae3b6600565b2d80b7c05acb8e24d2b26ac407b27a3f2e078229721ba5698427"}, - {file = "fonttools-4.55.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:54153c49913f45065c8d9e6d0c101396725c5621c8aee744719300f79771d75a"}, - {file = "fonttools-4.55.3-cp312-cp312-win32.whl", hash = "sha256:827e95fdbbd3e51f8b459af5ea10ecb4e30af50221ca103bea68218e9615de07"}, - {file = "fonttools-4.55.3-cp312-cp312-win_amd64.whl", hash = "sha256:e6e8766eeeb2de759e862004aa11a9ea3d6f6d5ec710551a88b476192b64fd54"}, - {file = "fonttools-4.55.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a430178ad3e650e695167cb53242dae3477b35c95bef6525b074d87493c4bf29"}, - {file = "fonttools-4.55.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:529cef2ce91dc44f8e407cc567fae6e49a1786f2fefefa73a294704c415322a4"}, - {file = "fonttools-4.55.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e75f12c82127486fac2d8bfbf5bf058202f54bf4f158d367e41647b972342ca"}, - {file = "fonttools-4.55.3-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:859c358ebf41db18fb72342d3080bce67c02b39e86b9fbcf1610cca14984841b"}, - {file = "fonttools-4.55.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:546565028e244a701f73df6d8dd6be489d01617863ec0c6a42fa25bf45d43048"}, - {file = "fonttools-4.55.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:aca318b77f23523309eec4475d1fbbb00a6b133eb766a8bdc401faba91261abe"}, - {file = "fonttools-4.55.3-cp313-cp313-win32.whl", hash = "sha256:8c5ec45428edaa7022f1c949a632a6f298edc7b481312fc7dc258921e9399628"}, - {file = "fonttools-4.55.3-cp313-cp313-win_amd64.whl", hash = "sha256:11e5de1ee0d95af4ae23c1a138b184b7f06e0b6abacabf1d0db41c90b03d834b"}, - {file = "fonttools-4.55.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:caf8230f3e10f8f5d7593eb6d252a37caf58c480b19a17e250a63dad63834cf3"}, - {file = "fonttools-4.55.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b586ab5b15b6097f2fb71cafa3c98edfd0dba1ad8027229e7b1e204a58b0e09d"}, - {file = "fonttools-4.55.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a8c2794ded89399cc2169c4d0bf7941247b8d5932b2659e09834adfbb01589aa"}, - {file = "fonttools-4.55.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf4fe7c124aa3f4e4c1940880156e13f2f4d98170d35c749e6b4f119a872551e"}, - {file = "fonttools-4.55.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:86721fbc389ef5cc1e2f477019e5069e8e4421e8d9576e9c26f840dbb04678de"}, - {file = "fonttools-4.55.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:89bdc5d88bdeec1b15af790810e267e8332d92561dce4f0748c2b95c9bdf3926"}, - {file = "fonttools-4.55.3-cp38-cp38-win32.whl", hash = "sha256:bc5dbb4685e51235ef487e4bd501ddfc49be5aede5e40f4cefcccabc6e60fb4b"}, - {file = "fonttools-4.55.3-cp38-cp38-win_amd64.whl", hash = "sha256:cd70de1a52a8ee2d1877b6293af8a2484ac82514f10b1c67c1c5762d38073e56"}, - {file = "fonttools-4.55.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bdcc9f04b36c6c20978d3f060e5323a43f6222accc4e7fcbef3f428e216d96af"}, - {file = "fonttools-4.55.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c3ca99e0d460eff46e033cd3992a969658c3169ffcd533e0a39c63a38beb6831"}, - {file = "fonttools-4.55.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22f38464daa6cdb7b6aebd14ab06609328fe1e9705bb0fcc7d1e69de7109ee02"}, - {file = "fonttools-4.55.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed63959d00b61959b035c7d47f9313c2c1ece090ff63afea702fe86de00dbed4"}, - {file = "fonttools-4.55.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5e8d657cd7326eeaba27de2740e847c6b39dde2f8d7cd7cc56f6aad404ddf0bd"}, - {file = "fonttools-4.55.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:fb594b5a99943042c702c550d5494bdd7577f6ef19b0bc73877c948a63184a32"}, - {file = "fonttools-4.55.3-cp39-cp39-win32.whl", hash = "sha256:dc5294a3d5c84226e3dbba1b6f61d7ad813a8c0238fceea4e09aa04848c3d851"}, - {file = "fonttools-4.55.3-cp39-cp39-win_amd64.whl", hash = "sha256:aedbeb1db64496d098e6be92b2e63b5fac4e53b1b92032dfc6988e1ea9134a4d"}, - {file = "fonttools-4.55.3-py3-none-any.whl", hash = "sha256:f412604ccbeee81b091b420272841e5ec5ef68967a9790e80bffd0e30b8e2977"}, - {file = "fonttools-4.55.3.tar.gz", hash = "sha256:3983313c2a04d6cc1fe9251f8fc647754cf49a61dac6cb1e7249ae67afaafc45"}, + {file = "fonttools-4.55.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:57d55fc965e5dd20c8a60d880e0f43bafb506be87af0b650bdc42591e41e0d0d"}, + {file = "fonttools-4.55.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:127999618afe3a2490fad54bab0650c5fbeab1f8109bdc0205f6ad34306deb8b"}, + {file = "fonttools-4.55.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3226d40cb92787e09dcc3730f54b3779dfe56bdfea624e263685ba17a6faac4"}, + {file = "fonttools-4.55.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e82772f70b84e17aa36e9f236feb2a4f73cb686ec1e162557a36cf759d1acd58"}, + {file = "fonttools-4.55.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a632f85bd73e002b771bcbcdc512038fa5d2e09bb18c03a22fb8d400ea492ddf"}, + {file = "fonttools-4.55.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:791e0cf862cdd3a252df395f1bb5f65e3a760f1da3c7ce184d0f7998c266614d"}, + {file = "fonttools-4.55.6-cp310-cp310-win32.whl", hash = "sha256:94f7f2c5c5f3a6422e954ecb6d37cc363e27d6f94050a7ed3f79f12157af6bb2"}, + {file = "fonttools-4.55.6-cp310-cp310-win_amd64.whl", hash = "sha256:2d15e02b93a46982a8513a208e8f89148bca8297640527365625be56151687d0"}, + {file = "fonttools-4.55.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0879f99eabbf2171dfadd9c8c75cec2b7b3aa9cd1f3955dd799c69d60a5189ef"}, + {file = "fonttools-4.55.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d77d83ca77a4c3156a2f4cbc7f09f5a8503795da658fa255b987ad433a191266"}, + {file = "fonttools-4.55.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07478132407736ee5e54f9f534e73923ae28e9bb6dba17764a35e3caf7d7fea3"}, + {file = "fonttools-4.55.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e1c06fbc2fd76b9bab03eddfd8aa9fb7c0981d314d780e763c80aa76be1c9982"}, + {file = "fonttools-4.55.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:09ed667c4753e1270994e5398cce8703e6423c41702a55b08f843b2907b1be65"}, + {file = "fonttools-4.55.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0ee6ed68af8d57764d69da099db163aaf37d62ba246cfd42f27590e3e6724b55"}, + {file = "fonttools-4.55.6-cp311-cp311-win32.whl", hash = "sha256:9f99e7876518b2d059a9cc67c506168aebf9c71ac8d81006d75e684222f291d2"}, + {file = "fonttools-4.55.6-cp311-cp311-win_amd64.whl", hash = "sha256:3aa6c684007723895aade9b2fe76d07008c9dc90fd1ef6c310b3ca9c8566729f"}, + {file = "fonttools-4.55.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:51120695ee13001533e50abd40eec32c01b9c6f44c5567db38a7acd3eedcd19d"}, + {file = "fonttools-4.55.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:76ac5a595f86892b49ba86ba2e46185adc76328ce6eff0583b30e5c3ab02a914"}, + {file = "fonttools-4.55.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b7535a5ac386e549e2b00b34c59b53f805e2423000676723b6867df3c10df04"}, + {file = "fonttools-4.55.6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c42009177d3690894288082d5e3dac6bdc9f5d38e25054535e341a19cf5183a4"}, + {file = "fonttools-4.55.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:88f74bc19dbab3dee6a00ca67ca54bb4793e44ff0c4dcf1fa61d68651ae3fa0a"}, + {file = "fonttools-4.55.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:bc6f58976ffc19fe1630119a2736153b66151d023c6f30065f31c9e8baed1303"}, + {file = "fonttools-4.55.6-cp312-cp312-win32.whl", hash = "sha256:4259159715142c10b0f4d121ef14da3fa6eafc719289d9efa4b20c15e57fef82"}, + {file = "fonttools-4.55.6-cp312-cp312-win_amd64.whl", hash = "sha256:d91fce2e9a87cc0db9f8042281b6458f99854df810cfefab2baf6ab2acc0f4b4"}, + {file = "fonttools-4.55.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:9394813cc73fa22c5413ec1c5745c0a16f68dd2b890f7c55eaba5cb40187ed55"}, + {file = "fonttools-4.55.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ac817559a7d245454231374e194b4e457dca6fefa5b52af466ab0516e9a09c6e"}, + {file = "fonttools-4.55.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34405f1314f1e88b1877a9f9e497fe45190e8c4b29a6c7cd85ed7f666a57d702"}, + {file = "fonttools-4.55.6-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af5469bbf555047efd8752d85faeb2a3510916ddc6c50dd6fb168edf1677408f"}, + {file = "fonttools-4.55.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8a8004a19195eb8a8a13de69e26ec9ed60a5bc1fde336d0021b47995b368fac9"}, + {file = "fonttools-4.55.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:73a4aaf672e7b2265c6354a69cbbadf71b7f3133ecb74e98fec4c67c366698a3"}, + {file = "fonttools-4.55.6-cp313-cp313-win32.whl", hash = "sha256:73bdff9c44d36c57ea84766afc20517eda0c9bb1571b4a09876646264bd5ff3b"}, + {file = "fonttools-4.55.6-cp313-cp313-win_amd64.whl", hash = "sha256:132fa22be8a99784de8cb171b30425a581f04a40ec1c05183777fb2b1fe3bac9"}, + {file = "fonttools-4.55.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:8398928acb8a57073606feb9a310682d4a7e2d7536f2c61719261f4c0974504c"}, + {file = "fonttools-4.55.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c2f78ebfdef578d4db7c44bc207ac5f9a5c1f22c9db606460dcc8ad48e183338"}, + {file = "fonttools-4.55.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fb545f3a4ebada908fa717ec732277de18dd10161f03ee3b3144d34477804de"}, + {file = "fonttools-4.55.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1062daa0390b32bfd062ded2b450db9e9cf10e5a9919561c13f535e818b1952b"}, + {file = "fonttools-4.55.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:860ab9ed3f9e088d3bdb77b9074e656635f173b039e77d550b603cba052a0dca"}, + {file = "fonttools-4.55.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:03701e7de70c71eb5965cb200986b0c11dfa3cf8e843e4f517ee30a0f43f0a25"}, + {file = "fonttools-4.55.6-cp38-cp38-win32.whl", hash = "sha256:f66561fbfb75785d06513b8025a50be37bf970c3c413e87581cc6eff10bc78f1"}, + {file = "fonttools-4.55.6-cp38-cp38-win_amd64.whl", hash = "sha256:edf159a8f1e48dc4683a715b36da76dd2f82954b16bfe11a215d58e963d31cfc"}, + {file = "fonttools-4.55.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:61aa1997c520bee4cde14ffabe81efc4708c500c8c81dce37831551627a2be56"}, + {file = "fonttools-4.55.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7954ea66a8d835f279c17d8474597a001ddd65a2c1ca97e223041bfbbe11f65e"}, + {file = "fonttools-4.55.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f4e88f15f5ed4d2e4bdfcc98540bb3987ae25904f9be304be9a604e7a7050a1"}, + {file = "fonttools-4.55.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d419483a6295e83cabddb56f1c7b7bfdc8169de2fcb5c68d622bd11140355f9"}, + {file = "fonttools-4.55.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:acc74884afddc2656bffc50100945ff407574538c152931c402fccddc46f0abc"}, + {file = "fonttools-4.55.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a55489c7e9d5ea69690a2afad06723c3d0c48c6d276a25391ea97cb31a16b37c"}, + {file = "fonttools-4.55.6-cp39-cp39-win32.whl", hash = "sha256:8c9de8d16d02ecc8b65e3f3d2d1e3002be2c4a3f094d580faf76d7f768bd45fe"}, + {file = "fonttools-4.55.6-cp39-cp39-win_amd64.whl", hash = "sha256:471961af7a4b8461fac0c8ee044b4986e6fe3746d4c83a1aacbdd85b4eb53f93"}, + {file = "fonttools-4.55.6-py3-none-any.whl", hash = "sha256:d20ab5a78d0536c26628eaadba661e7ae2427b1e5c748a0a510a44d914e1b155"}, + {file = "fonttools-4.55.6.tar.gz", hash = "sha256:1beb4647a0df5ceaea48015656525eb8081af226fe96554089fd3b274d239ef0"}, ] [package.extras] @@ -2384,13 +2384,13 @@ test = ["eth_utils (>=2.0.0)", "hypothesis (>=3.44.24,<=6.31.6)", "pytest (>=7.0 [[package]] name = "hpack" -version = "4.0.0" -description = "Pure-Python HPACK header compression" +version = "4.1.0" +description = "Pure-Python HPACK header encoding" optional = true -python-versions = ">=3.6.1" +python-versions = ">=3.9" files = [ - {file = "hpack-4.0.0-py3-none-any.whl", hash = "sha256:84a076fad3dc9a9f8063ccb8041ef100867b1878b25ef0ee63847a5d53818a6c"}, - {file = "hpack-4.0.0.tar.gz", hash = "sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095"}, + {file = "hpack-4.1.0-py3-none-any.whl", hash = "sha256:157ac792668d995c657d93111f46b4535ed114f0c9c8d672271bbec7eae1b496"}, + {file = "hpack-4.1.0.tar.gz", hash = "sha256:ec5eca154f7056aa06f196a557655c5b009b382873ac8d1e66e79e87535f1dca"}, ] [[package]] @@ -2531,24 +2531,24 @@ tests = ["freezegun", "pytest", "pytest-cov"] [[package]] name = "hyperframe" -version = "6.0.1" -description = "HTTP/2 framing layer for Python" +version = "6.1.0" +description = "Pure-Python HTTP/2 framing" optional = true -python-versions = ">=3.6.1" +python-versions = ">=3.9" files = [ - {file = "hyperframe-6.0.1-py3-none-any.whl", hash = "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15"}, - {file = "hyperframe-6.0.1.tar.gz", hash = "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"}, + {file = "hyperframe-6.1.0-py3-none-any.whl", hash = "sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5"}, + {file = "hyperframe-6.1.0.tar.gz", hash = "sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08"}, ] [[package]] name = "identify" -version = "2.6.5" +version = "2.6.6" description = "File identification library for Python" optional = false python-versions = ">=3.9" files = [ - {file = "identify-2.6.5-py2.py3-none-any.whl", hash = "sha256:14181a47091eb75b337af4c23078c9d09225cd4c48929f521f3bf16b09d02566"}, - {file = "identify-2.6.5.tar.gz", hash = "sha256:c10b33f250e5bba374fae86fb57f3adcebf1161bce7cdf92031915fd480c13bc"}, + {file = "identify-2.6.6-py2.py3-none-any.whl", hash = "sha256:cbd1810bce79f8b671ecb20f53ee0ae8e86ae84b557de31d89709dc2a48ba881"}, + {file = "identify-2.6.6.tar.gz", hash = "sha256:7bec12768ed44ea4761efb47806f0a41f86e7c0a5fdf5950d4648c90eca7e251"}, ] [package.extras] @@ -3379,18 +3379,18 @@ tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<10" [[package]] name = "langchain-core" -version = "0.3.30" +version = "0.3.31" description = "Building applications with LLMs through composability" optional = true python-versions = "<4.0,>=3.9" files = [ - {file = "langchain_core-0.3.30-py3-none-any.whl", hash = "sha256:0a4c4e02fac5968b67fbb0142c00c2b976c97e45fce62c7ac9eb1636a6926493"}, - {file = "langchain_core-0.3.30.tar.gz", hash = "sha256:0f1281b4416977df43baf366633ad18e96c5dcaaeae6fcb8a799f9889c853243"}, + {file = "langchain_core-0.3.31-py3-none-any.whl", hash = "sha256:882e64ad95887c951dce8e835889e43263b11848c394af3b73e06912624bd743"}, + {file = "langchain_core-0.3.31.tar.gz", hash = "sha256:5ffa56354c07de9efaa4139609659c63e7d9b29da2c825f6bab9392ec98300df"}, ] [package.dependencies] jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.1.125,<0.3" +langsmith = ">=0.1.125,<0.4" packaging = ">=23.2,<25" pydantic = [ {version = ">=2.5.2,<3.0.0", markers = "python_full_version < \"3.12.4\""}, @@ -3402,17 +3402,17 @@ typing-extensions = ">=4.7" [[package]] name = "langchain-openai" -version = "0.3.1" +version = "0.3.2" description = "An integration package connecting OpenAI and LangChain" optional = true python-versions = "<4.0,>=3.9" files = [ - {file = "langchain_openai-0.3.1-py3-none-any.whl", hash = "sha256:5cf2a1e115b12570158d89c22832fa381803c3e1e11d1eb781195c8d9e454bd5"}, - {file = "langchain_openai-0.3.1.tar.gz", hash = "sha256:cce314f1437b2cad73e0ed2b55e74dc399bc1bbc43594c4448912fb51c5e4447"}, + {file = "langchain_openai-0.3.2-py3-none-any.whl", hash = "sha256:8674183805e26d3ae3f78cc44f79fe0b2066f61e2de0e7e18be3b86f0d3b2759"}, + {file = "langchain_openai-0.3.2.tar.gz", hash = "sha256:c2c80ac0208eb7cefdef96f6353b00fa217979ffe83f0a21cc8666001df828c1"}, ] [package.dependencies] -langchain-core = ">=0.3.30,<0.4.0" +langchain-core = ">=0.3.31,<0.4.0" openai = ">=1.58.1,<2.0.0" tiktoken = ">=0.7,<1" @@ -3446,13 +3446,13 @@ six = "*" [[package]] name = "langfuse" -version = "2.57.11" +version = "2.57.12" description = "A client library for accessing langfuse" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "langfuse-2.57.11-py3-none-any.whl", hash = "sha256:c9a074c68de62b7a7b144c02577a1a124df84274f13c80488f077147e93d6e78"}, - {file = "langfuse-2.57.11.tar.gz", hash = "sha256:f1c220decdd9c858fb58916af1775ac999836859553c6ffef33ebf2197030697"}, + {file = "langfuse-2.57.12-py3-none-any.whl", hash = "sha256:11f7b0a002ef08c1de129384c866a389aa7997d6620c5a7282678ea769b93857"}, + {file = "langfuse-2.57.12.tar.gz", hash = "sha256:e74e7c7ef790475d222a9ee6e5163524495a899817db18736df2ab14bc72615f"}, ] [package.dependencies] @@ -3524,13 +3524,13 @@ proxy = ["PyJWT (>=2.8.0,<3.0.0)", "apscheduler (>=3.10.4,<4.0.0)", "backoff", " [[package]] name = "llama-index-core" -version = "0.12.12" +version = "0.12.14" description = "Interface between LLMs and your data" optional = true python-versions = "<4.0,>=3.9" files = [ - {file = "llama_index_core-0.12.12-py3-none-any.whl", hash = "sha256:cea491e87f65e6b775b5aef95720de302b85af1bdc67d779c4b09170a30e5b98"}, - {file = "llama_index_core-0.12.12.tar.gz", hash = "sha256:068b755bbc681731336e822f5977d7608585e8f759c6293ebd812e2659316a37"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [package.dependencies] @@ -3852,13 +3852,13 @@ files = [ [[package]] name = "marshmallow" -version = "3.25.1" +version = "3.26.0" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = true python-versions = ">=3.9" files = [ - {file = "marshmallow-3.25.1-py3-none-any.whl", hash = "sha256:ec5d00d873ce473b7f2ffcb7104286a376c354cab0c2fa12f5573dab03e87210"}, - {file = "marshmallow-3.25.1.tar.gz", hash = "sha256:f4debda3bb11153d81ac34b0d582bf23053055ee11e791b54b4b35493468040a"}, + {file = "marshmallow-3.26.0-py3-none-any.whl", hash = "sha256:1287bca04e6a5f4094822ac153c03da5e214a0a60bcd557b140f3e66991b8ca1"}, + {file = "marshmallow-3.26.0.tar.gz", hash = "sha256:eb36762a1cc76d7abf831e18a3a1b26d3d481bbc74581b8e532a3d3a8115e1cb"}, ] [package.dependencies] @@ -4998,8 +4998,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.22.4", markers = "python_version < \"3.11\""}, - {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, + {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" @@ -5361,13 +5361,13 @@ tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "p [[package]] name = "posthog" -version = "3.8.4" +version = "3.10.0" description = "Integrate PostHog into any python application." optional = true python-versions = "*" files = [ - {file = "posthog-3.8.4-py2.py3-none-any.whl", hash = "sha256:a6f781310fda9c18a36e697400b7f8be8bd46e998f152560273e62b88d1c9f73"}, - {file = "posthog-3.8.4.tar.gz", hash = "sha256:ba8cd14bca58686a199b1ba5655d3bad67c09a3a381062347eb30908282df1da"}, + {file = "posthog-3.10.0-py2.py3-none-any.whl", hash = "sha256:8481949321ba84059bfc8778d358ffec008c64efe834ac7c8eae80243fafa090"}, + {file = "posthog-3.10.0.tar.gz", hash = "sha256:c07113c0558fde279d0462010e4ad87b6a2a76cb970cae0122d5a31d629fc27b"}, ] [package.dependencies] @@ -5381,7 +5381,7 @@ six = ">=1.5" dev = ["black", "flake8", "flake8-print", "isort", "pre-commit"] langchain = ["langchain (>=0.2.0)"] sentry = ["django", "sentry-sdk"] -test = ["anthropic", "coverage", "django", "flake8", "freezegun (==0.3.15)", "langchain-anthropic (>=0.2.0)", "langchain-community (>=0.2.0)", "langchain-openai (>=0.2.0)", "mock (>=2.0.0)", "openai", "pylint", "pytest", "pytest-asyncio", "pytest-timeout"] +test = ["anthropic", "coverage", "django", "flake8", "freezegun (==0.3.15)", "langchain-anthropic (>=0.2.0)", "langchain-community (>=0.2.0)", "langchain-openai (>=0.2.0)", "langgraph", "mock (>=2.0.0)", "openai", "pylint", "pytest", "pytest-asyncio", "pytest-timeout"] [[package]] name = "pre-commit" @@ -5927,8 +5927,8 @@ astroid = ">=3.3.8,<=3.4.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -5942,13 +5942,13 @@ testutils = ["gitpython (>3)"] [[package]] name = "pymdown-extensions" -version = "10.14" +version = "10.14.1" description = "Extension pack for Python Markdown." optional = false python-versions = ">=3.8" files = [ - {file = "pymdown_extensions-10.14-py3-none-any.whl", hash = "sha256:202481f716cc8250e4be8fce997781ebf7917701b59652458ee47f2401f818b5"}, - {file = "pymdown_extensions-10.14.tar.gz", hash = "sha256:741bd7c4ff961ba40b7528d32284c53bc436b8b1645e8e37c3e57770b8700a34"}, + {file = "pymdown_extensions-10.14.1-py3-none-any.whl", hash = "sha256:637951cbfbe9874ba28134fb3ce4b8bcadd6aca89ac4998ec29dcbafd554ae08"}, + {file = "pymdown_extensions-10.14.1.tar.gz", hash = "sha256:b65801996a0cd4f42a3110810c306c45b7313c09b0610a6f773730f2a9e3c96b"}, ] [package.dependencies] @@ -5960,13 +5960,13 @@ extra = ["pygments (>=2.19.1)"] [[package]] name = "pymilvus" -version = "2.5.3" +version = "2.5.4" description = "Python Sdk for Milvus" optional = true python-versions = ">=3.8" files = [ - {file = "pymilvus-2.5.3-py3-none-any.whl", hash = "sha256:64ca63594284586937274800be27a402f3be2d078130bf81d94ab8d7798ac9c8"}, - {file = "pymilvus-2.5.3.tar.gz", hash = "sha256:68bc3797b7a14c494caf116cee888894ffd6eba7b96a3ac841be85d60694cc5d"}, + {file = "pymilvus-2.5.4-py3-none-any.whl", hash = "sha256:3f7ddaeae0c8f63554b8e316b73f265d022e05a457d47c366ce47293434a3aea"}, + {file = "pymilvus-2.5.4.tar.gz", hash = "sha256:611732428ff669d57ded3d1f823bdeb10febf233d0251cce8498b287e5a10ce8"}, ] [package.dependencies] @@ -6481,13 +6481,13 @@ cffi = {version = "*", markers = "implementation_name == \"pypy\""} [[package]] name = "qdrant-client" -version = "1.13.0" +version = "1.13.2" description = "Client library for the Qdrant vector search engine" optional = true python-versions = ">=3.9" files = [ - {file = "qdrant_client-1.13.0-py3-none-any.whl", hash = "sha256:63a063d5232618b609f2c438caf6f3afd3bd110dd80d01be20c596e516efab6b"}, - {file = "qdrant_client-1.13.0.tar.gz", hash = "sha256:9708e3194081619b38194c99e7c369064e3f3f328d8a8ef1d71a87425a5ddf0c"}, + {file = "qdrant_client-1.13.2-py3-none-any.whl", hash = "sha256:db97e759bd3f8d483a383984ba4c2a158eef56f2188d83df7771591d43de2201"}, + {file = "qdrant_client-1.13.2.tar.gz", hash = "sha256:c8cce87ce67b006f49430a050a35c85b78e3b896c0c756dafc13bdeca543ec13"}, ] [package.dependencies] @@ -6626,13 +6626,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==23.2.1)", "requests (>=2.31.0)" [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" description = "JSON Referencing + Python" optional = false python-versions = ">=3.9" files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [package.dependencies] @@ -6969,40 +6969,40 @@ files = [ [[package]] name = "ruff" -version = "0.9.2" +version = "0.9.3" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.9.2-py3-none-linux_armv6l.whl", hash = "sha256:80605a039ba1454d002b32139e4970becf84b5fee3a3c3bf1c2af6f61a784347"}, - {file = "ruff-0.9.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b9aab82bb20afd5f596527045c01e6ae25a718ff1784cb92947bff1f83068b00"}, - {file = "ruff-0.9.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:fbd337bac1cfa96be615f6efcd4bc4d077edbc127ef30e2b8ba2a27e18c054d4"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82b35259b0cbf8daa22a498018e300b9bb0174c2bbb7bcba593935158a78054d"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8b6a9701d1e371bf41dca22015c3f89769da7576884d2add7317ec1ec8cb9c3c"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9cc53e68b3c5ae41e8faf83a3b89f4a5d7b2cb666dff4b366bb86ed2a85b481f"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:8efd9da7a1ee314b910da155ca7e8953094a7c10d0c0a39bfde3fcfd2a015684"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3292c5a22ea9a5f9a185e2d131dc7f98f8534a32fb6d2ee7b9944569239c648d"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a605fdcf6e8b2d39f9436d343d1f0ff70c365a1e681546de0104bef81ce88df"}, - {file = "ruff-0.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c547f7f256aa366834829a08375c297fa63386cbe5f1459efaf174086b564247"}, - {file = "ruff-0.9.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d18bba3d3353ed916e882521bc3e0af403949dbada344c20c16ea78f47af965e"}, - {file = "ruff-0.9.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b338edc4610142355ccf6b87bd356729b62bf1bc152a2fad5b0c7dc04af77bfe"}, - {file = "ruff-0.9.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:492a5e44ad9b22a0ea98cf72e40305cbdaf27fac0d927f8bc9e1df316dcc96eb"}, - {file = "ruff-0.9.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:af1e9e9fe7b1f767264d26b1075ac4ad831c7db976911fa362d09b2d0356426a"}, - {file = "ruff-0.9.2-py3-none-win32.whl", hash = "sha256:71cbe22e178c5da20e1514e1e01029c73dc09288a8028a5d3446e6bba87a5145"}, - {file = "ruff-0.9.2-py3-none-win_amd64.whl", hash = "sha256:c5e1d6abc798419cf46eed03f54f2e0c3adb1ad4b801119dedf23fcaf69b55b5"}, - {file = "ruff-0.9.2-py3-none-win_arm64.whl", hash = "sha256:a1b63fa24149918f8b37cef2ee6fff81f24f0d74b6f0bdc37bc3e1f2143e41c6"}, - {file = "ruff-0.9.2.tar.gz", hash = "sha256:b5eceb334d55fae5f316f783437392642ae18e16dcf4f1858d55d3c2a0f8f5d0"}, + {file = "ruff-0.9.3-py3-none-linux_armv6l.whl", hash = "sha256:7f39b879064c7d9670197d91124a75d118d00b0990586549949aae80cdc16624"}, + {file = "ruff-0.9.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a187171e7c09efa4b4cc30ee5d0d55a8d6c5311b3e1b74ac5cb96cc89bafc43c"}, + {file = "ruff-0.9.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c59ab92f8e92d6725b7ded9d4a31be3ef42688a115c6d3da9457a5bda140e2b4"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dc153c25e715be41bb228bc651c1e9b1a88d5c6e5ed0194fa0dfea02b026439"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:646909a1e25e0dc28fbc529eab8eb7bb583079628e8cbe738192853dbbe43af5"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a5a46e09355695fbdbb30ed9889d6cf1c61b77b700a9fafc21b41f097bfbba4"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c4bb09d2bbb394e3730d0918c00276e79b2de70ec2a5231cd4ebb51a57df9ba1"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:96a87ec31dc1044d8c2da2ebbed1c456d9b561e7d087734336518181b26b3aa5"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9bb7554aca6f842645022fe2d301c264e6925baa708b392867b7a62645304df4"}, + {file = "ruff-0.9.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cabc332b7075a914ecea912cd1f3d4370489c8018f2c945a30bcc934e3bc06a6"}, + {file = "ruff-0.9.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:33866c3cc2a575cbd546f2cd02bdd466fed65118e4365ee538a3deffd6fcb730"}, + {file = "ruff-0.9.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:006e5de2621304c8810bcd2ee101587712fa93b4f955ed0985907a36c427e0c2"}, + {file = "ruff-0.9.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ba6eea4459dbd6b1be4e6bfc766079fb9b8dd2e5a35aff6baee4d9b1514ea519"}, + {file = "ruff-0.9.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:90230a6b8055ad47d3325e9ee8f8a9ae7e273078a66401ac66df68943ced029b"}, + {file = "ruff-0.9.3-py3-none-win32.whl", hash = "sha256:eabe5eb2c19a42f4808c03b82bd313fc84d4e395133fb3fc1b1516170a31213c"}, + {file = "ruff-0.9.3-py3-none-win_amd64.whl", hash = "sha256:040ceb7f20791dfa0e78b4230ee9dce23da3b64dd5848e40e3bf3ab76468dcf4"}, + {file = "ruff-0.9.3-py3-none-win_arm64.whl", hash = "sha256:800d773f6d4d33b0a3c60e2c6ae8f4c202ea2de056365acfa519aa48acf28e0b"}, + {file = "ruff-0.9.3.tar.gz", hash = "sha256:8293f89985a090ebc3ed1064df31f3b4b56320cdfcec8b60d3295bddb955c22a"}, ] [[package]] name = "s3transfer" -version = "0.11.1" +version = "0.11.2" description = "An Amazon S3 Transfer Manager" optional = false python-versions = ">=3.8" files = [ - {file = "s3transfer-0.11.1-py3-none-any.whl", hash = "sha256:8fa0aa48177be1f3425176dfe1ab85dcd3d962df603c3dbfc585e6bf857ef0ff"}, - {file = "s3transfer-0.11.1.tar.gz", hash = "sha256:3f25c900a367c8b7f7d8f9c34edc87e300bde424f779dc9f0a8ae4f9df9264f6"}, + {file = "s3transfer-0.11.2-py3-none-any.whl", hash = "sha256:be6ecb39fadd986ef1701097771f87e4d2f821f27f6071c872143884d2950fbc"}, + {file = "s3transfer-0.11.2.tar.gz", hash = "sha256:3b39185cb72f5acc77db1a58b6e25b977f28d20496b6e58d6813d75f464d632f"}, ] [package.dependencies] @@ -7161,13 +7161,13 @@ test = ["Cython", "array-api-strict (>=2.0,<2.1.1)", "asv", "gmpy2", "hypothesis [[package]] name = "semver" -version = "3.0.2" +version = "3.0.4" description = "Python helper for Semantic Versioning (https://semver.org)" optional = false python-versions = ">=3.7" files = [ - {file = "semver-3.0.2-py3-none-any.whl", hash = "sha256:b1ea4686fe70b981f85359eda33199d60c53964284e0cfb4977d243e37cf4bf4"}, - {file = "semver-3.0.2.tar.gz", hash = "sha256:6253adb39c70f6e51afed2fa7152bcd414c411286088fb4b9effb133885ab4cc"}, + {file = "semver-3.0.4-py3-none-any.whl", hash = "sha256:9c824d87ba7f7ab4a1890799cec8596f15c1241cb473404ea1cb0c55e4b04746"}, + {file = "semver-3.0.4.tar.gz", hash = "sha256:afc7d8c584a5ed0a11033af086e8af226a9c0b206f313e0301f8dd7b6b589602"}, ] [[package]] @@ -7563,20 +7563,20 @@ tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] [[package]] name = "starlette" -version = "0.41.3" +version = "0.45.3" description = "The little ASGI library that shines." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "starlette-0.41.3-py3-none-any.whl", hash = "sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7"}, - {file = "starlette-0.41.3.tar.gz", hash = "sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835"}, + {file = "starlette-0.45.3-py3-none-any.whl", hash = "sha256:dfb6d332576f136ec740296c7e8bb8c8a7125044e7c6da30744718880cdd059d"}, + {file = "starlette-0.45.3.tar.gz", hash = "sha256:2cbcba2a75806f8a41c722141486f37c28e30a0921c5f6fe4346cb0dcee1302f"}, ] [package.dependencies] -anyio = ">=3.4.0,<5" +anyio = ">=3.6.2,<5" [package.extras] -full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"] +full = ["httpx (>=0.27.0,<0.29.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.18)", "pyyaml"] [[package]] name = "tabulate" @@ -8008,13 +8008,13 @@ typing-extensions = ">=3.7.4" [[package]] name = "tzdata" -version = "2024.2" +version = "2025.1" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" files = [ - {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, - {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, + {file = "tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639"}, + {file = "tzdata-2025.1.tar.gz", hash = "sha256:24894909e88cdb28bd1636c6887801df64cb485bd593f2fd83ef29075a81d694"}, ] [[package]] @@ -8106,13 +8106,13 @@ files = [ [[package]] name = "unstructured" -version = "0.16.14" +version = "0.16.15" description = "A library that prepares raw documents for downstream ML tasks." optional = true python-versions = "<3.13,>=3.9.0" files = [ - {file = "unstructured-0.16.14-py3-none-any.whl", hash = "sha256:7b3c2eb21e65d2f61240de7a5241fd7734d97be2c9cfa5f70934e10470318131"}, - {file = "unstructured-0.16.14.tar.gz", hash = "sha256:cec819461090226cd478429c1e0fda19a66ba49ab9ade1ea1fd9ec79c279d7ac"}, + {file = "unstructured-0.16.15-py3-none-any.whl", hash = "sha256:5b0931eb92fb858b983fada18111efdf9c2a0c861ef8e9b58c4e05b1daa50e35"}, + {file = "unstructured-0.16.15.tar.gz", hash = "sha256:18fb850d47b5a2a6ea45b2f7e0eda687f903a2f2e58909b1defd48e2b3126ff4"}, ] [package.dependencies] @@ -8148,19 +8148,19 @@ wrapt = "*" xlrd = {version = "*", optional = true, markers = "extra == \"xlsx\""} [package.extras] -all-docs = ["effdet", "google-cloud-vision", "markdown", "networkx", "onnx", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypandoc", "pypdf", "python-docx (>=1.1.2)", "python-pptx (>=1.0.1)", "unstructured-inference (==0.8.1)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] +all-docs = ["effdet", "google-cloud-vision", "markdown", "networkx", "onnx", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypandoc", "pypdf", "python-docx (>=1.1.2)", "python-pptx (>=1.0.1)", "unstructured-inference (>=0.8.6)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] csv = ["pandas"] doc = ["python-docx (>=1.1.2)"] docx = ["python-docx (>=1.1.2)"] epub = ["pypandoc"] huggingface = ["langdetect", "sacremoses", "sentencepiece", "torch", "transformers"] -image = ["effdet", "google-cloud-vision", "onnx", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypdf", "unstructured-inference (==0.8.1)", "unstructured.pytesseract (>=0.3.12)"] -local-inference = ["effdet", "google-cloud-vision", "markdown", "networkx", "onnx", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypandoc", "pypdf", "python-docx (>=1.1.2)", "python-pptx (>=1.0.1)", "unstructured-inference (==0.8.1)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] +image = ["effdet", "google-cloud-vision", "onnx", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypdf", "unstructured-inference (>=0.8.6)", "unstructured.pytesseract (>=0.3.12)"] +local-inference = ["effdet", "google-cloud-vision", "markdown", "networkx", "onnx", "openpyxl", "pandas", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypandoc", "pypdf", "python-docx (>=1.1.2)", "python-pptx (>=1.0.1)", "unstructured-inference (>=0.8.6)", "unstructured.pytesseract (>=0.3.12)", "xlrd"] md = ["markdown"] odt = ["pypandoc", "python-docx (>=1.1.2)"] org = ["pypandoc"] paddleocr = ["paddlepaddle (==3.0.0b1)", "unstructured.paddleocr (==2.8.1.0)"] -pdf = ["effdet", "google-cloud-vision", "onnx", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypdf", "unstructured-inference (==0.8.1)", "unstructured.pytesseract (>=0.3.12)"] +pdf = ["effdet", "google-cloud-vision", "onnx", "pdf2image", "pdfminer.six", "pi-heif", "pikepdf", "pypdf", "unstructured-inference (>=0.8.6)", "unstructured.pytesseract (>=0.3.12)"] ppt = ["python-pptx (>=1.0.1)"] pptx = ["python-pptx (>=1.0.1)"] rst = ["pypandoc"] @@ -8528,13 +8528,13 @@ test = ["pytest", "pytest-cov"] [[package]] name = "xlsxwriter" -version = "3.2.0" +version = "3.2.1" description = "A Python module for creating Excel XLSX files." optional = true python-versions = ">=3.6" files = [ - {file = "XlsxWriter-3.2.0-py3-none-any.whl", hash = "sha256:ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e"}, - {file = "XlsxWriter-3.2.0.tar.gz", hash = "sha256:9977d0c661a72866a61f9f7a809e25ebbb0fb7036baa3b9fe74afcfca6b3cb8c"}, + {file = "XlsxWriter-3.2.1-py3-none-any.whl", hash = "sha256:7e8f7c60b7a1660ef791d46ab5de78469cb978b991ca841af61f5832d2f9f4fe"}, + {file = "XlsxWriter-3.2.1.tar.gz", hash = "sha256:97618759cb264fb6a93397f660cca156ffa9561743b1823dafb60dc4474e1902"}, ] [[package]] @@ -8815,4 +8815,4 @@ weaviate = ["weaviate-client"] [metadata] lock-version = "2.0" python-versions = ">=3.10.0,<3.13" -content-hash = "9b5d0162e4fdaaded920a2c8b448e07ec794c55914c1d6e18c6ab9b48c42df2d" +content-hash = "1cc352109264d0e3add524cdc15c9b2e6153e1bab20d968b40e42a4d5138967f" diff --git a/pyproject.toml b/pyproject.toml index 731203c9..034b4889 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ python = ">=3.10.0,<3.13" openai = "1.59.4" pydantic = "2.10.5" python-dotenv = "1.0.1" -fastapi = ">=0.109.2,<0.116.0" +fastapi = "0.115.7" uvicorn = "0.34.0" requests = "2.32.3" aiohttp = "3.10.10" From 3e2ac3b3315c3a5cf8523b18cc4d15c325b4a22d Mon Sep 17 00:00:00 2001 From: vasilije Date: Sun, 26 Jan 2025 17:40:15 +0100 Subject: [PATCH 15/15] fix modal --- .github/workflows/clean_stale_pr.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/clean_stale_pr.yaml diff --git a/.github/workflows/clean_stale_pr.yaml b/.github/workflows/clean_stale_pr.yaml new file mode 100644 index 00000000..80cbde66 --- /dev/null +++ b/.github/workflows/clean_stale_pr.yaml @@ -0,0 +1,24 @@ +name: clean | remove stale PRs + +on: + # Run this action periodically (daily at 0:00 UTC in this example). + schedule: + - cron: "0 0 * * *" + # Optionally, also run when pull requests are labeled, unlabeled, synchronized, or reopened + # to update the stale timer as needed. Uncomment if desired. + # pull_request: + # types: [labeled, unlabeled, synchronize, reopened] + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: Mark and Close Stale + uses: actions/stale@v6 + with: + # Number of days of inactivity before the pull request is marked stale + days-before-stale: 60 + # Number of days of inactivity after being marked stale before the pull request is closed + days-before-close: 7 + # Comment to post when marking as stale + stale-pr-message: "This pull request has been automatically marke