To execute the sample you need to generate the Python client library.
To do this follow these steps:
- Go to https://editor.swagger.io
- Click File, then click Import URL
- Enter the Swagger URL including the region for your Speech Services subscription:
https://<your-region>.cris.ai/docs/v2.0/swagger
- Click Generate Client and select Python
- Save the client library
- Extract the downloaded python-client-generated.zip somewhere in your file system.
- Install the extracted python-client module in your Python environment using pip:
pip install path/to/package/python-client
. - The installed package has the name
swagger_client
. You can check that the installation worked using the commandpython -c "import swagger_client"
.
The sample code itself is main.py. You can use a development environment like PyCharm to edit, debug, and execute the sample.