Skip to content

Commit fb0a489

Browse files
committed
Suppress reportDeprecated for GenAI semconv enums in token metrics
1 parent 1e5b733 commit fb0a489

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

util/opentelemetry-util-genai/src/opentelemetry/util/genai/_inference_invocation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
operation_name: str | None = None,
5151
) -> None:
5252
operation_name = (
53-
operation_name or GenAI.GenAiOperationNameValues.CHAT.value
53+
operation_name or GenAI.GenAiOperationNameValues.CHAT.value # pyright: ignore[reportDeprecated]
5454
)
5555
"""Use handler.inference(provider) rather than calling this directly."""
5656
super().__init__(
@@ -179,9 +179,9 @@ def _get_metric_attributes(self) -> dict[str, AttributeValue]:
179179
def _get_metric_token_counts(self) -> dict[str, int]:
180180
counts: dict[str, int] = {}
181181
if self.input_tokens is not None:
182-
counts[GenAI.GenAiTokenTypeValues.INPUT.value] = self.input_tokens
182+
counts[GenAI.GenAiTokenTypeValues.INPUT.value] = self.input_tokens # pyright: ignore[reportDeprecated]
183183
if self.output_tokens is not None or self.thinking_tokens is not None:
184-
counts[GenAI.GenAiTokenTypeValues.OUTPUT.value] = (
184+
counts[GenAI.GenAiTokenTypeValues.OUTPUT.value] = ( # pyright: ignore[reportDeprecated]
185185
self.output_tokens or 0
186186
) + (self.thinking_tokens or 0)
187187
return counts

0 commit comments

Comments
 (0)