{
    "openapi": "3.0.2",
    "info": {
        "title": "API Reference",
        "description": "Private AI API Reference",
        "termsOfService": "https://www.private-ai.com/terms-of-use/",
        "contact": {
            "url": "https://www.private-ai.com/contact/",
            "email": "info@private-ai.com"
        },
        "version": "3.3.3"
    },
    "servers": [
        {
            "url": "https://api.private-ai.com/deid",
            "description": "Private AI Demo Server"
        },
        {
            "url": "http://localhost:8080",
            "description": "Local Server"
        }
    ],
    "paths": {
        "/metrics": {
            "get": {
                "summary": "Metrics",
                "description": "This endpoint serves Prometheus metrics via a HTTP-based interface that provides access to metrics data in a format suitable for scraping by Prometheus servers. The endpoint provides real-time insights into how the system is functioning. The endpoint exposed the metrics in a time-series format, allowing you to track various types of data, including system resources usage, application performance, and other custom metrics.\n\nCurrently following metrics are available:\n* **cpu_usage_percent** (_CPU usage in percentage._)\n* **cpu_memory_used_bytes** (_Used CPU memory, in bytes._)\n* **cpu_memory_total_bytes** (_Total CPU memory, in bytes._)\n* **cpu_load_percent** (_CPU load, in percentage. Calculated for last 1m, 5m & 15m._)\n* **http_request_size_bytes** (_HTTP request sizes in bytes grouped by method, status and handler._)\n* **http_requests_total** (_Total number of requests grouped by method, status and handler._)\n* **http_request_duration_seconds** (_The HTTP request latencies in seconds._)",
                "operationId": "metrics_metrics_get",
                "x-hideTryItPanel": true,
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "# HELP cpu_usage_percent Multiprocess metric\n# TYPE cpu_usage_percent gauge\ncpu_usage_percent 53.9\n# HELP cpu_memory_used_bytes Multiprocess metric\n# TYPE cpu_memory_used_bytes gauge\ncpu_memory_used_bytes 2.260492288e+010\n# HELP cpu_memory_total_bytes Multiprocess metric\n# TYPE cpu_memory_total_bytes gauge\ncpu_memory_total_bytes 6.7373068288e+010\n# HELP cpu_load_percent Multiprocess metric\n# TYPE cpu_load_percent gauge\ncpu_load_percent{duration=\"1m\"} 1.1666666666666667cpu_load_percent{duration=\"5m\"} 0.8333333333333334cpu_load_percent{duration=\"15m\"} 0.9583333333333335# HELP http_request_size_bytes Multiprocess metric\n# TYPE http_request_size_bytes summary\nhttp_request_size_bytes_count{handler=\"/v3/process/text\",method=\"GET\",status=\"2xx\"} 3.0\n# HELP http_requests_total Multiprocess metric\n# TYPE http_requests_total counter\nhttp_requests_total{handler=\"/v3/process/text\",method=\"POST\",status=\"2xx\"} 3.0\n# HELP http_request_duration_seconds Multiprocess metric\n# TYPE http_request_duration_seconds histogram\nhttp_request_duration_seconds_sum{handler=\"/v3/process/text\",method=\"POST\",status=\"2xx\"} 0.8316442219074816\nhttp_request_duration_seconds_bucket{handler=\"/v3/process/text\",le=\"0.1\",method=\"POST\",status=\"2xx\"} 0.0\nhttp_request_duration_seconds_bucket{handler=\"/v3/process/text\",le=\"0.25\",method=\"POST\",status=\"2xx\"} 2.0\nhttp_request_duration_seconds_bucket{handler=\"/v3/process/text\",le=\"0.5\",method=\"POST\",status=\"2xx\"} 3.0\nhttp_request_duration_seconds_bucket{handler=\"/v3/process/text\",le=\"1.0\",method=\"POST\",status=\"2xx\"} 3.0\nhttp_request_duration_seconds_count{handler=\"/v3/process/text\",method=\"POST\",status=\"2xx\"} 3.0"
                            }
                        }
                    }
                }
            }
        },
        "/": {
            "get": {
                "summary": "Get Version",
                "description": "Return the version of the container application code",
                "operationId": "get_version__get",
                "x-hideTryItPanel": true,
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VersionResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/healthz": {
            "get": {
                "summary": "Healthz",
                "description": "Check the health of the container.",
                "operationId": "healthz_healthz_get",
                "x-hideTryItPanel": true,
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HealthzResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/diagnostics": {
            "get": {
                "summary": "Diagnostics",
                "description": "Get diagnostic information for the container.",
                "operationId": "diagnostics_diagnostics_get",
                "x-hideTryItPanel": true,
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DiagnosticResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v3/process/text": {
            "post": {
                "summary": "Process Text",
                "description": "Detect entities such as PII, PHI or PCI in the provided text strings using Private AI's entity detection engine. After entity detection, any entities found can be redacted, masked or replaced with AI-generated synthetic entities.",
                "operationId": "process_text_v3_process_text_post",
                "parameters": [
                    {
                        "required": false,
                        "schema": {
                            "title": "X-Api-Key",
                            "type": "string",
                            "default": ""
                        },
                        "name": "x-api-key",
                        "in": "header"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ProcessTextRequest"
                            },
                            "examples": {
                                "simple_deidentification": {
                                    "summary": "Simple De-Identification",
                                    "value": {
                                        "text": [
                                            "Hello John and Jane"
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "synthetic_deidentification": {
                                    "summary": "Synthetic PII",
                                    "value": {
                                        "text": [
                                            "Hello, my name is May. I am the aunt of Pieter Parker. We live in Toronto, Canada."
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "SYNTHETIC",
                                            "synthetic_entity_accuracy": "standard",
                                            "preserve_relationships": true
                                        }
                                    }
                                },
                                "enabled_entity_types": {
                                    "summary": "Enabled Entity Types",
                                    "value": {
                                        "text": [
                                            "Hello, My name is Mike and I am 24 years old"
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "entity_types": [
                                                {
                                                    "type": "ENABLE",
                                                    "value": [
                                                        "NAME"
                                                    ]
                                                }
                                            ],
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "allow_list": {
                                    "summary": "Allow List",
                                    "value": {
                                        "text": [
                                            "Hello Xavier, I broke my right leg on the 31st. Id of PAI is PAI_ID-44444 yeah, my birthday, My id is 78549 and I'm waiting for my x-ray results. dr. zhang, mercer health centre."
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "filter": [
                                                {
                                                    "type": "ALLOW",
                                                    "pattern": "PAI_ID-\\d{5}"
                                                }
                                            ],
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "block_list": {
                                    "summary": "Block List",
                                    "value": {
                                        "text": [
                                            "Hello Xavier, I broke my right leg on the 31st. Id of PAI is PAI_ID-44444 yeah, my birthday, My id is 78549 and I'm waiting for my x-ray results. dr. zhang, mercer health centre."
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "filter": [
                                                {
                                                    "type": "BLOCK",
                                                    "entity_type": "MY_5_DIGIT_PAI_ID",
                                                    "pattern": "PAI_ID-\\d{5}"
                                                }
                                            ],
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "link_batch": {
                                    "summary": "Link Batch",
                                    "value": {
                                        "text": [
                                            "Hi, my name is Penelope, could you tell me your phone number please?",
                                            "Sure, x234",
                                            "and your DOB please?",
                                            "fourth of Feb nineteen 86"
                                        ],
                                        "link_batch": true,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "masked_pii": {
                                    "summary": "Masked PII",
                                    "value": {
                                        "text": [
                                            "Hello John and Jane"
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MASK",
                                            "mask_character": "#"
                                        }
                                    }
                                },
                                "multiple_input": {
                                    "summary": "Multiple Input",
                                    "value": {
                                        "text": [
                                            "Hello John and Jane",
                                            "Mark is 42 years old"
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                                        }
                                    }
                                },
                                "non_unique_pii_markers": {
                                    "summary": "Non Unique PII Markers",
                                    "value": {
                                        "text": [
                                            "Hello John and Jane"
                                        ],
                                        "link_batch": false,
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "processed_text": {
                                            "type": "MARKER",
                                            "pattern": "[BEST_ENTITY_TYPE]"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProcessTextResponse"
                                }
                            }
                        }
                    },
                    "4XX": {
                        "description": "Client Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserErrorResponseModel"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserErrorResponseModel"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalErrorResponseModel"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v3/process/text/reidentify": {
            "post": {
                "summary": "Reidentify Text",
                "description": "This route is intended to improve integrations with LLMs such as ChatGPT. Entities that are removed prior to sending to the LLM can be re-injected into the response from the LLM to improve user experience.",
                "operationId": "reidentify_text_v3_process_text_reidentify_post",
                "parameters": [
                    {
                        "required": false,
                        "schema": {
                            "title": "X-Api-Key",
                            "type": "string",
                            "default": ""
                        },
                        "name": "x-api-key",
                        "in": "header"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ReIdentifyTextRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "title": "Response 200 Reidentify Text V3 Process Text Reidentify Post",
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "4XX": {
                        "description": "Client Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserErrorResponseModel"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserErrorResponseModel"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalErrorResponseModel"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v3/process/files/uri": {
            "post": {
                "summary": "Process Files Uri",
                "description": "Detect entities such as PII, PHI or PCI in the file located at the provided URI using Private AI's entity detection engine. After entity detection, a copy of the file with all entities removed is created and placed in the folder specified by `PAI_OUTPUT_FILE_DIR` on the local host.\n\nThis route is similar to `/v3/process/files/base64`, but relies on URIs instead of base64-encoded strings. As this route avoids the overhead of base64 encoding, it is more suitable for processing large files and large volumes of data.\n\nThis route supports the following content types: application/json, application/msword, application/pdf, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/xml, message/rfc822, text/csv, text/plain, jpeg, jpeg, tiff, tiff, png, bmp, bmp, mp4, m4a, m4a, mp3, mp3, wav, wav",
                "operationId": "process_files_uri_v3_process_files_uri_post",
                "parameters": [
                    {
                        "required": false,
                        "schema": {
                            "title": "X-Api-Key",
                            "type": "string",
                            "default": ""
                        },
                        "name": "x-api-key",
                        "in": "header"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ProcessFileRequest"
                            },
                            "examples": {
                                "process_files": {
                                    "summary": "Process File with uri payload",
                                    "value": {
                                        "uri": "/home/azureuser/example-image.jpeg",
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProcessFileResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v3/process/files/base64": {
            "post": {
                "summary": "Process Files Base64",
                "description": "Detect entities such as PII, PHI or PCI in a base64-encoded file using Private AI's entity detection engine. After entity detection, a copy of the file with all entities removed is created and returned.\n\nThis route is similar to `/v3/process/files/uri`, but passes the file in the POST request itself. This route allows for simple setup and testing, as no folders or volumes need to be mounted to the container.\n\nThis route supports the following content types: application/json, application/msword, application/pdf, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/xml, message/rfc822, text/csv, text/plain, jpeg, jpeg, tiff, tiff, png, bmp, bmp, mp4, m4a, m4a, mp3, mp3, wav, wav",
                "operationId": "process_files_base64_v3_process_files_base64_post",
                "parameters": [
                    {
                        "required": false,
                        "schema": {
                            "title": "X-Api-Key",
                            "type": "string",
                            "default": ""
                        },
                        "name": "x-api-key",
                        "in": "header"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ProcessFileRequestBase64"
                            },
                            "examples": {
                                "process_file": {
                                    "summary": "Process File with base64-encoded payload",
                                    "value": {
                                        "file": {
                                            "data": "JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9UaXRsZSAoc2FtcGxlKQovUHJvZHVj...",
                                            "content_type": "application/pdf or image/jpeg"
                                        },
                                        "entity_detection": {
                                            "accuracy": "high",
                                            "return_entity": true
                                        },
                                        "pdf_options": {
                                            "density": 150,
                                            "max_resolution": 2000
                                        },
                                        "audio_options": {
                                            "bleep_start_padding": 0,
                                            "bleep_end_padding": 0
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProcessFileResponseBase64"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v3/bleep": {
            "post": {
                "summary": "Bleep",
                "description": "Bleep an audio given the timestamps to bleep.",
                "operationId": "bleep_v3_bleep_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BleepRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/BleepResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AccuracyMode": {
                "title": "AccuracyMode",
                "enum": [
                    "standard",
                    "standard_high",
                    "standard_high_multilingual",
                    "high",
                    "high_multilingual"
                ],
                "type": "string",
                "description": "Selects the model used to identify PII in the input text. By default, the \"high\" accuracy model is used. While the models used by the Private AI solution are highly optimized (~25X faster than a reference transformer implementation), in high-throughput cases it is possible to trade accuracy for speed by selecting either the \"standard\" or \"standard_high\" accuracy modes. Multilingual support can be enabled by using one of the multilingual models, namely \"standard_high_multilingual\" (GPU container only) and \"high_multilingual\". The multilingual models process all supported languages including English, without the need to specify language. It is advisable to use the English-only models where possible, as they perform slightly better on English."
            },
            "AllowFilter": {
                "title": "AllowFilter",
                "required": [
                    "pattern"
                ],
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "ALLOW"
                        ],
                        "type": "string",
                        "description": "Any entities in this list that match the regex pattern provided will be discarded. It is also possible to set this option via environment variable. See [Environment Variables](https://docs.private-ai.com/environment-variables)",
                        "default": "ALLOW"                        
                    },
                    "pattern": {
                        "title": "Pattern",
                        "type": "string",
                        "description": "Any string matching this regex pattern will not be caught by the PII detection algorithm."
                    }
                },
                "additionalProperties": false
            },
            "AudioLocation": {
                "title": "AudioLocation",
                "required": [
                    "stt_time",
                    "end_time"
                ],
                "type": "object",
                "properties": {
                    "stt_time": {
                        "title": "Stt Time",
                        "type": "number",
                        "description": "The start timestamp of the entity, in seconds"
                    },
                    "end_time": {
                        "title": "End Time",
                        "type": "number",
                        "description": "The end timestamp of the entity, in seconds"
                    }
                },
                "description": "Timestamp of the entity in an audio file such as `.wav`."
            },
            "AudioOptions": {
                "title": "AudioOptions",
                "type": "object",
                "properties": {
                    "bleep_start_padding": {
                        "title": "Bleep Start Padding",
                        "minimum": 0.0,
                        "type": "number",
                        "description": "Additional padding at the start of bleep, in seconds.",
                        "default": 0
                    },
                    "bleep_end_padding": {
                        "title": "Bleep End Padding",
                        "minimum": 0.0,
                        "type": "number",
                        "description": "Additional padding at the end of bleep, in seconds.",
                        "default": 0
                    }
                },
                "additionalProperties": false
            },
            "BleepRequest": {
                "title": "BleepRequest",
                "required": [
                    "file",
                    "timestamps"
                ],
                "type": "object",
                "properties": {
                    "file": {
                        "title": "File",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/FileData"
                            }
                        ],
                        "description": "File object containing base64 encoded text data and its content type."
                    },
                    "timestamps": {
                        "title": "Timestamps",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PIITimestamp"
                        }
                    }
                }
            },
            "BleepResponse": {
                "title": "BleepResponse",
                "required": [
                    "bleeped_file"
                ],
                "type": "object",
                "properties": {
                    "bleeped_file": {
                        "title": "Bleeped File",
                        "type": "string",
                        "description": "the base64 encoded file content of the redacted file."
                    }
                }
            },
            "BlockFilter": {
                "title": "BlockFilter",
                "required": [
                    "entity_type",
                    "pattern"
                ],
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "BLOCK"
                        ],
                        "type": "string",
                        "description": "The block feature allows you to extend the functionality of the Private AI models by using regular expressions. This way, you can define a Python regex pattern that will be used to identify additional tokens with the given PII label.\n\nSeveral block list filters can be specified with their own regex pattern.\n\nLastly,for supported labels, if you would like the model to pick up only the tokens from the block list, you can use the enabled entity type feature together with the block list feature. This can be done by defining a list of enabled entity types and not including the supported label you are adding to the block list. For example, if you would like the label `ORGANIZATION` to only pick up Microsoft, you can define the enabled entity types as `[{\"type\":\"ENABLE\", \"value\": \"NAME\"}, {\"type\": \"ENABLE\", \"value\": \"LOCATION\"}, {\"type\": \"ENABLE\", \"value\": \"AGE\"}, ...]` (and omitting `ORGANIZATION`) and the block list as `[{\"type\": \"BLOCK\", \"entitiy_type\": \"ORGANIZATION\", \"pattern\": \"Microsoft\"}]`.",
                        "default": "BLOCK"                        
                    },
                    "entity_type": {
                        "title": "Entity Type",
                        "type": "string",
                        "description": "Name of the custom entity type. It can either be a completely new entity type such as `CUSTOM_ID` or an existing entity, such as `NAME`."
                    },
                    "pattern": {
                        "title": "Pattern",
                        "type": "string",
                        "description": "This is a pattern to match in the text. This feature uses regex patterns, you can either pass a word (e.g. the, word, custom, etc.) or you can pass a valid Python regex pattern. It is important to note that regex patterns may require escaping when used in JSON objects. To give an example, if you would like to send the regex pattern `r\"\\b\\w{4}\\b\"` which will catch every 4-character word, you need to send it as `\"\\\\b\\\\w{4}\\\\b\"`. A complete JSON grammar is found here: https://www.json.org/json-en.html. More information on how to write a python regex is found here: https://docs.python.org/3/library/re.html\n\nIt is important to note also that only non-overlapping matches are returned."
                    },
                    "threshold": {
                        "title": "Threshold",
                        "type": "number",
                        "description": "This is defining a likelihood threshold for custom entity. This likelihood is compared against the predicted model likelihood and if it is greater then the custom entity is outputted instead of the model predicted entity. By default this threshold is set to 1.0 which will ensure that the blocked entities will always be preferred over a matching model predicted entity. This can be any value between 0 and 1.",
                        "default": 1.0
                    }
                },
                "additionalProperties": false
            },
            "DiagnosticResponse": {
                "title": "DiagnosticResponse",
                "required": [
                    "platform",
                    "cpu_count",
                    "container_version",
                    "cpu_name"
                ],
                "type": "object",
                "properties": {
                    "platform": {
                        "title": "Platform",
                        "type": "string",
                        "description": "The platform on which the container is running."
                    },
                    "cpu_count": {
                        "title": "Cpu Count",
                        "type": "integer",
                        "description": "The number of CPUs allocated to the container."
                    },
                    "container_version": {
                        "title": "Container Version",
                        "type": "string",
                        "description": "The version of the container."
                    },
                    "cpu_name": {
                        "title": "Cpu Name",
                        "type": "string",
                        "description": "The name of the CPU."
                    },
                    "gpu_info": {
                        "title": "Gpu Info",
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "The uuid and name of attached GPUs."
                    }
                }
            },
            "DisableEntityTypeSelector": {
                "title": "DisableEntityTypeSelector",
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "DISABLE"
                        ],
                        "type": "string",
                        "default": "DISABLE"                        
                    },
                    "value": {
                        "title": "Value",
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "A list of entity types to ignore. See [Supported Entity Types](https://docs.private-ai.com/entities/#supported-entities) for a complete list of entity types."
                    }
                },
                "additionalProperties": false
            },
            "EnableEntityTypeSelector": {
                "title": "EnableEntityTypeSelector",
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "ENABLE"
                        ],
                        "type": "string",
                        "default": "ENABLE"                        
                    },
                    "value": {
                        "title": "Value",
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "A list of entity types to detect and remove. See [Supported Entity Types](https://docs.private-ai.com/entities/#supported-entities) for a complete list of entity types. This can also be one or many legislations. We currently support these legislations  ['GDPR', 'GDPR_SENSITIVE', 'HIPAA', 'CPRA', 'QUEBEC_PRIVACY_ACT', 'PCI', 'APPI', 'APPI_SENSITIVE', 'LIDI']."
                    }
                },
                "additionalProperties": false
            },
            "EntityItem": {
                "title": "EntityItem",
                "required": [
                    "processed_text",
                    "text",
                    "best_label",
                    "labels"
                ],
                "type": "object",
                "properties": {
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "Either the redaction marker, hash marker or synthetic entity text in `processed_text` corresponding to the entity."
                    },
                    "text": {
                        "title": "Text",
                        "type": "string",
                        "description": "The entity text. When the `return_entity` option is set to `False`, this returns a null string"
                    },
                    "location": {
                        "title": "Location",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/TextLocation"
                            }
                        ],
                        "default": "Location object containing the start-end character indexes of given and processed text."
                    },
                    "best_label": {
                        "title": "Best Label",
                        "type": "string",
                        "description": "The entity label with the highest likelihood."
                    },
                    "labels": {
                        "title": "Labels",
                        "type": "object",
                        "additionalProperties": {
                            "type": "number"
                        },
                        "description": "A dictionary containing any other labels found, together with associated likelihoods. Note that these are not strictly probabilities and do not sum to 1, as an entity can have multiple types.\n\nNote that the likelihoods have also been thresholded, so no additional thresholding is necessary."
                    }
                }
            },
            "ErrorMessage": {
                "title": "ErrorMessage",
                "type": "string",
                "description": "An error message"
            },
            "File": {
                "title": "File",
                "required": [
                    "data",
                    "content_type"
                ],
                "type": "object",
                "properties": {
                    "data": {
                        "title": "Data",
                        "type": "string",
                        "description": "Base64 encoded ASCII text data of the file to process."
                    },
                    "content_type": {
                        "title": "Content Type",
                        "type": "string",
                        "description": "Content type of the file. Currently ['application/json', 'application/msword', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/xml', 'message/rfc822', 'text/csv', 'text/plain', 'jpeg', 'jpeg', 'tiff', 'tiff', 'png', 'bmp', 'bmp', 'mp4', 'm4a', 'm4a', 'mp3', 'mp3', 'wav', 'wav'] are supported."
                    }
                },
                "additionalProperties": false
            },
            "FileData": {
                "title": "FileData",
                "required": [
                    "data",
                    "content_type"
                ],
                "type": "object",
                "properties": {
                    "data": {
                        "title": "Data",
                        "type": "string",
                        "description": "Base64 encoded ASCII text data."
                    },
                    "content_type": {
                        "title": "Content Type",
                        "type": "string",
                        "description": "Content type of the data."
                    }
                }
            },
            "FileEntityItem": {
                "title": "FileEntityItem",
                "required": [
                    "processed_text",
                    "text",
                    "location",
                    "best_label",
                    "labels"
                ],
                "type": "object",
                "properties": {
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "The corresponding marker in the de-identified text (result field), where the entity exists. Note that this field is only populated for text-based formats such as `.txt`"
                    },
                    "text": {
                        "title": "Text",
                        "type": "string",
                        "description": "The text corresponding to the entity. For images the text is obtained using OCR, while for audio the text is obtained using ASR."
                    },
                    "location": {
                        "title": "Location",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TextLocation"
                            },
                            {
                                "$ref": "#/components/schemas/ImageLocation"
                            },
                            {
                                "$ref": "#/components/schemas/AudioLocation"
                            }
                        ]
                    },
                    "best_label": {
                        "title": "Best Label",
                        "type": "string",
                        "description": "The entity label with the highest likelihood."
                    },
                    "labels": {
                        "title": "Labels",
                        "type": "object",
                        "additionalProperties": {
                            "type": "number"
                        },
                        "description": "A dictionary of all possible labels, together with associated likelihoods. Note that these are not strictly probabilities and do not sum to 1, as a word can belong to multiple classes. The scores have also been thresholded, so no additional thresholding is necessary."
                    }
                },
                "description": "Empty"
            },
            "HTTPValidationError": {
                "title": "HTTPValidationError",
                "type": "object",
                "properties": {
                    "detail": {
                        "title": "Detail",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ValidationError"
                        }
                    }
                }
            },
            "HealthzResponse": {
                "title": "HealthzResponse",
                "required": [
                    "success"
                ],
                "type": "object",
                "properties": {
                    "success": {
                        "title": "Success",
                        "type": "boolean",
                        "description": "Whether the healthz request succeeded."
                    },
                    "gpu_inference_engine_success": {
                        "title": "Gpu Inference Engine Success",
                        "type": "boolean",
                        "description": "Whether the health check on the GPU inference engine succeeded. Returned on GPU container only."
                    }
                }
            },
            "ImageLocation": {
                "title": "ImageLocation",
                "required": [
                    "page",
                    "x0",
                    "x1",
                    "y0",
                    "y1"
                ],
                "type": "object",
                "properties": {
                    "page": {
                        "title": "Page",
                        "type": "integer",
                        "description": "The page or layer that the entity occurs on. This corresponds to page in a PDF document or layer in a TIFF image."
                    },
                    "x0": {
                        "title": "X0",
                        "type": "number",
                        "description": "X coordinate of the upper left point of the entity bounding box."
                    },
                    "x1": {
                        "title": "X1",
                        "type": "number",
                        "description": "X coordinate of the lower right point of the entity bounding box."
                    },
                    "y0": {
                        "title": "Y0",
                        "type": "number",
                        "description": "Y coordinate of the upper left point of the entity bounding box."
                    },
                    "y1": {
                        "title": "Y1",
                        "type": "number",
                        "description": "Y coordinate of the lower right point of the entity bounding box."
                    }
                },
                "description": "Bounding box of the entity in an image or PDF file (PDF files are converted to images). The origin is the upper left pixel of the image. Coordinates are given as a fraction of the X and Y image dimensions."
            },
            "InternalErrorResponseModel": {
                "title": "InternalErrorResponseModel",
                "required": [
                    "detail"
                ],
                "type": "object",
                "properties": {
                    "detail": {
                        "title": "Detail",
                        "type": "string",
                        "description": "The details of the error, usually relating to an unhandled processing error"
                    }
                }
            },
            "MarkerRedactedText": {
                "title": "MarkerRedactedText",
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "MARKER"
                        ],
                        "type": "string",
                        "default": "MARKER"                        
                    },
                    "pattern": {
                        "title": "Pattern",
                        "type": "string",
                        "description": "Specifies a custom redaction marker format. The format must contain one and only one of these predefined keywords: `BEST_ENTITY_TYPE`, `ALL_ENTITY_TYPES`, `UNIQUE_NUMBERED_ENTITY_TYPE`, which will be replaced as follows:\n\n The keyword `BEST_ENTITY_TYPE` will be replaced by the entity type. For example, `--[BEST_ENTITY_TYPE]--` will transform `My name is John` into `My name is --[NAME_GIVEN]--`.\n\nThe keyword `UNIQUE_NUMBERED_ENTITY_TYPE` is similar, but it will also make the marker unique by appending an index at the end. For example `--[UNIQUE_NUMBERED_ENTITY_TYPE]--` yields `My name is --[NAME_GIVEN_1]--`.\n\nThe keyword `ALL_ENTITY_TYPES` will be replaced with all the entity types applicable to the entity. For example `--[ALL_ENTITY_TYPES]--` yields `My name is --[NAME,NAME_GIVEN]--`.\n\nIt is also possible to set this option via environment variable. See [Environment Variables](https://docs.private-ai.com/environment-variables).",
                        "default": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                    }
                },
                "additionalProperties": false
            },
            "MaskRedactedText": {
                "title": "MaskRedactedText",
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "MASK"
                        ],
                        "type": "string",
                        "default": "MASK"                        
                    },
                    "mask_character": {
                        "title": "Mask Character",
                        "type": "string",
                        "description": "Replaces redacted PII with the specified mask character. Note that this input may only be a single character",
                        "default": "#"
                    }
                },
                "additionalProperties": false
            },
            "PDFOptions": {
                "title": "PDFOptions",
                "type": "object",
                "properties": {
                    "density": {
                        "title": "Density",
                        "type": "integer",
                        "description": "PDFs are converted into images using this DPI value. Smaller values result in images with smaller resolutions, which will take up less storage space and process faster, at the cost of output quality & redaction accuracy.",
                        "default": 200
                    },
                    "max_resolution": {
                        "title": "Max Resolution",
                        "type": "integer",
                        "description": "PDFs are converted into images using the `density` DPI value. Any resulting images with maximum size length larger than this will be resized to this value, while preserving aspect ratio.",
                        "default": 3000
                    }
                },
                "additionalProperties": false
            },
            "PIIDetectionParams": {
                "title": "PIIDetectionParams",
                "type": "object",
                "properties": {
                    "accuracy": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/AccuracyMode"
                            }
                        ],
                        "description": "Selects the model used to identify PII in the input text. By default, the `high` accuracy model is used. While the models used by the Private AI solution are highly optimized (~25X faster than a reference transformer implementation), in high-throughput cases it is possible to trade accuracy for speed by selecting either the `standard` or `standard_high` accuracy modes. Multilingual support can be enabled by using one of the multilingual models, namely `standard_high_multilingual` (GPU container only) and `high_multilingual`. The multilingual models process all supported languages including English, without the need to specify language. It is advisable to use the English-only models where possible, as they perform slightly better on English.",
                        "default": "high"
                    },
                    "entity_types": {
                        "title": "Entity Types",
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/EnableEntityTypeSelector"
                                },
                                {
                                    "$ref": "#/components/schemas/DisableEntityTypeSelector"
                                }
                            ]
                        },
                        "description": "Controls which entity types and legislation sets are detected. See [Supported Entity Types](https://docs.private-ai.com/entities/#supported-entities) for the list of possible entities and legislation sets. By default, all entities are detected and removed. You can specify one of many selectors, which can be either an individual entity type such as `LOCATION_CITY` or a legislation like `GDPR`. `EnableEntityTypeSelector` selectors will add entity types to detect. On the contrary, `DisableEntityTypeSelector` selectors will ignore entities of the specified types. If only `DisableEntityTypeSelector` selectors are specified, they are assumed to be ignoring entity types from the entire supported list of entity types."
                    },
                    "filter": {
                        "title": "Filter",
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/AllowFilter"
                                },
                                {
                                    "$ref": "#/components/schemas/BlockFilter"
                                }
                            ]
                        },
                        "description": "Allows the user to customize PII detection via allow and block lists. See [Supported Entity Types](https://docs.private-ai.com/entities/#supported-entities) for the list of possible entities."
                    },
                    "return_entity": {
                        "title": "Return Entity",
                        "type": "boolean",
                        "description": "Controls whether the PII list in the response contains the `text` field. Turning this off means that no sensitive PII is returned in the response.",
                        "default": true
                    },
                    "override": {
                        "title": "Override",
                        "type": "boolean",
                        "description": "Determines whether the disabled entity is used to override any other entities that the PII might belong to. Using this will force the system to keep a detected PII in the text.",
                        "default": false
                    }
                },
                "additionalProperties": false
            },
            "PIITimestamp": {
                "title": "PIITimestamp",
                "required": [
                    "start",
                    "end"
                ],
                "type": "object",
                "properties": {
                    "start": {
                        "title": "Start",
                        "type": "number"
                    },
                    "end": {
                        "title": "End",
                        "type": "number"
                    }
                }
            },
            "ProcessFileRequest": {
                "title": "ProcessFileRequest",
                "required": [
                    "uri"
                ],
                "type": "object",
                "properties": {
                    "uri": {
                        "title": "Uri",
                        "type": "string",
                        "description": "URI of the file to be processed. It must be an accessible file path on the host machine (e.g. /Users/sam/files/file.pdf)."
                    },
                    "entity_detection": {
                        "title": "Entity Detection",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/PIIDetectionParams"
                            }
                        ],
                        "description": "This section contains a set of parameters to control the PII detection process. All fields have sensible default that can be changed for specific needs."
                    },
                    "pdf_options": {
                        "title": "Pdf Options",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/PDFOptions"
                            }
                        ],
                        "description": "Options to process PDF files, such as the rendering quality when each page is turned into an image."
                    },
                    "audio_options": {
                        "title": "Audio Options",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/AudioOptions"
                            }
                        ],
                        "description": "Options to process audio files, such as the padding to add while redacting audio segments."
                    },
                    "project_id": {
                        "title": "Project Id",
                        "maxLength": 32,
                        "pattern": "^[a-zA-Z0-9\\-_\\:]*$",
                        "type": "string",
                        "description": "Used to categorize requests for reporting purposes. Limited to alphanumeric characters or the following special characters :_-"
                    }
                },
                "additionalProperties": false
            },
            "ProcessFileRequestBase64": {
                "title": "ProcessFileRequestBase64",
                "required": [
                    "file"
                ],
                "type": "object",
                "properties": {
                    "file": {
                        "title": "File",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/File"
                            }
                        ],
                        "description": "This section contains a set of parameters to control the PII detection process. All fields have sensible default that can be changed for specific needs."
                    },
                    "entity_detection": {
                        "title": "Entity Detection",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/PIIDetectionParams"
                            }
                        ],
                        "description": "This section contains a set of parameters to control the PII detection process. All fields have sensible default that can be changed for specific needs."
                    },
                    "pdf_options": {
                        "title": "Pdf Options",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/PDFOptions"
                            }
                        ],
                        "description": "Options to process PDF files, such as the rendering quality when each page is turned into an image."
                    },
                    "audio_options": {
                        "title": "Audio Options",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/AudioOptions"
                            }
                        ],
                        "description": "Options to process audio files, such as the padding to add while redacting audio segments."
                    },
                    "project_id": {
                        "title": "Project Id",
                        "maxLength": 32,
                        "pattern": "^[a-zA-Z0-9\\-_\\:]*$",
                        "type": "string",
                        "description": "Used to categorize requests for reporting purposes. Limited to alphanumeric characters or the following special characters :_-"
                    }
                },
                "additionalProperties": false
            },
            "ProcessFileResponse": {
                "title": "ProcessFileResponse",
                "required": [
                    "result_uri",
                    "processed_text",
                    "entities",
                    "entities_present"
                ],
                "type": "object",
                "properties": {
                    "result_uri": {
                        "title": "Result Uri",
                        "type": "string",
                        "description": "URI of the processed file in the output directory (e.g. /Users/sam/files/file.redacted.pdf)."
                    },
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "This field contains the redacted version of any text that was extracted from the input file. It corresponds to a redacted ASR transcript for audio files and any text found inside a document such as a PDF or image file."
                    },
                    "entities": {
                        "title": "Entities",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/FileEntityItem"
                        },
                        "description": "A list of all entities found in the provided file."
                    },
                    "entities_present": {
                        "title": "Entities Present",
                        "type": "boolean",
                        "description": "Returns `True` if the list of detected entities is not empty."
                    }
                }
            },
            "ProcessFileResponseBase64": {
                "title": "ProcessFileResponseBase64",
                "required": [
                    "processed_file",
                    "processed_text",
                    "entities",
                    "entities_present"
                ],
                "type": "object",
                "properties": {
                    "processed_file": {
                        "title": "Processed File",
                        "type": "string",
                        "description": "the base64 encoded file content of the redacted file."
                    },
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "This field contains the redacted version of any text that was extracted from the input file. It corresponds to a redacted ASR transcript for audio files and any text found inside a document such as a PDF or image file."
                    },
                    "entities": {
                        "title": "Entities",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/FileEntityItem"
                        },
                        "description": "A list of all entities found in the provided file."
                    },
                    "entities_present": {
                        "title": "Entities Present",
                        "type": "boolean",
                        "description": "Returns `True` if the list of detected entities is not empty."
                    }
                }
            },
            "ProcessTextRequest": {
                "title": "ProcessTextRequest",
                "required": [
                    "text"
                ],
                "type": "object",
                "properties": {
                    "text": {
                        "title": "Text",
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "UTF-8 encoded message(s) to process. E.g. `[\"My name is Adam\"]` or `[\"I live at\", \"263 Spadina Av\"]`. Request processing time increases linearly with input text length, therefore maximum length is dependent on provisioned hardware and any timeouts set by the user. Private AI has tested up to 500K characters on the CPU and GPU containers."
                    },
                    "link_batch": {
                        "title": "Link Batch",
                        "type": "boolean",
                        "description": "When set to `True`, the list of inputs provided in `text` will be processed together as a single input by the Private AI PII detection model. This shares context between the different inputs and is useful when processing a sequence of short inputs, such as an SMS chat log. This option should only be enabled when the inputs are related, otherwise PII detection performance could be degraded.",
                        "default": false
                    },
                    "entity_detection": {
                        "title": "Entity Detection",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/PIIDetectionParams"
                            }
                        ],
                        "description": "This section contains a set of parameters to control the PII detection process. All fields have sensible default that can be changed for specific needs."
                    },
                    "processed_text": {
                        "title": "Processed Text",
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/MarkerRedactedText"
                            },
                            {
                                "$ref": "#/components/schemas/SyntheticRedactedText"
                            },
                            {
                                "$ref": "#/components/schemas/MaskRedactedText"
                            }
                        ],
                        "description": "This section allows the user to generate redacted (default), synthetic or masked text.",
                        "default": {
                            "type": "MARKER",
                            "pattern": "[UNIQUE_NUMBERED_ENTITY_TYPE]"
                        },
                        "discriminator": {
                            "propertyName": "type",
                            "mapping": {
                                "MARKER": "#/components/schemas/MarkerRedactedText",
                                "SYNTHETIC": "#/components/schemas/SyntheticRedactedText",
                                "MASK": "#/components/schemas/MaskRedactedText"
                            }
                        }
                    },
                    "project_id": {
                        "title": "Project Id",
                        "maxLength": 32,
                        "pattern": "^[a-zA-Z0-9\\-_\\:]*$",
                        "type": "string",
                        "description": "Used to categorize requests for reporting purposes. Limited to alphanumeric characters or the following special characters :_-"
                    }
                },
                "additionalProperties": false,
                "description": "API 3.0 Spec Definition"
            },
            "ProcessTextResponse": {
                "title": "ProcessTextResponse",
                "type": "array",
                "items": {
                    "$ref": "#/components/schemas/ProcessTextResponseItem"
                }
            },
            "ProcessTextResponseItem": {
                "title": "ProcessTextResponseItem",
                "required": [
                    "processed_text",
                    "entities",
                    "entities_present",
                    "characters_processed",
                    "languages_detected"
                ],
                "type": "object",
                "properties": {
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "The redacted, synthetic or masked text."
                    },
                    "entities": {
                        "title": "Entities",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/EntityItem"
                        },
                        "description": "A list of all entities found in the text."
                    },
                    "entities_present": {
                        "title": "Entities Present",
                        "type": "boolean",
                        "description": "Returns `True` if the list of detected entities is not empty."
                    },
                    "characters_processed": {
                        "title": "Characters Processed",
                        "type": "integer",
                        "description": "The number of characters in all the text inputs."
                    },
                    "languages_detected": {
                        "title": "Languages Detected",
                        "type": "object",
                        "additionalProperties": {
                            "type": "number"
                        },
                        "description": "A dictionary containing ISO 639-1 language labels and the likelihood of their detection in the request payload."
                    }
                }
            },
            "ReIdentifyTextRequest": {
                "title": "ReIdentifyTextRequest",
                "required": [
                    "processed_text",
                    "entities"
                ],
                "type": "object",
                "properties": {
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "The text with redaction markers. The markers will be replaced with the entity texts.                                                 E.g. `Hi [NAME_1], nice to meet you.`"
                    },
                    "entities": {
                        "title": "Entities",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ReIdentifyTextRequestEntity"
                        },
                        "description": "A list of all entities found in the text."
                    },
                    "model": {
                        "title": "Model",
                        "type": "string",
                        "description": "The LLM that provides the completions. E.g. `gpt3.5-turbo`. While optional,                                             this is used to improve the re-identification process by accounting for the model's                                             unique behaviour surrounding redaction markers"
                    }
                },
                "additionalProperties": false
            },
            "ReIdentifyTextRequestEntity": {
                "title": "ReIdentifyTextRequestEntity",
                "required": [
                    "processed_text",
                    "text"
                ],
                "type": "object",
                "properties": {
                    "processed_text": {
                        "title": "Processed Text",
                        "type": "string",
                        "description": "The redaction marker in `processed_text` corresponding to the entity. E.g. `NAME_1`"
                    },
                    "text": {
                        "title": "Text",
                        "type": "string",
                        "description": "The entity text. E.g. `Sansa`"
                    }
                },
                "additionalProperties": false
            },
            "SyntheticPIIAccuracyMode": {
                "title": "SyntheticPIIAccuracyMode",
                "enum": [
                    "standard",
                    "standard_multilingual"
                ],
                "type": "string",
                "description": "An enumeration."
            },
            "SyntheticRedactedText": {
                "title": "SyntheticRedactedText",
                "type": "object",
                "properties": {
                    "type": {
                        "title": "Type",
                        "enum": [
                            "SYNTHETIC"
                        ],
                        "type": "string",
                        "default": "SYNTHETIC"                        
                    },
                    "synthetic_entity_accuracy": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SyntheticPIIAccuracyMode"
                            }
                        ],
                        "description": "(Beta) Enable synthetic entity generation using the specified model. Currently this feature is in beta and supports modes `standard` and `standard_multilingual`",
                        "default": "standard"
                    },
                    "preserve_relationships": {
                        "title": "Preserve Relationships",
                        "type": "boolean",
                        "description": "(Beta) Specifies whether multiple instances of the same entity should have the same generated synthetic entity or not. For example, preserve relationships: \"Hi John and Rosha, John nice to meet you\" -> \"Hi Harry and Alev, Harry nice to meet you\". No preserve relationships: \"Hi John and Rosha, John nice to meet you\" -> \"Hi Harry and Alev, Sulav nice to meet you\". This field has no effects when **synthetic_entity_accuracy** is not set.",
                        "default": true
                    }
                },
                "additionalProperties": false
            },
            "TextLocation": {
                "title": "TextLocation",
                "required": [
                    "stt_idx",
                    "end_idx",
                    "stt_idx_processed",
                    "end_idx_processed"
                ],
                "type": "object",
                "properties": {
                    "stt_idx": {
                        "title": "Stt Idx",
                        "type": "integer",
                        "description": "Start character index of the entity in the original text."
                    },
                    "end_idx": {
                        "title": "End Idx",
                        "type": "integer",
                        "description": "Index of the character immediately following the entity, such that end_idx - stt_idx = number of characters in the entity."
                    },
                    "stt_idx_processed": {
                        "title": "Stt Idx Processed",
                        "type": "integer",
                        "description": "Start character index of the entity in the processed text."
                    },
                    "end_idx_processed": {
                        "title": "End Idx Processed",
                        "type": "integer",
                        "description": "Index of the character immediately following the entity in the processed text."
                    }
                },
                "description": "Start and end indices of the entity in a text-based file format such as `.txt`."
            },
            "UserErrorResponseModel": {
                "title": "UserErrorResponseModel",
                "required": [
                    "detail"
                ],
                "type": "object",
                "properties": {
                    "detail": {
                        "title": "Detail",
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ErrorMessage"
                            },
                            {
                                "$ref": "#/components/schemas/ValidationErrorModel"
                            }
                        ],
                        "description": "The details of the error, usually relating to an input validation error"
                    }
                }
            },
            "ValidationError": {
                "title": "ValidationError",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "type": "object",
                "properties": {
                    "loc": {
                        "title": "Location",
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        }
                    },
                    "msg": {
                        "title": "Message",
                        "type": "string"
                    },
                    "type": {
                        "title": "Error Type",
                        "type": "string"
                    }
                }
            },
            "ValidationErrorModel": {
                "title": "ValidationErrorModel",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "type": "object",
                "properties": {
                    "description": {
                        "title": "Description",
                        "type": "string",
                        "description": "User-friendly error message description."
                    },
                    "loc": {
                        "title": "Loc",
                        "type": "array",
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "description": "The location where the error has occurred. This could be location of a character if the error is a parsing error, or it could be a value in the request if there is a validation error."
                    },
                    "msg": {
                        "title": "Msg",
                        "type": "string",
                        "description": "The error message."
                    },
                    "type": {
                        "title": "Type",
                        "type": "string",
                        "description": "The type of error that has been encountered."
                    }
                }
            },
            "VersionResponse": {
                "title": "VersionResponse",
                "required": [
                    "app_version"
                ],
                "type": "object",
                "properties": {
                    "app_version": {
                        "title": "App Version",
                        "type": "string",
                        "description": "The app version of the code currently deployed at this endpoint."
                    }
                }
            }
        }
    }
}