fix: Resolve issue with search serialization (#1370)

<!-- .github/pull_request_template.md -->

## Description
Resolve issue with search serialization

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
Igor Ilic 2025-09-11 13:36:09 +02:00 committed by GitHub
commit ff8396fd7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@ from datetime import datetime
from pydantic import Field
from fastapi import Depends, APIRouter
from fastapi.responses import JSONResponse
from fastapi.encoders import jsonable_encoder
from cognee.modules.search.types import SearchType
from cognee.api.DTO import InDTO, OutDTO
@ -136,7 +137,7 @@ def get_search_router() -> APIRouter:
use_combined_context=payload.use_combined_context,
)
return JSONResponse(content=results)
return jsonable_encoder(results)
except PermissionDeniedError:
return []
except Exception as error: