def on_trial_complete(self, trial_id: str, result: Optional[Dict]=None, error: bool=False):
    'Notification for the completion of trial.\n\n        If a trial fails, it will be reported as a failed Observation, telling\n        the optimizer that the Suggestion led to a metric failure, which\n        updates the feasible region and improves parameter recommendation.\n\n        Creates SigOpt Observation object for trial.\n        '
    if result:
        payload = dict(suggestion=self._live_trial_mapping[trial_id], values=self.serialize_result(result))
        self.conn.experiments(self.experiment.id).observations().create(**payload)
        self.experiment = self.conn.experiments(self.experiment.id).fetch()
    elif error:
        self.conn.experiments(self.experiment.id).observations().create(failed=True, suggestion=self._live_trial_mapping[trial_id])
    del self._live_trial_mapping[trial_id]
Notification for the completion of trial.

If a trial fails, it will be reported as a failed Observation, telling
the optimizer that the Suggestion led to a metric failure, which
updates the feasible region and improves parameter recommendation.

Creates SigOpt Observation object for trial.
def on_trial_complete(self, trial_id: str, result: Optional[Dict]=None, error: bool=False):
    'Notification for the completion of trial.\n\n        If a trial fails, it will be reported as a failed Observation, telling\n        the optimizer that the Suggestion led to a metric failure, which\n        updates the feasible region and improves parameter recommendation.\n\n        Creates SigOpt Observation object for trial.\n        '
    if result:
        payload = dict(suggestion=self._live_trial_mapping[trial_id], values=self.serialize_result(result))
        self.conn.experiments(self.experiment.id).observations().create(**payload)
        self.experiment = self.conn.experiments(self.experiment.id).fetch()
    elif error:
        self.conn.experiments(self.experiment.id).observations().create(failed=True, suggestion=self._live_trial_mapping[trial_id])
    del self._live_trial_mapping[trial_id]