{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/calypsoai-com/json-schema/calypsoai-com-get-datasets-response-schema.json",
  "title": "GetDatasetsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/calypsoai-com-datasets-api-openapi.yml#/components/schemas/GetDatasetsResponse",
  "properties": {
    "datasetRuns": {
      "additionalProperties": {
        "$ref": "#/$defs/DatasetRun"
      },
      "default": {},
      "description": "Map of dataset run IDs to runs.",
      "propertyNames": {
        "format": "uuid"
      },
      "title": "Datasetruns",
      "type": "object"
    },
    "datasets": {
      "description": "Array of datasets.",
      "items": {
        "$ref": "#/$defs/Dataset"
      },
      "title": "Datasets",
      "type": "array"
    },
    "scannerPackages": {
      "additionalProperties": {
        "$ref": "#/$defs/ScannerPackage"
      },
      "default": {},
      "description": "Map of guardrail version IDs to guardrails.",
      "propertyNames": {
        "format": "uuid"
      },
      "title": "Scannerpackages",
      "type": "object"
    },
    "scanners": {
      "additionalProperties": {
        "$ref": "#/$defs/Scanner"
      },
      "default": {},
      "description": "Map of guardrail version IDs to guardrails.",
      "propertyNames": {
        "format": "uuid"
      },
      "title": "Scanners",
      "type": "object"
    },
    "users": {
      "additionalProperties": {
        "$ref": "#/$defs/User"
      },
      "default": {},
      "description": "Map of user IDs to users.",
      "title": "Users",
      "type": "object"
    }
  },
  "required": [
    "datasets"
  ],
  "type": "object",
  "$defs": {
    "Dataset": {
      "properties": {
        "createdAt": {
          "format": "date-time",
          "title": "Createdat",
          "type": "string"
        },
        "createdBy": {
          "title": "Createdby",
          "type": "string"
        },
        "fileId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fileid"
        },
        "filename": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filename"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "scannerPackageId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scannerpackageid"
        }
      },
      "required": [
        "id",
        "createdBy",
        "createdAt",
        "fileId",
        "filename",
        "name"
      ],
      "title": "Dataset",
      "type": "object"
    },
    "DatasetRun": {
      "properties": {
        "datasetId": {
          "format": "uuid",
          "title": "Datasetid",
          "type": "string"
        },
        "fileId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fileid"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "result": {
          "anyOf": [
            {
              "$ref": "#/$defs/DatasetScores"
            },
            {
              "type": "null"
            }
          ]
        },
        "scannerId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scannerid"
        },
        "scannerPackageId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scannerpackageid"
        },
        "scannerVersionId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scannerversionid"
        },
        "status": {
          "$ref": "#/$defs/RunStatus"
        }
      },
      "required": [
        "id",
        "datasetId",
        "status"
      ],
      "title": "DatasetRun",
      "type": "object"
    },
    "DatasetScores": {
      "properties": {
        "accuracy": {
          "title": "Accuracy",
          "type": "number"
        },
        "f1Score": {
          "title": "F1Score",
          "type": "number"
        },
        "falseNegative": {
          "title": "Falsenegative",
          "type": "integer"
        },
        "falsePositive": {
          "title": "Falsepositive",
          "type": "integer"
        },
        "trueNegative": {
          "title": "Truenegative",
          "type": "integer"
        },
        "truePositive": {
          "title": "Truepositive",
          "type": "integer"
        }
      },
      "required": [
        "f1Score",
        "accuracy",
        "falseNegative",
        "truePositive",
        "trueNegative",
        "falsePositive"
      ],
      "title": "DatasetScores",
      "type": "object"
    },
    "GenAIScannerConfig": {
      "properties": {
        "input": {
          "default": "",
          "title": "Input",
          "type": "string"
        },
        "scanContext": {
          "default": "directional",
          "description": "Describes the context that is provided to the scanner\nindividual: Scan only the latest message\ndirectional: Scan all messages in the conversation in the same direction as the latest message",
          "enum": [
            "individual",
            "directional"
          ],
          "title": "Scancontext",
          "type": "string"
        },
        "type": {
          "default": "custom",
          "enum": [
            "genai",
            "custom"
          ],
          "title": "Type",
          "type": "string"
        }
      },
      "title": "GenAIScannerConfig",
      "type": "object"
    },
    "InternalScannerSource": {
      "properties": {
        "type": {
          "const": "internal",
          "default": "internal",
          "title": "Type",
          "type": "string"
        }
      },
      "title": "InternalScannerSource",
      "type": "object"
    },
    "KeywordScannerConfig": {
      "properties": {
        "type": {
          "const": "keyword",
          "default": "keyword",
          "title": "Type",
          "type": "string"
        },
        "words": {
          "description": "Words to check for in the prompt or response. Case insensitive. Empty strings will be removed.",
          "items": {
            "type": "string"
          },
          "title": "Words",
          "type": "array"
        }
      },
      "required": [
        "words"
      ],
      "title": "KeywordScannerConfig",
      "type": "object"
    },
    "LegacyScannerConfig": {
      "additionalProperties": true,
      "properties": {},
      "title": "LegacyScannerConfig",
      "type": "object"
    },
    "MLTextScannerConfig": {
      "properties": {
        "type": {
          "const": "ml_text",
          "default": "ml_text",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [],
      "title": "MLTextScannerConfig",
      "type": "object"
    },
    "RegexScannerConfig": {
      "properties": {
        "pattern": {
          "description": "Python Flavored Regular Expression (RegEx) to check for in the prompt or response. Case insensitive.",
          "title": "Pattern",
          "type": "string"
        },
        "type": {
          "const": "regex",
          "default": "regex",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "pattern"
      ],
      "title": "RegexScannerConfig",
      "type": "object"
    },
    "RemediationScannerSource": {
      "properties": {
        "sourceId": {
          "format": "uuid",
          "title": "Sourceid",
          "type": "string"
        },
        "type": {
          "const": "remediation",
          "default": "remediation",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "sourceId"
      ],
      "title": "RemediationScannerSource",
      "type": "object"
    },
    "RunStatus": {
      "enum": [
        "in_progress",
        "complete",
        "error"
      ],
      "title": "RunStatus",
      "type": "string"
    },
    "Scanner": {
      "properties": {
        "availability": {
          "$ref": "#/$defs/ScannerAvailability",
          "default": {
            "global": false,
            "projectIds": []
          }
        },
        "config": {
          "anyOf": [
            {
              "oneOf": [
                {
                  "$ref": "#/$defs/RegexScannerConfig"
                },
                {
                  "$ref": "#/$defs/KeywordScannerConfig"
                },
                {
                  "$ref": "#/$defs/GenAIScannerConfig"
                },
                {
                  "$ref": "#/$defs/MLTextScannerConfig"
                }
              ]
            },
            {
              "$ref": "#/$defs/LegacyScannerConfig"
            },
            {
              "type": "null"
            }
          ],
          "title": "Config"
        },
        "direction": {
          "$ref": "#/$defs/ScannerDirection",
          "default": "request"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "packageId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Packageid"
        },
        "projectId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Projectid"
        },
        "scannerTemplateId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scannertemplateid"
        },
        "source": {
          "default": {
            "type": "internal"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/InternalScannerSource"
            },
            {
              "$ref": "#/$defs/ZipScannerSource"
            },
            {
              "$ref": "#/$defs/VendorScannerSource"
            },
            {
              "$ref": "#/$defs/RemediationScannerSource"
            }
          ],
          "title": "Source"
        },
        "tags": {
          "default": [],
          "items": {
            "maxLength": 50,
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9-_]+$",
            "type": "string"
          },
          "title": "Tags",
          "type": "array"
        },
        "vendored": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          ],
          "default": false,
          "title": "Vendored"
        },
        "versionMeta": {
          "$ref": "#/$defs/ScannerVersionMeta"
        }
      },
      "required": [
        "name",
        "id",
        "versionMeta"
      ],
      "title": "Scanner",
      "type": "object"
    },
    "ScannerAvailability": {
      "properties": {
        "global": {
          "default": false,
          "description": "If True guardrail can be used by all projects",
          "title": "Global",
          "type": "boolean"
        },
        "projectIds": {
          "default": [],
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "title": "Projectids",
          "type": "array",
          "uniqueItems": true
        }
      },
      "title": "ScannerAvailability",
      "type": "object"
    },
    "ScannerDatasetResult": {
      "properties": {
        "datasetRunId": {
          "format": "uuid",
          "title": "Datasetrunid",
          "type": "string"
        },
        "f1Score": {
          "title": "F1Score",
          "type": "number"
        }
      },
      "required": [
        "datasetRunId",
        "f1Score"
      ],
      "title": "ScannerDatasetResult",
      "type": "object"
    },
    "ScannerDirection": {
      "enum": [
        "both",
        "request",
        "response"
      ],
      "title": "ScannerDirection",
      "type": "string"
    },
    "ScannerPackage": {
      "properties": {
        "availability": {
          "$ref": "#/$defs/ScannerAvailability",
          "default": {
            "global": false,
            "projectIds": []
          }
        },
        "direction": {
          "$ref": "#/$defs/ScannerDirection"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "performanceScannerIds": {
          "anyOf": [
            {
              "items": {
                "format": "uuid",
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Performancescannerids"
        },
        "projectId": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Projectid"
        },
        "scannerCounts": {
          "additionalProperties": {
            "type": "integer"
          },
          "default": {},
          "title": "Scannercounts",
          "type": "object"
        },
        "scannerIds": {
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "title": "Scannerids",
          "type": "array"
        },
        "source": {
          "oneOf": [
            {
              "$ref": "#/$defs/InternalScannerSource"
            },
            {
              "$ref": "#/$defs/ZipScannerSource"
            },
            {
              "$ref": "#/$defs/VendorScannerSource"
            },
            {
              "$ref": "#/$defs/RemediationScannerSource"
            }
          ],
          "title": "Source"
        },
        "vendored": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          ],
          "default": false,
          "title": "Vendored"
        }
      },
      "required": [
        "id",
        "name",
        "source",
        "direction",
        "scannerIds"
      ],
      "title": "ScannerPackage",
      "type": "object"
    },
    "ScannerVersionMeta": {
      "properties": {
        "createdAt": {
          "format": "date-time",
          "title": "Createdat",
          "type": "string"
        },
        "createdBy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Createdby"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "direction": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScannerDirection"
            },
            {
              "type": "null"
            }
          ]
        },
        "f1Score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "F1Score"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "latestDatasetResult": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScannerDatasetResult"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "maxLength": 100,
          "minLength": 1,
          "pattern": "^[a-zA-Z0-9-_]+$",
          "title": "Name",
          "type": "string"
        },
        "published": {
          "title": "Published",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "createdAt",
        "name",
        "published"
      ],
      "title": "ScannerVersionMeta",
      "type": "object"
    },
    "User": {
      "properties": {
        "admin": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Admin"
        },
        "blocked": {
          "default": false,
          "title": "Blocked",
          "type": "boolean"
        },
        "createdAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Createdat"
        },
        "email": {
          "format": "password",
          "title": "Email",
          "type": "string",
          "writeOnly": true
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "lastInvitationSentAt": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lastinvitationsentat"
        },
        "machine": {
          "default": false,
          "title": "Machine",
          "type": "boolean"
        },
        "name": {
          "format": "password",
          "title": "Name",
          "type": "string",
          "writeOnly": true
        },
        "org": {
          "title": "Org",
          "type": "string"
        },
        "permissions": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Permissions",
          "type": "array",
          "uniqueItems": true
        },
        "roleIds": {
          "default": [],
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "title": "Roleids",
          "type": "array"
        },
        "roles": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Roles",
          "type": "array"
        },
        "social": {
          "default": false,
          "title": "Social",
          "type": "boolean"
        },
        "teams": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Teams",
          "type": "array"
        },
        "verified": {
          "default": true,
          "title": "Verified",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "email",
        "org"
      ],
      "title": "User",
      "type": "object"
    },
    "VendorScannerSource": {
      "properties": {
        "type": {
          "const": "vendor",
          "default": "vendor",
          "title": "Type",
          "type": "string"
        }
      },
      "title": "VendorScannerSource",
      "type": "object"
    },
    "ZipScannerSource": {
      "properties": {
        "type": {
          "const": "zip",
          "default": "zip",
          "title": "Type",
          "type": "string"
        }
      },
      "title": "ZipScannerSource",
      "type": "object"
    }
  }
}