caikit.core.data_model.json_dict
This module holds common utilities for managing arbitrary JSON serializable dicts as protobuf Struct objects
Attributes
Functions
|
Convert a python dict to a protobuf Struct |
|
Convert a struct into the equivalent json dict |
|
Recursive helper to convert python values to struct values |
|
Recursive helper to convert struct values to python values |
|
Helper to get the concrete protobuf class from a descriptor. This |
Module Contents
- caikit.core.data_model.json_dict.JsonDictValue
- caikit.core.data_model.json_dict.JsonDict
- caikit.core.data_model.json_dict.STRUCT_PROTOBUF_NAME = 'google.protobuf.Struct'
- caikit.core.data_model.json_dict.dict_to_struct(dictionary: JsonDict, struct_class: type | None = None, value_class: type | None = None, list_value_class: type | None = None) google.protobuf.struct_pb2.Struct[source]
Convert a python dict to a protobuf Struct
- caikit.core.data_model.json_dict.struct_to_dict(struct: google.protobuf.struct_pb2.Struct) JsonDict[source]
Convert a struct into the equivalent json dict
- caikit.core.data_model.json_dict._value_to_struct_value(value, struct_class, value_class, list_value_class)[source]
Recursive helper to convert python values to struct values