Skip to content

Commit 24301ad

Browse files
committed
Remove variadic **Any
1 parent 93b211e commit 24301ad

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

sentry_sdk/integrations/langchain.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _normalize_langchain_message(self, message):
8686
return parsed
8787

8888
def _create_span(self, run_id, parent_id, **kwargs):
89-
# type: (UUID, Optional[UUID], **Any) -> Span
89+
# type: (UUID, Optional[UUID], Any) -> Span
9090

9191
span = None # type: Optional[Span]
9292
if parent_id:
@@ -113,7 +113,7 @@ def on_llm_start(
113113
metadata=None,
114114
**kwargs,
115115
):
116-
# type: (Dict[str, Any], List[str], *Any, UUID, Optional[List[str]], Optional[UUID], Optional[Dict[str, Any]], **Any) -> Any
116+
# type: (Dict[str, Any], List[str], Any, UUID, Optional[List[str]], Optional[UUID], Optional[Dict[str, Any]], Any) -> Any
117117
"""Run when LLM starts running."""
118118
with capture_internal_exceptions():
119119
if not run_id:
@@ -128,7 +128,7 @@ def on_llm_start(
128128
set_data_normalized(span, SPANDATA.AI_INPUT_MESSAGES, prompts)
129129

130130
def on_chat_model_start(self, serialized, messages, *, run_id, **kwargs):
131-
# type: (Dict[str, Any], List[List[BaseMessage]], *Any, UUID, **Any) -> Any
131+
# type: (Dict[str, Any], List[List[BaseMessage]], Any, UUID, Any) -> Any
132132
"""Run when Chat Model starts running."""
133133
if not run_id:
134134
return
@@ -151,7 +151,7 @@ def on_chat_model_start(self, serialized, messages, *, run_id, **kwargs):
151151
)
152152

153153
def on_llm_new_token(self, token, *, run_id, **kwargs):
154-
# type: (str, *Any, UUID, **Any) -> Any
154+
# type: (str, Any, UUID, Any) -> Any
155155
"""Run on new LLM token. Only available when streaming is enabled."""
156156
with capture_internal_exceptions():
157157
if not run_id or not self.span_map[run_id]:
@@ -162,7 +162,7 @@ def on_llm_new_token(self, token, *, run_id, **kwargs):
162162
span_data.num_tokens += 1
163163

164164
def on_llm_end(self, response, *, run_id, **kwargs):
165-
# type: (LLMResult, *Any, UUID, **Any) -> Any
165+
# type: (LLMResult, Any, UUID, Any) -> Any
166166
"""Run when LLM ends running."""
167167
with capture_internal_exceptions():
168168
if not run_id:
@@ -206,13 +206,13 @@ def on_llm_end(self, response, *, run_id, **kwargs):
206206
del self.span_map[run_id]
207207

208208
def on_llm_error(self, error, *, run_id, **kwargs):
209-
# type: (Union[Exception, KeyboardInterrupt], *Any, UUID, **Any) -> Any
209+
# type: (Union[Exception, KeyboardInterrupt], Any, UUID, Any) -> Any
210210
"""Run when LLM errors."""
211211
with capture_internal_exceptions():
212212
self._handle_error(run_id, error)
213213

214214
def on_chain_start(self, serialized, inputs, *, run_id, **kwargs):
215-
# type: (Dict[str, Any], Dict[str, Any], *Any, UUID, **Any) -> Any
215+
# type: (Dict[str, Any], Dict[str, Any], Any, UUID, Any) -> Any
216216
"""Run when chain starts running."""
217217
with capture_internal_exceptions():
218218
if not run_id:
@@ -225,7 +225,7 @@ def on_chain_start(self, serialized, inputs, *, run_id, **kwargs):
225225
)
226226

227227
def on_chain_end(self, outputs, *, run_id, **kwargs):
228-
# type: (Dict[str, Any], *Any, UUID, **Any) -> Any
228+
# type: (Dict[str, Any], Any, UUID, Any) -> Any
229229
"""Run when chain ends running."""
230230
with capture_internal_exceptions():
231231
if not run_id or not self.span_map[run_id]:
@@ -238,12 +238,12 @@ def on_chain_end(self, outputs, *, run_id, **kwargs):
238238
del self.span_map[run_id]
239239

240240
def on_chain_error(self, error, *, run_id, **kwargs):
241-
# type: (Union[Exception, KeyboardInterrupt], *Any, UUID, **Any) -> Any
241+
# type: (Union[Exception, KeyboardInterrupt], Any, UUID, Any) -> Any
242242
"""Run when chain errors."""
243243
self._handle_error(run_id, error)
244244

245245
def on_tool_start(self, serialized, input_str, *, run_id, **kwargs):
246-
# type: (Dict[str, Any], str, *Any, UUID, **Any) -> Any
246+
# type: (Dict[str, Any], str, Any, UUID, Any) -> Any
247247
"""Run when tool starts running."""
248248
with capture_internal_exceptions():
249249
if not run_id:
@@ -260,7 +260,7 @@ def on_tool_start(self, serialized, input_str, *, run_id, **kwargs):
260260
)
261261

262262
def on_tool_end(self, output, *, run_id, **kwargs):
263-
# type: (str, *Any, UUID, **Any) -> Any
263+
# type: (str, Any, UUID, Any) -> Any
264264
"""Run when tool ends running."""
265265
with capture_internal_exceptions():
266266
if not run_id or not self.span_map[run_id]:
@@ -275,7 +275,7 @@ def on_tool_end(self, output, *, run_id, **kwargs):
275275
del self.span_map[run_id]
276276

277277
def on_tool_error(self, error, *args, run_id, **kwargs):
278-
# type: (Union[Exception, KeyboardInterrupt], *Any, UUID, **Any) -> Any
278+
# type: (Union[Exception, KeyboardInterrupt], Any, UUID, Any) -> Any
279279
"""Run when tool errors."""
280280
self._handle_error(run_id, error)
281281

@@ -285,7 +285,7 @@ def _wrap_configure(f):
285285

286286
@wraps(f)
287287
def new_configure(*args, **kwargs):
288-
# type: (*Any, **Any) -> Any
288+
# type: (Any, Any) -> Any
289289

290290
integration = sentry_sdk.get_client().get_integration(LangchainIntegration)
291291

0 commit comments

Comments
 (0)