"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2024 Phonexia s.r.o.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Phonexia Language Identification gRPC API.
"""

import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.duration_pb2
import google.protobuf.internal.containers
import google.protobuf.message
import phonexia.grpc.common.core_pb2
import typing

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class IdentifyRequest(google.protobuf.message.Message):
    """The top level message sent by the client for the <code>Identify</code> method."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    AUDIO_FIELD_NUMBER: builtins.int
    CONFIG_FIELD_NUMBER: builtins.int
    @property
    def audio(self) -> phonexia.grpc.common.core_pb2.Audio:
        """Audio data to be identified."""

    @property
    def config(self) -> global___IdentifyConfig:
        """Configuration for the language identification."""

    def __init__(
        self,
        *,
        audio: phonexia.grpc.common.core_pb2.Audio | None = ...,
        config: global___IdentifyConfig | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["audio", b"audio", "config", b"config"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["audio", b"audio", "config", b"config"]) -> None: ...

global___IdentifyRequest = IdentifyRequest

@typing.final
class IdentifyResponse(google.protobuf.message.Message):
    """The top level message returned to the client by the <code>Identify</code> method."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    RESULT_FIELD_NUMBER: builtins.int
    PROCESSED_AUDIO_LENGTH_FIELD_NUMBER: builtins.int
    @property
    def result(self) -> global___LanguageIdentificationResult:
        """Result of language identification."""

    @property
    def processed_audio_length(self) -> google.protobuf.duration_pb2.Duration:
        """When available, total length of the processed audio.
        Set only if this is the last response in the stream.
        """

    def __init__(
        self,
        *,
        result: global___LanguageIdentificationResult | None = ...,
        processed_audio_length: google.protobuf.duration_pb2.Duration | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["processed_audio_length", b"processed_audio_length", "result", b"result"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["processed_audio_length", b"processed_audio_length", "result", b"result"]) -> None: ...

global___IdentifyResponse = IdentifyResponse

@typing.final
class ListSupportedLanguagesRequest(google.protobuf.message.Message):
    """The top-level message sent by the client for the <code>ListSupportedLanguages</code> method."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    def __init__(
        self,
    ) -> None: ...

global___ListSupportedLanguagesRequest = ListSupportedLanguagesRequest

@typing.final
class ListSupportedLanguagesResponse(google.protobuf.message.Message):
    """The top-level message returned to the client by the <code>ListSupportedLanguages</code>."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SUPPORTED_LANGUAGES_FIELD_NUMBER: builtins.int
    @property
    def supported_languages(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of supported languages."""

    def __init__(
        self,
        *,
        supported_languages: collections.abc.Iterable[builtins.str] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["supported_languages", b"supported_languages"]) -> None: ...

global___ListSupportedLanguagesResponse = ListSupportedLanguagesResponse

@typing.final
class IdentifyConfig(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SPEECH_LENGTH_FIELD_NUMBER: builtins.int
    LANGUAGES_FIELD_NUMBER: builtins.int
    GROUPS_FIELD_NUMBER: builtins.int
    @property
    def speech_length(self) -> google.protobuf.duration_pb2.Duration:
        """Specifies the maximum speech length from which the languages will be
        identified. If there is less speech in the audio than the specified
        duration, the languages will be identified from the entire audio.
        """

    @property
    def languages(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Language]:
        """Specify which languages can be used for language identification.
        Choose only from list of supported languages, which can be retrieved at <code>ListSuportedlanguages</code>.
        Choosing desired languages is profficient to better identify a smaller group of languages since probability will be distributed only on selected languages.
        Leaving this field empty is the same as selecting every supported language.
        """

    @property
    def groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LanguageGroup]:
        """Create custom groups of languages and assign them common identifier.
        Defining group produces score for the individual languages as well as for the group.
        One of the use cases for using groups may be grouping individual language dialects into one encapsulating group.  
        Languages in multiple clusters mustn't intersect. Meaning one language cannot be in multiple clusters at the same time.
        """

    def __init__(
        self,
        *,
        speech_length: google.protobuf.duration_pb2.Duration | None = ...,
        languages: collections.abc.Iterable[global___Language] | None = ...,
        groups: collections.abc.Iterable[global___LanguageGroup] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["speech_length", b"speech_length"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["groups", b"groups", "languages", b"languages", "speech_length", b"speech_length"]) -> None: ...

global___IdentifyConfig = IdentifyConfig

@typing.final
class Language(google.protobuf.message.Message):
    """Message for selecting specific language."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    LANGUAGE_CODE_FIELD_NUMBER: builtins.int
    language_code: builtins.str
    """Language code in RFC 5646 format."""
    def __init__(
        self,
        *,
        language_code: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["language_code", b"language_code"]) -> None: ...

global___Language = Language

@typing.final
class LanguageGroup(google.protobuf.message.Message):
    """Message defining language group.
    Group several languages and assigns them common identifier.
    Defining group produces score for the individual languages as well as for the language groups.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    IDENTIFIER_FIELD_NUMBER: builtins.int
    LANGUAGE_CODES_FIELD_NUMBER: builtins.int
    identifier: builtins.str
    """Identifier of created group.
    This identifier will be used in <code>LanguageIdentificationScore</code>.
    Group identifier must be unique between all groups and languages.
    """
    @property
    def language_codes(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Set of languages forming this group."""

    def __init__(
        self,
        *,
        identifier: builtins.str = ...,
        language_codes: collections.abc.Iterable[builtins.str] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["identifier", b"identifier", "language_codes", b"language_codes"]) -> None: ...

global___LanguageGroup = LanguageGroup

@typing.final
class LanguageIdentificationResult(google.protobuf.message.Message):
    """Message representing the result of language identification."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SPEECH_LENGTH_FIELD_NUMBER: builtins.int
    SCORES_FIELD_NUMBER: builtins.int
    @property
    def speech_length(self) -> google.protobuf.duration_pb2.Duration:
        """Speech length from which the languageprint was extracted."""

    @property
    def scores(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LanguageIdentificationScore]:
        """List of scores for each selected language or language group."""

    def __init__(
        self,
        *,
        speech_length: google.protobuf.duration_pb2.Duration | None = ...,
        scores: collections.abc.Iterable[global___LanguageIdentificationScore] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["speech_length", b"speech_length"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["scores", b"scores", "speech_length", b"speech_length"]) -> None: ...

global___LanguageIdentificationResult = LanguageIdentificationResult

@typing.final
class LanguageIdentificationScore(google.protobuf.message.Message):
    """Score for a single language or language group."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    IDENTIFIER_FIELD_NUMBER: builtins.int
    SCORE_FIELD_NUMBER: builtins.int
    identifier: builtins.str
    """This field has either language code (specified by RFC 5646) or identifier of language group."""
    score: builtins.float
    """Score for this language or language group.
    The score is a probability distribution representing the probability likelihood
    of the input belonging to each language.
    Language group scores sum up the probabilities of their individual languages.
    """
    def __init__(
        self,
        *,
        identifier: builtins.str = ...,
        score: builtins.float = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["identifier", b"identifier", "score", b"score"]) -> None: ...

global___LanguageIdentificationScore = LanguageIdentificationScore
