File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 22from .providers .openai .openai_async import AsyncOpenAI
33
44__all__ = ["OpenAI" , "AsyncOpenAI" ]
5+ # TODO: add Azure OpenAI wrapper
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ def __init__(
2828 of the global posthog.
2929 **openai_config: Any additional keyword args to set on openai (e.g. organization="xxx").
3030 """
31- # The standard OpenAI client for synchronous usage
3231 self ._openai_client = openai .OpenAI (** openai_config )
3332 self ._posthog_client = posthog_client
3433
@@ -60,7 +59,7 @@ def create(
6059 ** kwargs : Any ,
6160 ):
6261 """
63- Wraps openai chat completions (sync) and captures a $ai_generation event in PostHog.
62+ Wraps openai chat completions and captures a $ai_generation event in PostHog.
6463
6564 PostHog-specific parameters:
6665 - posthog_distinct_id: Ties the resulting event to a user in PostHog.
@@ -75,7 +74,7 @@ def create(
7574 return process_sync_streaming_response (
7675 response = response ,
7776 ph_client = self ._ph_client ,
78- event_properties = {}, # Will be filled in by the streaming logic
77+ event_properties = {},
7978 distinct_id = distinct_id ,
8079 )
8180
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ def __init__(
2727 posthog_client: If provided, events will be captured via this client instance.
2828 **openai_config: Additional keyword args (e.g. organization="xxx").
2929 """
30- # The async OpenAI client for async usage
3130 self ._openai_client = openai .AsyncOpenAI (** openai_config )
3231 self ._posthog_client = posthog_client
3332
@@ -73,7 +72,7 @@ async def create(
7372 return process_async_streaming_response (
7473 response = response ,
7574 ph_client = self ._ph_client ,
76- event_properties = {}, # The streaming method will define event props
75+ event_properties = {},
7776 distinct_id = distinct_id ,
7877 )
7978
You can’t perform that action at this time.
0 commit comments