PromptInjectionProtectionResult

class oci.generative_ai_inference.models.PromptInjectionProtectionResult(**kwargs)

Bases: object

The result of prompt injection protection.

Attributes:

FLAGGED_MODALITIES_IMAGE

A constant which can be used with the flagged_modalities property of a PromptInjectionProtectionResult.

FLAGGED_MODALITIES_TEXT

A constant which can be used with the flagged_modalities property of a PromptInjectionProtectionResult.

flagged_modalities

Gets the flagged_modalities of this PromptInjectionProtectionResult.

score

[Required] Gets the score of this PromptInjectionProtectionResult.

Methods:

__init__(**kwargs)

Initializes a new PromptInjectionProtectionResult object with values from keyword arguments.

FLAGGED_MODALITIES_IMAGE = 'IMAGE'

A constant which can be used with the flagged_modalities property of a PromptInjectionProtectionResult. This constant has a value of “IMAGE”

FLAGGED_MODALITIES_TEXT = 'TEXT'

A constant which can be used with the flagged_modalities property of a PromptInjectionProtectionResult. This constant has a value of “TEXT”

__init__(**kwargs)

Initializes a new PromptInjectionProtectionResult object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • score (float) – The value to assign to the score property of this PromptInjectionProtectionResult.

  • flagged_modalities (list[str]) – The value to assign to the flagged_modalities property of this PromptInjectionProtectionResult. Allowed values for items in this list are: “TEXT”, “IMAGE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

property flagged_modalities

Gets the flagged_modalities of this PromptInjectionProtectionResult. The input modalities flagged by the prompt injection result. Present only when the request is processed using a non-empty multimodalInput.

Allowed values for items in this list are: “TEXT”, “IMAGE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The flagged_modalities of this PromptInjectionProtectionResult.

Return type

list[str]

property score

[Required] Gets the score of this PromptInjectionProtectionResult. The score indicating the likelihood of a prompt injection attack.

Returns

The score of this PromptInjectionProtectionResult.

Return type

float