From 6a87be463b0dc3b496ee06deb37f7460c3a201d7 Mon Sep 17 00:00:00 2001 From: Wenzhe Xue Date: Thu, 8 Feb 2024 08:06:13 -0800 Subject: [PATCH] ruff fix --- examples/logging/steaming.py | 1 + tests/test_requests.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/logging/steaming.py b/examples/logging/steaming.py index 39ebba4f..8f1f1d10 100644 --- a/examples/logging/steaming.py +++ b/examples/logging/steaming.py @@ -1,6 +1,7 @@ # from openai import OpenAI from log10.load import OpenAI + client = OpenAI() response = client.chat.completions.create( diff --git a/tests/test_requests.py b/tests/test_requests.py index 92054053..9e32202a 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -5,8 +5,8 @@ import pytest import requests_mock -from log10.load import log_sync, log_async, OpenAI, log10_session from log10.llm import LLM, Log10Config +from log10.load import OpenAI, log10_session, log_async, log_sync def test_log_sync_500(): @@ -69,10 +69,8 @@ async def test_log_async_httpx_multiple_calls_with_tags(respx_mock): def better_logging(): uuids = [str(uuid.uuid4()) for _ in range(5)] - with log10_session(tags=uuids) as s: - completion = client.chat.completions.create( - model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Say pong"}] - ) + with log10_session(tags=uuids): + client.chat.completions.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Say pong"}]) loop = asyncio.get_event_loop() await asyncio.gather(*[loop.run_in_executor(None, better_logging) for _ in range(simultaneous_calls)])