Skip to content

Commit 328063b

Browse files
committed
fix: mypy baseline
1 parent 86a25f4 commit 328063b

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

mypy-baseline.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,4 @@ posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [v
4040
posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"?
4141
posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
4242
sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[<type>] = ...") [var-annotated]
43-
sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment]
44-
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
45-
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
46-
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
47-
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
48-
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
49-
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
50-
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
51-
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
52-
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
53-
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
54-
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
55-
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment]
43+
sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment]

posthog/ai/anthropic/anthropic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def create(
5454
**kwargs: Arguments passed to Anthropic's messages.create
5555
"""
5656
if posthog_trace_id is None:
57-
posthog_trace_id = uuid.uuid4()
57+
posthog_trace_id = str(uuid.uuid4())
5858

5959
if kwargs.get("stream", False):
6060
return self._create_streaming(
@@ -89,7 +89,7 @@ def stream(
8989
**kwargs: Any,
9090
):
9191
if posthog_trace_id is None:
92-
posthog_trace_id = uuid.uuid4()
92+
posthog_trace_id = str(uuid.uuid4())
9393

9494
return self._create_streaming(
9595
posthog_distinct_id,
@@ -167,7 +167,7 @@ def _capture_streaming_event(
167167
output: str,
168168
):
169169
if posthog_trace_id is None:
170-
posthog_trace_id = uuid.uuid4()
170+
posthog_trace_id = str(uuid.uuid4())
171171

172172
event_properties = {
173173
"$ai_provider": "anthropic",

posthog/ai/anthropic/anthropic_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def create(
5454
**kwargs: Arguments passed to Anthropic's messages.create
5555
"""
5656
if posthog_trace_id is None:
57-
posthog_trace_id = uuid.uuid4()
57+
posthog_trace_id = str(uuid.uuid4())
5858

5959
if kwargs.get("stream", False):
6060
return await self._create_streaming(
@@ -89,7 +89,7 @@ async def stream(
8989
**kwargs: Any,
9090
):
9191
if posthog_trace_id is None:
92-
posthog_trace_id = uuid.uuid4()
92+
posthog_trace_id = str(uuid.uuid4())
9393

9494
return await self._create_streaming(
9595
posthog_distinct_id,
@@ -167,7 +167,7 @@ async def _capture_streaming_event(
167167
output: str,
168168
):
169169
if posthog_trace_id is None:
170-
posthog_trace_id = uuid.uuid4()
170+
posthog_trace_id = str(uuid.uuid4())
171171

172172
event_properties = {
173173
"$ai_provider": "anthropic",

0 commit comments

Comments
 (0)