{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"after_request_hooks": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"async": {
"type": "boolean"
},
"on_fail": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
}
}
},
"on_success": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
}
}
},
"checks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"parameters": {
"type": "object"
}
},
"required": ["id", "parameters"]
}
}
},
"required": ["id"]
}
},
"input_guardrails": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"deny": {
"type": "boolean"
},
"on_fail": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
}
}
},
"on_success": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
}
}
},
"async": {
"type": "boolean"
}
},
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
{
"type": "string"
}
]
}
},
"output_guardrails": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"deny": {
"type": "boolean"
},
"on_fail": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
},
"deny": {
"type": "boolean"
}
}
},
"on_success": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
},
"deny": {
"type": "boolean"
}
}
},
"async": {
"type": "boolean"
}
},
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
{
"type": "string"
}
]
}
},
"before_request_hooks": {
"type": "array",
"items": {
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string"
},
"on_fail": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
},
"deny": {
"type": "boolean"
}
}
},
"on_success": {
"type": "object",
"properties": {
"feedback": {
"type": "object",
"properties": {
"value": {
"type": "number"
},
"weight": {
"type": "number"
},
"metadata": {
"type": "object"
}
}
},
"deny": {
"type": "boolean"
}
}
},
"checks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"parameters": {
"type": "object"
}
},
"required": ["id", "parameters"]
}
}
},
"required": ["id"]
}
},
"strategy": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["single", "loadbalance", "fallback", "conditional"]
},
"conditions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"query": {
"type": "object"
},
"then": {
"type": "string"
}
},
"required": ["query", "then"]
}
},
"default": {
"type": "string"
},
"on_status_codes": {
"type": "array",
"items": {
"type": "integer"
},
"optional": true
}
},
"allOf": [
{
"if": {
"properties": {
"mode": {
"const": "conditional"
}
}
},
"then": {
"required": ["conditions", "default"]
}
}
],
"required": ["mode"]
},
"name": {
"type": "string"
},
"strict_open_ai_compliance": {
"type": "boolean"
},
"provider": {
"type": "string"
},
"resource_name": {
"type": "string",
"optional": true
},
"deployment_id": {
"type": "string",
"optional": true
},
"api_version": {
"type": "string",
"optional": true
},
"deployments": {
"type": "array",
"optional": true,
"items": {
"type": "object",
"properties": {
"deployment_id": {
"type": "string"
},
"alias": {
"type": "string"
},
"api_version": {
"type": "string"
},
"is_default": {
"type": "boolean"
}
},
"required": ["deployment_id", "alias", "api_version"]
}
},
"override_params": {
"type": "object"
},
"api_key": {
"type": "string"
},
"virtual_key": {
"type": "string"
},
"prompt_id": {
"type": "string"
},
"request_timeout": {
"type": "integer"
},
"cache": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["simple", "semantic"]
},
"max_age": {
"type": "integer",
"optional": true
}
},
"required": ["mode"]
},
"cb_config": {
"type": "object",
"properties": {
"failure_threshold": {
"type": "number",
"minimum": 1
},
"cooldown_interval": {
"type": "number",
"minimum": 30000
},
"failure_status_codes": {
"type": "array",
"items": {
"type": "integer"
},
"optional": true
}
},
"required": ["failure_threshold", "cooldown_interval"]
},
"retry": {
"type": "object",
"properties": {
"attempts": {
"type": "integer"
},
"use_retry_after_headers": {
"type": "boolean"
},
"on_status_codes": {
"type": "array",
"items": {
"type": "number"
},
"optional": true
}
},
"required": ["attempts"]
},
"weight": {
"type": "number"
},
"on_status_codes": {
"type": "array",
"items": {
"type": "integer"
}
},
"custom_host": {
"type": "string"
},
"forward_headers": {
"type": "array",
"items": {
"type": "string"
}
},
"targets": {
"type": "array",
"items": {
"$ref": "#"
}
},
"aws_access_key_id": {
"type": "string"
},
"aws_secret_access_key": {
"type": "string"
},
"aws_region": {
"type": "string"
},
"aws_session_token": {
"type": "string"
},
"openai_organization": {
"type": "string"
},
"openai_project": {
"type": "string"
},
"vertex_project_id": {
"type": "string"
},
"vertex_region": {
"type": "string"
},
"vertex_service_account_json": {
"type": "object"
},
"azure_region": {
"type": "string"
},
"azure_deployment_name": {
"type": "string"
},
"azure_deployment_type": {
"type": "string",
"enum": ["serverless", "managed"]
},
"azure_endpoint_name": {
"type": "string"
},
"azure_api_version": {
"type": "string"
}
},
"anyOf": [
{
"required": ["provider", "api_key"]
},
{
"required": ["provider", "custom_host"]
},
{
"required": ["virtual_key"]
},
{
"required": ["strategy", "targets"]
},
{
"required": ["cache"]
},
{
"required": ["retry"]
},
{
"required": ["prompt_id"]
},
{
"required": ["forward_headers"]
},
{
"required": ["request_timeout"]
},
{
"required": ["provider", "aws_access_key_id", "aws_secret_access_key"]
},
{
"required": ["provider", "vertex_region", "vertex_service_account_json"]
},
{
"required": ["provider", "vertex_region", "vertex_project_id"]
},
{
"required": [
"provider",
"azure_deployment_name",
"azure_deployment_type",
"azure_region",
"azure_api_version"
]
},
{
"required": ["provider", "azure_endpoint_name", "azure_deployment_type"]
},
{
"required": ["after_request_hooks"]
},
{
"required": ["before_request_hooks"]
},
{
"required": ["input_guardrails"]
},
{
"required": ["output_guardrails"]
}
],
"additionalProperties": false
}