From dc37646df3cbe346717ed03da5cdc058358a656f Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:30:12 +0100 Subject: [PATCH 1/4] Update get_cognify_router.py --- cognee/api/v1/cognify/routers/get_cognify_router.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cognee/api/v1/cognify/routers/get_cognify_router.py b/cognee/api/v1/cognify/routers/get_cognify_router.py index 9616fa71c..5e321bf33 100644 --- a/cognee/api/v1/cognify/routers/get_cognify_router.py +++ b/cognee/api/v1/cognify/routers/get_cognify_router.py @@ -6,6 +6,7 @@ from fastapi.responses import JSONResponse from cognee.modules.users.methods import get_authenticated_user from fastapi import Depends + class CognifyPayloadDTO(BaseModel): datasets: List[str] @@ -13,15 +14,15 @@ def get_cognify_router() -> APIRouter: router = APIRouter() @router.post("/", response_model=None) - async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user)): + async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user), graph_model:BaseModel): """ This endpoint is responsible for the cognitive processing of the content.""" from cognee.api.v1.cognify.cognify_v2 import cognify as cognee_cognify try: - await cognee_cognify(payload.datasets, user) + await cognee_cognify(payload.datasets, user, payload.graph_model) except Exception as error: return JSONResponse( status_code=409, content={"error": str(error)} ) - return router \ No newline at end of file + return router From cfad366c5ca9c1961a2b162a0bdec3a3680ef09c Mon Sep 17 00:00:00 2001 From: vasilije Date: Mon, 16 Dec 2024 11:45:33 +0100 Subject: [PATCH 2/4] update --- cognee/api/v1/cognify/routers/get_cognify_router.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cognee/api/v1/cognify/routers/get_cognify_router.py b/cognee/api/v1/cognify/routers/get_cognify_router.py index 5e321bf33..761740bab 100644 --- a/cognee/api/v1/cognify/routers/get_cognify_router.py +++ b/cognee/api/v1/cognify/routers/get_cognify_router.py @@ -9,12 +9,13 @@ from fastapi import Depends class CognifyPayloadDTO(BaseModel): datasets: List[str] + graph_model: BaseModel def get_cognify_router() -> APIRouter: router = APIRouter() @router.post("/", response_model=None) - async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user), graph_model:BaseModel): + async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user), graph_model:BaseModel=None): """ This endpoint is responsible for the cognitive processing of the content.""" from cognee.api.v1.cognify.cognify_v2 import cognify as cognee_cognify try: From 3366bb368036389b4eaca58ed9a2c663b1b6b495 Mon Sep 17 00:00:00 2001 From: vasilije Date: Mon, 16 Dec 2024 21:23:11 +0100 Subject: [PATCH 3/4] Fixes --- cognee/api/v1/cognify/routers/get_cognify_router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cognee/api/v1/cognify/routers/get_cognify_router.py b/cognee/api/v1/cognify/routers/get_cognify_router.py index 761740bab..a56dbd7a5 100644 --- a/cognee/api/v1/cognify/routers/get_cognify_router.py +++ b/cognee/api/v1/cognify/routers/get_cognify_router.py @@ -1,5 +1,5 @@ from fastapi import APIRouter -from typing import List +from typing import List, Optional from pydantic import BaseModel from cognee.modules.users.models import User from fastapi.responses import JSONResponse @@ -9,13 +9,13 @@ from fastapi import Depends class CognifyPayloadDTO(BaseModel): datasets: List[str] - graph_model: BaseModel + graph_model: Optional[BaseModel] = None def get_cognify_router() -> APIRouter: router = APIRouter() @router.post("/", response_model=None) - async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user), graph_model:BaseModel=None): + async def cognify(payload: CognifyPayloadDTO, user: User = Depends(get_authenticated_user)): """ This endpoint is responsible for the cognitive processing of the content.""" from cognee.api.v1.cognify.cognify_v2 import cognify as cognee_cognify try: From 98cc84aa286c767e19cb7fb0bc26ea00d5dd2586 Mon Sep 17 00:00:00 2001 From: vasilije Date: Mon, 16 Dec 2024 21:30:29 +0100 Subject: [PATCH 4/4] Fixes to our demo --- .github/workflows/test_deduplication.yml | 1 + .github/workflows/test_milvus.yml | 1 + .github/workflows/test_neo4j.yml | 1 + .github/workflows/test_pgvector.yml | 1 + .github/workflows/test_python_3_10.yml | 1 + .github/workflows/test_python_3_11.yml | 1 + .github/workflows/test_python_3_9.yml | 1 + .github/workflows/test_qdrant.yml | 1 + .github/workflows/test_weaviate.yml | 1 + 9 files changed, 9 insertions(+) diff --git a/.github/workflows/test_deduplication.yml b/.github/workflows/test_deduplication.yml index 77a7ddbb7..a1aab3252 100644 --- a/.github/workflows/test_deduplication.yml +++ b/.github/workflows/test_deduplication.yml @@ -17,6 +17,7 @@ jobs: run_deduplication_test: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} defaults: run: shell: bash diff --git a/.github/workflows/test_milvus.yml b/.github/workflows/test_milvus.yml index 5cad72378..c4214fddf 100644 --- a/.github/workflows/test_milvus.yml +++ b/.github/workflows/test_milvus.yml @@ -18,6 +18,7 @@ jobs: run_milvus: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} strategy: fail-fast: false defaults: diff --git a/.github/workflows/test_neo4j.yml b/.github/workflows/test_neo4j.yml index 3f3a35e4f..5f955eefc 100644 --- a/.github/workflows/test_neo4j.yml +++ b/.github/workflows/test_neo4j.yml @@ -15,6 +15,7 @@ env: jobs: run_neo4j_integration_test: name: test + if: ${{ github.event.label.name == 'run-checks' }} runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/test_pgvector.yml b/.github/workflows/test_pgvector.yml index a162d2cb4..9f5ffd1da 100644 --- a/.github/workflows/test_pgvector.yml +++ b/.github/workflows/test_pgvector.yml @@ -18,6 +18,7 @@ jobs: run_pgvector_integration_test: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} defaults: run: shell: bash diff --git a/.github/workflows/test_python_3_10.yml b/.github/workflows/test_python_3_10.yml index 39eb4e57a..770d2fd63 100644 --- a/.github/workflows/test_python_3_10.yml +++ b/.github/workflows/test_python_3_10.yml @@ -18,6 +18,7 @@ jobs: run_common: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} strategy: fail-fast: false defaults: diff --git a/.github/workflows/test_python_3_11.yml b/.github/workflows/test_python_3_11.yml index 2dd704eb9..69eb875bd 100644 --- a/.github/workflows/test_python_3_11.yml +++ b/.github/workflows/test_python_3_11.yml @@ -18,6 +18,7 @@ jobs: run_common: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} strategy: fail-fast: false defaults: diff --git a/.github/workflows/test_python_3_9.yml b/.github/workflows/test_python_3_9.yml index 99c2b9a7a..380c894ca 100644 --- a/.github/workflows/test_python_3_9.yml +++ b/.github/workflows/test_python_3_9.yml @@ -18,6 +18,7 @@ jobs: run_common: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} strategy: fail-fast: false defaults: diff --git a/.github/workflows/test_qdrant.yml b/.github/workflows/test_qdrant.yml index f0a2e3d3f..17d9ac628 100644 --- a/.github/workflows/test_qdrant.yml +++ b/.github/workflows/test_qdrant.yml @@ -18,6 +18,7 @@ jobs: run_qdrant_integration_test: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} defaults: run: diff --git a/.github/workflows/test_weaviate.yml b/.github/workflows/test_weaviate.yml index b8eb72383..9a3651dda 100644 --- a/.github/workflows/test_weaviate.yml +++ b/.github/workflows/test_weaviate.yml @@ -18,6 +18,7 @@ jobs: run_weaviate_integration_test: name: test runs-on: ubuntu-latest + if: ${{ github.event.label.name == 'run-checks' }} defaults: run: