Skip to content

Commit 6497376

Browse files
committed
Fix typecheck add changelog
1 parent 3157b97 commit 6497376

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

util/opentelemetry-util-genai/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3795](#3795))
1616
- Make inputs / outputs / system instructions optional params to `on_completion`,
1717
([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3802](#3802)).
18+
- Use an md5 hash of the system instructions as it's upload filename, and check
19+
if the file exists before re-uploading it, ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3814](#3814)).
20+
1821

1922
## Version 0.1b0 (2025-09-25)
2023

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _calculate_ref_path(
163163
if all(isinstance(x, types.Text) for x in system_instruction):
164164
md5_hash = hashlib.md5()
165165
md5_hash.update(
166-
"\n".join(x.content for x in system_instruction).encode(
166+
"\n".join(x.content for x in system_instruction).encode( # pyright: ignore[reportUnknownMemberType, reportAttributeAccessIssue, reportUnknownArgumentType]
167167
"utf-8"
168168
)
169169
)
@@ -187,7 +187,7 @@ def _do_upload(
187187
) -> None:
188188
# FileSystem class has this method. Only check for system instructions as that's the only where the filename is a hash.
189189
# https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.exists
190-
if "_system_instruction" in path and self._fs.exists(path):
190+
if "_system_instruction" in path and self._fs.exists(path): # pyright: ignore[reportUnknownMemberType]
191191
return
192192
if self._format == "json":
193193
# output as a single line with the json messages array

0 commit comments

Comments
 (0)