Skip to content

Commit 7f2090a

Browse files
committed
some fixes
1 parent 3049746 commit 7f2090a

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pylint==3.0.2
22
httpretty==1.1.4
3-
pyright==v1.1.404
3+
pyright==v1.1.408
44
sphinx==7.1.2
55
sphinx-rtd-theme==2.0.0rc4
66
sphinx-autodoc-typehints==1.25.2

instrumentation-genai/opentelemetry-instrumentation-anthropic/src/opentelemetry/instrumentation/anthropic/patch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
gen_ai_attributes as GenAIAttributes,
2525
)
2626
from opentelemetry.util.genai.handler import TelemetryHandler
27+
from opentelemetry.util.genai.inference_invocation import (
28+
LLMInvocation, # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
29+
)
2730
from opentelemetry.util.genai.types import Error
28-
from opentelemetry.util.genai.inference_invocation import LLMInvocation # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
2931
from opentelemetry.util.genai.utils import (
3032
should_capture_content_on_spans_in_experimental_mode,
3133
)

instrumentation-genai/opentelemetry-instrumentation-anthropic/src/opentelemetry/instrumentation/anthropic/wrappers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
from typing import TYPE_CHECKING, Callable, Iterator, Optional
2020

2121
from opentelemetry.util.genai.handler import TelemetryHandler
22+
from opentelemetry.util.genai.inference_invocation import (
23+
LLMInvocation, # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
24+
)
2225
from opentelemetry.util.genai.types import (
2326
Error,
2427
MessagePart,
2528
OutputMessage,
2629
)
27-
from opentelemetry.util.genai.inference_invocation import LLMInvocation # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
2830

2931
from .messages_extractors import (
3032
GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/callback_handler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
_InvocationManager,
2626
)
2727
from opentelemetry.util.genai.handler import TelemetryHandler
28-
from opentelemetry.util.genai.inference_invocation import LLMInvocation # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
28+
from opentelemetry.util.genai.inference_invocation import (
29+
LLMInvocation, # pyright: ignore[reportDeprecated] # TODO: migrate to InferenceInvocation
30+
)
2931
from opentelemetry.util.genai.types import (
3032
Error,
3133
InputMessage,
@@ -171,7 +173,8 @@ def on_llm_end(
171173
) -> None:
172174
llm_invocation = self._invocation_manager.get_invocation(run_id=run_id)
173175
if llm_invocation is None or not isinstance(
174-
llm_invocation, LLMInvocation # pyright: ignore[reportDeprecated]
176+
llm_invocation,
177+
LLMInvocation, # pyright: ignore[reportDeprecated]
175178
):
176179
# If the invocation does not exist, we cannot set attributes or end it
177180
return
@@ -262,7 +265,8 @@ def on_llm_error(
262265
) -> None:
263266
llm_invocation = self._invocation_manager.get_invocation(run_id=run_id)
264267
if llm_invocation is None or not isinstance(
265-
llm_invocation, LLMInvocation # pyright: ignore[reportDeprecated]
268+
llm_invocation,
269+
LLMInvocation, # pyright: ignore[reportDeprecated]
266270
):
267271
# If the invocation does not exist, we cannot set attributes or end it
268272
return

0 commit comments

Comments
 (0)