"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .modality import Modality, ModalityTypedDict
from .textualdetection import Textualdetection, TextualdetectionTypedDict
from acuvity.types import BaseModel
import pydantic
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ExtractionTypedDict(TypedDict):
    r"""Represents the extracted information to log."""

    pi_is: NotRequired[Dict[str, float]]
    r"""The PIIs found during classification."""
    annotations: NotRequired[Dict[str, str]]
    r"""Annotations attached to the extraction."""
    categories: NotRequired[List[ModalityTypedDict]]
    r"""The categories are remapping of the modalities in a more human friendly way."""
    confidentiality: NotRequired[float]
    r"""The level of general confidentiality of the input."""
    data: NotRequired[str]
    r"""The data extracted."""
    detections: NotRequired[List[TextualdetectionTypedDict]]
    r"""The detections found while applying policies."""
    exploits: NotRequired[Dict[str, float]]
    r"""The various exploits attempts."""
    hash: NotRequired[str]
    r"""The hash of the extraction."""
    intent: NotRequired[Dict[str, float]]
    r"""The estimated intent embodied into the text."""
    internal: NotRequired[bool]
    r"""If true, this extraction is for internal use only. This can be used by agentic
    systems to mark an extraction as internal only as opposed to user facing.
    """
    keywords: NotRequired[Dict[str, float]]
    r"""The keywords found during classification."""
    label: NotRequired[str]
    r"""A means of distinguishing what was extracted, such as prompt, input file or
    code.
    """
    languages: NotRequired[Dict[str, float]]
    r"""The language of the classification."""
    modalities: NotRequired[List[ModalityTypedDict]]
    r"""The modalities of data detected in the data."""
    relevance: NotRequired[float]
    r"""The level of general organization relevance of the input."""
    secrets: NotRequired[Dict[str, float]]
    r"""The secrets found during classification."""
    topics: NotRequired[Dict[str, float]]
    r"""The topic of the classification."""


class Extraction(BaseModel):
    r"""Represents the extracted information to log."""

    pi_is: Annotated[Optional[Dict[str, float]], pydantic.Field(alias="PIIs")] = None
    r"""The PIIs found during classification."""

    annotations: Optional[Dict[str, str]] = None
    r"""Annotations attached to the extraction."""

    categories: Optional[List[Modality]] = None
    r"""The categories are remapping of the modalities in a more human friendly way."""

    confidentiality: Optional[float] = None
    r"""The level of general confidentiality of the input."""

    data: Optional[str] = None
    r"""The data extracted."""

    detections: Optional[List[Textualdetection]] = None
    r"""The detections found while applying policies."""

    exploits: Optional[Dict[str, float]] = None
    r"""The various exploits attempts."""

    hash: Optional[str] = None
    r"""The hash of the extraction."""

    intent: Optional[Dict[str, float]] = None
    r"""The estimated intent embodied into the text."""

    internal: Optional[bool] = None
    r"""If true, this extraction is for internal use only. This can be used by agentic
    systems to mark an extraction as internal only as opposed to user facing.
    """

    keywords: Optional[Dict[str, float]] = None
    r"""The keywords found during classification."""

    label: Optional[str] = None
    r"""A means of distinguishing what was extracted, such as prompt, input file or
    code.
    """

    languages: Optional[Dict[str, float]] = None
    r"""The language of the classification."""

    modalities: Optional[List[Modality]] = None
    r"""The modalities of data detected in the data."""

    relevance: Optional[float] = None
    r"""The level of general organization relevance of the input."""

    secrets: Optional[Dict[str, float]] = None
    r"""The secrets found during classification."""

    topics: Optional[Dict[str, float]] = None
    r"""The topic of the classification."""
