File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
util/opentelemetry-util-genai/src/opentelemetry/util/genai Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import json
1516import logging
1617import os
1718from base64 import b64encode
18- from json import encoder
1919from typing import Any
2020
2121from 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 ()
You can’t perform that action at this time.
0 commit comments