code: def _encode_personality(self, personality):
          
          if personality is None:
              personality = []
          else:
              personality = utils.coerce_to_list(personality)
              for pfile in personality:
                  if "contents" in pfile:
                      pfile["contents"] = base64.b64encode(pfile["contents"])
          return personality
docs: Personality files must be base64-encoded before transmitting.