{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bookmyhost/json-schema/bookmyhost-test-policies-and-guardrails-request-schema.json",
  "title": "TestPoliciesAndGuardrailsRequest",
  "description": "Request body for POST /utils/test_policies_and_guardrails.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookmyhost-policies-api-openapi.yml#/components/schemas/TestPoliciesAndGuardrailsRequest",
  "properties": {
    "agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "When set, call chat completion with this model/agent for each input and include the response in the result.",
      "title": "Agent Id"
    },
    "guardrail_names": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "description": "Guardrail names to apply directly",
      "title": "Guardrail Names"
    },
    "input_type": {
      "default": "request",
      "description": "Whether inputs are request or response",
      "enum": [
        "request",
        "response"
      ],
      "title": "Input Type",
      "type": "string"
    },
    "inputs_list": {
      "default": [],
      "description": "List of GenericGuardrailAPIInputs; each item processed separately (for batch compliance testing).",
      "items": {
        "$ref": "#/$defs/GenericGuardrailAPIInputs"
      },
      "title": "Inputs List",
      "type": "array"
    },
    "policy_names": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "description": "Policy names to resolve guardrails from",
      "title": "Policy Names"
    },
    "request_data": {
      "additionalProperties": true,
      "description": "Request context (model, user_id, etc.)",
      "title": "Request Data",
      "type": "object"
    }
  },
  "type": "object",
  "$defs": {
    "ChatCompletionAssistantMessage": {
      "properties": {
        "role": {
          "const": "assistant",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ChatCompletionTextObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionThinkingBlock"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionRedactedThinkingBlock"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionImageObject"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionAssistantToolCall"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Calls"
        },
        "function_call": {
          "anyOf": [
            {
              "$ref": "#/$defs/ChatCompletionToolCallFunctionChunk"
            },
            {
              "type": "null"
            }
          ]
        },
        "reasoning_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning Content"
        },
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        },
        "thinking_blocks": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ChatCompletionThinkingBlock"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionRedactedThinkingBlock"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Thinking Blocks"
        },
        "reasoning_items": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionReasoningItem"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning Items"
        }
      },
      "required": [
        "role"
      ],
      "title": "ChatCompletionAssistantMessage",
      "type": "object"
    },
    "ChatCompletionAssistantToolCall": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "type": {
          "const": "function",
          "title": "Type",
          "type": "string"
        },
        "function": {
          "$ref": "#/$defs/ChatCompletionToolCallFunctionChunk"
        }
      },
      "required": [
        "id",
        "type",
        "function"
      ],
      "title": "ChatCompletionAssistantToolCall",
      "type": "object"
    },
    "ChatCompletionAudioObject": {
      "properties": {
        "input_audio": {
          "$ref": "#/$defs/InputAudio"
        },
        "type": {
          "const": "input_audio",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "input_audio",
        "type"
      ],
      "title": "ChatCompletionAudioObject",
      "type": "object"
    },
    "ChatCompletionCachedContent": {
      "properties": {
        "type": {
          "const": "ephemeral",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ChatCompletionCachedContent",
      "type": "object"
    },
    "ChatCompletionDeveloperMessage": {
      "properties": {
        "role": {
          "const": "developer",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {},
              "type": "array"
            }
          ],
          "title": "Content"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "ChatCompletionDeveloperMessage",
      "type": "object"
    },
    "ChatCompletionDocumentObject": {
      "properties": {
        "type": {
          "const": "document",
          "title": "Type",
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/DocumentObject"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "context": {
          "title": "Context",
          "type": "string"
        },
        "citations": {
          "anyOf": [
            {
              "$ref": "#/$defs/CitationsObject"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type",
        "source",
        "title",
        "context",
        "citations"
      ],
      "title": "ChatCompletionDocumentObject",
      "type": "object"
    },
    "ChatCompletionFileObject": {
      "properties": {
        "type": {
          "const": "file",
          "title": "Type",
          "type": "string"
        },
        "file": {
          "$ref": "#/$defs/ChatCompletionFileObjectFile"
        }
      },
      "required": [
        "type",
        "file"
      ],
      "title": "ChatCompletionFileObject",
      "type": "object"
    },
    "ChatCompletionFileObjectFile": {
      "properties": {
        "file_data": {
          "title": "File Data",
          "type": "string"
        },
        "file_id": {
          "title": "File Id",
          "type": "string"
        },
        "filename": {
          "title": "Filename",
          "type": "string"
        },
        "format": {
          "title": "Format",
          "type": "string"
        },
        "detail": {
          "title": "Detail",
          "type": "string"
        },
        "video_metadata": {
          "additionalProperties": true,
          "title": "Video Metadata",
          "type": "object"
        }
      },
      "title": "ChatCompletionFileObjectFile",
      "type": "object"
    },
    "ChatCompletionFunctionMessage": {
      "properties": {
        "role": {
          "const": "function",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionTextObject"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "tool_call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Call Id"
        }
      },
      "required": [
        "role",
        "content",
        "name",
        "tool_call_id"
      ],
      "title": "ChatCompletionFunctionMessage",
      "type": "object"
    },
    "ChatCompletionImageObject": {
      "properties": {
        "type": {
          "const": "image_url",
          "title": "Type",
          "type": "string"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/ChatCompletionImageUrlObject"
            }
          ],
          "title": "Image Url"
        }
      },
      "required": [
        "type",
        "image_url"
      ],
      "title": "ChatCompletionImageObject",
      "type": "object"
    },
    "ChatCompletionImageUrlObject": {
      "properties": {
        "url": {
          "title": "Url",
          "type": "string"
        },
        "detail": {
          "title": "Detail",
          "type": "string"
        },
        "format": {
          "title": "Format",
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "title": "ChatCompletionImageUrlObject",
      "type": "object"
    },
    "ChatCompletionMessageToolCall": {
      "properties": {},
      "additionalProperties": true,
      "type": "object",
      "title": "ChatCompletionMessageToolCall"
    },
    "ChatCompletionReasoningItem": {
      "description": "Represents an OpenAI Responses API reasoning item for round-tripping in conversation history.",
      "properties": {
        "type": {
          "const": "reasoning",
          "title": "Type",
          "type": "string"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "encrypted_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Encrypted Content"
        },
        "summary": {
          "items": {
            "$ref": "#/$defs/ChatCompletionReasoningSummaryTextBlock"
          },
          "title": "Summary",
          "type": "array"
        }
      },
      "required": [
        "type"
      ],
      "title": "ChatCompletionReasoningItem",
      "type": "object"
    },
    "ChatCompletionReasoningSummaryTextBlock": {
      "properties": {
        "type": {
          "const": "summary_text",
          "title": "Type",
          "type": "string"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "title": "ChatCompletionReasoningSummaryTextBlock",
      "type": "object"
    },
    "ChatCompletionRedactedThinkingBlock": {
      "properties": {
        "type": {
          "const": "redacted_thinking",
          "title": "Type",
          "type": "string"
        },
        "data": {
          "title": "Data",
          "type": "string"
        },
        "cache_control": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "$ref": "#/$defs/ChatCompletionCachedContent"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cache Control"
        }
      },
      "required": [
        "type"
      ],
      "title": "ChatCompletionRedactedThinkingBlock",
      "type": "object"
    },
    "ChatCompletionSystemMessage": {
      "properties": {
        "role": {
          "const": "system",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {},
              "type": "array"
            }
          ],
          "title": "Content"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "ChatCompletionSystemMessage",
      "type": "object"
    },
    "ChatCompletionTextObject": {
      "properties": {
        "type": {
          "const": "text",
          "title": "Type",
          "type": "string"
        },
        "text": {
          "title": "Text",
          "type": "string"
        },
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "title": "ChatCompletionTextObject",
      "type": "object"
    },
    "ChatCompletionThinkingBlock": {
      "properties": {
        "type": {
          "const": "thinking",
          "title": "Type",
          "type": "string"
        },
        "thinking": {
          "title": "Thinking",
          "type": "string"
        },
        "signature": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Signature"
        },
        "cache_control": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "$ref": "#/$defs/ChatCompletionCachedContent"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cache Control"
        }
      },
      "required": [
        "type"
      ],
      "title": "ChatCompletionThinkingBlock",
      "type": "object"
    },
    "ChatCompletionToolCallChunk": {
      "properties": {
        "function": {
          "$ref": "#/$defs/ChatCompletionToolCallFunctionChunk"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "index": {
          "title": "Index",
          "type": "integer"
        },
        "type": {
          "const": "function",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type",
        "function",
        "index"
      ],
      "title": "ChatCompletionToolCallChunk",
      "type": "object"
    },
    "ChatCompletionToolCallFunctionChunk": {
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "arguments": {
          "title": "Arguments",
          "type": "string"
        },
        "provider_specific_fields": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Specific Fields"
        }
      },
      "title": "ChatCompletionToolCallFunctionChunk",
      "type": "object"
    },
    "ChatCompletionToolMessage": {
      "properties": {
        "role": {
          "const": "tool",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionTextObject"
              },
              "type": "array"
            }
          ],
          "title": "Content"
        },
        "tool_call_id": {
          "title": "Tool Call Id",
          "type": "string"
        }
      },
      "required": [
        "role",
        "content",
        "tool_call_id"
      ],
      "title": "ChatCompletionToolMessage",
      "type": "object"
    },
    "ChatCompletionToolParam": {
      "properties": {
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        },
        "function": {
          "$ref": "#/$defs/ChatCompletionToolParamFunctionChunk"
        },
        "type": {
          "anyOf": [
            {
              "const": "function",
              "type": "string"
            },
            {
              "type": "string"
            }
          ],
          "title": "Type"
        }
      },
      "required": [
        "type",
        "function"
      ],
      "title": "ChatCompletionToolParam",
      "type": "object"
    },
    "ChatCompletionToolParamFunctionChunk": {
      "properties": {
        "description": {
          "title": "Description",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "parameters": {
          "additionalProperties": true,
          "title": "Parameters",
          "type": "object"
        },
        "strict": {
          "title": "Strict",
          "type": "boolean"
        }
      },
      "required": [
        "name"
      ],
      "title": "ChatCompletionToolParamFunctionChunk",
      "type": "object"
    },
    "ChatCompletionUserMessage": {
      "properties": {
        "role": {
          "const": "user",
          "title": "Role",
          "type": "string"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/ChatCompletionTextObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionImageObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionAudioObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionDocumentObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionVideoObject"
                  },
                  {
                    "$ref": "#/$defs/ChatCompletionFileObject"
                  }
                ]
              },
              "type": "array"
            }
          ],
          "title": "Content"
        },
        "cache_control": {
          "$ref": "#/$defs/ChatCompletionCachedContent"
        }
      },
      "required": [
        "role",
        "content"
      ],
      "title": "ChatCompletionUserMessage",
      "type": "object"
    },
    "ChatCompletionVideoObject": {
      "properties": {
        "type": {
          "const": "video_url",
          "title": "Type",
          "type": "string"
        },
        "video_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/ChatCompletionVideoUrlObject"
            }
          ],
          "title": "Video Url"
        }
      },
      "required": [
        "type",
        "video_url"
      ],
      "title": "ChatCompletionVideoObject",
      "type": "object"
    },
    "ChatCompletionVideoUrlObject": {
      "properties": {
        "url": {
          "title": "Url",
          "type": "string"
        },
        "detail": {
          "title": "Detail",
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "title": "ChatCompletionVideoUrlObject",
      "type": "object"
    },
    "CitationsObject": {
      "properties": {
        "enabled": {
          "title": "Enabled",
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "title": "CitationsObject",
      "type": "object"
    },
    "DocumentObject": {
      "properties": {
        "type": {
          "const": "text",
          "title": "Type",
          "type": "string"
        },
        "media_type": {
          "title": "Media Type",
          "type": "string"
        },
        "data": {
          "title": "Data",
          "type": "string"
        }
      },
      "required": [
        "type",
        "media_type",
        "data"
      ],
      "title": "DocumentObject",
      "type": "object"
    },
    "GenericGuardrailAPIInputs": {
      "properties": {
        "images": {
          "items": {
            "type": "string"
          },
          "title": "Images",
          "type": "array"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model"
        },
        "structured_messages": {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/ChatCompletionUserMessage"
              },
              {
                "$ref": "#/$defs/ChatCompletionAssistantMessage"
              },
              {
                "$ref": "#/$defs/ChatCompletionToolMessage"
              },
              {
                "$ref": "#/$defs/ChatCompletionSystemMessage"
              },
              {
                "$ref": "#/$defs/ChatCompletionFunctionMessage"
              },
              {
                "$ref": "#/$defs/ChatCompletionDeveloperMessage"
              }
            ]
          },
          "title": "Structured Messages",
          "type": "array"
        },
        "texts": {
          "items": {
            "type": "string"
          },
          "title": "Texts",
          "type": "array"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionToolCallChunk"
              },
              "type": "array"
            },
            {
              "items": {
                "$ref": "#/$defs/ChatCompletionMessageToolCall"
              },
              "type": "array"
            }
          ],
          "title": "Tool Calls"
        },
        "tools": {
          "items": {
            "$ref": "#/$defs/ChatCompletionToolParam"
          },
          "title": "Tools",
          "type": "array"
        }
      },
      "title": "GenericGuardrailAPIInputs",
      "type": "object"
    },
    "InputAudio": {
      "properties": {
        "data": {
          "title": "Data",
          "type": "string"
        },
        "format": {
          "enum": [
            "wav",
            "mp3"
          ],
          "title": "Format",
          "type": "string"
        }
      },
      "required": [
        "data",
        "format"
      ],
      "title": "InputAudio",
      "type": "object"
    }
  }
}