Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruff fix test_requests #100

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/logging/steaming.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# from openai import OpenAI
from log10.load import OpenAI


client = OpenAI()

response = client.chat.completions.create(
Expand Down
8 changes: 3 additions & 5 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)])
Loading