diff --git a/log10/_httpx_utils.py b/log10/_httpx_utils.py index 8ef69e11..54efd286 100644 --- a/log10/_httpx_utils.py +++ b/log10/_httpx_utils.py @@ -9,7 +9,7 @@ from httpx import Request, Response from log10.llm import Log10Config -from log10.load import get_log10_session_tags, sessionID +from log10.load import get_log10_session_tags, session_id_var logger: logging.Logger = logging.getLogger("LOG10") @@ -139,7 +139,7 @@ async def log_request(request: Request): "orig_module": orig_module, "orig_qualname": orig_qualname, "request": request.content.decode("utf-8"), - "session_id": sessionID, + "session_id": session_id_var.get(), } if get_log10_session_tags(): log_row["tags"] = get_log10_session_tags() @@ -230,7 +230,7 @@ async def aiter_bytes(self, *args, **kwargs): "stacktrace": json.dumps(stacktrace), "kind": "chat", "request": self.request.content.decode("utf-8"), - "session_id": sessionID, + "session_id": session_id_var.get(), } if get_log10_session_tags(): log_row["tags"] = get_log10_session_tags() @@ -272,7 +272,7 @@ async def handle_async_request(self, request: httpx.Request) -> httpx.Response: "stacktrace": json.dumps(stacktrace), "kind": "chat", "request": request.content.decode("utf-8"), - "session_id": sessionID, + "session_id": session_id_var.get(), } if get_log10_session_tags(): log_row["tags"] = get_log10_session_tags()