gen_ai_hub.orchestration.models.content_filtering module¶
- class gen_ai_hub.orchestration.models.content_filtering.InputFiltering(filters: List[ContentFilter])¶
Bases:
JSONSerializableModule for managing and applying input content filters.
- __init__(filters: List[ContentFilter])¶
Initializes the InputFiltering with specified filters.
- Parameters:
filters (List[ContentFilter]) – List of ContentFilter objects to be applied to input content.
- to_dict()¶
to_dict method to convert the input filtering configuration to a dictionary.
- Returns:
dictionary representation of the input filtering configuration.
- Return type:
dict
- class gen_ai_hub.orchestration.models.content_filtering.OutputFiltering(filters: List[ContentFilter], stream_options: dict | None = None)¶
Bases:
JSONSerializableModule for managing and applying output content filters.
- __init__(filters: List[ContentFilter], stream_options: dict | None = None)¶
Initializes the OutputFiltering with specified filters and optional streaming options.
- Parameters:
filters (List[ContentFilter]) – List of ContentFilter objects to be applied to output content.
stream_options (Optional[dict], optional) – Module-specific streaming options, defaults to None
- to_dict()¶
to_dict method to convert the output filtering configuration to a dictionary.
- Returns:
dictionary representation of the output filtering configuration.
- Return type:
dict
- class gen_ai_hub.orchestration.models.content_filtering.ContentFiltering(input_filtering: InputFiltering | None = None, output_filtering: OutputFiltering | None = None)¶
Bases:
JSONSerializableModule for managing and applying content filters.
- __init__(input_filtering: InputFiltering | None = None, output_filtering: OutputFiltering | None = None)¶
Initializes the ContentFiltering with optional input and output filtering configurations.
- Parameters:
input_filtering (Optional[InputFiltering], optional) – the configuration for input filtering, defaults to None
output_filtering (Optional[OutputFiltering], optional) – the configuration for output filtering, defaults to None
- to_dict()¶
to_dict method to convert the content filtering configuration to a dictionary.
- Returns:
dictionary representation of the content filtering configuration.
- Return type:
dict