def __call__(self, utterances_batch: list, utterances_ids: Optional[list] = None) -> Tuple[list, list]:
        """Wraps __call__ method of Skill instance.

            Provides skill __call__ with signature of Agent __call__ and handles
            automatic state management for skill.

        Args:
            utterances_batch: Batch of incoming utterances.
            utterances_ids: Batch of dialog IDs corresponding to incoming utterances.

        Returns:
            response: A batch of arbitrary typed skill inference results.
            confidence: A batch of float typed confidence levels for each of
                skill inference result.
            states: Optional. A batch of arbitrary typed states for each
                response.
        """
        history_batch = [self.agent.history[utt_id] for utt_id in utterances_ids]
        states_batch = [self.agent.states[utt_id][self.skill_id] for utt_id in utterances_ids]

        predicted, confidence, *states = self.skill(utterances_batch, history_batch, states_batch)

        states = states[0] if states else [None] * len(predicted)
        for utt_id, state in zip(utterances_ids, states):
            self.agent.states[utt_id][self.skill_id] = state

        return predicted, confidence
def __call__ ( self , utterances_batch : list , utterances_ids : Optional [ list ] = None ) -> Tuple [ list , list ] : history_batch = [ self . agent . history [ utt_id ] for utt_id in utterances_ids ] states_batch = [ self . agent . states [ utt_id ] [ self . skill_id ] for utt_id in utterances_ids ] predicted , confidence , * states = self . skill ( utterances_batch , history_batch , states_batch ) states = states [ 0 ] if states else [ None ] * len ( predicted ) for utt_id , state in zip ( utterances_ids , states ) : self . agent . states [ utt_id ] [ self . skill_id ] = state return predicted , confidence
Wraps __call__ method of Skill instance.

            Provides skill __call__ with signature of Agent __call__ and handles
            automatic state management for skill.

        Args:
            utterances_batch: Batch of incoming utterances.
            utterances_ids: Batch of dialog IDs corresponding to incoming utterances.

        Returns:
            response: A batch of arbitrary typed skill inference results.
            confidence: A batch of float typed confidence levels for each of
                skill inference result.
            states: Optional. A batch of arbitrary typed states for each
                response.