Skip to content

Commit 686da52

Browse files
committed
fix(llma): run ruff
1 parent ecb9737 commit 686da52

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

posthog/test/ai/anthropic/test_anthropic.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,25 @@
2424
# Reusable Mock Helpers
2525
# =======================
2626

27+
2728
class MockContent:
2829
"""Reusable mock content class for Anthropic responses."""
30+
2931
def __init__(self, text="Bar", content_type="text"):
3032
self.type = content_type
3133
self.text = text
3234

3335

3436
class MockUsage:
3537
"""Reusable mock usage class for Anthropic responses."""
36-
def __init__(self, input_tokens=18, output_tokens=1, cache_read_input_tokens=0, cache_creation_input_tokens=0):
38+
39+
def __init__(
40+
self,
41+
input_tokens=18,
42+
output_tokens=1,
43+
cache_read_input_tokens=0,
44+
cache_creation_input_tokens=0,
45+
):
3746
self.input_tokens = input_tokens
3847
self.output_tokens = output_tokens
3948
self.cache_read_input_tokens = cache_read_input_tokens
@@ -42,15 +51,23 @@ def __init__(self, input_tokens=18, output_tokens=1, cache_read_input_tokens=0,
4251

4352
class MockResponse:
4453
"""Reusable mock response class for Anthropic messages."""
45-
def __init__(self, content_text="Bar", model="claude-3-opus-20240229",
46-
input_tokens=18, output_tokens=1, cache_read=0, cache_creation=0):
54+
55+
def __init__(
56+
self,
57+
content_text="Bar",
58+
model="claude-3-opus-20240229",
59+
input_tokens=18,
60+
output_tokens=1,
61+
cache_read=0,
62+
cache_creation=0,
63+
):
4764
self.content = [MockContent(text=content_text)]
4865
self.model = model
4966
self.usage = MockUsage(
5067
input_tokens=input_tokens,
5168
output_tokens=output_tokens,
5269
cache_read_input_tokens=cache_read,
53-
cache_creation_input_tokens=cache_creation
70+
cache_creation_input_tokens=cache_creation,
5471
)
5572

5673

@@ -62,6 +79,7 @@ def create_mock_response(**kwargs):
6279
# Streaming mock helpers
6380
class MockStreamEvent:
6481
"""Reusable mock event class for streaming responses."""
82+
6583
def __init__(self, event_type=None, **kwargs):
6684
self.type = event_type
6785
for key, value in kwargs.items():
@@ -70,6 +88,7 @@ def __init__(self, event_type=None, **kwargs):
7088

7189
class MockContentBlock:
7290
"""Reusable mock content block for streaming."""
91+
7392
def __init__(self, block_type, **kwargs):
7493
self.type = block_type
7594
for key, value in kwargs.items():
@@ -78,6 +97,7 @@ def __init__(self, block_type, **kwargs):
7897

7998
class MockDelta:
8099
"""Reusable mock delta for streaming events."""
100+
81101
def __init__(self, **kwargs):
82102
for key, value in kwargs.items():
83103
setattr(self, key, value)

0 commit comments

Comments
 (0)