Subscription Rai Policy - Get
获得与订阅相关的指定内容过滤器。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}?api-version=2025-10-01-preview
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
rai
|
path | True |
string pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$ |
与认知服务帐户关联的 RaiPolicy 的名称 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure 运营顺利完成。 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow.
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
GetRaiPolicy
示例请求
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/raiPolicy/raiPolicyName?api-version=2025-10-01-preview
示例响应
{
"name": "raiPolicyName",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/raiPolicies/raiPolicyName",
"properties": {
"basePolicyName": "Microsoft.Default",
"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,
"enabled": true,
"source": "Prompt"
},
{
"name": "Protected Material Text",
"blocking": true,
"enabled": true,
"source": "Completion"
},
{
"name": "Protected Material Code",
"blocking": true,
"enabled": true,
"source": "Completion"
},
{
"name": "Profanity",
"blocking": true,
"enabled": true,
"source": "Prompt"
}
],
"mode": "Asynchronous_filter"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Content |
筛选内容的级别。 |
|
created |
创建资源的标识的类型。 |
|
Custom |
获取或设置应用筛选器的源。 |
|
Custom |
获取或设置应用筛选器的源。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Rai |
要应用于内容过滤器的作类型 |
|
Rai |
认知服务 RaiPolicy。 |
|
Rai |
Azure OpenAI Content Filter. |
|
Rai |
要应用内容筛选器的内容源。 |
|
Rai |
Rai 策略模式。 枚举值映射如下所示:默认值 = 0,Deferred=1,Blocking=2,Asynchronous_filter =3。 请在 2025 年 6 月 1 日之后使用“Asynchronous_filter”。 它与以前版本中的“延迟”相同。 |
|
Rai |
Azure OpenAI 内容过滤属性。 |
|
Rai |
内容筛选器策略类型。 |
|
Safety |
获取或设定安全服务适用的来源。 |
|
system |
与创建和上次修改资源相关的元数据。 |
ContentLevel
筛选内容的级别。
| 值 | 说明 |
|---|---|
| Low | |
| Medium | |
| High |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CustomBlocklistConfig
获取或设置应用筛选器的源。
| 名称 | 类型 | 说明 |
|---|---|---|
| blocking |
boolean |
如果发生阻塞, |
| blocklistName |
string |
ContentFilter 的名称。 |
| source |
要应用内容筛选器的内容源。 |
CustomTopicConfig
获取或设置应用筛选器的源。
| 名称 | 类型 | 说明 |
|---|---|---|
| blocking |
boolean |
如果发生阻塞, |
| source |
要应用内容筛选器的内容源。 |
|
| topicName |
string |
RAI 主题的名称。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
附加信息。 |
| type |
string |
附加信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
RaiActionType
要应用于内容过滤器的作类型
| 值 | 说明 |
|---|---|
| None | |
| BLOCKING | |
| ANNOTATING | |
| HITL | |
| RETRY |
RaiPolicy
认知服务 RaiPolicy。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
资源 Etag。 |
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
资源的名称 |
| properties |
认知服务 RaiPolicy 的属性。 |
|
| systemData |
Azure Resource Manager 包含 createdBy 和 modifiedBy 信息的元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
RaiPolicyContentFilter
Azure OpenAI Content Filter.
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
要应用于内容过滤器的作类型 |
|
| blocking |
boolean |
如果发生阻塞, |
| enabled |
boolean |
如果已启用 ContentFilter。 |
| name |
string |
ContentFilter 的名称。 |
| severityThreshold |
筛选内容的级别。 |
|
| source |
要应用内容筛选器的内容源。 |
RaiPolicyContentSource
要应用内容筛选器的内容源。
| 值 | 说明 |
|---|---|
| Prompt | |
| Completion | |
| PreToolCall | |
| PostToolCall | |
| PreRun | |
| PostRun |
RaiPolicyMode
Rai 策略模式。 枚举值映射如下所示:默认值 = 0,Deferred=1,Blocking=2,Asynchronous_filter =3。 请在 2025 年 6 月 1 日之后使用“Asynchronous_filter”。 它与以前版本中的“延迟”相同。
| 值 | 说明 |
|---|---|
| Default | |
| Deferred | |
| Blocking | |
| Asynchronous_filter |
RaiPolicyProperties
Azure OpenAI 内容过滤属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| basePolicyName |
string |
Rai 策略的名称。 |
| contentFilters |
内容筛选器的列表。 |
|
| customBlocklists |
自定义阻止列表的列表。 |
|
| customTopics |
自定义 rai 主题的列表。 |
|
| mode |
Rai 策略模式。 枚举值映射如下所示:默认值 = 0,Deferred=1,Blocking=2,Asynchronous_filter =3。 请在 2025 年 6 月 1 日之后使用“Asynchronous_filter”。 它与以前版本中的“延迟”相同。 |
|
| safetyProviders |
安全提供者列表。 |
|
| type |
内容筛选器策略类型。 |
RaiPolicyType
内容筛选器策略类型。
| 值 | 说明 |
|---|---|
| UserManaged | |
| SystemManaged |
SafetyProviderConfig
获取或设定安全服务适用的来源。
| 名称 | 类型 | 说明 |
|---|---|---|
| blocking |
boolean |
如果发生阻塞, |
| safetyProviderName |
string |
RAI 安全提供商的名称。 |
| source |
要应用内容筛选器的内容源。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
资源上次修改的时间戳 (UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |