Skip to content

Commit 104aaad

Browse files
committed
fix: comments
1 parent b8cf4fe commit 104aaad

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

posthog/ai/gemini/gemini.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ def _merge_posthog_params(
128128
if call_properties:
129129
properties.update(call_properties)
130130

131+
if call_trace_id is None:
132+
call_trace_id = str(uuid.uuid4())
133+
131134
return distinct_id, call_trace_id, properties, privacy_mode, groups
132135

133136
def generate_content(
@@ -162,9 +165,6 @@ def generate_content(
162165
posthog_distinct_id, posthog_trace_id, posthog_properties, posthog_privacy_mode, posthog_groups
163166
)
164167

165-
if trace_id is None:
166-
trace_id = str(uuid.uuid4())
167-
168168
kwargs_with_contents = {"model": model, "contents": contents, **kwargs}
169169

170170
return call_llm_and_track_usage(
@@ -319,9 +319,6 @@ def generate_content_stream(
319319
posthog_distinct_id, posthog_trace_id, posthog_properties, posthog_privacy_mode, posthog_groups
320320
)
321321

322-
if trace_id is None:
323-
trace_id = str(uuid.uuid4())
324-
325322
return self._generate_content_streaming(
326323
model,
327324
contents,

0 commit comments

Comments
 (0)