| | |
- builtins.int(builtins.object)
-
- AzureThreshold(builtins.int, enum.Enum)
- enum.Enum(builtins.object)
-
- AzureThreshold(builtins.int, enum.Enum)
- gen_ai_hub.orchestration.models.content_filter.ContentFilter(gen_ai_hub.orchestration.models.base.JSONSerializable)
-
- AzureContentFilter
class AzureContentFilter(gen_ai_hub.orchestration.models.content_filter.ContentFilter) |
| |
AzureContentFilter(hate: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], sexual: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], violence: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], self_harm: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], **kwargs)
Specific implementation of ContentFilter for Azure's content filtering service.
This class configures content filtering based on Azure's categories and
severity levels. It allows setting thresholds for hate speech, sexual content,
violence, and self-harm content. |
| |
- Method resolution order:
- AzureContentFilter
- gen_ai_hub.orchestration.models.content_filter.ContentFilter
- gen_ai_hub.orchestration.models.base.JSONSerializable
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, hate: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], sexual: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], violence: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], self_harm: Union[gen_ai_hub.orchestration.models.azure_content_filter.AzureThreshold, Literal[0, 2, 4, 6]], **kwargs)
- Initializes the AzureContentFilter with specified thresholds for different content categories.
:param hate: threshold for hate speech content
:type hate: Union[AzureThreshold, Literal[0, 2, 4, 6]]
:param sexual: threshold for sexual content
:type sexual: Union[AzureThreshold, Literal[0, 2, 4, 6]]
:param violence: threshold for violent content
:type violence: Union[AzureThreshold, Literal[0, 2, 4, 6]]
:param self_harm: threshold for self-harm content
:type self_harm: Union[AzureThreshold, Literal[0, 2, 4, 6]]
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
- __annotations__ = {}
Methods inherited from gen_ai_hub.orchestration.models.content_filter.ContentFilter:
- to_dict(self)
- to_dict method to convert the content filter to a dictionary.
:return: dictionary representation of the content filter.
:rtype: dict
Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class AzureThreshold(builtins.int, enum.Enum) |
| |
AzureThreshold(value, names=None, *, module=None, qualname=None, type=None, start=1)
Enumerates the threshold levels for the Azure Content Safety service.
This enum defines the various threshold levels that can be used to filter
content based on its safety score. Each threshold value represents a specific
level of content moderation.
Values:
ALLOW_SAFE: Allows only Safe content.
ALLOW_SAFE_LOW: Allows Safe and Low content.
ALLOW_SAFE_LOW_MEDIUM: Allows Safe, Low, and Medium content.
ALLOW_ALL: Allows all content (Safe, Low, Medium, and High). |
| |
- Method resolution order:
- AzureThreshold
- builtins.int
- enum.Enum
- builtins.object
Data and other attributes defined here:
- ALLOW_ALL = <AzureThreshold.ALLOW_ALL: 6>
- ALLOW_SAFE = <AzureThreshold.ALLOW_SAFE: 0>
- ALLOW_SAFE_LOW = <AzureThreshold.ALLOW_SAFE_LOW: 2>
- ALLOW_SAFE_LOW_MEDIUM = <AzureThreshold.ALLOW_SAFE_LOW_MEDIUM: 4>
Data descriptors inherited from enum.Enum:
- name
- The name of the Enum member.
- value
- The value of the Enum member.
Readonly properties inherited from enum.EnumMeta:
- __members__
- Returns a mapping of member name->value.
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.
| |