autointent.generation.utterances.CriticHumanLike#

class autointent.generation.utterances.CriticHumanLike(generator, max_retries=3)#

A simple critic class that classifies user utterances as either ‘human’ or ‘generated’.

using an LLM-based binary classifier prompt.

Parameters:
generator#
max_retries = 3#
build_classification_prompt(example, intent_name)#

Args.

example: The user utterance to classify. intent_name: The name of the intent associated with the utterance.

Returns:

A formatted message prompt for classification.

Return type:

Message

Parameters:
  • example (str)

  • intent_name (str)

is_human(utterance, intent_name)#

Args.

utterance: The utterance to evaluate. intent_name: The associated intent.

Returns:

True if classified as human, False otherwise.

Return type:

bool

Parameters:
  • utterance (str)

  • intent_name (str)

async is_human_async(utterance, intent_name)#
Parameters:
  • utterance (str)

  • intent_name (str)

Return type:

bool