diff --git a/log10/load.py b/log10/load.py index 1eddf994..2cd3c339 100644 --- a/log10/load.py +++ b/log10/load.py @@ -153,7 +153,7 @@ def last_completion_url(self): if last_completion_response_var.get() is None: return None response = last_completion_response_var.get() - return url + "/app/" + response["organizationSlug"] + "/completions/" + response["completionID"] + return f'{url}/app/{response["organizationSlug"]}/completions/{response["completionID"]}' @contextmanager @@ -196,8 +196,6 @@ async def log_async(completion_url, log_row): res = post_request(_url, log_row) except Exception as e: logging.warn(f"LOG10: failed to log: {e}. Skipping") - # Print the exception tracompletion_urlceback - traceback.print_tb(e.__traceback__) return None elif target_service == "bigquery": @@ -206,8 +204,6 @@ async def log_async(completion_url, log_row): except Exception as e: logging.warn(f"LOG10: failed to log: {e}. Skipping") - # Print the exception traceback - traceback.print_tb(e.__traceback__) return None return completionID diff --git a/tests/test_context_managers.py b/tests/test_context_managers.py index f7ad3d2e..345371e7 100644 --- a/tests/test_context_managers.py +++ b/tests/test_context_managers.py @@ -1,7 +1,7 @@ import asyncio import contextvars import uuid - +import pytest session_id_var = contextvars.ContextVar("session_id", default=str(uuid.uuid4())) @@ -52,7 +52,7 @@ def test_nested_contexts(): assert simulated_llm_call() == before_outer_session - +@pytest.mark.asyncio async def test_nested_async_contexts(): print("") before_outer_session = await simulated_llm_acall() @@ -74,6 +74,7 @@ async def test_nested_async_contexts(): # Test overlapping async context managers +@pytest.mark.asyncio async def test_overlapping_async_contexts(): # Run two async context managers in parallel # The second one should not overwrite the session ID of the first one