@@ -135,7 +135,7 @@ def __init__(self, ld_client: LDClient, version_key: str, config_key: str, conte
135135 self .config_key = config_key
136136 self .context = context
137137
138- def get_track_data (self ):
138+ def __get_track_data (self ):
139139 """
140140 Get tracking data for events.
141141
@@ -152,7 +152,7 @@ def track_duration(self, duration: int) -> None:
152152
153153 :param duration: Duration in milliseconds.
154154 """
155- self .ld_client .track ('$ld:ai:duration:total' , self .context , self .get_track_data (), duration )
155+ self .ld_client .track ('$ld:ai:duration:total' , self .context , self .__get_track_data (), duration )
156156
157157 def track_duration_of (self , func ):
158158 """
@@ -175,15 +175,15 @@ def track_feedback(self, feedback: Dict[str, FeedbackKind]) -> None:
175175 :param feedback: Dictionary containing feedback kind.
176176 """
177177 if feedback ['kind' ] == FeedbackKind .Positive :
178- self .ld_client .track ('$ld:ai:feedback:user:positive' , self .context , self .get_track_data (), 1 )
178+ self .ld_client .track ('$ld:ai:feedback:user:positive' , self .context , self .__get_track_data (), 1 )
179179 elif feedback ['kind' ] == FeedbackKind .Negative :
180- self .ld_client .track ('$ld:ai:feedback:user:negative' , self .context , self .get_track_data (), 1 )
180+ self .ld_client .track ('$ld:ai:feedback:user:negative' , self .context , self .__get_track_data (), 1 )
181181
182182 def track_success (self ) -> None :
183183 """
184184 Track a successful AI generation.
185185 """
186- self .ld_client .track ('$ld:ai:generation' , self .context , self .get_track_data (), 1 )
186+ self .ld_client .track ('$ld:ai:generation' , self .context , self .__get_track_data (), 1 )
187187
188188 def track_openai (self , func ):
189189 """
@@ -224,8 +224,8 @@ def track_tokens(self, tokens: Union[TokenUsage, BedrockTokenUsage]) -> None:
224224 """
225225 token_metrics = tokens .to_metrics ()
226226 if token_metrics .total > 0 :
227- self .ld_client .track ('$ld:ai:tokens:total' , self .context , self .get_track_data (), token_metrics .total )
227+ self .ld_client .track ('$ld:ai:tokens:total' , self .context , self .__get_track_data (), token_metrics .total )
228228 if token_metrics .input > 0 :
229- self .ld_client .track ('$ld:ai:tokens:input' , self .context , self .get_track_data (), token_metrics .input )
229+ self .ld_client .track ('$ld:ai:tokens:input' , self .context , self .__get_track_data (), token_metrics .input )
230230 if token_metrics .output > 0 :
231- self .ld_client .track ('$ld:ai:tokens:output' , self .context , self .get_track_data (), token_metrics .output )
231+ self .ld_client .track ('$ld:ai:tokens:output' , self .context , self .__get_track_data (), token_metrics .output )
0 commit comments