次の方法で共有


Rai Policies - Create Or Update

Azure OpenAI アカウントに関連付けられている指定されたコンテンツ フィルターの状態を更新します。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}?api-version=2024-10-01

URI パラメーター

名前 / 必須 説明
accountName
path True

string

minLength: 2
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$

Cognitive Services アカウントの名前。

raiPolicyName
path True

string

pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$

Cognitive Services アカウントに関連付けられている RaiPolicy の名前

resourceGroupName
path True

string

minLength: 1
maxLength: 90

リソース グループの名前。 名前では大文字と小文字が区別されません。

subscriptionId
path True

string

minLength: 1

ターゲット サブスクリプションの ID。

api-version
query True

string

minLength: 1

この操作に使用する API バージョン。

要求本文

名前 説明
properties

RaiPolicyProperties

Cognitive Services RaiPolicy のプロパティ。

tags

object

リソース タグ。

応答

名前 説明
200 OK

RaiPolicy

コンテンツ フィルターを正常に作成/更新します。

201 Created

RaiPolicy

コンテンツ フィルターを正常に作成します。

Other Status Codes

ErrorResponse

操作が失敗した理由を説明するエラー応答。

PutRaiPolicy

要求のサンプル

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/raiPolicies/raiPolicyName?api-version=2024-10-01

{
  "properties": {
    "basePolicyName": "Microsoft.Default",
    "mode": "Asynchronous_filter",
    "contentFilters": [
      {
        "name": "Hate",
        "blocking": false,
        "enabled": false,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Hate",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Prompt"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Jailbreak",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      },
      {
        "name": "Protected Material Text",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Protected Material Code",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Profanity",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      }
    ]
  }
}

応答のサンプル

{
  "name": "raiPolicyName",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/raiPolicies/raiPolicyName",
  "properties": {
    "basePolicyName": "Microsoft.Default",
    "mode": "Asynchronous_filter",
    "contentFilters": [
      {
        "name": "Hate",
        "blocking": false,
        "enabled": false,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Hate",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Prompt"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Jailbreak",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      },
      {
        "name": "Protected Material Text",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Protected Material Code",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Profanity",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      }
    ]
  }
}
{
  "name": "raiPolicyName",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/raiPolicies/raiPolicyName",
  "properties": {
    "basePolicyName": "Microsoft.Default",
    "mode": "Asynchronous_filter",
    "contentFilters": [
      {
        "name": "Hate",
        "blocking": false,
        "enabled": false,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Hate",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Sexual",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "High",
        "source": "Prompt"
      },
      {
        "name": "Selfharm",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Prompt"
      },
      {
        "name": "Violence",
        "blocking": true,
        "enabled": true,
        "severityThreshold": "Medium",
        "source": "Completion"
      },
      {
        "name": "Jailbreak",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      },
      {
        "name": "Protected Material Text",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Protected Material Code",
        "blocking": true,
        "source": "Completion",
        "enabled": true
      },
      {
        "name": "Profanity",
        "blocking": true,
        "source": "Prompt",
        "enabled": true
      }
    ]
  }
}

定義

名前 説明
ContentLevel

コンテンツがフィルター処理されるレベル。

createdByType

リソースを作成した ID の種類。

CustomBlocklistConfig

フィルターを適用するソースを取得または設定します。

ErrorAdditionalInfo

リソース管理エラーの追加情報。

ErrorDetail

エラーの詳細。

ErrorResponse

エラー応答

RaiPolicy

Cognitive Services RaiPolicy。

RaiPolicyContentFilter

Azure OpenAI コンテンツ フィルター。

RaiPolicyContentSource

コンテンツ フィルターを適用するコンテンツ ソース。

RaiPolicyMode

Rai ポリシー モード。 列挙値のマッピングは次のとおりです。既定値は 0、Deferred=1、Blocking=2、Asynchronous_filter =3 です。 2024-10-01 以降は 、'Asynchronous_filter' を使用してください。 これは、以前のバージョンの 'Deferred' と同じです。

RaiPolicyProperties

Azure OpenAI コンテンツ フィルターのプロパティ。

RaiPolicyType

コンテンツ フィルター ポリシーの種類。

systemData

リソースの作成と最後の変更に関連するメタデータ。

ContentLevel

コンテンツがフィルター処理されるレベル。

説明
Low
Medium
High

createdByType

リソースを作成した ID の種類。

説明
User
Application
ManagedIdentity
Key

CustomBlocklistConfig

フィルターを適用するソースを取得または設定します。

名前 説明
blocking

boolean

ブロックが発生した場合。

blocklistName

string

ContentFilter の名前。

source

RaiPolicyContentSource

コンテンツ フィルターを適用するコンテンツ ソース。

ErrorAdditionalInfo

リソース管理エラーの追加情報。

名前 説明
info

object

追加情報。

type

string

追加情報の種類。

ErrorDetail

エラーの詳細。

名前 説明
additionalInfo

ErrorAdditionalInfo[]

エラーの追加情報。

code

string

エラー コード。

details

ErrorDetail[]

エラーの詳細。

message

string

エラー メッセージ。

target

string

エラーターゲット。

ErrorResponse

エラー応答

名前 説明
error

ErrorDetail

エラー オブジェクト。

RaiPolicy

Cognitive Services RaiPolicy。

名前 説明
etag

string

リソース Etag。

id

string

リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

リソースの名前

properties

RaiPolicyProperties

Cognitive Services RaiPolicy のプロパティ。

systemData

systemData

リソースの作成と最後の変更に関連するメタデータ。

tags

object

リソース タグ。

type

string

リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"

RaiPolicyContentFilter

Azure OpenAI コンテンツ フィルター。

名前 説明
blocking

boolean

ブロックが発生した場合。

enabled

boolean

ContentFilter が有効になっている場合。

name

string

ContentFilter の名前。

severityThreshold

ContentLevel

コンテンツがフィルター処理されるレベル。

source

RaiPolicyContentSource

コンテンツ フィルターを適用するコンテンツ ソース。

RaiPolicyContentSource

コンテンツ フィルターを適用するコンテンツ ソース。

説明
Prompt
Completion

RaiPolicyMode

Rai ポリシー モード。 列挙値のマッピングは次のとおりです。既定値は 0、Deferred=1、Blocking=2、Asynchronous_filter =3 です。 2024-10-01 以降は 、'Asynchronous_filter' を使用してください。 これは、以前のバージョンの 'Deferred' と同じです。

説明
Default
Deferred
Blocking
Asynchronous_filter

RaiPolicyProperties

Azure OpenAI コンテンツ フィルターのプロパティ。

名前 説明
basePolicyName

string

Rai ポリシーの名前。

contentFilters

RaiPolicyContentFilter[]

コンテンツ フィルターの一覧。

customBlocklists

CustomBlocklistConfig[]

カスタム ブロックリストの一覧。

mode

RaiPolicyMode

Rai ポリシー モード。 列挙値のマッピングは次のとおりです。既定値は 0、Deferred=1、Blocking=2、Asynchronous_filter =3 です。 2024-10-01 以降は 、'Asynchronous_filter' を使用してください。 これは、以前のバージョンの 'Deferred' と同じです。

type

RaiPolicyType

コンテンツ フィルター ポリシーの種類。

RaiPolicyType

コンテンツ フィルター ポリシーの種類。

説明
UserManaged
SystemManaged

systemData

リソースの作成と最後の変更に関連するメタデータ。

名前 説明
createdAt

string (date-time)

リソース作成のタイムスタンプ (UTC)。

createdBy

string

リソースを作成した ID。

createdByType

createdByType

リソースを作成した ID の種類。

lastModifiedAt

string (date-time)

リソースの最終変更のタイムスタンプ (UTC)

lastModifiedBy

string

リソースを最後に変更した ID。

lastModifiedByType

createdByType

リソースを最後に変更した ID の種類。