refactor: add type hints for user_id and visualization server args
Signed-off-by: HectorSin <kkang15634@ajou.ac.kr>
This commit is contained in:
parent
2c23063da7
commit
f73457ef72
1 changed files with 6 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue