| Parameter | Type | Description | Example |
|---|---|---|---|
| object | body | ||
| type | string | Policy Type | AiCache |
| enable | boolean | Policy Enable | true |
| aiFallbackConfig | object | AiFallbackConfig | |
| serviceConfigs | array<object> | List of fallback service configurations | |
| object | object | ||
| serviceId | string | Fallback service ID | svc-123456 |
| name | string | Service name for frontend display | azure.ai |
| targetModelName | string | Target model name for fallback | kimi-fallback-test |
| passThroughModelName | boolean | Whether to pass through the original model name | true |
| onlyRedirectUpstreamCode | boolean | Only trigger fallback when backend returns 4xx/5xx status codes | true |
| routeEmbedded | boolean | Whether the policy is generated from route embedded configuration | true |
| aiSecurityGuardConfig | object | AiSecurityGuardConfig | |
| serviceAddress | string | Security guard service endpoint URL | https://api.example.com/v1 |
| checkRequest | boolean | Enable request content checking | true |
| checkResponse | boolean | Enable response content checking | true |
| checkRequestImage | boolean | Enable request image checking | true |
| checkResponseImage | boolean | Enable response image checking | true |
| requestCheckService | string | Request text check service type | content-moderation-service |
| responseCheckService | string | Response text check service type | output-moderation-service |
| requestImageCheckService | string | Request image check service type | image-moderation-service |
| responseImageCheckService | string | Response image check service type | generated-image-scanner |
| riskAlertLevel | string | Global risk alert level | high |
| riskConfig | array<object> | RiskConfig | |
| object | object | ||
| type | string | Risk type | ContentModeration |
| level | string | Risk level | high |
| consumerRules | object | consumerRules | |
| pattern | string | pattern | /v1/chat/* |
| matchType | string | matchType | Exact |
| bufferLimit | integer | Buffer limit for content checking | 1000 |
| pluginStatus | object | pluginStatus | |
| errorLogs | object | errorLogs | |
| string | string | Failed to connect to server | |
| serviceHealthy | boolean | serviceHealthy | true |
| pluginId | string | pluginId | pl-123456 |
| consumerRequestCheckService | array<object> | consumerRequestCheckService | |
| object | object | ||
| name | string | Consumer name | consumer-1 |
| requestCheckService | string | requestCheckService | query_security_check |
| requestImageCheckService | string | requestImageCheckService | nsfw-image-detector |
| matchType | string | Match type | Exact |
| modalityType | string | Modality type | Text |
| consumerResponseCheckService | array<object> | consumerResponseCheckService | |
| object | object | ||
| name | string | Consumer name | consumer-1 |
| responseCheckService | string | responseCheckService | response_security_check |
| responseImageCheckService | string | responseImageCheckService | watermark-detector |
| matchType | string | Match type | Exact |
| modalityType | string | Modality type | Text |
| consumerRiskLevel | array<object> | consumerRiskLevel | |
| object | object | ||
| name | string | Consumer name | consumer-1 |
| matchType | string | Match type | Exact |
| type | string | Risk type | ContentModeration |
| level | string | Risk level | high |
| aiTokenRateLimitConfig | object | AiTokenRateLimitConfig | |
| rules | array<object> | List of rate limit rules | |
| object | object | ||
| limitType | string | Limit type | Header |
| matchKey | string | Match key | x-api-key |
| matchType | string | Match type | Exact |
| matchValue | string | Match value | test-value |
| limitMode | string | Limit mode | TokenPerSecond |
| limitValue | string | Limit value | 100 |
| enableGlobalRules | boolean | Enable global rate limit rules | true |
| globalRules | array<object> | List of global rate limit rules | |
| object | object | ||
| limitType | string | Limit type | Global |
| matchKey | string | Match key | user_id |
| matchType | string | Match type | Exact |
| matchValue | string | Match value | 12345 |
| limitMode | string | Limit mode | TokenPerSecond |
| limitValue | string | Limit value | 100 |
| redisConfig | object | Redis Config | |
| host | string | Redis host | redis.example.com |
| port | integer | Redis port | 6379 |
| username | string | Redis username | username |
| password | string | Redis password | ****** |
| timeout | integer | Redis timeout | 60 |
| databaseNumber | integer | Redis database number | 1 |
| pluginStatus | object | pluginStatus | |
| errorLogs | object | Array of plugin execution error logs | |
| string | string | auth-failed | |
| serviceHealthy | boolean | Health status of the cache service | true |
| pluginId | string | Plugin instance unique identifier | pl-123456 |
| aiCacheConfig | object | AiCacheConfig | |
| cacheTTL | integer | Cache time-to-live in seconds | 3600 |
| redisConfig | object | Redis configuration for cache storage | |
| host | string | Redis host | redis.example.com |
| port | integer | Redis port | 6379 |
| username | string | Redis username | username |
| password | string | Redis password | ****** |
| timeout | integer | Redis timeout | 60 |
| databaseNumber | integer | Redis database number | 1 |
| vectorConfig | object | vectorConfig | |
| type | string | Vector database service type | dashvector |
| serviceHost | string | Vector database service host address | vec.example.com |
| apiKey | string | Vector database API key for authentication | vec-api-key-123 |
| timeout | integer | Vector database request timeout in milliseconds | 1000 |
| collectionId | string | Vector database collection ID for storing vector embeddings | col-1 |
| threshold | float | Similarity threshold for semantic matching | 0.8 |
| embeddingConfig | object | Embedding Config | |
| type | string | Embedding service provider type | dashscope |
| serviceId | string | Embedding service ID | svc-1 |
| timeout | integer | Embedding service request timeout in milliseconds | 2000 |
| modelName | string | Embedding model name | model-1 |
| cacheKeyStrategy | string | Strategy for generating cache keys | default |
| cacheMode | string | Cache mode type | exact |
| pluginStatus | object | pluginStatus | |
| errorLogs | object | errorLogs | |
| string | string | timeout | |
| serviceHealthy | boolean | serviceHealthy | true |
| pluginId | string | pluginId | pl-123456 |
| aiNetworkSearchConfig | object | AiNetworkSearchConfig | |
| needReference | boolean | Add reference sources in answer | true |
| referenceFormat | string | Reference format | Reference: %s |
| referenceLocation | string | Reference location | head |
| defaultLang | string | Default search language code | zh-CN |
| defaultEnable | boolean | Default enable | true |
| searchFrom | array<object> | Search engine list | |
| object | object | ||
| type | string | Search engine type | Bing |
| apiKey | string | Search engine API key | xxx |
| count | integer | Result count | 10 |
| start | integer | Result offset | 0 |
| timeoutMillisecond | integer | API call timeout in milliseconds | 5000 |
| optionArgs | object | Additional parameters | |
| string | string | value | |
| endpoint | string | Search engine endpoint | ******-hangzhou.aliyuncs.com |
| contentMode | string | Content mode | summary |
| industry | string | Industry | tech |
| timeRange | string | Time range | 7d |
| searchEngineConfig | object | Search engine configuration | |
| type | string | Search engine type: Bing/aliyunQuark | Bing |
| apiKey | string | Search engine API key | xxx |
| count | integer | Result count | 10 |
| start | integer | Result offset | 0 |
| timeoutMillisecond | integer | API call timeout in milliseconds | 5000 |
| optionArgs | object | Additional parameters | |
| string | string | value | |
| endpoint | string | Search engine endpoint | ******-hangzhou.aliyuncs.com |
| contentMode | string | Content mode | summary |
| industry | string | Industry | tech |
| timeRange | string | Time range | 7d |
| searchRewrite | object | Search rewrite configuration | |
| enable | boolean | Enable search rewrite | true |
| serviceId | string | Service ID | svc-123456 |
| modelName | string | Model name | qwen-turbo |
| timeoutMillisecond | integer | Timeout in milliseconds | 5000 |
| maxCount | integer | Max rewrite count (1-5) | 3 |
| pluginStatus | object | pluginStatus | |
| errorLogs | object | errorLogs | |
| string | string | timeout | |
| serviceHealthy | boolean | serviceHealthy | true |
| pluginId | string | pluginId | pl-123456 |
| aiToolSelectionConfig | object | AiToolSelectionConfig | |
| enableConditions | object | Enable conditions configuration | |
| toolCountThreshold | integer | Tool count threshold | 10 |
| toolReranking | object | Tool reranking configuration | |
| modelService | object | Model service configuration | |
| serviceId | string | Service ID | svc-123456 |
| modelName | string | Model name | gte-rerank-v2 |
| timeoutMillisecond | integer | Timeout in milliseconds | 5000 |
| filteringMethod | string | Filtering method: topK/topN/combined | topK |
| topKPercent | integer | TopK percentage (1-100) | 50 |
| topNCount | integer | TopN count | 5 |
| scoreThreshold | float | Score threshold (0.0-1.0, 0 means disabled) | 0.5 |
| fallbackStrategy | string | Fallback strategy: skip/error | skip |
| queryRewriting | object | Query rewriting configuration | |
| enabled | boolean | Enable query rewriting | true |
| modelService | object | Model service configuration | |
| serviceId | string | Service ID | svc-123456 |
| modelName | string | Model name | qwen-turbo |
| timeoutMillisecond | integer | Timeout in milliseconds | 5000 |
| promptConfig | object | Prompt configuration | |
| type | string | Prompt type: builtIn/custom | builtIn |
| customPrompt | string | Custom prompt (required when type=custom) | Custom prompt |
| maxOutputTokens | integer | Max output tokens | 50 |
| triggerConditions | object | Trigger conditions | |
| messageCountThreshold | integer | Message count threshold (≥0) | 1 |
| contextSelection | object | Context selection | |
| type | string | Context type | recentMessages |
| value | integer | Value | 5 |
| fallbackStrategy | string | Fallback strategy | skip |
| pluginStatus | object | Plugin status | |
| errorLogs | object | errorLogs | |
| string | string | timeout | |
| serviceHealthy | boolean | serviceHealthy | true |
| pluginId | string | pluginId | pl-123456 |
| aiStatisticsConfig | object | AiStatisticsConfig | |
| logRequestContent | boolean | Log request content | true |
| logResponseContent | boolean | Log response content | true |
| semanticRouterConfig | object | SemanticRouterConfig | |
| timeoutMillisecond | integer | Timeout in milliseconds | 2000 |