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 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import json
15
16
import logging
16
17
import os
17
18
from base64 import b64encode
18
- from json import encoder
19
19
from typing import Any
20
20
21
21
from opentelemetry .instrumentation ._semconv import (
@@ -59,7 +59,9 @@ def get_content_capturing_mode() -> ContentCapturingMode:
59
59
return ContentCapturingMode .NO_CONTENT
60
60
61
61
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
+
63
65
def default (self , o : Any ) -> Any :
64
66
if isinstance (o , bytes ):
65
67
return b64encode (o ).decode ()
You can’t perform that action at this time.
0 commit comments