Skip to content

Commit 97d300f

Browse files
committed
Add docstring
1 parent 28cad57 commit 97d300f

File tree

1 file changed

+4
-2
lines changed
  • util/opentelemetry-util-genai/src/opentelemetry/util/genai

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import json
1516
import logging
1617
import os
1718
from base64 import b64encode
18-
from json import encoder
1919
from typing import Any
2020

2121
from opentelemetry.instrumentation._semconv import (
@@ -59,7 +59,9 @@ def get_content_capturing_mode() -> ContentCapturingMode:
5959
return ContentCapturingMode.NO_CONTENT
6060

6161

62-
class Base64JsonEncoder(encoder.JSONEncoder):
62+
class Base64JsonEncoder(json.JSONEncoder):
63+
"""Should be used to serialize python objects to json that may contain bytes."""
64+
6365
def default(self, o: Any) -> Any:
6466
if isinstance(o, bytes):
6567
return b64encode(o).decode()

0 commit comments

Comments
 (0)