code: def add_operations(self, agent_id, operations):
      
      # Raises an error when agent_id is invalid
      self._check_agent_id(agent_id)
  
      # Extra header in addition to the main session's
      ct_header = {"Content-Type": "application/json; charset=utf-8"}
      offset = 0
  
      is_looping = True
  
      while is_looping:
        next_offset = offset + self.config["operationsChunksSize"]
  
        try:
          json_pl = json.dumps(operations[offset:next_offset])
        except TypeError as err:
          raise CraftAiBadRequestError("Invalid configuration or agent id given. {}"
                                       .format(err.__str__()))
  
        req_url = "{}/agents/{}/context".format(self._base_url, agent_id)
        resp = self._requests_session.post(req_url, headers=ct_header, data=json_pl)
        self._decode_response(resp)
  
        if next_offset >= len(operations):
          is_looping = False
  
        offset = next_offset
  
      return {
        "message": "Successfully added %i operation(s) to the agent \"%s/%s/%s\" context."
                   % (len(operations), self.config["owner"], self.config["project"], agent_id)
      }
docs: Add operations to an agent.
  
      :param str agent_id: The id of the agent to delete. It must be
      an str containing only characters in "a-zA-Z0-9_-" and must be
      between 1 and 36 characters. It must referenced an existing agent.
      :param list operations: Contains dictionnaries that has the
      form given in the craftai documentation and the configuration
      of the agent.
  
      :return: message about the added operations.
      :rtype: str
  
      :raise CraftAiBadRequestError: if the input is not of
      the right form.