├── speechpro ├── cloud │ ├── __init__.py │ └── speech │ │ ├── __init__.py │ │ ├── common │ │ ├── rest │ │ │ ├── __init__.py │ │ │ └── cloud_client │ │ │ │ ├── api │ │ │ │ └── __init__.py │ │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── auth_status_dto.py │ │ │ │ ├── auth_response_dto.py │ │ │ │ ├── exception_model.py │ │ │ │ ├── credentials.py │ │ │ │ └── auth_request_dto.py │ │ │ │ └── __init__.py │ │ └── __init__.py │ │ ├── synthesis │ │ ├── enums.py │ │ ├── rest │ │ │ ├── cloud_client │ │ │ │ ├── api │ │ │ │ │ └── __init__.py │ │ │ │ ├── models │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── web_socket_server_configuration_response.py │ │ │ │ │ ├── auth_status_dto.py │ │ │ │ │ ├── web_socket_text_param.py │ │ │ │ │ ├── synthesize_response.py │ │ │ │ │ ├── auth_response_dto.py │ │ │ │ │ ├── synthesize_language.py │ │ │ │ │ ├── synthesize_text.py │ │ │ │ │ ├── exception_model.py │ │ │ │ │ ├── close_transaction_response.py │ │ │ │ │ ├── credentials.py │ │ │ │ │ ├── auth_request_dto.py │ │ │ │ │ ├── synthesize_voice_type.py │ │ │ │ │ ├── synthesize_request.py │ │ │ │ │ ├── web_socket_synthesize_request.py │ │ │ │ │ └── synthesize_sessionless_request.py │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ └── __init__.py │ │ └── recognition │ │ ├── __init__.py │ │ ├── rest │ │ ├── cloud_client │ │ │ ├── api │ │ │ │ └── __init__.py │ │ │ ├── run.py │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── stream_response_dto.py │ │ │ │ ├── status_dto.py │ │ │ │ ├── auth_status_dto.py │ │ │ │ ├── auth_response_dto.py │ │ │ │ ├── asr_result_dto.py │ │ │ │ ├── message_dto.py │ │ │ │ ├── stream_request_dto.py │ │ │ │ ├── audio_file_dto.py │ │ │ │ ├── recognition_request_dto.py │ │ │ │ ├── asr_advanced_result_dto.py │ │ │ │ ├── sessionless_recognition_request_dto.py │ │ │ │ ├── auth_request_dto.py │ │ │ │ ├── start_session_request.py │ │ │ │ └── advanced_recognition_request_dto.py │ │ │ └── __init__.py │ │ └── __init__.py │ │ └── enums.py ├── __init__.py └── cli.py ├── docs ├── authors.rst ├── history.rst ├── readme.rst ├── contributing.rst ├── usage.rst ├── index.rst ├── Makefile ├── make.bat ├── installation.rst └── conf.py ├── tests ├── __init__.py └── test_speechpro.py ├── requirements_dev.txt ├── AUTHORS.rst ├── MANIFEST.in ├── tox.ini ├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md └── workflows │ └── python-publish.yml ├── setup.cfg ├── HISTORY.rst ├── README.rst ├── LICENSE ├── setup.py ├── Makefile ├── .gitignore ├── cli.py ├── README.md └── CONTRIBUTING.rst /speechpro/cloud/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/authors.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../AUTHORS.rst 2 | -------------------------------------------------------------------------------- /docs/history.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../HISTORY.rst 2 | -------------------------------------------------------------------------------- /docs/readme.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | """Unit test package for speechpro.""" 2 | -------------------------------------------------------------------------------- /docs/usage.rst: -------------------------------------------------------------------------------- 1 | ===== 2 | Usage 3 | ===== 4 | 5 | To use Speechpro Cloud Python in a project:: 6 | 7 | import speechpro 8 | -------------------------------------------------------------------------------- /speechpro/__init__.py: -------------------------------------------------------------------------------- 1 | """Top-level package for Speechpro Cloud Python.""" 2 | 3 | __author__ = """Dmitry Kozhedubov""" 4 | __email__ = 'hiisi13@gmail.com' 5 | __version__ = '0.1.10' 6 | -------------------------------------------------------------------------------- /requirements_dev.txt: -------------------------------------------------------------------------------- 1 | pip==19.2.3 2 | bump2version==0.5.11 3 | wheel==0.33.6 4 | watchdog==0.9.0 5 | flake8==3.7.8 6 | tox==3.14.0 7 | coverage==4.5.4 8 | Sphinx==1.8.5 9 | twine==1.14.0 10 | Click==7.0 11 | toml==0.10.1 12 | -------------------------------------------------------------------------------- /AUTHORS.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Credits 3 | ======= 4 | 5 | Development Lead 6 | ---------------- 7 | 8 | * Dmitry Kozhedubov 9 | 10 | Contributors 11 | ------------ 12 | 13 | None yet. Why not be the first? 14 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | import speechpro.cloud.speech.common.rest.cloud_client.api.session_api -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/enums.py: -------------------------------------------------------------------------------- 1 | import enum 2 | 3 | class Voice(enum.Enum): 4 | ANNA = 1 5 | JULIA = 2 6 | VLADIMIR = 3 7 | DASHA = 4 8 | ASEL = 5 9 | CAROL = 6 10 | 11 | 12 | class PlaybackProfile(enum.Enum): 13 | SPEAKER = 1 14 | PHONE_CALL = 2 -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS.rst 2 | include CONTRIBUTING.rst 3 | include HISTORY.rst 4 | include LICENSE 5 | include README.rst 6 | 7 | recursive-include tests * 8 | recursive-exclude * __pycache__ 9 | recursive-exclude * *.py[co] 10 | 11 | recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif 12 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | import speechpro.cloud.speech.synthesis.rest.cloud_client.api.session_api 7 | import speechpro.cloud.speech.synthesis.rest.cloud_client.api.synthesize_api 8 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/__init__.py: -------------------------------------------------------------------------------- 1 | from speechpro.cloud.speech.recognition import rest 2 | from speechpro.cloud.speech import common 3 | 4 | 5 | class RecognitionClient(common.SpeechproApiClientBase, rest.ShortAudioRecognitionClient, rest.LongRunningRecognitionClient): 6 | pass 7 | 8 | 9 | __all__ = ('RecognitionClient') -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/__init__.py: -------------------------------------------------------------------------------- 1 | from speechpro.cloud.speech.synthesis import rest 2 | from speechpro.cloud.speech import common 3 | from speechpro.cloud.speech.synthesis import enums 4 | 5 | class SynthesisClient(common.SpeechproApiClientBase, rest.BatchSynthesisClient): 6 | pass 7 | 8 | 9 | __all__ = ('SynthesisClient', 'enums') -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py35, py36, py37, py38, flake8 3 | 4 | [travis] 5 | python = 6 | 3.8: py38 7 | 3.7: py37 8 | 3.6: py36 9 | 3.5: py35 10 | 11 | [testenv:flake8] 12 | basepython = python 13 | deps = flake8 14 | commands = flake8 speechpro tests 15 | 16 | [testenv] 17 | setenv = 18 | PYTHONPATH = {toxinidir} 19 | 20 | commands = python setup.py test 21 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | charset = utf-8 11 | end_of_line = lf 12 | 13 | [*.bat] 14 | indent_style = tab 15 | end_of_line = crlf 16 | 17 | [LICENSE] 18 | insert_final_newline = false 19 | 20 | [Makefile] 21 | indent_style = tab 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | * Speechpro Cloud Python version: 2 | * Python version: 3 | * Operating System: 4 | 5 | ### Description 6 | 7 | Describe what you were trying to get done. 8 | Tell us what happened, what went wrong, and what you expected to happen. 9 | 10 | ### What I Did 11 | 12 | ``` 13 | Paste the command(s) you ran and the output. 14 | If there was a crash, please include the traceback here. 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Speechpro Cloud Python's documentation! 2 | ====================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | readme 9 | installation 10 | usage 11 | modules 12 | contributing 13 | authors 14 | history 15 | 16 | Indices and tables 17 | ================== 18 | * :ref:`genindex` 19 | * :ref:`modindex` 20 | * :ref:`search` 21 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.1.10 3 | commit = True 4 | tag = True 5 | 6 | [bumpversion:file:setup.py] 7 | search = version='{current_version}' 8 | replace = version='{new_version}' 9 | 10 | [bumpversion:file:speechpro/__init__.py] 11 | search = __version__ = '{current_version}' 12 | replace = __version__ = '{new_version}' 13 | 14 | [bdist_wheel] 15 | universal = 1 16 | 17 | [flake8] 18 | exclude = docs 19 | 20 | [aliases] 21 | 22 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.packages_api import PackagesApi 7 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.recognize_api import RecognizeApi 8 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.session_api import SessionApi 9 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/enums.py: -------------------------------------------------------------------------------- 1 | import enum 2 | 3 | 4 | class AudioEncoding(enum.Enum): 5 | WAV = 'audio/wav' 6 | OGG_OPUS = 'audio/ogg' 7 | 8 | 9 | class Model(enum.IntEnum): 10 | GENERAL = 1 11 | PHONE_CALL = 2 12 | 13 | 14 | class Language(enum.IntEnum): 15 | RU = 1 16 | EN = 2 17 | ES = 3 18 | KZ = 4 19 | 20 | 21 | class ResponseType(enum.Enum): 22 | PLAIN_TEXT = 'plaintext' 23 | WORD_LIST = 'wordlist' 24 | MULTICHANNEL = 'multichannel' -------------------------------------------------------------------------------- /tests/test_speechpro.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """Tests for `speechpro` package.""" 4 | 5 | 6 | import unittest 7 | 8 | from speechpro import speechpro 9 | 10 | 11 | class TestSpeechpro(unittest.TestCase): 12 | """Tests for `speechpro` package.""" 13 | 14 | def setUp(self): 15 | """Set up test fixtures, if any.""" 16 | 17 | def tearDown(self): 18 | """Tear down test fixtures, if any.""" 19 | 20 | def test_000_something(self): 21 | """Test something.""" 22 | -------------------------------------------------------------------------------- /HISTORY.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | History 3 | ======= 4 | 5 | 0.1.9 (2020-08-29) 6 | ------------------ 7 | 8 | * Credentials can now be stored in TOML format and read automatically. 9 | 10 | 0.1.8 (2020-08-28) 11 | ------------------ 12 | 13 | * Add session status check to avoid 401 responses after a period of inactivity. 14 | 15 | 0.1.7 (2020-08-04) 16 | ------------------ 17 | 18 | * Fixed enum parsing when using CLI. 19 | 20 | 0.1.6 (2020-07-08) 21 | ------------------ 22 | 23 | * Updated enums to support new voices - Dasha, Carol Asel. 24 | 25 | 26 | 0.1.0 (2020-05-23) 27 | ------------------ 28 | 29 | * First release on PyPI. 30 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | """ 5 | TTS documentation 6 | 7 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 8 | 9 | OpenAPI spec version: 1.1 10 | 11 | Generated by: https://github.com/swagger-api/swagger-codegen.git 12 | """ 13 | 14 | 15 | from __future__ import absolute_import 16 | 17 | # import models into model package 18 | from speechpro.cloud.speech.common.rest.cloud_client.models.auth_response_dto import AuthResponseDto 19 | from speechpro.cloud.speech.common.rest.cloud_client.models.auth_status_dto import AuthStatusDto 20 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = speechpro 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=python -msphinx 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | set SPHINXPROJ=speechpro 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The Sphinx module was not found. Make sure you have Sphinx installed, 20 | echo.then set the SPHINXBUILD environment variable to point to the full 21 | echo.path of the 'sphinx-build' executable. Alternatively you may add the 22 | echo.Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflows will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | name: Upload Python Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | deploy: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Set up Python 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: '3.7' 21 | - name: Install dependencies 22 | run: | 23 | python -m pip install --upgrade pip 24 | pip install setuptools wheel twine 25 | - name: Build and publish 26 | env: 27 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 28 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 29 | run: | 30 | python setup.py sdist bdist_wheel 31 | twine upload dist/* 32 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | TTS documentation 7 | 8 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 9 | 10 | OpenAPI spec version: 1.1 11 | 12 | Generated by: https://github.com/swagger-api/swagger-codegen.git 13 | """ 14 | 15 | 16 | from __future__ import absolute_import 17 | 18 | # import apis into sdk package 19 | from speechpro.cloud.speech.common.rest.cloud_client.api.session_api import SessionApi 20 | 21 | # import ApiClient 22 | from speechpro.cloud.speech.common.rest.cloud_client.cloud_api_client import CloudApiClient 23 | from speechpro.cloud.speech.common.rest.cloud_client.configuration import Configuration 24 | # import models into sdk package 25 | from speechpro.cloud.speech.common.rest.cloud_client.models.auth_response_dto import AuthResponseDto 26 | from speechpro.cloud.speech.common.rest.cloud_client.models.auth_request_dto import AuthRequestDto -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Speechpro Cloud Python 3 | ====================== 4 | 5 | 6 | .. image:: https://img.shields.io/pypi/v/speechpro.svg 7 | :target: https://pypi.python.org/pypi/speechpro 8 | 9 | .. image:: https://img.shields.io/travis/hiisi13/speechpro.svg 10 | :target: https://travis-ci.com/hiisi13/speechpro 11 | 12 | .. image:: https://readthedocs.org/projects/speechpro/badge/?version=latest 13 | :target: https://speechpro.readthedocs.io/en/latest/?badge=latest 14 | :alt: Documentation Status 15 | 16 | 17 | 18 | 19 | Python клиент для API распознавания и синтеза речи Облака ЦРТ. 20 | 21 | 22 | * Free software: MIT license 23 | * Documentation: https://speechpro.readthedocs.io. 24 | 25 | 26 | Features 27 | -------- 28 | 29 | * TODO 30 | 31 | Credits 32 | ------- 33 | 34 | This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. 35 | 36 | .. _Cookiecutter: https://github.com/audreyr/cookiecutter 37 | .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Speech Technology Center 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Installation 5 | ============ 6 | 7 | 8 | Stable release 9 | -------------- 10 | 11 | To install Speechpro Cloud Python, run this command in your terminal: 12 | 13 | .. code-block:: console 14 | 15 | $ pip install speechpro 16 | 17 | This is the preferred method to install Speechpro Cloud Python, as it will always install the most recent stable release. 18 | 19 | If you don't have `pip`_ installed, this `Python installation guide`_ can guide 20 | you through the process. 21 | 22 | .. _pip: https://pip.pypa.io 23 | .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ 24 | 25 | 26 | From sources 27 | ------------ 28 | 29 | The sources for Speechpro Cloud Python can be downloaded from the `Github repo`_. 30 | 31 | You can either clone the public repository: 32 | 33 | .. code-block:: console 34 | 35 | $ git clone git://github.com/hiisi13/speechpro 36 | 37 | Or download the `tarball`_: 38 | 39 | .. code-block:: console 40 | 41 | $ curl -OJL https://github.com/hiisi13/speechpro/tarball/master 42 | 43 | Once you have a copy of the source, you can install it with: 44 | 45 | .. code-block:: console 46 | 47 | $ python setup.py install 48 | 49 | 50 | .. _Github repo: https://github.com/hiisi13/speechpro 51 | .. _tarball: https://github.com/hiisi13/speechpro/tarball/master 52 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/run.py: -------------------------------------------------------------------------------- 1 | import base64 2 | import cloud_client 3 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_request_dto import AuthRequestDto 4 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.session_api import SessionApi 5 | from speechpro.cloud.speech.recognition.rest.cloud_client.api import PackagesApi 6 | from speechpro.cloud.speech.recognition.rest.cloud_client.api import RecognizeApi 7 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.audio_file_dto import AudioFileDto 8 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.recognition_request_dto import RecognitionRequestDto 9 | 10 | session_api = SessionApi() 11 | credentials = AuthRequestDto("kozhedubov@speechpro.com", 863, "bb1e439bY#") 12 | session_id = session_api.login(credentials).session_id 13 | packages_api = PackagesApi() 14 | packages_api.load(session_id, "FarField").status 15 | in_file = open("~/documents/Projects/STC/CP/stafory/sample_1.wav", "rb") 16 | data = in_file.read() 17 | in_file.close() 18 | encoded_string = base64.standard_b64encode(data) 19 | string = str(encoded_string, 'ascii', 'ignore') 20 | recognize_api = RecognizeApi() 21 | audio_file = AudioFileDto(string, "audio/x-wav") 22 | recognition_request = RecognitionRequestDto(audio_file, "FarField") 23 | recognition_result = recognize_api.recognize(session_id, recognition_request) 24 | print(recognition_result) 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """The setup script.""" 4 | 5 | from setuptools import setup, find_packages 6 | 7 | with open('README.rst') as readme_file: 8 | readme = readme_file.read() 9 | 10 | with open('HISTORY.rst') as history_file: 11 | history = history_file.read() 12 | 13 | requirements = [ 14 | 'Click>=7.0', 15 | 'certifi>=14.05.14', 16 | 'six>=1.10', 17 | 'python_dateutil>=2.5.3', 18 | 'setuptools>=21.0.0', 19 | 'urllib3>=1.15.1', 20 | 'toml==0.10.1' 21 | ] 22 | 23 | setup_requirements = [ ] 24 | 25 | test_requirements = [ ] 26 | 27 | setup( 28 | author="Dmitry Kozhedubov", 29 | author_email='hiisi13@gmail.com', 30 | python_requires='>=3.5', 31 | classifiers=[ 32 | 'Development Status :: 2 - Pre-Alpha', 33 | 'Intended Audience :: Developers', 34 | 'License :: OSI Approved :: MIT License', 35 | 'Natural Language :: English', 36 | 'Programming Language :: Python :: 3', 37 | 'Programming Language :: Python :: 3.5', 38 | 'Programming Language :: Python :: 3.6', 39 | 'Programming Language :: Python :: 3.7', 40 | 'Programming Language :: Python :: 3.8', 41 | ], 42 | description="Python клиент для API распознавания и синтеза речи Облака ЦРТ", 43 | entry_points={ 44 | 'console_scripts': [ 45 | 'speechpro=speechpro.cli:cli', 46 | ], 47 | }, 48 | install_requires=requirements, 49 | license="MIT license", 50 | long_description=readme + '\n\n' + history, 51 | include_package_data=True, 52 | keywords='speechpro', 53 | name='speechpro-cloud-python', 54 | packages=find_packages(include=['speechpro', 'speechpro.*']), 55 | setup_requires=setup_requirements, 56 | test_suite='tests', 57 | tests_require=test_requirements, 58 | url='https://github.com/speechpro/cloud-python', 59 | version='0.1.10', 60 | zip_safe=False, 61 | ) 62 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/__init__.py: -------------------------------------------------------------------------------- 1 | from typing import Optional, Union 2 | import os 3 | 4 | import toml 5 | from speechpro.cloud.speech.common.rest.cloud_client.models.auth_status_dto import AuthStatusDto 6 | from speechpro.cloud.speech.common.rest.cloud_client import SessionApi, AuthRequestDto 7 | 8 | 9 | class SpeechproApiClientBase: 10 | def __init__(self, username: Optional[str] = None, domain_id: Optional[Union[str, int]] = None, password: Optional[str] = None): 11 | if username and domain_id and password: 12 | self.username = username 13 | self.domain_id = domain_id 14 | self.password = password 15 | else: 16 | profile: str = os.environ.get('SPEECHPRO_PROFILE', 'default') 17 | try: 18 | f = os.path.expanduser(os.path.join('~', '.speechpro', 'credentials')) 19 | credentials = toml.load(f)[profile] 20 | self.username = credentials['username'] 21 | self.domain_id = credentials['domain_id'] 22 | self.password = credentials['password'] 23 | except (FileNotFoundError, KeyError): 24 | self.username = os.environ.get('SPEECHPRO_USERNAME') 25 | self.domain_id = os.environ.get('SPEECHPRO_DOMAIN_ID') 26 | self.password = os.environ.get('SPEECHPRO_PASSWORD') 27 | 28 | self._session_id = None 29 | 30 | 31 | def _check_session_status(self) -> bool: 32 | session_api = SessionApi() 33 | status: AuthStatusDto = session_api.check(self._session_id) 34 | return status.is_active 35 | 36 | 37 | @property 38 | def session_id(self) -> str: 39 | if self._session_id and self._check_session_status(): 40 | return self._session_id 41 | else: 42 | session_api = SessionApi() 43 | credentials = AuthRequestDto(self.username, self.domain_id, self.password) 44 | self._session_id = session_api.login(credentials).session_id 45 | return self._session_id -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | """ 5 | TTS documentation 6 | 7 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 8 | 9 | OpenAPI spec version: 1.1 10 | 11 | Generated by: https://github.com/swagger-api/swagger-codegen.git 12 | """ 13 | 14 | 15 | from __future__ import absolute_import 16 | 17 | # import models into model package 18 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.close_transaction_response import CloseTransactionResponse 19 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.credentials import Credentials 20 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.exception_model import ExceptionModel 21 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_language import SynthesizeLanguage 22 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_request import SynthesizeRequest 23 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_response import SynthesizeResponse 24 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_sessionless_request import SynthesizeSessionlessRequest 25 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_text import SynthesizeText 26 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_voice_type import SynthesizeVoiceType 27 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_server_configuration_response import WebSocketServerConfigurationResponse 28 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_synthesize_request import WebSocketSynthesizeRequest 29 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_text_param import WebSocketTextParam 30 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.auth_response_dto import AuthResponseDto 31 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.auth_status_dto import AuthStatusDto 32 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | """ 5 | ASR documentation 6 | 7 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 8 | 9 | OpenAPI spec version: 1.1 10 | 11 | Generated by: https://github.com/swagger-api/swagger-codegen.git 12 | """ 13 | 14 | 15 | from __future__ import absolute_import 16 | 17 | # import models into model package 18 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.asr_advanced_result_dto import ASRAdvancedResultDto 19 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.asr_result_dto import ASRResultDto 20 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.advanced_recognition_request_dto import AdvancedRecognitionRequestDto 21 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.audio_file_dto import AudioFileDto 22 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.message_dto import MessageDto 23 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.package_dto import PackageDto 24 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.recognition_request_dto import RecognitionRequestDto 25 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.sessionless_recognition_request_dto import SessionlessRecognitionRequestDto 26 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.start_session_request import StartSessionRequest 27 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.status_dto import StatusDto 28 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.stream_request_dto import StreamRequestDto 29 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.stream_response_dto import StreamResponseDto 30 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.word_dto import WordDto 31 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_response_dto import AuthResponseDto 32 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_status_dto import AuthStatusDto 33 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/__init__.py: -------------------------------------------------------------------------------- 1 | import base64 2 | from typing import Union 3 | 4 | from speechpro.cloud.speech.synthesis.rest.cloud_client import Synthesize, SynthesizeRequest, SynthesizeText 5 | from speechpro.cloud.speech.synthesis import enums 6 | 7 | class BatchSynthesisClient: 8 | voice_profile_mapping = { 9 | (enums.Voice.VLADIMIR, enums.PlaybackProfile.SPEAKER): 'Vladimir_n', 10 | (enums.Voice.VLADIMIR, enums.PlaybackProfile.PHONE_CALL): 'Vladimir_8000n', 11 | (enums.Voice.ANNA, enums.PlaybackProfile.SPEAKER): 'Anna_n', 12 | (enums.Voice.ANNA, enums.PlaybackProfile.PHONE_CALL): 'Anna_8000n', 13 | (enums.Voice.JULIA, enums.PlaybackProfile.SPEAKER): 'Julia_n', 14 | (enums.Voice.JULIA, enums.PlaybackProfile.PHONE_CALL): 'Julia_8000n', 15 | (enums.Voice.DASHA, enums.PlaybackProfile.SPEAKER): 'Dasha_n', 16 | (enums.Voice.DASHA, enums.PlaybackProfile.PHONE_CALL): 'Dasha_8000n', 17 | (enums.Voice.ASEL, enums.PlaybackProfile.SPEAKER): 'Asel_n', 18 | (enums.Voice.ASEL, enums.PlaybackProfile.PHONE_CALL): 'Asel_8000n', 19 | (enums.Voice.CAROL, enums.PlaybackProfile.SPEAKER): 'Carol_n', 20 | (enums.Voice.CAROL, enums.PlaybackProfile.PHONE_CALL): 'Carol_8000n', 21 | } 22 | 23 | 24 | def get_enum_value(self, value, enum_type): 25 | return value if isinstance(value, enum_type) else enum_type[value] 26 | 27 | 28 | def synthesize(self, voice: Union[enums.Voice, str], profile: Union[enums.PlaybackProfile, str], text: str): 29 | try: 30 | voice = self.get_enum_value(voice, enums.Voice) 31 | profile = self.get_enum_value(profile, enums.PlaybackProfile) 32 | mapped_voice = self.voice_profile_mapping[(voice, profile)] 33 | except KeyError: 34 | raise ValueError('Incorrect combination of voice and playback profile') 35 | synthesize = Synthesize() 36 | text_request = SynthesizeText("text/plain", text) 37 | synthesize_request = SynthesizeRequest(text_request, mapped_voice, "audio/wav") 38 | audio_data = synthesize.synthesize(self.session_id, synthesize_request) 39 | sound = base64.decodebytes(bytes(audio_data.data, 'utf-8')) 40 | 41 | return sound -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | TTS documentation 7 | 8 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 9 | 10 | OpenAPI spec version: 1.1 11 | 12 | Generated by: https://github.com/swagger-api/swagger-codegen.git 13 | """ 14 | 15 | 16 | from __future__ import absolute_import 17 | 18 | # import apis into sdk package 19 | from speechpro.cloud.speech.synthesis.rest.cloud_client.api.synthesize_api import Synthesize 20 | from speechpro.cloud.speech.synthesis.rest.cloud_client.api.session_api import SessionApi 21 | 22 | # import ApiClient 23 | from speechpro.cloud.speech.synthesis.rest.cloud_client.cloud_api_client import CloudApiClient 24 | from speechpro.cloud.speech.synthesis.rest.cloud_client.configuration import Configuration 25 | # import models into sdk package 26 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.close_transaction_response import CloseTransactionResponse 27 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.credentials import Credentials 28 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.exception_model import ExceptionModel 29 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_language import SynthesizeLanguage 30 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_request import SynthesizeRequest 31 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_response import SynthesizeResponse 32 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_sessionless_request import SynthesizeSessionlessRequest 33 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_text import SynthesizeText 34 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_voice_type import SynthesizeVoiceType 35 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_server_configuration_response import WebSocketServerConfigurationResponse 36 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_synthesize_request import WebSocketSynthesizeRequest 37 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_text_param import WebSocketTextParam 38 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.auth_response_dto import AuthResponseDto -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean clean-test clean-pyc clean-build docs help 2 | .DEFAULT_GOAL := help 3 | 4 | define BROWSER_PYSCRIPT 5 | import os, webbrowser, sys 6 | 7 | from urllib.request import pathname2url 8 | 9 | webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) 10 | endef 11 | export BROWSER_PYSCRIPT 12 | 13 | define PRINT_HELP_PYSCRIPT 14 | import re, sys 15 | 16 | for line in sys.stdin: 17 | match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) 18 | if match: 19 | target, help = match.groups() 20 | print("%-20s %s" % (target, help)) 21 | endef 22 | export PRINT_HELP_PYSCRIPT 23 | 24 | BROWSER := python -c "$$BROWSER_PYSCRIPT" 25 | 26 | help: 27 | @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) 28 | 29 | clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts 30 | 31 | clean-build: ## remove build artifacts 32 | rm -fr build/ 33 | rm -fr dist/ 34 | rm -fr .eggs/ 35 | find . -name '*.egg-info' -exec rm -fr {} + 36 | find . -name '*.egg' -exec rm -f {} + 37 | 38 | clean-pyc: ## remove Python file artifacts 39 | find . -name '*.pyc' -exec rm -f {} + 40 | find . -name '*.pyo' -exec rm -f {} + 41 | find . -name '*~' -exec rm -f {} + 42 | find . -name '__pycache__' -exec rm -fr {} + 43 | 44 | clean-test: ## remove test and coverage artifacts 45 | rm -fr .tox/ 46 | rm -f .coverage 47 | rm -fr htmlcov/ 48 | rm -fr .pytest_cache 49 | 50 | lint: ## check style with flake8 51 | flake8 speechpro tests 52 | 53 | test: ## run tests quickly with the default Python 54 | python setup.py test 55 | 56 | test-all: ## run tests on every Python version with tox 57 | tox 58 | 59 | coverage: ## check code coverage quickly with the default Python 60 | coverage run --source speechpro setup.py test 61 | coverage report -m 62 | coverage html 63 | $(BROWSER) htmlcov/index.html 64 | 65 | docs: ## generate Sphinx HTML documentation, including API docs 66 | rm -f docs/speechpro.rst 67 | rm -f docs/modules.rst 68 | sphinx-apidoc -o docs/ speechpro 69 | $(MAKE) -C docs clean 70 | $(MAKE) -C docs html 71 | $(BROWSER) docs/_build/html/index.html 72 | 73 | servedocs: docs ## compile the docs watching for changes 74 | watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . 75 | 76 | release: dist ## package and upload a release 77 | twine upload dist/* 78 | 79 | dist: clean ## builds source and wheel package 80 | python setup.py sdist 81 | python setup.py bdist_wheel 82 | ls -l dist 83 | 84 | install: clean ## install the package to the active Python's site-packages 85 | python setup.py install 86 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | ASR documentation 7 | 8 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 9 | 10 | OpenAPI spec version: 1.0.dev 11 | 12 | Generated by: https://github.com/swagger-api/swagger-codegen.git 13 | """ 14 | 15 | 16 | from __future__ import absolute_import 17 | 18 | # import apis into sdk package 19 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.packages_api import PackagesApi 20 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.recognize_api import RecognizeApi 21 | from speechpro.cloud.speech.recognition.rest.cloud_client.api.session_api import SessionApi 22 | 23 | # import ApiClient 24 | from speechpro.cloud.speech.recognition.rest.cloud_client.cloud_api_client import CloudApiClient 25 | from speechpro.cloud.speech.recognition.rest.cloud_client.configuration import Configuration 26 | # import models into sdk package 27 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.advanced_recognition_request_dto import AdvancedRecognitionRequestDto 28 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.asr_advanced_result_dto import ASRAdvancedResultDto 29 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.asr_result_dto import ASRResultDto 30 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.audio_file_dto import AudioFileDto 31 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_request_dto import AuthRequestDto 32 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_response_dto import AuthResponseDto 33 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.auth_status_dto import AuthStatusDto 34 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.message_dto import MessageDto 35 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.package_dto import PackageDto 36 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.recognition_request_dto import RecognitionRequestDto 37 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.sessionless_recognition_request_dto import SessionlessRecognitionRequestDto 38 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.start_session_request import StartSessionRequest 39 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.status_dto import StatusDto 40 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.stream_request_dto import StreamRequestDto 41 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.stream_response_dto import StreamResponseDto 42 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.word_dto import WordDto 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ 139 | .DS_Store 140 | 141 | *.wav 142 | *.txt 143 | -------------------------------------------------------------------------------- /speechpro/cli.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import click 5 | 6 | from speechpro.cloud.speech import recognition 7 | from speechpro.cloud.speech import synthesis 8 | 9 | 10 | recognitionClient = recognition.RecognitionClient() 11 | 12 | synthesisClient = synthesis.SynthesisClient() 13 | 14 | 15 | def recognize(language, model, response_type, filename, audio_channel_count=1): 16 | with open(filename, "rb") as f: 17 | content = f.read() 18 | 19 | config = { 20 | 'language': language, 21 | 'model': model, 22 | 'encoding': recognition.enums.AudioEncoding.WAV, 23 | 'response_type': response_type, 24 | 'audio_channel_count': audio_channel_count 25 | } 26 | return recognitionClient.recognize(config, content) 27 | 28 | 29 | @click.group() 30 | def cli(): 31 | pass 32 | 33 | @cli.command() 34 | @click.option('--language', default=recognition.enums.Language.RU) 35 | @click.option('--model', default=recognition.enums.Model.GENERAL) 36 | @click.option('--filename', type=str,) 37 | def recognize_plain_text(language, model, filename): 38 | result = recognize(language, model, recognition.enums.ResponseType.PLAIN_TEXT, filename) 39 | print(result.text) 40 | return 0 41 | 42 | 43 | @cli.command() 44 | @click.option('--language', default=recognition.enums.Language.RU) 45 | @click.option('--model', default=recognition.enums.Model.GENERAL) 46 | @click.option('--filename', type=str,) 47 | def recognize_word_list(language, model, filename): 48 | result = recognize(language, model, recognition.enums.ResponseType.WORD_LIST, filename) 49 | for w in result: 50 | print(w.word) 51 | return 0 52 | 53 | 54 | @cli.command() 55 | @click.option('--language', default=recognition.enums.Language.RU) 56 | @click.option('--model', default=recognition.enums.Model.GENERAL) 57 | @click.option('--filename', type=str,) 58 | @click.option('--audio_channel_count', type=int,) 59 | def recognize_multichannel(language, model, filename, audio_channel_count): 60 | result = recognize(language, model, recognition.enums.ResponseType.MULTICHANNEL, filename, audio_channel_count) 61 | for ch in result: 62 | print(f'Channel {ch.channel_id}') 63 | for w in ch.result: 64 | print(w.word) 65 | print('\n') 66 | return 0 67 | 68 | 69 | @cli.command() 70 | @click.option('--voice', default=synthesis.enums.Voice.JULIA) 71 | @click.option('--profile', default=synthesis.enums.PlaybackProfile.SPEAKER) 72 | @click.option('--output', type=str) 73 | @click.option('--input', type=str) 74 | def synthesize(voice, profile, output, input): 75 | try: 76 | with open(input) as f: 77 | text = f.read() 78 | except: 79 | text = input 80 | audio = synthesisClient.synthesize(voice, profile, text) 81 | 82 | with open(output, 'wb') as outputfile: 83 | outputfile.write(audio) 84 | 85 | 86 | 87 | if __name__ == "__main__": 88 | sys.exit(cli()) # pragma: no cover -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/__init__.py: -------------------------------------------------------------------------------- 1 | import base64 2 | import enum 3 | from typing import Any, Dict, Tuple 4 | 5 | from speechpro.cloud.speech.recognition.rest.cloud_client.api import RecognizeApi 6 | from speechpro.cloud.speech.recognition.rest.cloud_client.models import AudioFileDto, RecognitionRequestDto, AdvancedRecognitionRequestDto 7 | 8 | from speechpro.cloud.speech.recognition import enums 9 | 10 | 11 | CONFIG_MODEL_KEY = 'model' 12 | CONFIG_LANGUAGE_KEY = 'language' 13 | 14 | 15 | class ShortAudioRecognitionClient(): 16 | 17 | model_mapping: Dict[Tuple[enums.Language, enums.Model], str] = { 18 | (enums.Language.RU, enums.Model.GENERAL): 'FarField', 19 | (enums.Language.RU, enums.Model.PHONE_CALL): 'TelecomRus', 20 | (enums.Language.KZ, enums.Model.PHONE_CALL): 'TelecomKz', 21 | (enums.Language.EN, enums.Model.PHONE_CALL): 'TelecomEngUs', 22 | (enums.Language.ES, enums.Model.PHONE_CALL): 'TelecomEsp', 23 | (enums.Language.ES, enums.Model.GENERAL): 'FarFieldEsp', 24 | (enums.Language.EN, enums.Model.GENERAL): 'FarFieldEng', 25 | } 26 | 27 | def validate_enum_value(self, config: Dict[str, Any], key: str, enum_type: enum.EnumMeta): 28 | try: 29 | return config[key] if isinstance(config[key], enum_type) else enum_type[config[key]] 30 | except: 31 | raise ValueError(f"{enum_type.__name__} is not provided or does not exist. Available models: {', '.join([m.name for m in enum_type])}") 32 | 33 | 34 | def recognize(self, config: Dict[str, Any], audio: bytes) -> Any: 35 | b64encoded_audio = base64.standard_b64encode(audio) 36 | audio_str = str(b64encoded_audio, 'ascii', 'ignore') 37 | 38 | recognize_api = RecognizeApi() 39 | audio_file = AudioFileDto(audio_str, config.get('encoding', enums.AudioEncoding.WAV).value) 40 | 41 | model = self.validate_enum_value(config, CONFIG_MODEL_KEY, enums.Model) 42 | language = self.validate_enum_value(config, CONFIG_LANGUAGE_KEY, enums.Language) 43 | mapped_model = self.model_mapping[(language, model)] 44 | 45 | recognition_request = RecognitionRequestDto( 46 | audio_file, mapped_model 47 | ) 48 | response_type = config.get('response_type', enums.ResponseType.PLAIN_TEXT) 49 | if response_type == enums.ResponseType.PLAIN_TEXT: 50 | return recognize_api.recognize(self.session_id, recognition_request) 51 | elif response_type == enums.ResponseType.WORD_LIST: 52 | return recognize_api.recognize_words(self.session_id, recognition_request) 53 | elif response_type == enums.ResponseType.MULTICHANNEL: 54 | channel_count = config.get('audio_channel_count', 1) 55 | return recognize_api.recognize_advanced( 56 | self.session_id, 57 | AdvancedRecognitionRequestDto( 58 | mapped_model, channels=[i for i in range(0, channel_count)], data=audio_str 59 | ) 60 | ) 61 | 62 | 63 | class LongRunningRecognitionClient(): 64 | pass -------------------------------------------------------------------------------- /cli.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import click 5 | 6 | from speechpro.cloud.speech import recognition 7 | from speechpro.cloud.speech import synthesis 8 | 9 | 10 | recognitionClient = recognition.RecognitionClient( 11 | os.environ['SPEECHPRO_USERNAME'], 12 | os.environ['SPEECHPRO_DOMAIN_ID'], 13 | os.environ['SPEECHPRO_PASSWORD'] 14 | ) 15 | 16 | synthesisClient = synthesis.SynthesisClient( 17 | os.environ['SPEECHPRO_USERNAME'], 18 | os.environ['SPEECHPRO_DOMAIN_ID'], 19 | os.environ['SPEECHPRO_PASSWORD'] 20 | ) 21 | 22 | 23 | def recognize(language, model, response_type, filename, audio_channel_count=1): 24 | with open(filename, "rb") as f: 25 | content = f.read() 26 | 27 | config = { 28 | 'language': language, 29 | 'model': model, 30 | 'encoding': recognition.enums.AudioEncoding.WAV, 31 | 'response_type': response_type, 32 | 'audio_channel_count': audio_channel_count 33 | } 34 | return recognitionClient.recognize(config, content) 35 | 36 | 37 | @click.group() 38 | def cli(): 39 | pass 40 | 41 | @cli.command() 42 | @click.option('--language', default=recognition.enums.Language.RU) 43 | @click.option('--model', default=recognition.enums.Model.GENERAL) 44 | @click.option('--filename', type=str,) 45 | def recognize_plain_text(language, model, filename): 46 | result = recognize(language, model, recognition.enums.ResponseType.PLAIN_TEXT, filename) 47 | print(result.text) 48 | return 0 49 | 50 | 51 | @cli.command() 52 | @click.option('--language', default=recognition.enums.Language.RU) 53 | @click.option('--model', default=recognition.enums.Model.GENERAL) 54 | @click.option('--filename', type=str,) 55 | def recognize_word_list(language, model, filename): 56 | result = recognize(language, model, recognition.enums.ResponseType.WORD_LIST, filename) 57 | for w in result: 58 | print(w.word) 59 | return 0 60 | 61 | 62 | @cli.command() 63 | @click.option('--language', default=recognition.enums.Language.RU) 64 | @click.option('--model', default=recognition.enums.Model.GENERAL) 65 | @click.option('--filename', type=str,) 66 | @click.option('--audio_channel_count', type=int,) 67 | def recognize_multichannel(language, model, filename, audio_channel_count): 68 | result = recognize(language, model, recognition.enums.ResponseType.MULTICHANNEL, filename, audio_channel_count) 69 | for ch in result: 70 | print(f'Channel {ch.channel_id}') 71 | for w in ch.result: 72 | print(w.word) 73 | print('\n') 74 | return 0 75 | 76 | 77 | @cli.command() 78 | @click.option('--voice', default=synthesis.enums.Voice.JULIA) 79 | @click.option('--profile', default=synthesis.enums.PlaybackProfile.SPEAKER) 80 | @click.option('--output', type=str) 81 | @click.option('--input', type=str) 82 | def synthesize(voice, profile, output, input): 83 | try: 84 | with open(input) as f: 85 | text = f.read() 86 | except: 87 | text = input 88 | audio = synthesisClient.synthesize(voice, profile, text) 89 | 90 | with open(output, 'wb') as outputfile: 91 | outputfile.write(audio) 92 | 93 | 94 | 95 | if __name__ == "__main__": 96 | sys.exit(cli()) # pragma: no cover -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/stream_response_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class StreamResponseDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'url': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'url': 'url' 39 | } 40 | 41 | def __init__(self, url=None): # noqa: E501 42 | """StreamResponseDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._url = None 45 | self.discriminator = None 46 | 47 | if url is not None: 48 | self.url = url 49 | 50 | @property 51 | def url(self): 52 | """Gets the url of this StreamResponseDto. # noqa: E501 53 | 54 | 55 | :return: The url of this StreamResponseDto. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._url 59 | 60 | @url.setter 61 | def url(self, url): 62 | """Sets the url of this StreamResponseDto. 63 | 64 | 65 | :param url: The url of this StreamResponseDto. # noqa: E501 66 | :type: str 67 | """ 68 | 69 | self._url = url 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.swagger_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, StreamResponseDto): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/status_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class StatusDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'status': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'status': 'status' 39 | } 40 | 41 | def __init__(self, status=None): # noqa: E501 42 | """StatusDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._status = None 45 | self.discriminator = None 46 | 47 | self.status = status 48 | 49 | @property 50 | def status(self): 51 | """Gets the status of this StatusDto. # noqa: E501 52 | 53 | 54 | :return: The status of this StatusDto. # noqa: E501 55 | :rtype: str 56 | """ 57 | return self._status 58 | 59 | @status.setter 60 | def status(self, status): 61 | """Sets the status of this StatusDto. 62 | 63 | 64 | :param status: The status of this StatusDto. # noqa: E501 65 | :type: str 66 | """ 67 | if status is None: 68 | raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 69 | 70 | self._status = status 71 | 72 | def to_dict(self): 73 | """Returns the model properties as a dict""" 74 | result = {} 75 | 76 | for attr, _ in six.iteritems(self.swagger_types): 77 | value = getattr(self, attr) 78 | if isinstance(value, list): 79 | result[attr] = list(map( 80 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 81 | value 82 | )) 83 | elif hasattr(value, "to_dict"): 84 | result[attr] = value.to_dict() 85 | elif isinstance(value, dict): 86 | result[attr] = dict(map( 87 | lambda item: (item[0], item[1].to_dict()) 88 | if hasattr(item[1], "to_dict") else item, 89 | value.items() 90 | )) 91 | else: 92 | result[attr] = value 93 | 94 | return result 95 | 96 | def to_str(self): 97 | """Returns the string representation of the model""" 98 | return pprint.pformat(self.to_dict()) 99 | 100 | def __repr__(self): 101 | """For `print` and `pprint`""" 102 | return self.to_str() 103 | 104 | def __eq__(self, other): 105 | """Returns true if both objects are equal""" 106 | if not isinstance(other, StatusDto): 107 | return False 108 | 109 | return self.__dict__ == other.__dict__ 110 | 111 | def __ne__(self, other): 112 | """Returns true if both objects are not equal""" 113 | return not self == other 114 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/web_socket_server_configuration_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class WebSocketServerConfigurationResponse(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'url': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'url': 'url' 39 | } 40 | 41 | def __init__(self, url=None): # noqa: E501 42 | """WebSocketServerConfigurationResponse - a model defined in Swagger""" # noqa: E501 43 | 44 | self._url = None 45 | self.discriminator = None 46 | 47 | if url is not None: 48 | self.url = url 49 | 50 | @property 51 | def url(self): 52 | """Gets the url of this WebSocketServerConfigurationResponse. # noqa: E501 53 | 54 | 55 | :return: The url of this WebSocketServerConfigurationResponse. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._url 59 | 60 | @url.setter 61 | def url(self, url): 62 | """Sets the url of this WebSocketServerConfigurationResponse. 63 | 64 | 65 | :param url: The url of this WebSocketServerConfigurationResponse. # noqa: E501 66 | :type: str 67 | """ 68 | 69 | self._url = url 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.swagger_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, WebSocketServerConfigurationResponse): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/auth_status_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthStatusDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'is_active': 'bool' 35 | } 36 | 37 | attribute_map = { 38 | 'is_active': 'is_active' 39 | } 40 | 41 | def __init__(self, is_active=None): # noqa: E501 42 | """AuthStatusDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._is_active = None 45 | self.discriminator = None 46 | 47 | if is_active is not None: 48 | self.is_active = is_active 49 | 50 | @property 51 | def is_active(self): 52 | """Gets the is_active of this AuthStatusDto. # noqa: E501 53 | 54 | Auth status # noqa: E501 55 | 56 | :return: The is_active of this AuthStatusDto. # noqa: E501 57 | :rtype: bool 58 | """ 59 | return self._is_active 60 | 61 | @is_active.setter 62 | def is_active(self, is_active): 63 | """Sets the is_active of this AuthStatusDto. 64 | 65 | Auth status # noqa: E501 66 | 67 | :param is_active: The is_active of this AuthStatusDto. # noqa: E501 68 | :type: bool 69 | """ 70 | 71 | self._is_active = is_active 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthStatusDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/auth_status_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthStatusDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'is_active': 'bool' 35 | } 36 | 37 | attribute_map = { 38 | 'is_active': 'is_active' 39 | } 40 | 41 | def __init__(self, is_active=None): # noqa: E501 42 | """AuthStatusDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._is_active = None 45 | self.discriminator = None 46 | 47 | if is_active is not None: 48 | self.is_active = is_active 49 | 50 | @property 51 | def is_active(self): 52 | """Gets the is_active of this AuthStatusDto. # noqa: E501 53 | 54 | Auth status # noqa: E501 55 | 56 | :return: The is_active of this AuthStatusDto. # noqa: E501 57 | :rtype: bool 58 | """ 59 | return self._is_active 60 | 61 | @is_active.setter 62 | def is_active(self, is_active): 63 | """Sets the is_active of this AuthStatusDto. 64 | 65 | Auth status # noqa: E501 66 | 67 | :param is_active: The is_active of this AuthStatusDto. # noqa: E501 68 | :type: bool 69 | """ 70 | 71 | self._is_active = is_active 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthStatusDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/auth_status_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthStatusDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'is_active': 'bool' 35 | } 36 | 37 | attribute_map = { 38 | 'is_active': 'is_active' 39 | } 40 | 41 | def __init__(self, is_active=None): # noqa: E501 42 | """AuthStatusDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._is_active = None 45 | self.discriminator = None 46 | 47 | if is_active is not None: 48 | self.is_active = is_active 49 | 50 | @property 51 | def is_active(self): 52 | """Gets the is_active of this AuthStatusDto. # noqa: E501 53 | 54 | Auth status # noqa: E501 55 | 56 | :return: The is_active of this AuthStatusDto. # noqa: E501 57 | :rtype: bool 58 | """ 59 | return self._is_active 60 | 61 | @is_active.setter 62 | def is_active(self, is_active): 63 | """Sets the is_active of this AuthStatusDto. 64 | 65 | Auth status # noqa: E501 66 | 67 | :param is_active: The is_active of this AuthStatusDto. # noqa: E501 68 | :type: bool 69 | """ 70 | 71 | self._is_active = is_active 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthStatusDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/web_socket_text_param.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class WebSocketTextParam(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'mime': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'mime': 'mime' 39 | } 40 | 41 | def __init__(self, mime=None): # noqa: E501 42 | """WebSocketTextParam - a model defined in Swagger""" # noqa: E501 43 | 44 | self._mime = None 45 | self.discriminator = None 46 | 47 | self.mime = mime 48 | 49 | @property 50 | def mime(self): 51 | """Gets the mime of this WebSocketTextParam. # noqa: E501 52 | 53 | Type of content # noqa: E501 54 | 55 | :return: The mime of this WebSocketTextParam. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._mime 59 | 60 | @mime.setter 61 | def mime(self, mime): 62 | """Sets the mime of this WebSocketTextParam. 63 | 64 | Type of content # noqa: E501 65 | 66 | :param mime: The mime of this WebSocketTextParam. # noqa: E501 67 | :type: str 68 | """ 69 | if mime is None: 70 | raise ValueError("Invalid value for `mime`, must not be `None`") # noqa: E501 71 | 72 | self._mime = mime 73 | 74 | def to_dict(self): 75 | """Returns the model properties as a dict""" 76 | result = {} 77 | 78 | for attr, _ in six.iteritems(self.swagger_types): 79 | value = getattr(self, attr) 80 | if isinstance(value, list): 81 | result[attr] = list(map( 82 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 83 | value 84 | )) 85 | elif hasattr(value, "to_dict"): 86 | result[attr] = value.to_dict() 87 | elif isinstance(value, dict): 88 | result[attr] = dict(map( 89 | lambda item: (item[0], item[1].to_dict()) 90 | if hasattr(item[1], "to_dict") else item, 91 | value.items() 92 | )) 93 | else: 94 | result[attr] = value 95 | 96 | return result 97 | 98 | def to_str(self): 99 | """Returns the string representation of the model""" 100 | return pprint.pformat(self.to_dict()) 101 | 102 | def __repr__(self): 103 | """For `print` and `pprint`""" 104 | return self.to_str() 105 | 106 | def __eq__(self, other): 107 | """Returns true if both objects are equal""" 108 | if not isinstance(other, WebSocketTextParam): 109 | return False 110 | 111 | return self.__dict__ == other.__dict__ 112 | 113 | def __ne__(self, other): 114 | """Returns true if both objects are not equal""" 115 | return not self == other 116 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class SynthesizeResponse(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'data': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'data': 'data' 39 | } 40 | 41 | def __init__(self, data=None): # noqa: E501 42 | """SynthesizeResponse - a model defined in Swagger""" # noqa: E501 43 | 44 | self._data = None 45 | self.discriminator = None 46 | 47 | self.data = data 48 | 49 | @property 50 | def data(self): 51 | """Gets the data of this SynthesizeResponse. # noqa: E501 52 | 53 | Result speech in data with base64 coding # noqa: E501 54 | 55 | :return: The data of this SynthesizeResponse. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._data 59 | 60 | @data.setter 61 | def data(self, data): 62 | """Sets the data of this SynthesizeResponse. 63 | 64 | Result speech in data with base64 coding # noqa: E501 65 | 66 | :param data: The data of this SynthesizeResponse. # noqa: E501 67 | :type: str 68 | """ 69 | if data is None: 70 | raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 71 | 72 | self._data = data 73 | 74 | def to_dict(self): 75 | """Returns the model properties as a dict""" 76 | result = {} 77 | 78 | for attr, _ in six.iteritems(self.swagger_types): 79 | value = getattr(self, attr) 80 | if isinstance(value, list): 81 | result[attr] = list(map( 82 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 83 | value 84 | )) 85 | elif hasattr(value, "to_dict"): 86 | result[attr] = value.to_dict() 87 | elif isinstance(value, dict): 88 | result[attr] = dict(map( 89 | lambda item: (item[0], item[1].to_dict()) 90 | if hasattr(item[1], "to_dict") else item, 91 | value.items() 92 | )) 93 | else: 94 | result[attr] = value 95 | 96 | return result 97 | 98 | def to_str(self): 99 | """Returns the string representation of the model""" 100 | return pprint.pformat(self.to_dict()) 101 | 102 | def __repr__(self): 103 | """For `print` and `pprint`""" 104 | return self.to_str() 105 | 106 | def __eq__(self, other): 107 | """Returns true if both objects are equal""" 108 | if not isinstance(other, SynthesizeResponse): 109 | return False 110 | 111 | return self.__dict__ == other.__dict__ 112 | 113 | def __ne__(self, other): 114 | """Returns true if both objects are not equal""" 115 | return not self == other 116 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/auth_response_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthResponseDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'session_id': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'session_id': 'session_id' 39 | } 40 | 41 | def __init__(self, session_id=None): # noqa: E501 42 | """AuthResponseDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._session_id = None 45 | self.discriminator = None 46 | 47 | if session_id is not None: 48 | self.session_id = session_id 49 | 50 | @property 51 | def session_id(self): 52 | """Gets the session_id of this AuthResponseDto. # noqa: E501 53 | 54 | Session identifier to be provided in header on all REST API results # noqa: E501 55 | 56 | :return: The session_id of this AuthResponseDto. # noqa: E501 57 | :rtype: str 58 | """ 59 | return self._session_id 60 | 61 | @session_id.setter 62 | def session_id(self, session_id): 63 | """Sets the session_id of this AuthResponseDto. 64 | 65 | Session identifier to be provided in header on all REST API results # noqa: E501 66 | 67 | :param session_id: The session_id of this AuthResponseDto. # noqa: E501 68 | :type: str 69 | """ 70 | 71 | self._session_id = session_id 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthResponseDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/auth_response_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthResponseDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'session_id': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'session_id': 'session_id' 39 | } 40 | 41 | def __init__(self, session_id=None): # noqa: E501 42 | """AuthResponseDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._session_id = None 45 | self.discriminator = None 46 | 47 | if session_id is not None: 48 | self.session_id = session_id 49 | 50 | @property 51 | def session_id(self): 52 | """Gets the session_id of this AuthResponseDto. # noqa: E501 53 | 54 | Session identifier to be provided in header on all REST API results # noqa: E501 55 | 56 | :return: The session_id of this AuthResponseDto. # noqa: E501 57 | :rtype: str 58 | """ 59 | return self._session_id 60 | 61 | @session_id.setter 62 | def session_id(self, session_id): 63 | """Sets the session_id of this AuthResponseDto. 64 | 65 | Session identifier to be provided in header on all REST API results # noqa: E501 66 | 67 | :param session_id: The session_id of this AuthResponseDto. # noqa: E501 68 | :type: str 69 | """ 70 | 71 | self._session_id = session_id 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthResponseDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/auth_response_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthResponseDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'session_id': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'session_id': 'session_id' 39 | } 40 | 41 | def __init__(self, session_id=None): # noqa: E501 42 | """AuthResponseDto - a model defined in Swagger""" # noqa: E501 43 | 44 | self._session_id = None 45 | self.discriminator = None 46 | 47 | if session_id is not None: 48 | self.session_id = session_id 49 | 50 | @property 51 | def session_id(self): 52 | """Gets the session_id of this AuthResponseDto. # noqa: E501 53 | 54 | Session identifier to be provided in header on all REST API results # noqa: E501 55 | 56 | :return: The session_id of this AuthResponseDto. # noqa: E501 57 | :rtype: str 58 | """ 59 | return self._session_id 60 | 61 | @session_id.setter 62 | def session_id(self, session_id): 63 | """Sets the session_id of this AuthResponseDto. 64 | 65 | Session identifier to be provided in header on all REST API results # noqa: E501 66 | 67 | :param session_id: The session_id of this AuthResponseDto. # noqa: E501 68 | :type: str 69 | """ 70 | 71 | self._session_id = session_id 72 | 73 | def to_dict(self): 74 | """Returns the model properties as a dict""" 75 | result = {} 76 | 77 | for attr, _ in six.iteritems(self.swagger_types): 78 | value = getattr(self, attr) 79 | if isinstance(value, list): 80 | result[attr] = list(map( 81 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 82 | value 83 | )) 84 | elif hasattr(value, "to_dict"): 85 | result[attr] = value.to_dict() 86 | elif isinstance(value, dict): 87 | result[attr] = dict(map( 88 | lambda item: (item[0], item[1].to_dict()) 89 | if hasattr(item[1], "to_dict") else item, 90 | value.items() 91 | )) 92 | else: 93 | result[attr] = value 94 | 95 | return result 96 | 97 | def to_str(self): 98 | """Returns the string representation of the model""" 99 | return pprint.pformat(self.to_dict()) 100 | 101 | def __repr__(self): 102 | """For `print` and `pprint`""" 103 | return self.to_str() 104 | 105 | def __eq__(self, other): 106 | """Returns true if both objects are equal""" 107 | if not isinstance(other, AuthResponseDto): 108 | return False 109 | 110 | return self.__dict__ == other.__dict__ 111 | 112 | def __ne__(self, other): 113 | """Returns true if both objects are not equal""" 114 | return not self == other 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Распознавание и синтез речи в Облаке ЦРТ 2 | [![PyPI version](https://badge.fury.io/py/speechpro-cloud-python.svg)](https://badge.fury.io/py/speechpro-cloud-python) 3 | 4 | ## Начало работы 5 | Установите клиентскую библиотеку с помощью pip 6 | ```shell 7 | pip install speechpro-cloud-python 8 | ``` 9 | 10 | Создайте файл *~/.speechpro/credentials*, укажите в ней данные учетной записи в формате TOML в профиле (секции) *default*, например: 11 | ```toml 12 | [default] 13 | username = "username" 14 | domain_id = 200 15 | password = "password" 16 | ``` 17 | Узнайте больше об аутентификации в разделе [Аутентификация](#аутентификация). 18 | 19 | ## Распознавание речи из файла 20 | Код распознавания WAV файла на русском языке моделью **GENERAL** выглядит следующим образом 21 | ```python 22 | import os 23 | 24 | from speechpro.cloud.speech.recognition import RecognitionClient 25 | from speechpro.cloud.speech.recognition import enums 26 | 27 | сlient = RecognitionClient() 28 | 29 | with open('path_to_wav_file', "rb") as f: 30 | content = f.read() 31 | 32 | config = { 33 | 'language': enums.Language.RU, 34 | 'model': enums.Model.GENERAL, 35 | 'encoding': enums.AudioEncoding.WAV, 36 | 'response_type': enums.ResponseType.WORD_LIST, 37 | } 38 | 39 | word_list = сlient.recognize(config, content) 40 | for w in word_list: 41 | print(w.word) 42 | ``` 43 | 44 | Аналогичная операция с помощью командной строки 45 | ```shell 46 | speechpro recognize-word-list --model GENERAL --filename //path_to_audio 47 | ``` 48 | 49 | ### Полная документация API распознавания речи 50 | Полная документация API распознавания речи доступна на сайте Облака ЦРТ по адресу https://cp.speechpro.com/doc/asr 51 | 52 | ## Синтез речи 53 | Код для синтеза текста голосом **Юлия** выглядит следующим образом: 54 | ```python 55 | import os 56 | from speechpro.cloud.speech import synthesis 57 | 58 | сlient = synthesis.SynthesisClient() 59 | 60 | text = 'Привет, я - синтезированный голос от компании ЦРТ' 61 | audio = сlient.synthesize(synthesis.enums.Voice.JULIA, synthesis.enums.PlaybackProfile.SPEAKER, text) 62 | 63 | with open('output.wav', 'wb') as f: 64 | f.write(audio) 65 | ``` 66 | 67 | Аналогичная операция с помощью командной строки 68 | ```shell 69 | speechpro synthesize --voice JULIA --input "Привет, я - синтезированный голос от компании ЦРТ" --output hi.wav 70 | ``` 71 | 72 | ### Полная документация API синтеза речи 73 | Полная документация API синтеза речи доступна на сайте Облака ЦРТ по адресу https://cp.speechpro.com/doc/tts 74 | 75 | ## Аутентификация 76 | 77 | Данные для аутентификации можно задать несколькими способами - передать в качестве параметров в конструктор, сохранить в TOML формате, либо установить переменные среды. 78 | 79 | ### TOML 80 | 81 | Предполагается, что TOML файл расположен по пути *~/.speechpro/credentials*, по умолчанию используется профиль (секция) *default*: 82 | 83 | ```toml 84 | [default] 85 | username = "username" 86 | domain_id = 200 87 | password = "password" 88 | ``` 89 | Для использования профиля с другим именем, установите его значение в переменную среду *SPEECHPRO_PROFILE*. 90 | 91 | ### Переменные среды 92 | 93 | Задайте данные вашей учетной записи [Облака ЦРТ](https://cp.speechpro.com) с помощью переменных среды, их значения будут использованы в случае, если не удастся прочитать TOML файл. 94 | ```shell 95 | export SPEECHPRO_USERNAME=username 96 | export SPEECHPRO_DOMAIN_ID=200 97 | export SPEECHPRO_PASSWORD=password 98 | ``` 99 | 100 | ### Конструктор 101 | 102 | Возможно также передать значения напрямую в конструктор, например: 103 | 104 | ```python 105 | from speechpro.cloud.speech.recognition import RecognitionClient 106 | 107 | сlient = RecognitionClient( 108 | 'username', 109 | 200, 110 | 'password' 111 | ) 112 | ``` 113 | 114 | ## TODO 115 | * Добавить оставшиеся методы API распознавания речи 116 | * Описания моделей и голосов 117 | * Больше примеров 118 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Contributing 5 | ============ 6 | 7 | Contributions are welcome, and they are greatly appreciated! Every little bit 8 | helps, and credit will always be given. 9 | 10 | You can contribute in many ways: 11 | 12 | Types of Contributions 13 | ---------------------- 14 | 15 | Report Bugs 16 | ~~~~~~~~~~~ 17 | 18 | Report bugs at https://github.com/hiisi13/speechpro/issues. 19 | 20 | If you are reporting a bug, please include: 21 | 22 | * Your operating system name and version. 23 | * Any details about your local setup that might be helpful in troubleshooting. 24 | * Detailed steps to reproduce the bug. 25 | 26 | Fix Bugs 27 | ~~~~~~~~ 28 | 29 | Look through the GitHub issues for bugs. Anything tagged with "bug" and "help 30 | wanted" is open to whoever wants to implement it. 31 | 32 | Implement Features 33 | ~~~~~~~~~~~~~~~~~~ 34 | 35 | Look through the GitHub issues for features. Anything tagged with "enhancement" 36 | and "help wanted" is open to whoever wants to implement it. 37 | 38 | Write Documentation 39 | ~~~~~~~~~~~~~~~~~~~ 40 | 41 | Speechpro Cloud Python could always use more documentation, whether as part of the 42 | official Speechpro Cloud Python docs, in docstrings, or even on the web in blog posts, 43 | articles, and such. 44 | 45 | Submit Feedback 46 | ~~~~~~~~~~~~~~~ 47 | 48 | The best way to send feedback is to file an issue at https://github.com/hiisi13/speechpro/issues. 49 | 50 | If you are proposing a feature: 51 | 52 | * Explain in detail how it would work. 53 | * Keep the scope as narrow as possible, to make it easier to implement. 54 | * Remember that this is a volunteer-driven project, and that contributions 55 | are welcome :) 56 | 57 | Get Started! 58 | ------------ 59 | 60 | Ready to contribute? Here's how to set up `speechpro` for local development. 61 | 62 | 1. Fork the `speechpro` repo on GitHub. 63 | 2. Clone your fork locally:: 64 | 65 | $ git clone git@github.com:your_name_here/speechpro.git 66 | 67 | 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: 68 | 69 | $ mkvirtualenv speechpro 70 | $ cd speechpro/ 71 | $ python setup.py develop 72 | 73 | 4. Create a branch for local development:: 74 | 75 | $ git checkout -b name-of-your-bugfix-or-feature 76 | 77 | Now you can make your changes locally. 78 | 79 | 5. When you're done making changes, check that your changes pass flake8 and the 80 | tests, including testing other Python versions with tox:: 81 | 82 | $ flake8 speechpro tests 83 | $ python setup.py test or pytest 84 | $ tox 85 | 86 | To get flake8 and tox, just pip install them into your virtualenv. 87 | 88 | 6. Commit your changes and push your branch to GitHub:: 89 | 90 | $ git add . 91 | $ git commit -m "Your detailed description of your changes." 92 | $ git push origin name-of-your-bugfix-or-feature 93 | 94 | 7. Submit a pull request through the GitHub website. 95 | 96 | Pull Request Guidelines 97 | ----------------------- 98 | 99 | Before you submit a pull request, check that it meets these guidelines: 100 | 101 | 1. The pull request should include tests. 102 | 2. If the pull request adds functionality, the docs should be updated. Put 103 | your new functionality into a function with a docstring, and add the 104 | feature to the list in README.rst. 105 | 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check 106 | https://travis-ci.com/hiisi13/speechpro/pull_requests 107 | and make sure that the tests pass for all supported Python versions. 108 | 109 | Tips 110 | ---- 111 | 112 | To run a subset of tests:: 113 | 114 | 115 | $ python -m unittest tests.test_speechpro 116 | 117 | Deploying 118 | --------- 119 | 120 | A reminder for the maintainers on how to deploy. 121 | Make sure all your changes are committed (including an entry in HISTORY.rst). 122 | Then run:: 123 | 124 | $ bump2version patch # possible: major / minor / patch 125 | $ git push 126 | $ git push --tags 127 | 128 | Travis will then deploy to PyPI if tests pass. 129 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/asr_result_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class ASRResultDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'score': 'str', 35 | 'text': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'score': 'score', 40 | 'text': 'text' 41 | } 42 | 43 | def __init__(self, score=None, text=None): # noqa: E501 44 | """ASRResultDto - a model defined in Swagger""" # noqa: E501 45 | 46 | self._score = None 47 | self._text = None 48 | self.discriminator = None 49 | 50 | self.score = score 51 | self.text = text 52 | 53 | @property 54 | def score(self): 55 | """Gets the score of this ASRResultDto. # noqa: E501 56 | 57 | Text score # noqa: E501 58 | 59 | :return: The score of this ASRResultDto. # noqa: E501 60 | :rtype: str 61 | """ 62 | return self._score 63 | 64 | @score.setter 65 | def score(self, score): 66 | """Sets the score of this ASRResultDto. 67 | 68 | Text score # noqa: E501 69 | 70 | :param score: The score of this ASRResultDto. # noqa: E501 71 | :type: str 72 | """ 73 | self._score = score 74 | 75 | @property 76 | def text(self): 77 | """Gets the text of this ASRResultDto. # noqa: E501 78 | 79 | Result text # noqa: E501 80 | 81 | :return: The text of this ASRResultDto. # noqa: E501 82 | :rtype: str 83 | """ 84 | return self._text 85 | 86 | @text.setter 87 | def text(self, text): 88 | """Sets the text of this ASRResultDto. 89 | 90 | Result text # noqa: E501 91 | 92 | :param text: The text of this ASRResultDto. # noqa: E501 93 | :type: str 94 | """ 95 | self._text = text 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.swagger_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, ASRResultDto): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/message_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class MessageDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'reason': 'str', 35 | 'message': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'reason': 'reason', 40 | 'message': 'message' 41 | } 42 | 43 | def __init__(self, reason=None, message=None): # noqa: E501 44 | """MessageDto - a model defined in Swagger""" # noqa: E501 45 | 46 | self._reason = None 47 | self._message = None 48 | self.discriminator = None 49 | 50 | if reason is not None: 51 | self.reason = reason 52 | if message is not None: 53 | self.message = message 54 | 55 | @property 56 | def reason(self): 57 | """Gets the reason of this MessageDto. # noqa: E501 58 | 59 | Reason # noqa: E501 60 | 61 | :return: The reason of this MessageDto. # noqa: E501 62 | :rtype: str 63 | """ 64 | return self._reason 65 | 66 | @reason.setter 67 | def reason(self, reason): 68 | """Sets the reason of this MessageDto. 69 | 70 | Reason # noqa: E501 71 | 72 | :param reason: The reason of this MessageDto. # noqa: E501 73 | :type: str 74 | """ 75 | 76 | self._reason = reason 77 | 78 | @property 79 | def message(self): 80 | """Gets the message of this MessageDto. # noqa: E501 81 | 82 | Message # noqa: E501 83 | 84 | :return: The message of this MessageDto. # noqa: E501 85 | :rtype: str 86 | """ 87 | return self._message 88 | 89 | @message.setter 90 | def message(self, message): 91 | """Sets the message of this MessageDto. 92 | 93 | Message # noqa: E501 94 | 95 | :param message: The message of this MessageDto. # noqa: E501 96 | :type: str 97 | """ 98 | 99 | self._message = message 100 | 101 | def to_dict(self): 102 | """Returns the model properties as a dict""" 103 | result = {} 104 | 105 | for attr, _ in six.iteritems(self.swagger_types): 106 | value = getattr(self, attr) 107 | if isinstance(value, list): 108 | result[attr] = list(map( 109 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 110 | value 111 | )) 112 | elif hasattr(value, "to_dict"): 113 | result[attr] = value.to_dict() 114 | elif isinstance(value, dict): 115 | result[attr] = dict(map( 116 | lambda item: (item[0], item[1].to_dict()) 117 | if hasattr(item[1], "to_dict") else item, 118 | value.items() 119 | )) 120 | else: 121 | result[attr] = value 122 | 123 | return result 124 | 125 | def to_str(self): 126 | """Returns the string representation of the model""" 127 | return pprint.pformat(self.to_dict()) 128 | 129 | def __repr__(self): 130 | """For `print` and `pprint`""" 131 | return self.to_str() 132 | 133 | def __eq__(self, other): 134 | """Returns true if both objects are equal""" 135 | if not isinstance(other, MessageDto): 136 | return False 137 | 138 | return self.__dict__ == other.__dict__ 139 | 140 | def __ne__(self, other): 141 | """Returns true if both objects are not equal""" 142 | return not self == other 143 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_language.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class SynthesizeLanguage(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'id': 'str', 35 | 'name': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'id': 'id', 40 | 'name': 'name' 41 | } 42 | 43 | def __init__(self, id=None, name=None): # noqa: E501 44 | """SynthesizeLanguage - a model defined in Swagger""" # noqa: E501 45 | 46 | self._id = None 47 | self._name = None 48 | self.discriminator = None 49 | 50 | self.id = id 51 | self.name = name 52 | 53 | @property 54 | def id(self): 55 | """Gets the id of this SynthesizeLanguage. # noqa: E501 56 | 57 | Language id # noqa: E501 58 | 59 | :return: The id of this SynthesizeLanguage. # noqa: E501 60 | :rtype: str 61 | """ 62 | return self._id 63 | 64 | @id.setter 65 | def id(self, id): 66 | """Sets the id of this SynthesizeLanguage. 67 | 68 | Language id # noqa: E501 69 | 70 | :param id: The id of this SynthesizeLanguage. # noqa: E501 71 | :type: str 72 | """ 73 | if id is None: 74 | raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 75 | 76 | self._id = id 77 | 78 | @property 79 | def name(self): 80 | """Gets the name of this SynthesizeLanguage. # noqa: E501 81 | 82 | Language name # noqa: E501 83 | 84 | :return: The name of this SynthesizeLanguage. # noqa: E501 85 | :rtype: str 86 | """ 87 | return self._name 88 | 89 | @name.setter 90 | def name(self, name): 91 | """Sets the name of this SynthesizeLanguage. 92 | 93 | Language name # noqa: E501 94 | 95 | :param name: The name of this SynthesizeLanguage. # noqa: E501 96 | :type: str 97 | """ 98 | if name is None: 99 | raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 100 | 101 | self._name = name 102 | 103 | def to_dict(self): 104 | """Returns the model properties as a dict""" 105 | result = {} 106 | 107 | for attr, _ in six.iteritems(self.swagger_types): 108 | value = getattr(self, attr) 109 | if isinstance(value, list): 110 | result[attr] = list(map( 111 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 112 | value 113 | )) 114 | elif hasattr(value, "to_dict"): 115 | result[attr] = value.to_dict() 116 | elif isinstance(value, dict): 117 | result[attr] = dict(map( 118 | lambda item: (item[0], item[1].to_dict()) 119 | if hasattr(item[1], "to_dict") else item, 120 | value.items() 121 | )) 122 | else: 123 | result[attr] = value 124 | 125 | return result 126 | 127 | def to_str(self): 128 | """Returns the string representation of the model""" 129 | return pprint.pformat(self.to_dict()) 130 | 131 | def __repr__(self): 132 | """For `print` and `pprint`""" 133 | return self.to_str() 134 | 135 | def __eq__(self, other): 136 | """Returns true if both objects are equal""" 137 | if not isinstance(other, SynthesizeLanguage): 138 | return False 139 | 140 | return self.__dict__ == other.__dict__ 141 | 142 | def __ne__(self, other): 143 | """Returns true if both objects are not equal""" 144 | return not self == other 145 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_text.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class SynthesizeText(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'mime': 'str', 35 | 'value': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'mime': 'mime', 40 | 'value': 'value' 41 | } 42 | 43 | def __init__(self, mime=None, value=None): # noqa: E501 44 | """SynthesizeText - a model defined in Swagger""" # noqa: E501 45 | 46 | self._mime = None 47 | self._value = None 48 | self.discriminator = None 49 | 50 | self.mime = mime 51 | self.value = value 52 | 53 | @property 54 | def mime(self): 55 | """Gets the mime of this SynthesizeText. # noqa: E501 56 | 57 | Type of content # noqa: E501 58 | 59 | :return: The mime of this SynthesizeText. # noqa: E501 60 | :rtype: str 61 | """ 62 | return self._mime 63 | 64 | @mime.setter 65 | def mime(self, mime): 66 | """Sets the mime of this SynthesizeText. 67 | 68 | Type of content # noqa: E501 69 | 70 | :param mime: The mime of this SynthesizeText. # noqa: E501 71 | :type: str 72 | """ 73 | if mime is None: 74 | raise ValueError("Invalid value for `mime`, must not be `None`") # noqa: E501 75 | 76 | self._mime = mime 77 | 78 | @property 79 | def value(self): 80 | """Gets the value of this SynthesizeText. # noqa: E501 81 | 82 | Text for synthesize # noqa: E501 83 | 84 | :return: The value of this SynthesizeText. # noqa: E501 85 | :rtype: str 86 | """ 87 | return self._value 88 | 89 | @value.setter 90 | def value(self, value): 91 | """Sets the value of this SynthesizeText. 92 | 93 | Text for synthesize # noqa: E501 94 | 95 | :param value: The value of this SynthesizeText. # noqa: E501 96 | :type: str 97 | """ 98 | if value is None: 99 | raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 100 | 101 | self._value = value 102 | 103 | def to_dict(self): 104 | """Returns the model properties as a dict""" 105 | result = {} 106 | 107 | for attr, _ in six.iteritems(self.swagger_types): 108 | value = getattr(self, attr) 109 | if isinstance(value, list): 110 | result[attr] = list(map( 111 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 112 | value 113 | )) 114 | elif hasattr(value, "to_dict"): 115 | result[attr] = value.to_dict() 116 | elif isinstance(value, dict): 117 | result[attr] = dict(map( 118 | lambda item: (item[0], item[1].to_dict()) 119 | if hasattr(item[1], "to_dict") else item, 120 | value.items() 121 | )) 122 | else: 123 | result[attr] = value 124 | 125 | return result 126 | 127 | def to_str(self): 128 | """Returns the string representation of the model""" 129 | return pprint.pformat(self.to_dict()) 130 | 131 | def __repr__(self): 132 | """For `print` and `pprint`""" 133 | return self.to_str() 134 | 135 | def __eq__(self, other): 136 | """Returns true if both objects are equal""" 137 | if not isinstance(other, SynthesizeText): 138 | return False 139 | 140 | return self.__dict__ == other.__dict__ 141 | 142 | def __ne__(self, other): 143 | """Returns true if both objects are not equal""" 144 | return not self == other 145 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/stream_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class StreamRequestDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'package_id': 'str', 35 | 'mime': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'package_id': 'package_id', 40 | 'mime': 'mime' 41 | } 42 | 43 | def __init__(self, package_id=None, mime=None): # noqa: E501 44 | """StreamRequestDto - a model defined in Swagger""" # noqa: E501 45 | 46 | self._package_id = None 47 | self._mime = None 48 | self.discriminator = None 49 | 50 | if package_id is not None: 51 | self.package_id = package_id 52 | self.mime = mime 53 | 54 | @property 55 | def package_id(self): 56 | """Gets the package_id of this StreamRequestDto. # noqa: E501 57 | 58 | Recognize with package # noqa: E501 59 | 60 | :return: The package_id of this StreamRequestDto. # noqa: E501 61 | :rtype: str 62 | """ 63 | return self._package_id 64 | 65 | @package_id.setter 66 | def package_id(self, package_id): 67 | """Sets the package_id of this StreamRequestDto. 68 | 69 | Recognize with package # noqa: E501 70 | 71 | :param package_id: The package_id of this StreamRequestDto. # noqa: E501 72 | :type: str 73 | """ 74 | 75 | self._package_id = package_id 76 | 77 | @property 78 | def mime(self): 79 | """Gets the mime of this StreamRequestDto. # noqa: E501 80 | 81 | Audio file mime type # noqa: E501 82 | 83 | :return: The mime of this StreamRequestDto. # noqa: E501 84 | :rtype: str 85 | """ 86 | return self._mime 87 | 88 | @mime.setter 89 | def mime(self, mime): 90 | """Sets the mime of this StreamRequestDto. 91 | 92 | Audio file mime type # noqa: E501 93 | 94 | :param mime: The mime of this StreamRequestDto. # noqa: E501 95 | :type: str 96 | """ 97 | if mime is None: 98 | raise ValueError("Invalid value for `mime`, must not be `None`") # noqa: E501 99 | 100 | self._mime = mime 101 | 102 | def to_dict(self): 103 | """Returns the model properties as a dict""" 104 | result = {} 105 | 106 | for attr, _ in six.iteritems(self.swagger_types): 107 | value = getattr(self, attr) 108 | if isinstance(value, list): 109 | result[attr] = list(map( 110 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 111 | value 112 | )) 113 | elif hasattr(value, "to_dict"): 114 | result[attr] = value.to_dict() 115 | elif isinstance(value, dict): 116 | result[attr] = dict(map( 117 | lambda item: (item[0], item[1].to_dict()) 118 | if hasattr(item[1], "to_dict") else item, 119 | value.items() 120 | )) 121 | else: 122 | result[attr] = value 123 | 124 | return result 125 | 126 | def to_str(self): 127 | """Returns the string representation of the model""" 128 | return pprint.pformat(self.to_dict()) 129 | 130 | def __repr__(self): 131 | """For `print` and `pprint`""" 132 | return self.to_str() 133 | 134 | def __eq__(self, other): 135 | """Returns true if both objects are equal""" 136 | if not isinstance(other, StreamRequestDto): 137 | return False 138 | 139 | return self.__dict__ == other.__dict__ 140 | 141 | def __ne__(self, other): 142 | """Returns true if both objects are not equal""" 143 | return not self == other 144 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/exception_model.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class ExceptionModel(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'reason': 'str', 35 | 'message': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'reason': 'reason', 40 | 'message': 'message' 41 | } 42 | 43 | def __init__(self, reason=None, message=None): # noqa: E501 44 | """ExceptionModel - a model defined in Swagger""" # noqa: E501 45 | 46 | self._reason = None 47 | self._message = None 48 | self.discriminator = None 49 | 50 | self.reason = reason 51 | self.message = message 52 | 53 | @property 54 | def reason(self): 55 | """Gets the reason of this ExceptionModel. # noqa: E501 56 | 57 | Reason of exception # noqa: E501 58 | 59 | :return: The reason of this ExceptionModel. # noqa: E501 60 | :rtype: str 61 | """ 62 | return self._reason 63 | 64 | @reason.setter 65 | def reason(self, reason): 66 | """Sets the reason of this ExceptionModel. 67 | 68 | Reason of exception # noqa: E501 69 | 70 | :param reason: The reason of this ExceptionModel. # noqa: E501 71 | :type: str 72 | """ 73 | if reason is None: 74 | raise ValueError("Invalid value for `reason`, must not be `None`") # noqa: E501 75 | 76 | self._reason = reason 77 | 78 | @property 79 | def message(self): 80 | """Gets the message of this ExceptionModel. # noqa: E501 81 | 82 | Message of exception # noqa: E501 83 | 84 | :return: The message of this ExceptionModel. # noqa: E501 85 | :rtype: str 86 | """ 87 | return self._message 88 | 89 | @message.setter 90 | def message(self, message): 91 | """Sets the message of this ExceptionModel. 92 | 93 | Message of exception # noqa: E501 94 | 95 | :param message: The message of this ExceptionModel. # noqa: E501 96 | :type: str 97 | """ 98 | if message is None: 99 | raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 100 | 101 | self._message = message 102 | 103 | def to_dict(self): 104 | """Returns the model properties as a dict""" 105 | result = {} 106 | 107 | for attr, _ in six.iteritems(self.swagger_types): 108 | value = getattr(self, attr) 109 | if isinstance(value, list): 110 | result[attr] = list(map( 111 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 112 | value 113 | )) 114 | elif hasattr(value, "to_dict"): 115 | result[attr] = value.to_dict() 116 | elif isinstance(value, dict): 117 | result[attr] = dict(map( 118 | lambda item: (item[0], item[1].to_dict()) 119 | if hasattr(item[1], "to_dict") else item, 120 | value.items() 121 | )) 122 | else: 123 | result[attr] = value 124 | 125 | return result 126 | 127 | def to_str(self): 128 | """Returns the string representation of the model""" 129 | return pprint.pformat(self.to_dict()) 130 | 131 | def __repr__(self): 132 | """For `print` and `pprint`""" 133 | return self.to_str() 134 | 135 | def __eq__(self, other): 136 | """Returns true if both objects are equal""" 137 | if not isinstance(other, ExceptionModel): 138 | return False 139 | 140 | return self.__dict__ == other.__dict__ 141 | 142 | def __ne__(self, other): 143 | """Returns true if both objects are not equal""" 144 | return not self == other 145 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/exception_model.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class ExceptionModel(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'reason': 'str', 35 | 'message': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'reason': 'reason', 40 | 'message': 'message' 41 | } 42 | 43 | def __init__(self, reason=None, message=None): # noqa: E501 44 | """ExceptionModel - a model defined in Swagger""" # noqa: E501 45 | 46 | self._reason = None 47 | self._message = None 48 | self.discriminator = None 49 | 50 | self.reason = reason 51 | self.message = message 52 | 53 | @property 54 | def reason(self): 55 | """Gets the reason of this ExceptionModel. # noqa: E501 56 | 57 | Reason of exception # noqa: E501 58 | 59 | :return: The reason of this ExceptionModel. # noqa: E501 60 | :rtype: str 61 | """ 62 | return self._reason 63 | 64 | @reason.setter 65 | def reason(self, reason): 66 | """Sets the reason of this ExceptionModel. 67 | 68 | Reason of exception # noqa: E501 69 | 70 | :param reason: The reason of this ExceptionModel. # noqa: E501 71 | :type: str 72 | """ 73 | if reason is None: 74 | raise ValueError("Invalid value for `reason`, must not be `None`") # noqa: E501 75 | 76 | self._reason = reason 77 | 78 | @property 79 | def message(self): 80 | """Gets the message of this ExceptionModel. # noqa: E501 81 | 82 | Message of exception # noqa: E501 83 | 84 | :return: The message of this ExceptionModel. # noqa: E501 85 | :rtype: str 86 | """ 87 | return self._message 88 | 89 | @message.setter 90 | def message(self, message): 91 | """Sets the message of this ExceptionModel. 92 | 93 | Message of exception # noqa: E501 94 | 95 | :param message: The message of this ExceptionModel. # noqa: E501 96 | :type: str 97 | """ 98 | if message is None: 99 | raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 100 | 101 | self._message = message 102 | 103 | def to_dict(self): 104 | """Returns the model properties as a dict""" 105 | result = {} 106 | 107 | for attr, _ in six.iteritems(self.swagger_types): 108 | value = getattr(self, attr) 109 | if isinstance(value, list): 110 | result[attr] = list(map( 111 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 112 | value 113 | )) 114 | elif hasattr(value, "to_dict"): 115 | result[attr] = value.to_dict() 116 | elif isinstance(value, dict): 117 | result[attr] = dict(map( 118 | lambda item: (item[0], item[1].to_dict()) 119 | if hasattr(item[1], "to_dict") else item, 120 | value.items() 121 | )) 122 | else: 123 | result[attr] = value 124 | 125 | return result 126 | 127 | def to_str(self): 128 | """Returns the string representation of the model""" 129 | return pprint.pformat(self.to_dict()) 130 | 131 | def __repr__(self): 132 | """For `print` and `pprint`""" 133 | return self.to_str() 134 | 135 | def __eq__(self, other): 136 | """Returns true if both objects are equal""" 137 | if not isinstance(other, ExceptionModel): 138 | return False 139 | 140 | return self.__dict__ == other.__dict__ 141 | 142 | def __ne__(self, other): 143 | """Returns true if both objects are not equal""" 144 | return not self == other 145 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/audio_file_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AudioFileDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'data': 'str', 35 | 'mime': 'str' 36 | } 37 | 38 | attribute_map = { 39 | 'data': 'data', 40 | 'mime': 'mime' 41 | } 42 | 43 | def __init__(self, data=None, mime=None): # noqa: E501 44 | """AudioFileDto - a model defined in Swagger""" # noqa: E501 45 | 46 | self._data = None 47 | self._mime = None 48 | self.discriminator = None 49 | 50 | self.data = data 51 | if mime is not None: 52 | self.mime = mime 53 | 54 | @property 55 | def data(self): 56 | """Gets the data of this AudioFileDto. # noqa: E501 57 | 58 | Binary audio file as Base64 string # noqa: E501 59 | 60 | :return: The data of this AudioFileDto. # noqa: E501 61 | :rtype: str 62 | """ 63 | return self._data 64 | 65 | @data.setter 66 | def data(self, data): 67 | """Sets the data of this AudioFileDto. 68 | 69 | Binary audio file as Base64 string # noqa: E501 70 | 71 | :param data: The data of this AudioFileDto. # noqa: E501 72 | :type: str 73 | """ 74 | if data is None: 75 | raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 76 | if data is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', data): # noqa: E501 77 | raise ValueError("Invalid value for `data`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 78 | 79 | self._data = data 80 | 81 | @property 82 | def mime(self): 83 | """Gets the mime of this AudioFileDto. # noqa: E501 84 | 85 | Audio file mime type # noqa: E501 86 | 87 | :return: The mime of this AudioFileDto. # noqa: E501 88 | :rtype: str 89 | """ 90 | return self._mime 91 | 92 | @mime.setter 93 | def mime(self, mime): 94 | """Sets the mime of this AudioFileDto. 95 | 96 | Audio file mime type # noqa: E501 97 | 98 | :param mime: The mime of this AudioFileDto. # noqa: E501 99 | :type: str 100 | """ 101 | 102 | self._mime = mime 103 | 104 | def to_dict(self): 105 | """Returns the model properties as a dict""" 106 | result = {} 107 | 108 | for attr, _ in six.iteritems(self.swagger_types): 109 | value = getattr(self, attr) 110 | if isinstance(value, list): 111 | result[attr] = list(map( 112 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 113 | value 114 | )) 115 | elif hasattr(value, "to_dict"): 116 | result[attr] = value.to_dict() 117 | elif isinstance(value, dict): 118 | result[attr] = dict(map( 119 | lambda item: (item[0], item[1].to_dict()) 120 | if hasattr(item[1], "to_dict") else item, 121 | value.items() 122 | )) 123 | else: 124 | result[attr] = value 125 | 126 | return result 127 | 128 | def to_str(self): 129 | """Returns the string representation of the model""" 130 | return pprint.pformat(self.to_dict()) 131 | 132 | def __repr__(self): 133 | """For `print` and `pprint`""" 134 | return self.to_str() 135 | 136 | def __eq__(self, other): 137 | """Returns true if both objects are equal""" 138 | if not isinstance(other, AudioFileDto): 139 | return False 140 | 141 | return self.__dict__ == other.__dict__ 142 | 143 | def __ne__(self, other): 144 | """Returns true if both objects are not equal""" 145 | return not self == other 146 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/close_transaction_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class CloseTransactionResponse(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'transaction_id': 'str', 35 | 'synthesize_text_size': 'int' 36 | } 37 | 38 | attribute_map = { 39 | 'transaction_id': 'transaction_id', 40 | 'synthesize_text_size': 'synthesize_text_size' 41 | } 42 | 43 | def __init__(self, transaction_id=None, synthesize_text_size=None): # noqa: E501 44 | """CloseTransactionResponse - a model defined in Swagger""" # noqa: E501 45 | 46 | self._transaction_id = None 47 | self._synthesize_text_size = None 48 | self.discriminator = None 49 | 50 | if transaction_id is not None: 51 | self.transaction_id = transaction_id 52 | if synthesize_text_size is not None: 53 | self.synthesize_text_size = synthesize_text_size 54 | 55 | @property 56 | def transaction_id(self): 57 | """Gets the transaction_id of this CloseTransactionResponse. # noqa: E501 58 | 59 | 60 | :return: The transaction_id of this CloseTransactionResponse. # noqa: E501 61 | :rtype: str 62 | """ 63 | return self._transaction_id 64 | 65 | @transaction_id.setter 66 | def transaction_id(self, transaction_id): 67 | """Sets the transaction_id of this CloseTransactionResponse. 68 | 69 | 70 | :param transaction_id: The transaction_id of this CloseTransactionResponse. # noqa: E501 71 | :type: str 72 | """ 73 | 74 | self._transaction_id = transaction_id 75 | 76 | @property 77 | def synthesize_text_size(self): 78 | """Gets the synthesize_text_size of this CloseTransactionResponse. # noqa: E501 79 | 80 | 81 | :return: The synthesize_text_size of this CloseTransactionResponse. # noqa: E501 82 | :rtype: int 83 | """ 84 | return self._synthesize_text_size 85 | 86 | @synthesize_text_size.setter 87 | def synthesize_text_size(self, synthesize_text_size): 88 | """Sets the synthesize_text_size of this CloseTransactionResponse. 89 | 90 | 91 | :param synthesize_text_size: The synthesize_text_size of this CloseTransactionResponse. # noqa: E501 92 | :type: int 93 | """ 94 | 95 | self._synthesize_text_size = synthesize_text_size 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.swagger_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, CloseTransactionResponse): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/recognition_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.audio_file_dto import AudioFileDto # noqa: F401,E501 20 | 21 | 22 | class RecognitionRequestDto(object): 23 | """NOTE: This class is auto generated by the swagger code generator program. 24 | 25 | Do not edit the class manually. 26 | """ 27 | 28 | """ 29 | Attributes: 30 | swagger_types (dict): The key is attribute name 31 | and the value is attribute type. 32 | attribute_map (dict): The key is attribute name 33 | and the value is json key in definition. 34 | """ 35 | swagger_types = { 36 | 'audio': 'AudioFileDto', 37 | 'package_id': 'str' 38 | } 39 | 40 | attribute_map = { 41 | 'audio': 'audio', 42 | 'package_id': 'package_id' 43 | } 44 | 45 | def __init__(self, audio=None, package_id=None): # noqa: E501 46 | """RecognitionRequestDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._audio = None 49 | self._package_id = None 50 | self.discriminator = None 51 | 52 | self.audio = audio 53 | if package_id is not None: 54 | self.package_id = package_id 55 | 56 | @property 57 | def audio(self): 58 | """Gets the audio of this RecognitionRequestDto. # noqa: E501 59 | 60 | Audio file data and description # noqa: E501 61 | 62 | :return: The audio of this RecognitionRequestDto. # noqa: E501 63 | :rtype: AudioFileDto 64 | """ 65 | return self._audio 66 | 67 | @audio.setter 68 | def audio(self, audio): 69 | """Sets the audio of this RecognitionRequestDto. 70 | 71 | Audio file data and description # noqa: E501 72 | 73 | :param audio: The audio of this RecognitionRequestDto. # noqa: E501 74 | :type: AudioFileDto 75 | """ 76 | if audio is None: 77 | raise ValueError("Invalid value for `audio`, must not be `None`") # noqa: E501 78 | 79 | self._audio = audio 80 | 81 | @property 82 | def package_id(self): 83 | """Gets the package_id of this RecognitionRequestDto. # noqa: E501 84 | 85 | Recognize with package # noqa: E501 86 | 87 | :return: The package_id of this RecognitionRequestDto. # noqa: E501 88 | :rtype: str 89 | """ 90 | return self._package_id 91 | 92 | @package_id.setter 93 | def package_id(self, package_id): 94 | """Sets the package_id of this RecognitionRequestDto. 95 | 96 | Recognize with package # noqa: E501 97 | 98 | :param package_id: The package_id of this RecognitionRequestDto. # noqa: E501 99 | :type: str 100 | """ 101 | 102 | self._package_id = package_id 103 | 104 | def to_dict(self): 105 | """Returns the model properties as a dict""" 106 | result = {} 107 | 108 | for attr, _ in six.iteritems(self.swagger_types): 109 | value = getattr(self, attr) 110 | if isinstance(value, list): 111 | result[attr] = list(map( 112 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 113 | value 114 | )) 115 | elif hasattr(value, "to_dict"): 116 | result[attr] = value.to_dict() 117 | elif isinstance(value, dict): 118 | result[attr] = dict(map( 119 | lambda item: (item[0], item[1].to_dict()) 120 | if hasattr(item[1], "to_dict") else item, 121 | value.items() 122 | )) 123 | else: 124 | result[attr] = value 125 | 126 | return result 127 | 128 | def to_str(self): 129 | """Returns the string representation of the model""" 130 | return pprint.pformat(self.to_dict()) 131 | 132 | def __repr__(self): 133 | """For `print` and `pprint`""" 134 | return self.to_str() 135 | 136 | def __eq__(self, other): 137 | """Returns true if both objects are equal""" 138 | if not isinstance(other, RecognitionRequestDto): 139 | return False 140 | 141 | return self.__dict__ == other.__dict__ 142 | 143 | def __ne__(self, other): 144 | """Returns true if both objects are not equal""" 145 | return not self == other 146 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/asr_advanced_result_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.word_dto import WordDto # noqa: F401,E501 20 | 21 | 22 | class ASRAdvancedResultDto(object): 23 | """NOTE: This class is auto generated by the swagger code generator program. 24 | 25 | Do not edit the class manually. 26 | """ 27 | 28 | """ 29 | Attributes: 30 | swagger_types (dict): The key is attribute name 31 | and the value is attribute type. 32 | attribute_map (dict): The key is attribute name 33 | and the value is json key in definition. 34 | """ 35 | swagger_types = { 36 | 'channel_id': 'int', 37 | 'result': 'list[WordDto]' 38 | } 39 | 40 | attribute_map = { 41 | 'channel_id': 'channel_id', 42 | 'result': 'result' 43 | } 44 | 45 | def __init__(self, channel_id=None, result=None): # noqa: E501 46 | """ASRAdvancedResultDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._channel_id = None 49 | self._result = None 50 | self.discriminator = None 51 | 52 | self.channel_id = channel_id 53 | self.result = result 54 | 55 | @property 56 | def channel_id(self): 57 | """Gets the channel_id of this ASRAdvancedResultDto. # noqa: E501 58 | 59 | Channel id # noqa: E501 60 | 61 | :return: The channel_id of this ASRAdvancedResultDto. # noqa: E501 62 | :rtype: int 63 | """ 64 | return self._channel_id 65 | 66 | @channel_id.setter 67 | def channel_id(self, channel_id): 68 | """Sets the channel_id of this ASRAdvancedResultDto. 69 | 70 | Channel id # noqa: E501 71 | 72 | :param channel_id: The channel_id of this ASRAdvancedResultDto. # noqa: E501 73 | :type: int 74 | """ 75 | if channel_id is None: 76 | raise ValueError("Invalid value for `channel_id`, must not be `None`") # noqa: E501 77 | 78 | self._channel_id = channel_id 79 | 80 | @property 81 | def result(self): 82 | """Gets the result of this ASRAdvancedResultDto. # noqa: E501 83 | 84 | Recognition result # noqa: E501 85 | 86 | :return: The result of this ASRAdvancedResultDto. # noqa: E501 87 | :rtype: list[WordDto] 88 | """ 89 | return self._result 90 | 91 | @result.setter 92 | def result(self, result): 93 | """Sets the result of this ASRAdvancedResultDto. 94 | 95 | Recognition result # noqa: E501 96 | 97 | :param result: The result of this ASRAdvancedResultDto. # noqa: E501 98 | :type: list[WordDto] 99 | """ 100 | if result is None: 101 | raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 102 | 103 | self._result = result 104 | 105 | def to_dict(self): 106 | """Returns the model properties as a dict""" 107 | result = {} 108 | 109 | for attr, _ in six.iteritems(self.swagger_types): 110 | value = getattr(self, attr) 111 | if isinstance(value, list): 112 | result[attr] = list(map( 113 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 114 | value 115 | )) 116 | elif hasattr(value, "to_dict"): 117 | result[attr] = value.to_dict() 118 | elif isinstance(value, dict): 119 | result[attr] = dict(map( 120 | lambda item: (item[0], item[1].to_dict()) 121 | if hasattr(item[1], "to_dict") else item, 122 | value.items() 123 | )) 124 | else: 125 | result[attr] = value 126 | 127 | return result 128 | 129 | def to_str(self): 130 | """Returns the string representation of the model""" 131 | return pprint.pformat(self.to_dict()) 132 | 133 | def __repr__(self): 134 | """For `print` and `pprint`""" 135 | return self.to_str() 136 | 137 | def __eq__(self, other): 138 | """Returns true if both objects are equal""" 139 | if not isinstance(other, ASRAdvancedResultDto): 140 | return False 141 | 142 | return self.__dict__ == other.__dict__ 143 | 144 | def __ne__(self, other): 145 | """Returns true if both objects are not equal""" 146 | return not self == other 147 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/sessionless_recognition_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.recognition_request_dto import RecognitionRequestDto # noqa: F401,E501 20 | from speechpro.cloud.speech.recognition.rest.cloud_client.models.start_session_request import StartSessionRequest # noqa: F401,E501 21 | 22 | 23 | class SessionlessRecognitionRequestDto(object): 24 | """NOTE: This class is auto generated by the swagger code generator program. 25 | 26 | Do not edit the class manually. 27 | """ 28 | 29 | """ 30 | Attributes: 31 | swagger_types (dict): The key is attribute name 32 | and the value is attribute type. 33 | attribute_map (dict): The key is attribute name 34 | and the value is json key in definition. 35 | """ 36 | swagger_types = { 37 | 'user_info': 'StartSessionRequest', 38 | 'recognition_request': 'RecognitionRequestDto' 39 | } 40 | 41 | attribute_map = { 42 | 'user_info': 'user_info', 43 | 'recognition_request': 'recognition_request' 44 | } 45 | 46 | def __init__(self, user_info=None, recognition_request=None): # noqa: E501 47 | """SessionlessRecognitionRequestDto - a model defined in Swagger""" # noqa: E501 48 | 49 | self._user_info = None 50 | self._recognition_request = None 51 | self.discriminator = None 52 | 53 | self.user_info = user_info 54 | self.recognition_request = recognition_request 55 | 56 | @property 57 | def user_info(self): 58 | """Gets the user_info of this SessionlessRecognitionRequestDto. # noqa: E501 59 | 60 | User credentials # noqa: E501 61 | 62 | :return: The user_info of this SessionlessRecognitionRequestDto. # noqa: E501 63 | :rtype: StartSessionRequest 64 | """ 65 | return self._user_info 66 | 67 | @user_info.setter 68 | def user_info(self, user_info): 69 | """Sets the user_info of this SessionlessRecognitionRequestDto. 70 | 71 | User credentials # noqa: E501 72 | 73 | :param user_info: The user_info of this SessionlessRecognitionRequestDto. # noqa: E501 74 | :type: StartSessionRequest 75 | """ 76 | if user_info is None: 77 | raise ValueError("Invalid value for `user_info`, must not be `None`") # noqa: E501 78 | 79 | self._user_info = user_info 80 | 81 | @property 82 | def recognition_request(self): 83 | """Gets the recognition_request of this SessionlessRecognitionRequestDto. # noqa: E501 84 | 85 | User credentials # noqa: E501 86 | 87 | :return: The recognition_request of this SessionlessRecognitionRequestDto. # noqa: E501 88 | :rtype: RecognitionRequestDto 89 | """ 90 | return self._recognition_request 91 | 92 | @recognition_request.setter 93 | def recognition_request(self, recognition_request): 94 | """Sets the recognition_request of this SessionlessRecognitionRequestDto. 95 | 96 | User credentials # noqa: E501 97 | 98 | :param recognition_request: The recognition_request of this SessionlessRecognitionRequestDto. # noqa: E501 99 | :type: RecognitionRequestDto 100 | """ 101 | if recognition_request is None: 102 | raise ValueError("Invalid value for `recognition_request`, must not be `None`") # noqa: E501 103 | 104 | self._recognition_request = recognition_request 105 | 106 | def to_dict(self): 107 | """Returns the model properties as a dict""" 108 | result = {} 109 | 110 | for attr, _ in six.iteritems(self.swagger_types): 111 | value = getattr(self, attr) 112 | if isinstance(value, list): 113 | result[attr] = list(map( 114 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 115 | value 116 | )) 117 | elif hasattr(value, "to_dict"): 118 | result[attr] = value.to_dict() 119 | elif isinstance(value, dict): 120 | result[attr] = dict(map( 121 | lambda item: (item[0], item[1].to_dict()) 122 | if hasattr(item[1], "to_dict") else item, 123 | value.items() 124 | )) 125 | else: 126 | result[attr] = value 127 | 128 | return result 129 | 130 | def to_str(self): 131 | """Returns the string representation of the model""" 132 | return pprint.pformat(self.to_dict()) 133 | 134 | def __repr__(self): 135 | """For `print` and `pprint`""" 136 | return self.to_str() 137 | 138 | def __eq__(self, other): 139 | """Returns true if both objects are equal""" 140 | if not isinstance(other, SessionlessRecognitionRequestDto): 141 | return False 142 | 143 | return self.__dict__ == other.__dict__ 144 | 145 | def __ne__(self, other): 146 | """Returns true if both objects are not equal""" 147 | return not self == other 148 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # speechpro documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Jun 9 13:47:02 2017. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | # If extensions (or modules to document with autodoc) are in another 16 | # directory, add these directories to sys.path here. If the directory is 17 | # relative to the documentation root, use os.path.abspath to make it 18 | # absolute, like shown here. 19 | # 20 | import os 21 | import sys 22 | sys.path.insert(0, os.path.abspath('..')) 23 | 24 | import speechpro 25 | 26 | # -- General configuration --------------------------------------------- 27 | 28 | # If your documentation needs a minimal Sphinx version, state it here. 29 | # 30 | # needs_sphinx = '1.0' 31 | 32 | # Add any Sphinx extension module names here, as strings. They can be 33 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 34 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ['_templates'] 38 | 39 | # The suffix(es) of source filenames. 40 | # You can specify multiple suffix as a list of string: 41 | # 42 | # source_suffix = ['.rst', '.md'] 43 | source_suffix = '.rst' 44 | 45 | # The master toctree document. 46 | master_doc = 'index' 47 | 48 | # General information about the project. 49 | project = 'Speechpro Cloud Python' 50 | copyright = "2020, Dmitry Kozhedubov" 51 | author = "Dmitry Kozhedubov" 52 | 53 | # The version info for the project you're documenting, acts as replacement 54 | # for |version| and |release|, also used in various other places throughout 55 | # the built documents. 56 | # 57 | # The short X.Y version. 58 | version = speechpro.__version__ 59 | # The full version, including alpha/beta/rc tags. 60 | release = speechpro.__version__ 61 | 62 | # The language for content autogenerated by Sphinx. Refer to documentation 63 | # for a list of supported languages. 64 | # 65 | # This is also used if you do content translation via gettext catalogs. 66 | # Usually you set "language" from the command line for these cases. 67 | language = None 68 | 69 | # List of patterns, relative to source directory, that match files and 70 | # directories to ignore when looking for source files. 71 | # This patterns also effect to html_static_path and html_extra_path 72 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 73 | 74 | # The name of the Pygments (syntax highlighting) style to use. 75 | pygments_style = 'sphinx' 76 | 77 | # If true, `todo` and `todoList` produce output, else they produce nothing. 78 | todo_include_todos = False 79 | 80 | 81 | # -- Options for HTML output ------------------------------------------- 82 | 83 | # The theme to use for HTML and HTML Help pages. See the documentation for 84 | # a list of builtin themes. 85 | # 86 | html_theme = 'alabaster' 87 | 88 | # Theme options are theme-specific and customize the look and feel of a 89 | # theme further. For a list of options available for each theme, see the 90 | # documentation. 91 | # 92 | # html_theme_options = {} 93 | 94 | # Add any paths that contain custom static files (such as style sheets) here, 95 | # relative to this directory. They are copied after the builtin static files, 96 | # so a file named "default.css" will overwrite the builtin "default.css". 97 | html_static_path = ['_static'] 98 | 99 | 100 | # -- Options for HTMLHelp output --------------------------------------- 101 | 102 | # Output file base name for HTML help builder. 103 | htmlhelp_basename = 'speechprodoc' 104 | 105 | 106 | # -- Options for LaTeX output ------------------------------------------ 107 | 108 | latex_elements = { 109 | # The paper size ('letterpaper' or 'a4paper'). 110 | # 111 | # 'papersize': 'letterpaper', 112 | 113 | # The font size ('10pt', '11pt' or '12pt'). 114 | # 115 | # 'pointsize': '10pt', 116 | 117 | # Additional stuff for the LaTeX preamble. 118 | # 119 | # 'preamble': '', 120 | 121 | # Latex figure (float) alignment 122 | # 123 | # 'figure_align': 'htbp', 124 | } 125 | 126 | # Grouping the document tree into LaTeX files. List of tuples 127 | # (source start file, target name, title, author, documentclass 128 | # [howto, manual, or own class]). 129 | latex_documents = [ 130 | (master_doc, 'speechpro.tex', 131 | 'Speechpro Cloud Python Documentation', 132 | 'Dmitry Kozhedubov', 'manual'), 133 | ] 134 | 135 | 136 | # -- Options for manual page output ------------------------------------ 137 | 138 | # One entry per manual page. List of tuples 139 | # (source start file, name, description, authors, manual section). 140 | man_pages = [ 141 | (master_doc, 'speechpro', 142 | 'Speechpro Cloud Python Documentation', 143 | [author], 1) 144 | ] 145 | 146 | 147 | # -- Options for Texinfo output ---------------------------------------- 148 | 149 | # Grouping the document tree into Texinfo files. List of tuples 150 | # (source start file, target name, title, author, 151 | # dir menu entry, description, category) 152 | texinfo_documents = [ 153 | (master_doc, 'speechpro', 154 | 'Speechpro Cloud Python Documentation', 155 | author, 156 | 'speechpro', 157 | 'One line description of project.', 158 | 'Miscellaneous'), 159 | ] 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/credentials.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class Credentials(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'password': 'str', 36 | 'domain_id': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'password': 'password', 42 | 'domain_id': 'domain_id' 43 | } 44 | 45 | def __init__(self, username=None, password=None, domain_id=None): # noqa: E501 46 | """Credentials - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._password = None 50 | self._domain_id = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.password = password 55 | self.domain_id = domain_id 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this Credentials. # noqa: E501 60 | 61 | Username # noqa: E501 62 | 63 | :return: The username of this Credentials. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this Credentials. 71 | 72 | Username # noqa: E501 73 | 74 | :param username: The username of this Credentials. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def password(self): 84 | """Gets the password of this Credentials. # noqa: E501 85 | 86 | Password # noqa: E501 87 | 88 | :return: The password of this Credentials. # noqa: E501 89 | :rtype: str 90 | """ 91 | return self._password 92 | 93 | @password.setter 94 | def password(self, password): 95 | """Sets the password of this Credentials. 96 | 97 | Password # noqa: E501 98 | 99 | :param password: The password of this Credentials. # noqa: E501 100 | :type: str 101 | """ 102 | if password is None: 103 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 104 | 105 | self._password = password 106 | 107 | @property 108 | def domain_id(self): 109 | """Gets the domain_id of this Credentials. # noqa: E501 110 | 111 | Domain ID # noqa: E501 112 | 113 | :return: The domain_id of this Credentials. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._domain_id 117 | 118 | @domain_id.setter 119 | def domain_id(self, domain_id): 120 | """Sets the domain_id of this Credentials. 121 | 122 | Domain ID # noqa: E501 123 | 124 | :param domain_id: The domain_id of this Credentials. # noqa: E501 125 | :type: str 126 | """ 127 | if domain_id is None: 128 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 129 | 130 | self._domain_id = domain_id 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, Credentials): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/credentials.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class Credentials(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'password': 'str', 36 | 'domain_id': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'password': 'password', 42 | 'domain_id': 'domain_id' 43 | } 44 | 45 | def __init__(self, username=None, password=None, domain_id=None): # noqa: E501 46 | """Credentials - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._password = None 50 | self._domain_id = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.password = password 55 | self.domain_id = domain_id 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this Credentials. # noqa: E501 60 | 61 | Username # noqa: E501 62 | 63 | :return: The username of this Credentials. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this Credentials. 71 | 72 | Username # noqa: E501 73 | 74 | :param username: The username of this Credentials. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def password(self): 84 | """Gets the password of this Credentials. # noqa: E501 85 | 86 | Password # noqa: E501 87 | 88 | :return: The password of this Credentials. # noqa: E501 89 | :rtype: str 90 | """ 91 | return self._password 92 | 93 | @password.setter 94 | def password(self, password): 95 | """Sets the password of this Credentials. 96 | 97 | Password # noqa: E501 98 | 99 | :param password: The password of this Credentials. # noqa: E501 100 | :type: str 101 | """ 102 | if password is None: 103 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 104 | 105 | self._password = password 106 | 107 | @property 108 | def domain_id(self): 109 | """Gets the domain_id of this Credentials. # noqa: E501 110 | 111 | Domain ID # noqa: E501 112 | 113 | :return: The domain_id of this Credentials. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._domain_id 117 | 118 | @domain_id.setter 119 | def domain_id(self, domain_id): 120 | """Sets the domain_id of this Credentials. 121 | 122 | Domain ID # noqa: E501 123 | 124 | :param domain_id: The domain_id of this Credentials. # noqa: E501 125 | :type: str 126 | """ 127 | if domain_id is None: 128 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 129 | 130 | self._domain_id = domain_id 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, Credentials): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/common/rest/cloud_client/models/auth_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthRequestDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'domain_id': 'int', 36 | 'password': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'domain_id': 'domain_id', 42 | 'password': 'password' 43 | } 44 | 45 | def __init__(self, username=None, domain_id=None, password=None): # noqa: E501 46 | """AuthRequestDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._domain_id = None 50 | self._password = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.domain_id = domain_id 55 | self.password = password 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this AuthRequestDto. # noqa: E501 60 | 61 | User name # noqa: E501 62 | 63 | :return: The username of this AuthRequestDto. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this AuthRequestDto. 71 | 72 | User name # noqa: E501 73 | 74 | :param username: The username of this AuthRequestDto. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def domain_id(self): 84 | """Gets the domain_id of this AuthRequestDto. # noqa: E501 85 | 86 | User domain # noqa: E501 87 | 88 | :return: The domain_id of this AuthRequestDto. # noqa: E501 89 | :rtype: int 90 | """ 91 | return self._domain_id 92 | 93 | @domain_id.setter 94 | def domain_id(self, domain_id): 95 | """Sets the domain_id of this AuthRequestDto. 96 | 97 | User domain # noqa: E501 98 | 99 | :param domain_id: The domain_id of this AuthRequestDto. # noqa: E501 100 | :type: int 101 | """ 102 | if domain_id is None: 103 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 104 | 105 | self._domain_id = domain_id 106 | 107 | @property 108 | def password(self): 109 | """Gets the password of this AuthRequestDto. # noqa: E501 110 | 111 | User password - planed text # noqa: E501 112 | 113 | :return: The password of this AuthRequestDto. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._password 117 | 118 | @password.setter 119 | def password(self, password): 120 | """Sets the password of this AuthRequestDto. 121 | 122 | User password - planed text # noqa: E501 123 | 124 | :param password: The password of this AuthRequestDto. # noqa: E501 125 | :type: str 126 | """ 127 | if password is None: 128 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 129 | 130 | self._password = password 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, AuthRequestDto): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/auth_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthRequestDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'domain_id': 'int', 36 | 'password': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'domain_id': 'domain_id', 42 | 'password': 'password' 43 | } 44 | 45 | def __init__(self, username=None, domain_id=None, password=None): # noqa: E501 46 | """AuthRequestDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._domain_id = None 50 | self._password = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.domain_id = domain_id 55 | self.password = password 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this AuthRequestDto. # noqa: E501 60 | 61 | User name # noqa: E501 62 | 63 | :return: The username of this AuthRequestDto. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this AuthRequestDto. 71 | 72 | User name # noqa: E501 73 | 74 | :param username: The username of this AuthRequestDto. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def domain_id(self): 84 | """Gets the domain_id of this AuthRequestDto. # noqa: E501 85 | 86 | User domain # noqa: E501 87 | 88 | :return: The domain_id of this AuthRequestDto. # noqa: E501 89 | :rtype: int 90 | """ 91 | return self._domain_id 92 | 93 | @domain_id.setter 94 | def domain_id(self, domain_id): 95 | """Sets the domain_id of this AuthRequestDto. 96 | 97 | User domain # noqa: E501 98 | 99 | :param domain_id: The domain_id of this AuthRequestDto. # noqa: E501 100 | :type: int 101 | """ 102 | if domain_id is None: 103 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 104 | 105 | self._domain_id = domain_id 106 | 107 | @property 108 | def password(self): 109 | """Gets the password of this AuthRequestDto. # noqa: E501 110 | 111 | User password - planed text # noqa: E501 112 | 113 | :return: The password of this AuthRequestDto. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._password 117 | 118 | @password.setter 119 | def password(self, password): 120 | """Sets the password of this AuthRequestDto. 121 | 122 | User password - planed text # noqa: E501 123 | 124 | :param password: The password of this AuthRequestDto. # noqa: E501 125 | :type: str 126 | """ 127 | if password is None: 128 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 129 | 130 | self._password = password 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, AuthRequestDto): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/auth_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | SessionService documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AuthRequestDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'domain_id': 'int', 36 | 'password': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'domain_id': 'domain_id', 42 | 'password': 'password' 43 | } 44 | 45 | def __init__(self, username=None, domain_id=None, password=None): # noqa: E501 46 | """AuthRequestDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._domain_id = None 50 | self._password = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.domain_id = domain_id 55 | self.password = password 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this AuthRequestDto. # noqa: E501 60 | 61 | User name # noqa: E501 62 | 63 | :return: The username of this AuthRequestDto. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this AuthRequestDto. 71 | 72 | User name # noqa: E501 73 | 74 | :param username: The username of this AuthRequestDto. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def domain_id(self): 84 | """Gets the domain_id of this AuthRequestDto. # noqa: E501 85 | 86 | User domain # noqa: E501 87 | 88 | :return: The domain_id of this AuthRequestDto. # noqa: E501 89 | :rtype: int 90 | """ 91 | return self._domain_id 92 | 93 | @domain_id.setter 94 | def domain_id(self, domain_id): 95 | """Sets the domain_id of this AuthRequestDto. 96 | 97 | User domain # noqa: E501 98 | 99 | :param domain_id: The domain_id of this AuthRequestDto. # noqa: E501 100 | :type: int 101 | """ 102 | if domain_id is None: 103 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 104 | 105 | self._domain_id = domain_id 106 | 107 | @property 108 | def password(self): 109 | """Gets the password of this AuthRequestDto. # noqa: E501 110 | 111 | User password - planed text # noqa: E501 112 | 113 | :return: The password of this AuthRequestDto. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._password 117 | 118 | @password.setter 119 | def password(self, password): 120 | """Sets the password of this AuthRequestDto. 121 | 122 | User password - planed text # noqa: E501 123 | 124 | :param password: The password of this AuthRequestDto. # noqa: E501 125 | :type: str 126 | """ 127 | if password is None: 128 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 129 | 130 | self._password = password 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, AuthRequestDto): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/start_session_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class StartSessionRequest(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'username': 'str', 35 | 'password': 'str', 36 | 'domain_id': 'int' 37 | } 38 | 39 | attribute_map = { 40 | 'username': 'username', 41 | 'password': 'password', 42 | 'domain_id': 'domain_id' 43 | } 44 | 45 | def __init__(self, username=None, password=None, domain_id=None): # noqa: E501 46 | """StartSessionRequest - a model defined in Swagger""" # noqa: E501 47 | 48 | self._username = None 49 | self._password = None 50 | self._domain_id = None 51 | self.discriminator = None 52 | 53 | self.username = username 54 | self.password = password 55 | self.domain_id = domain_id 56 | 57 | @property 58 | def username(self): 59 | """Gets the username of this StartSessionRequest. # noqa: E501 60 | 61 | User login # noqa: E501 62 | 63 | :return: The username of this StartSessionRequest. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._username 67 | 68 | @username.setter 69 | def username(self, username): 70 | """Sets the username of this StartSessionRequest. 71 | 72 | User login # noqa: E501 73 | 74 | :param username: The username of this StartSessionRequest. # noqa: E501 75 | :type: str 76 | """ 77 | if username is None: 78 | raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 79 | 80 | self._username = username 81 | 82 | @property 83 | def password(self): 84 | """Gets the password of this StartSessionRequest. # noqa: E501 85 | 86 | User password # noqa: E501 87 | 88 | :return: The password of this StartSessionRequest. # noqa: E501 89 | :rtype: str 90 | """ 91 | return self._password 92 | 93 | @password.setter 94 | def password(self, password): 95 | """Sets the password of this StartSessionRequest. 96 | 97 | User password # noqa: E501 98 | 99 | :param password: The password of this StartSessionRequest. # noqa: E501 100 | :type: str 101 | """ 102 | if password is None: 103 | raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 104 | 105 | self._password = password 106 | 107 | @property 108 | def domain_id(self): 109 | """Gets the domain_id of this StartSessionRequest. # noqa: E501 110 | 111 | User domain identifier # noqa: E501 112 | 113 | :return: The domain_id of this StartSessionRequest. # noqa: E501 114 | :rtype: int 115 | """ 116 | return self._domain_id 117 | 118 | @domain_id.setter 119 | def domain_id(self, domain_id): 120 | """Sets the domain_id of this StartSessionRequest. 121 | 122 | User domain identifier # noqa: E501 123 | 124 | :param domain_id: The domain_id of this StartSessionRequest. # noqa: E501 125 | :type: int 126 | """ 127 | if domain_id is None: 128 | raise ValueError("Invalid value for `domain_id`, must not be `None`") # noqa: E501 129 | 130 | self._domain_id = domain_id 131 | 132 | def to_dict(self): 133 | """Returns the model properties as a dict""" 134 | result = {} 135 | 136 | for attr, _ in six.iteritems(self.swagger_types): 137 | value = getattr(self, attr) 138 | if isinstance(value, list): 139 | result[attr] = list(map( 140 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 141 | value 142 | )) 143 | elif hasattr(value, "to_dict"): 144 | result[attr] = value.to_dict() 145 | elif isinstance(value, dict): 146 | result[attr] = dict(map( 147 | lambda item: (item[0], item[1].to_dict()) 148 | if hasattr(item[1], "to_dict") else item, 149 | value.items() 150 | )) 151 | else: 152 | result[attr] = value 153 | 154 | return result 155 | 156 | def to_str(self): 157 | """Returns the string representation of the model""" 158 | return pprint.pformat(self.to_dict()) 159 | 160 | def __repr__(self): 161 | """For `print` and `pprint`""" 162 | return self.to_str() 163 | 164 | def __eq__(self, other): 165 | """Returns true if both objects are equal""" 166 | if not isinstance(other, StartSessionRequest): 167 | return False 168 | 169 | return self.__dict__ == other.__dict__ 170 | 171 | def __ne__(self, other): 172 | """Returns true if both objects are not equal""" 173 | return not self == other 174 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/recognition/rest/cloud_client/models/advanced_recognition_request_dto.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | ASR documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class AdvancedRecognitionRequestDto(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'package_id': 'str', 35 | 'channels': 'list[int]', 36 | 'data': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'package_id': 'package_id', 41 | 'channels': 'channels', 42 | 'data': 'data' 43 | } 44 | 45 | def __init__(self, package_id=None, channels=None, data=None): # noqa: E501 46 | """AdvancedRecognitionRequestDto - a model defined in Swagger""" # noqa: E501 47 | 48 | self._package_id = None 49 | self._channels = None 50 | self._data = None 51 | self.discriminator = None 52 | 53 | if package_id is not None: 54 | self.package_id = package_id 55 | if channels is not None: 56 | self.channels = channels 57 | self.data = data 58 | 59 | @property 60 | def package_id(self): 61 | """Gets the package_id of this AdvancedRecognitionRequestDto. # noqa: E501 62 | 63 | Recognize with package # noqa: E501 64 | 65 | :return: The package_id of this AdvancedRecognitionRequestDto. # noqa: E501 66 | :rtype: str 67 | """ 68 | return self._package_id 69 | 70 | @package_id.setter 71 | def package_id(self, package_id): 72 | """Sets the package_id of this AdvancedRecognitionRequestDto. 73 | 74 | Recognize with package # noqa: E501 75 | 76 | :param package_id: The package_id of this AdvancedRecognitionRequestDto. # noqa: E501 77 | :type: str 78 | """ 79 | 80 | self._package_id = package_id 81 | 82 | @property 83 | def channels(self): 84 | """Gets the channels of this AdvancedRecognitionRequestDto. # noqa: E501 85 | 86 | Specific channels to process # noqa: E501 87 | 88 | :return: The channels of this AdvancedRecognitionRequestDto. # noqa: E501 89 | :rtype: list[int] 90 | """ 91 | return self._channels 92 | 93 | @channels.setter 94 | def channels(self, channels): 95 | """Sets the channels of this AdvancedRecognitionRequestDto. 96 | 97 | Specific channels to process # noqa: E501 98 | 99 | :param channels: The channels of this AdvancedRecognitionRequestDto. # noqa: E501 100 | :type: list[int] 101 | """ 102 | 103 | self._channels = channels 104 | 105 | @property 106 | def data(self): 107 | """Gets the data of this AdvancedRecognitionRequestDto. # noqa: E501 108 | 109 | Binary audio file as Base64 string # noqa: E501 110 | 111 | :return: The data of this AdvancedRecognitionRequestDto. # noqa: E501 112 | :rtype: str 113 | """ 114 | return self._data 115 | 116 | @data.setter 117 | def data(self, data): 118 | """Sets the data of this AdvancedRecognitionRequestDto. 119 | 120 | Binary audio file as Base64 string # noqa: E501 121 | 122 | :param data: The data of this AdvancedRecognitionRequestDto. # noqa: E501 123 | :type: str 124 | """ 125 | if data is None: 126 | raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 127 | 128 | self._data = data 129 | 130 | def to_dict(self): 131 | """Returns the model properties as a dict""" 132 | result = {} 133 | 134 | for attr, _ in six.iteritems(self.swagger_types): 135 | value = getattr(self, attr) 136 | if isinstance(value, list): 137 | result[attr] = list(map( 138 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 139 | value 140 | )) 141 | elif hasattr(value, "to_dict"): 142 | result[attr] = value.to_dict() 143 | elif isinstance(value, dict): 144 | result[attr] = dict(map( 145 | lambda item: (item[0], item[1].to_dict()) 146 | if hasattr(item[1], "to_dict") else item, 147 | value.items() 148 | )) 149 | else: 150 | result[attr] = value 151 | 152 | return result 153 | 154 | def to_str(self): 155 | """Returns the string representation of the model""" 156 | return pprint.pformat(self.to_dict()) 157 | 158 | def __repr__(self): 159 | """For `print` and `pprint`""" 160 | return self.to_str() 161 | 162 | def __eq__(self, other): 163 | """Returns true if both objects are equal""" 164 | if not isinstance(other, AdvancedRecognitionRequestDto): 165 | return False 166 | 167 | return self.__dict__ == other.__dict__ 168 | 169 | def __ne__(self, other): 170 | """Returns true if both objects are not equal""" 171 | return not self == other 172 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_voice_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | 20 | class SynthesizeVoiceType(object): 21 | """NOTE: This class is auto generated by the swagger code generator program. 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | swagger_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | swagger_types = { 34 | 'id': 'str', 35 | 'name': 'str', 36 | 'gender': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'id': 'id', 41 | 'name': 'name', 42 | 'gender': 'gender' 43 | } 44 | 45 | def __init__(self, id=None, name=None, gender=None): # noqa: E501 46 | """SynthesizeVoiceType - a model defined in Swagger""" # noqa: E501 47 | 48 | self._id = None 49 | self._name = None 50 | self._gender = None 51 | self.discriminator = None 52 | 53 | self.id = id 54 | self.name = name 55 | self.gender = gender 56 | 57 | @property 58 | def id(self): 59 | """Gets the id of this SynthesizeVoiceType. # noqa: E501 60 | 61 | Voice id # noqa: E501 62 | 63 | :return: The id of this SynthesizeVoiceType. # noqa: E501 64 | :rtype: str 65 | """ 66 | return self._id 67 | 68 | @id.setter 69 | def id(self, id): 70 | """Sets the id of this SynthesizeVoiceType. 71 | 72 | Voice id # noqa: E501 73 | 74 | :param id: The id of this SynthesizeVoiceType. # noqa: E501 75 | :type: str 76 | """ 77 | if id is None: 78 | raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 79 | 80 | self._id = id 81 | 82 | @property 83 | def name(self): 84 | """Gets the name of this SynthesizeVoiceType. # noqa: E501 85 | 86 | Name of voice # noqa: E501 87 | 88 | :return: The name of this SynthesizeVoiceType. # noqa: E501 89 | :rtype: str 90 | """ 91 | return self._name 92 | 93 | @name.setter 94 | def name(self, name): 95 | """Sets the name of this SynthesizeVoiceType. 96 | 97 | Name of voice # noqa: E501 98 | 99 | :param name: The name of this SynthesizeVoiceType. # noqa: E501 100 | :type: str 101 | """ 102 | if name is None: 103 | raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 104 | 105 | self._name = name 106 | 107 | @property 108 | def gender(self): 109 | """Gets the gender of this SynthesizeVoiceType. # noqa: E501 110 | 111 | Gender of voice # noqa: E501 112 | 113 | :return: The gender of this SynthesizeVoiceType. # noqa: E501 114 | :rtype: str 115 | """ 116 | return self._gender 117 | 118 | @gender.setter 119 | def gender(self, gender): 120 | """Sets the gender of this SynthesizeVoiceType. 121 | 122 | Gender of voice # noqa: E501 123 | 124 | :param gender: The gender of this SynthesizeVoiceType. # noqa: E501 125 | :type: str 126 | """ 127 | if gender is None: 128 | raise ValueError("Invalid value for `gender`, must not be `None`") # noqa: E501 129 | allowed_values = ["UNDEFINED", "MALE", "FEMALE"] # noqa: E501 130 | if gender not in allowed_values: 131 | raise ValueError( 132 | "Invalid value for `gender` ({0}), must be one of {1}" # noqa: E501 133 | .format(gender, allowed_values) 134 | ) 135 | 136 | self._gender = gender 137 | 138 | def to_dict(self): 139 | """Returns the model properties as a dict""" 140 | result = {} 141 | 142 | for attr, _ in six.iteritems(self.swagger_types): 143 | value = getattr(self, attr) 144 | if isinstance(value, list): 145 | result[attr] = list(map( 146 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 147 | value 148 | )) 149 | elif hasattr(value, "to_dict"): 150 | result[attr] = value.to_dict() 151 | elif isinstance(value, dict): 152 | result[attr] = dict(map( 153 | lambda item: (item[0], item[1].to_dict()) 154 | if hasattr(item[1], "to_dict") else item, 155 | value.items() 156 | )) 157 | else: 158 | result[attr] = value 159 | 160 | return result 161 | 162 | def to_str(self): 163 | """Returns the string representation of the model""" 164 | return pprint.pformat(self.to_dict()) 165 | 166 | def __repr__(self): 167 | """For `print` and `pprint`""" 168 | return self.to_str() 169 | 170 | def __eq__(self, other): 171 | """Returns true if both objects are equal""" 172 | if not isinstance(other, SynthesizeVoiceType): 173 | return False 174 | 175 | return self.__dict__ == other.__dict__ 176 | 177 | def __ne__(self, other): 178 | """Returns true if both objects are not equal""" 179 | return not self == other 180 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_text import SynthesizeText # noqa: F401,E501 20 | 21 | 22 | class SynthesizeRequest(object): 23 | """NOTE: This class is auto generated by the swagger code generator program. 24 | 25 | Do not edit the class manually. 26 | """ 27 | 28 | """ 29 | Attributes: 30 | swagger_types (dict): The key is attribute name 31 | and the value is attribute type. 32 | attribute_map (dict): The key is attribute name 33 | and the value is json key in definition. 34 | """ 35 | swagger_types = { 36 | 'text': 'SynthesizeText', 37 | 'voice_name': 'str', 38 | 'audio': 'str' 39 | } 40 | 41 | attribute_map = { 42 | 'text': 'text', 43 | 'voice_name': 'voice_name', 44 | 'audio': 'audio' 45 | } 46 | 47 | def __init__(self, text=None, voice_name=None, audio=None): # noqa: E501 48 | """SynthesizeRequest - a model defined in Swagger""" # noqa: E501 49 | 50 | self._text = None 51 | self._voice_name = None 52 | self._audio = None 53 | self.discriminator = None 54 | 55 | self.text = text 56 | self.voice_name = voice_name 57 | self.audio = audio 58 | 59 | @property 60 | def text(self): 61 | """Gets the text of this SynthesizeRequest. # noqa: E501 62 | 63 | Text for synthesize to speech # noqa: E501 64 | 65 | :return: The text of this SynthesizeRequest. # noqa: E501 66 | :rtype: SynthesizeText 67 | """ 68 | return self._text 69 | 70 | @text.setter 71 | def text(self, text): 72 | """Sets the text of this SynthesizeRequest. 73 | 74 | Text for synthesize to speech # noqa: E501 75 | 76 | :param text: The text of this SynthesizeRequest. # noqa: E501 77 | :type: SynthesizeText 78 | """ 79 | if text is None: 80 | raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 81 | 82 | self._text = text 83 | 84 | @property 85 | def voice_name(self): 86 | """Gets the voice_name of this SynthesizeRequest. # noqa: E501 87 | 88 | Name of name # noqa: E501 89 | 90 | :return: The voice_name of this SynthesizeRequest. # noqa: E501 91 | :rtype: str 92 | """ 93 | return self._voice_name 94 | 95 | @voice_name.setter 96 | def voice_name(self, voice_name): 97 | """Sets the voice_name of this SynthesizeRequest. 98 | 99 | Name of name # noqa: E501 100 | 101 | :param voice_name: The voice_name of this SynthesizeRequest. # noqa: E501 102 | :type: str 103 | """ 104 | if voice_name is None: 105 | raise ValueError("Invalid value for `voice_name`, must not be `None`") # noqa: E501 106 | 107 | self._voice_name = voice_name 108 | 109 | @property 110 | def audio(self): 111 | """Gets the audio of this SynthesizeRequest. # noqa: E501 112 | 113 | Format of response audio # noqa: E501 114 | 115 | :return: The audio of this SynthesizeRequest. # noqa: E501 116 | :rtype: str 117 | """ 118 | return self._audio 119 | 120 | @audio.setter 121 | def audio(self, audio): 122 | """Sets the audio of this SynthesizeRequest. 123 | 124 | Format of response audio # noqa: E501 125 | 126 | :param audio: The audio of this SynthesizeRequest. # noqa: E501 127 | :type: str 128 | """ 129 | if audio is None: 130 | raise ValueError("Invalid value for `audio`, must not be `None`") # noqa: E501 131 | 132 | self._audio = audio 133 | 134 | def to_dict(self): 135 | """Returns the model properties as a dict""" 136 | result = {} 137 | 138 | for attr, _ in six.iteritems(self.swagger_types): 139 | value = getattr(self, attr) 140 | if isinstance(value, list): 141 | result[attr] = list(map( 142 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 143 | value 144 | )) 145 | elif hasattr(value, "to_dict"): 146 | result[attr] = value.to_dict() 147 | elif isinstance(value, dict): 148 | result[attr] = dict(map( 149 | lambda item: (item[0], item[1].to_dict()) 150 | if hasattr(item[1], "to_dict") else item, 151 | value.items() 152 | )) 153 | else: 154 | result[attr] = value 155 | 156 | return result 157 | 158 | def to_str(self): 159 | """Returns the string representation of the model""" 160 | return pprint.pformat(self.to_dict()) 161 | 162 | def __repr__(self): 163 | """For `print` and `pprint`""" 164 | return self.to_str() 165 | 166 | def __eq__(self, other): 167 | """Returns true if both objects are equal""" 168 | if not isinstance(other, SynthesizeRequest): 169 | return False 170 | 171 | return self.__dict__ == other.__dict__ 172 | 173 | def __ne__(self, other): 174 | """Returns true if both objects are not equal""" 175 | return not self == other 176 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/web_socket_synthesize_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.web_socket_text_param import WebSocketTextParam # noqa: F401,E501 20 | 21 | 22 | class WebSocketSynthesizeRequest(object): 23 | """NOTE: This class is auto generated by the swagger code generator program. 24 | 25 | Do not edit the class manually. 26 | """ 27 | 28 | """ 29 | Attributes: 30 | swagger_types (dict): The key is attribute name 31 | and the value is attribute type. 32 | attribute_map (dict): The key is attribute name 33 | and the value is json key in definition. 34 | """ 35 | swagger_types = { 36 | 'text': 'WebSocketTextParam', 37 | 'voice_name': 'str', 38 | 'audio': 'str' 39 | } 40 | 41 | attribute_map = { 42 | 'text': 'text', 43 | 'voice_name': 'voice_name', 44 | 'audio': 'audio' 45 | } 46 | 47 | def __init__(self, text=None, voice_name=None, audio=None): # noqa: E501 48 | """WebSocketSynthesizeRequest - a model defined in Swagger""" # noqa: E501 49 | 50 | self._text = None 51 | self._voice_name = None 52 | self._audio = None 53 | self.discriminator = None 54 | 55 | self.text = text 56 | self.voice_name = voice_name 57 | self.audio = audio 58 | 59 | @property 60 | def text(self): 61 | """Gets the text of this WebSocketSynthesizeRequest. # noqa: E501 62 | 63 | Text for synthesize to speech # noqa: E501 64 | 65 | :return: The text of this WebSocketSynthesizeRequest. # noqa: E501 66 | :rtype: WebSocketTextParam 67 | """ 68 | return self._text 69 | 70 | @text.setter 71 | def text(self, text): 72 | """Sets the text of this WebSocketSynthesizeRequest. 73 | 74 | Text for synthesize to speech # noqa: E501 75 | 76 | :param text: The text of this WebSocketSynthesizeRequest. # noqa: E501 77 | :type: WebSocketTextParam 78 | """ 79 | if text is None: 80 | raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 81 | 82 | self._text = text 83 | 84 | @property 85 | def voice_name(self): 86 | """Gets the voice_name of this WebSocketSynthesizeRequest. # noqa: E501 87 | 88 | Name of name # noqa: E501 89 | 90 | :return: The voice_name of this WebSocketSynthesizeRequest. # noqa: E501 91 | :rtype: str 92 | """ 93 | return self._voice_name 94 | 95 | @voice_name.setter 96 | def voice_name(self, voice_name): 97 | """Sets the voice_name of this WebSocketSynthesizeRequest. 98 | 99 | Name of name # noqa: E501 100 | 101 | :param voice_name: The voice_name of this WebSocketSynthesizeRequest. # noqa: E501 102 | :type: str 103 | """ 104 | if voice_name is None: 105 | raise ValueError("Invalid value for `voice_name`, must not be `None`") # noqa: E501 106 | 107 | self._voice_name = voice_name 108 | 109 | @property 110 | def audio(self): 111 | """Gets the audio of this WebSocketSynthesizeRequest. # noqa: E501 112 | 113 | Format of response audio # noqa: E501 114 | 115 | :return: The audio of this WebSocketSynthesizeRequest. # noqa: E501 116 | :rtype: str 117 | """ 118 | return self._audio 119 | 120 | @audio.setter 121 | def audio(self, audio): 122 | """Sets the audio of this WebSocketSynthesizeRequest. 123 | 124 | Format of response audio # noqa: E501 125 | 126 | :param audio: The audio of this WebSocketSynthesizeRequest. # noqa: E501 127 | :type: str 128 | """ 129 | if audio is None: 130 | raise ValueError("Invalid value for `audio`, must not be `None`") # noqa: E501 131 | 132 | self._audio = audio 133 | 134 | def to_dict(self): 135 | """Returns the model properties as a dict""" 136 | result = {} 137 | 138 | for attr, _ in six.iteritems(self.swagger_types): 139 | value = getattr(self, attr) 140 | if isinstance(value, list): 141 | result[attr] = list(map( 142 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 143 | value 144 | )) 145 | elif hasattr(value, "to_dict"): 146 | result[attr] = value.to_dict() 147 | elif isinstance(value, dict): 148 | result[attr] = dict(map( 149 | lambda item: (item[0], item[1].to_dict()) 150 | if hasattr(item[1], "to_dict") else item, 151 | value.items() 152 | )) 153 | else: 154 | result[attr] = value 155 | 156 | return result 157 | 158 | def to_str(self): 159 | """Returns the string representation of the model""" 160 | return pprint.pformat(self.to_dict()) 161 | 162 | def __repr__(self): 163 | """For `print` and `pprint`""" 164 | return self.to_str() 165 | 166 | def __eq__(self, other): 167 | """Returns true if both objects are equal""" 168 | if not isinstance(other, WebSocketSynthesizeRequest): 169 | return False 170 | 171 | return self.__dict__ == other.__dict__ 172 | 173 | def __ne__(self, other): 174 | """Returns true if both objects are not equal""" 175 | return not self == other 176 | -------------------------------------------------------------------------------- /speechpro/cloud/speech/synthesis/rest/cloud_client/models/synthesize_sessionless_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | TTS documentation 5 | 6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 7 | 8 | OpenAPI spec version: 1.1 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | 14 | import pprint 15 | import re # noqa: F401 16 | 17 | import six 18 | 19 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.credentials import Credentials # noqa: F401,E501 20 | from speechpro.cloud.speech.synthesis.rest.cloud_client.models.synthesize_text import SynthesizeText # noqa: F401,E501 21 | 22 | 23 | class SynthesizeSessionlessRequest(object): 24 | """NOTE: This class is auto generated by the swagger code generator program. 25 | 26 | Do not edit the class manually. 27 | """ 28 | 29 | """ 30 | Attributes: 31 | swagger_types (dict): The key is attribute name 32 | and the value is attribute type. 33 | attribute_map (dict): The key is attribute name 34 | and the value is json key in definition. 35 | """ 36 | swagger_types = { 37 | 'text': 'SynthesizeText', 38 | 'credentials': 'Credentials', 39 | 'voice_name': 'str', 40 | 'audio': 'str' 41 | } 42 | 43 | attribute_map = { 44 | 'text': 'text', 45 | 'credentials': 'credentials', 46 | 'voice_name': 'voice_name', 47 | 'audio': 'audio' 48 | } 49 | 50 | def __init__(self, text=None, credentials=None, voice_name=None, audio=None): # noqa: E501 51 | """SynthesizeSessionlessRequest - a model defined in Swagger""" # noqa: E501 52 | 53 | self._text = None 54 | self._credentials = None 55 | self._voice_name = None 56 | self._audio = None 57 | self.discriminator = None 58 | 59 | self.text = text 60 | self.credentials = credentials 61 | self.voice_name = voice_name 62 | self.audio = audio 63 | 64 | @property 65 | def text(self): 66 | """Gets the text of this SynthesizeSessionlessRequest. # noqa: E501 67 | 68 | Text for synthesize to speech # noqa: E501 69 | 70 | :return: The text of this SynthesizeSessionlessRequest. # noqa: E501 71 | :rtype: SynthesizeText 72 | """ 73 | return self._text 74 | 75 | @text.setter 76 | def text(self, text): 77 | """Sets the text of this SynthesizeSessionlessRequest. 78 | 79 | Text for synthesize to speech # noqa: E501 80 | 81 | :param text: The text of this SynthesizeSessionlessRequest. # noqa: E501 82 | :type: SynthesizeText 83 | """ 84 | if text is None: 85 | raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 86 | 87 | self._text = text 88 | 89 | @property 90 | def credentials(self): 91 | """Gets the credentials of this SynthesizeSessionlessRequest. # noqa: E501 92 | 93 | Credentials # noqa: E501 94 | 95 | :return: The credentials of this SynthesizeSessionlessRequest. # noqa: E501 96 | :rtype: Credentials 97 | """ 98 | return self._credentials 99 | 100 | @credentials.setter 101 | def credentials(self, credentials): 102 | """Sets the credentials of this SynthesizeSessionlessRequest. 103 | 104 | Credentials # noqa: E501 105 | 106 | :param credentials: The credentials of this SynthesizeSessionlessRequest. # noqa: E501 107 | :type: Credentials 108 | """ 109 | if credentials is None: 110 | raise ValueError("Invalid value for `credentials`, must not be `None`") # noqa: E501 111 | 112 | self._credentials = credentials 113 | 114 | @property 115 | def voice_name(self): 116 | """Gets the voice_name of this SynthesizeSessionlessRequest. # noqa: E501 117 | 118 | Name of name # noqa: E501 119 | 120 | :return: The voice_name of this SynthesizeSessionlessRequest. # noqa: E501 121 | :rtype: str 122 | """ 123 | return self._voice_name 124 | 125 | @voice_name.setter 126 | def voice_name(self, voice_name): 127 | """Sets the voice_name of this SynthesizeSessionlessRequest. 128 | 129 | Name of name # noqa: E501 130 | 131 | :param voice_name: The voice_name of this SynthesizeSessionlessRequest. # noqa: E501 132 | :type: str 133 | """ 134 | if voice_name is None: 135 | raise ValueError("Invalid value for `voice_name`, must not be `None`") # noqa: E501 136 | 137 | self._voice_name = voice_name 138 | 139 | @property 140 | def audio(self): 141 | """Gets the audio of this SynthesizeSessionlessRequest. # noqa: E501 142 | 143 | Format of response audio # noqa: E501 144 | 145 | :return: The audio of this SynthesizeSessionlessRequest. # noqa: E501 146 | :rtype: str 147 | """ 148 | return self._audio 149 | 150 | @audio.setter 151 | def audio(self, audio): 152 | """Sets the audio of this SynthesizeSessionlessRequest. 153 | 154 | Format of response audio # noqa: E501 155 | 156 | :param audio: The audio of this SynthesizeSessionlessRequest. # noqa: E501 157 | :type: str 158 | """ 159 | if audio is None: 160 | raise ValueError("Invalid value for `audio`, must not be `None`") # noqa: E501 161 | 162 | self._audio = audio 163 | 164 | def to_dict(self): 165 | """Returns the model properties as a dict""" 166 | result = {} 167 | 168 | for attr, _ in six.iteritems(self.swagger_types): 169 | value = getattr(self, attr) 170 | if isinstance(value, list): 171 | result[attr] = list(map( 172 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 173 | value 174 | )) 175 | elif hasattr(value, "to_dict"): 176 | result[attr] = value.to_dict() 177 | elif isinstance(value, dict): 178 | result[attr] = dict(map( 179 | lambda item: (item[0], item[1].to_dict()) 180 | if hasattr(item[1], "to_dict") else item, 181 | value.items() 182 | )) 183 | else: 184 | result[attr] = value 185 | 186 | return result 187 | 188 | def to_str(self): 189 | """Returns the string representation of the model""" 190 | return pprint.pformat(self.to_dict()) 191 | 192 | def __repr__(self): 193 | """For `print` and `pprint`""" 194 | return self.to_str() 195 | 196 | def __eq__(self, other): 197 | """Returns true if both objects are equal""" 198 | if not isinstance(other, SynthesizeSessionlessRequest): 199 | return False 200 | 201 | return self.__dict__ == other.__dict__ 202 | 203 | def __ne__(self, other): 204 | """Returns true if both objects are not equal""" 205 | return not self == other 206 | --------------------------------------------------------------------------------