diff --git a/cognee/shared/utils.py b/cognee/shared/utils.py index 7c76cfa59..17501a512 100644 --- a/cognee/shared/utils.py +++ b/cognee/shared/utils.py @@ -8,7 +8,8 @@ import http.server import socketserver from threading import Thread import pathlib -from uuid import uuid4, uuid5, NAMESPACE_OID +from typing import Union +from uuid import uuid4, uuid5, NAMESPACE_OID, UUID from cognee.base_config import get_base_config from cognee.shared.logging_utils import get_logger @@ -78,7 +79,7 @@ def _sanitize_nested_properties(obj, property_names: list[str]): return obj -def send_telemetry(event_name: str, user_id, additional_properties: dict = {}): +def send_telemetry(event_name: str, user_id: Union[str, UUID], additional_properties: dict = {}): if os.getenv("TELEMETRY_DISABLED"): return @@ -138,7 +139,9 @@ def embed_logo(p, layout_scale, logo_alpha, position): def start_visualization_server( - host="0.0.0.0", port=8001, handler_class=http.server.SimpleHTTPRequestHandler + host: str = "0.0.0.0", + port: int = 8001, + handler_class=http.server.SimpleHTTPRequestHandler, ): """ Spin up a simple HTTP server in a background thread to serve files.