Skip to content

Commit ad5ad47

Browse files
committed
fix: typing error
1 parent 23d2fbc commit ad5ad47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
raise DidNotEnable("Anthropic not installed")
4242

4343
if TYPE_CHECKING:
44-
from typing import Any, AsyncIterator, Iterator
44+
from typing import Any, AsyncIterator, Iterator, List, Optional, Union
4545
from sentry_sdk.tracing import Span
4646

4747

@@ -134,7 +134,7 @@ def _set_input_data(span, kwargs, integration):
134134
):
135135
normalized_messages = []
136136
if system_prompt:
137-
system_prompt_content = None
137+
system_prompt_content = None # type: Optional[Union[str, List[dict[str, Any]]]]
138138
if isinstance(system_prompt, str):
139139
system_prompt_content = system_prompt
140140
elif isinstance(system_prompt, Iterable):
@@ -166,7 +166,7 @@ def _set_input_data(span, kwargs, integration):
166166
normalized_messages.append(
167167
{
168168
"role": GEN_AI_ALLOWED_MESSAGE_ROLES.TOOL,
169-
"content": {
169+
"content": { # type: ignore[dict-item]
170170
"tool_use_id": item.get("tool_use_id"),
171171
"output": item.get("content"),
172172
},

0 commit comments

Comments
 (0)