Skip to content

Commit fdf72b8

Browse files
committed
update comment
1 parent a95ae74 commit fdf72b8

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

util/opentelemetry-util-genai/src/opentelemetry/util/genai/_multimodal_upload/fs_uploader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import httpx
3636

3737
from opentelemetry.instrumentation.utils import suppress_http_instrumentation
38+
39+
# LoongSuite Extension: For Python 3.8 Compatibility
3840
from opentelemetry.util.genai import compatible_hashlib as hashlib
3941
from opentelemetry.util.genai._multimodal_upload._base import (
4042
Uploader,

util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929

3030
import fsspec
3131

32-
# Aliyun Python Agent Extension: Add support for Python 3.8
32+
# LoongSuite Extension: For Python 3.8 Compatibility
3333
from typing_extensions import TypeAlias
3434

3535
from opentelemetry._logs import LogRecord
3636
from opentelemetry.semconv._incubating.attributes import gen_ai_attributes
3737
from opentelemetry.trace import Span
38+
39+
# LoongSuite Extension: For Python 3.8 Compatibility
3840
from opentelemetry.util.genai import compatible_hashlib as hashlib
3941
from opentelemetry.util.genai import types
4042
from opentelemetry.util.genai.completion_hook import CompletionHook
@@ -75,11 +77,11 @@ class CompletionRefs:
7577
system_instruction_ref: str
7678

7779

78-
# Aliyun Python Agent Extension: Use TypeAlias with string annotation for Python 3.8 compatibility
80+
# LoongSuite Extension: Use TypeAlias with string annotation for Python 3.8 compatibility
7981
JsonEncodeable: TypeAlias = "list[dict[str, Any]]"
8082

8183
# mapping of upload path and whether the contents were hashed to the filename to function computing upload data dict
82-
# Aliyun Python Agent Extension: Use TypeAlias with string annotation for Python 3.8 compatibility
84+
# LoongSuite Extension: Use TypeAlias with string annotation for Python 3.8 compatibility
8385
UploadData: TypeAlias = "dict[tuple[str, bool], Callable[[], JsonEncodeable]]"
8486

8587

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def record(
9090
for token_count, token_type in token_counts:
9191
self._token_histogram.record(
9292
token_count,
93-
attributes={**attributes, GenAI.GEN_AI_TOKEN_TYPE: token_type},
93+
attributes={
94+
**attributes,
95+
GenAI.GEN_AI_TOKEN_TYPE: token_type,
96+
}, # LoongSuite Extension: For Python 3.8 Compatibility
9497
context=span_context,
9598
)
9699

0 commit comments

Comments
 (0)