"max_new_tokens": self.max_new_tokens,
            "top_k": self.top_k,
            "penalty_alpha": self.penalty_alpha,
        }
        if len(self.conversation) == 0:
            raise ValueError("Error conversation is empty.")
        logger.debug(f"NEBULA _model_kwargs: {_model_kwargs}")
        logger.debug(f"NEBULA body: {body}")
        logger.debug(f"NEBULA kwargs: {kwargs}")
        logger.debug(f"NEBULA conversation: {self.conversation}")
        # call API
        try:
            response = requests.post(
                nebula_service_endpoint, headers=headers, json=body
            )
        except requests.exceptions.RequestException as e:
            raise ValueError(f"Error raised by inference endpoint: {e}")
        logger.debug(f"NEBULA response: {response}")
        if response.status_code != 200:
            raise ValueError(
                f"Error returned by service, status code {response.status_code}"
            )
        """ get the result """
        text = response.text
        """ enforce stop """
        if stop is not None:
            # This is required since the stop tokens
            # are not enforced by the model parameters
            text = enforce_stop_tokens(text, stop)
        return text