--- sidebar_label: agent title: agenthub.micro.agent --- #### my\_encoder ```python def my_encoder(obj) ``` Encodes objects as dictionaries **Arguments**: - obj (Object): An object that will be converted **Returns**: - dict: If the object can be converted it is returned in dict format #### to\_json ```python def to_json(obj, **kwargs) ``` Serialize an object to str format