Skip to content

Commit 2360d8f

Browse files
committed
fix: formatting
1 parent 270d20c commit 2360d8f

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

posthog/ai/openai/openai_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ async def _capture_streaming_event(
229229
properties=event_properties,
230230
groups=posthog_groups,
231231
)
232-
232+
233233
async def parse(
234234
self,
235235
posthog_distinct_id: Optional[str] = None,

posthog/test/ai/openai/test_openai.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,20 @@ def mock_parsed_response():
145145
type="output_text",
146146
text='{"name": "Science Fair", "date": "Friday", "participants": ["Alice", "Bob"]}',
147147
annotations=[],
148-
parsed={"name": "Science Fair", "date": "Friday", "participants": ["Alice", "Bob"]},
148+
parsed={
149+
"name": "Science Fair",
150+
"date": "Friday",
151+
"participants": ["Alice", "Bob"],
152+
},
149153
)
150154
],
151155
)
152156
],
153-
output_parsed={"name": "Science Fair", "date": "Friday", "participants": ["Alice", "Bob"]},
157+
output_parsed={
158+
"name": "Science Fair",
159+
"date": "Friday",
160+
"participants": ["Alice", "Bob"],
161+
},
154162
parallel_tool_calls=True,
155163
previous_response_id=None,
156164
usage=ResponseUsage(
@@ -723,7 +731,10 @@ def test_responses_parse(mock_client, mock_parsed_response):
723731
"properties": {
724732
"name": {"type": "string"},
725733
"date": {"type": "string"},
726-
"participants": {"type": "array", "items": {"type": "string"}},
734+
"participants": {
735+
"type": "array",
736+
"items": {"type": "string"},
737+
},
727738
},
728739
"required": ["name", "date", "participants"],
729740
},
@@ -752,7 +763,10 @@ def test_responses_parse(mock_client, mock_parsed_response):
752763
},
753764
]
754765
assert props["$ai_output_choices"] == [
755-
{"role": "assistant", "content": '{"name": "Science Fair", "date": "Friday", "participants": ["Alice", "Bob"]}'}
766+
{
767+
"role": "assistant",
768+
"content": '{"name": "Science Fair", "date": "Friday", "participants": ["Alice", "Bob"]}',
769+
}
756770
]
757771
assert props["$ai_input_tokens"] == 15
758772
assert props["$ai_output_tokens"] == 20

0 commit comments

Comments
 (0)