Skip to main content

Classes

SourceReliability

Source reliability levels.

Values

ValueDescription
HIGHHigh reliability
MEDIUMMedium reliability
LOWLow reliability
UNKNOWNUnknown reliability

ValidationPoint

Validation point for content validation.

Parameters

ParameterTypeDefaultDescription
is_suspiciousbool-Whether the content is suspicious
feedbackstr-Feedback about the validation
suspicious_pointslist[str]-List of suspicious information raw names
source_reliabilitySourceReliabilityUNKNOWNSource reliability level
verification_methodstr""Method used for verification
confidence_scorefloat0.0Confidence score for the validation

ValidationResult

Result of content validation.

Parameters

ParameterTypeDefaultDescription
url_validationValidationPoint-URL validation results
number_validationValidationPoint-Number validation results
information_validationValidationPoint-Information validation results
code_validationValidationPoint-Code validation results
any_suspicionbool-Whether any suspicion was detected
suspicious_pointslist[str]-List of all suspicious points
overall_feedbackstr-Overall feedback about the validation
overall_confidencefloat0.0Overall confidence score

Functions

calculate_suspicion
Calculate suspicion based on all validation points. Returns:
  • str: Complete validation summary for editor

ReliabilityProcessor

Processor for reliability and content validation.

Parameters

ParameterTypeDefaultDescription
confidence_thresholdfloat0.7Confidence threshold for validation

Functions

process_task
Process a task through reliability validation. Parameters:
  • task (Task): The task to process
  • reliability_layer (Optional[Any]): The reliability layer configuration
  • model_provider (Optional[Union[Model, str]]): The model provider
Returns:
  • Task: The processed task

Functions

strip_context_tags

Remove context tags from text while preserving the content inside. Parameters:
  • text (str): The text to clean
Returns:
  • str: The cleaned text

find_urls_in_text

Find all URLs in the given text using regex pattern matching. Parameters:
  • text (str): The text to search
Returns:
  • List[str]: List of found URLs

find_numbers_in_text

Find all numbers in the given text using regex pattern matching. Parameters:
  • text (str): The text to search
Returns:
  • List[str]: List of found numbers

find_code_in_text

Check if text contains code-like patterns. Parameters:
  • text (str): The text to check
Returns:
  • bool: True if code patterns are found

contains_urls

Check if any of the provided texts contain URLs. Parameters:
  • texts (List[str]): List of texts to check
Returns:
  • bool: True if any text contains URLs

contains_numbers

Check if any of the provided texts contain numbers. Parameters:
  • texts (List[str]): List of texts to check
Returns:
  • bool: True if any text contains numbers

contains_code

Check if any of the provided texts contain code. Parameters:
  • texts (List[str]): List of texts to check
Returns:
  • bool: True if any text contains code
I