code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def delete(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> DeleteVoiceSampleResponseModel:
"""
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteVoiceSampleResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.delete(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.delete(voice_id, sample_id, request_options=request_options)
return _response.data |
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteVoiceSampleResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.delete(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/client.py | MIT |
async def create(
self,
voice_id: str,
*,
files: typing.List[core.File],
remove_background_noise: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[VoiceSample]:
"""
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[VoiceSample]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.create(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
"""
_response = await self._raw_client.create(
voice_id, files=files, remove_background_noise=remove_background_noise, request_options=request_options
)
return _response.data |
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[VoiceSample]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.create(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/client.py | MIT |
async def update(
self,
voice_id: str,
sample_id: str,
*,
remove_background_noise: typing.Optional[bool] = OMIT,
selected_speaker_ids: typing.Optional[typing.Sequence[str]] = OMIT,
trim_start_time: typing.Optional[int] = OMIT,
trim_end_time: typing.Optional[int] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AddVoiceResponseModel:
"""
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddVoiceResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.update(
voice_id,
sample_id,
remove_background_noise=remove_background_noise,
selected_speaker_ids=selected_speaker_ids,
trim_start_time=trim_start_time,
trim_end_time=trim_end_time,
request_options=request_options,
)
return _response.data |
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddVoiceResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/client.py | MIT |
async def delete(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> DeleteVoiceSampleResponseModel:
"""
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteVoiceSampleResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.delete(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.delete(voice_id, sample_id, request_options=request_options)
return _response.data |
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteVoiceSampleResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.delete(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/client.py | MIT |
def create(
self,
voice_id: str,
*,
files: typing.List[core.File],
remove_background_noise: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[typing.List[VoiceSample]]:
"""
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.List[VoiceSample]]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples",
base_url=self._client_wrapper.get_environment().base,
method="POST",
data={
"remove_background_noise": remove_background_noise,
},
files={
"files": files,
},
request_options=request_options,
omit=OMIT,
force_multipart=True,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[VoiceSample],
construct_type(
type_=typing.List[VoiceSample], # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.List[VoiceSample]]
Successful Response
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
def update(
self,
voice_id: str,
sample_id: str,
*,
remove_background_noise: typing.Optional[bool] = OMIT,
selected_speaker_ids: typing.Optional[typing.Sequence[str]] = OMIT,
trim_start_time: typing.Optional[int] = OMIT,
trim_end_time: typing.Optional[int] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[AddVoiceResponseModel]:
"""
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddVoiceResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"remove_background_noise": remove_background_noise,
"selected_speaker_ids": selected_speaker_ids,
"trim_start_time": trim_start_time,
"trim_end_time": trim_end_time,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddVoiceResponseModel,
construct_type(
type_=AddVoiceResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddVoiceResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
def delete(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[DeleteVoiceSampleResponseModel]:
"""
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteVoiceSampleResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteVoiceSampleResponseModel,
construct_type(
type_=DeleteVoiceSampleResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteVoiceSampleResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
async def create(
self,
voice_id: str,
*,
files: typing.List[core.File],
remove_background_noise: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[typing.List[VoiceSample]]:
"""
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.List[VoiceSample]]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples",
base_url=self._client_wrapper.get_environment().base,
method="POST",
data={
"remove_background_noise": remove_background_noise,
},
files={
"files": files,
},
request_options=request_options,
omit=OMIT,
force_multipart=True,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[VoiceSample],
construct_type(
type_=typing.List[VoiceSample], # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Add audio samples to a PVC voice
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.List[VoiceSample]]
Successful Response
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
async def update(
self,
voice_id: str,
sample_id: str,
*,
remove_background_noise: typing.Optional[bool] = OMIT,
selected_speaker_ids: typing.Optional[typing.Sequence[str]] = OMIT,
trim_start_time: typing.Optional[int] = OMIT,
trim_end_time: typing.Optional[int] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[AddVoiceResponseModel]:
"""
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddVoiceResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"remove_background_noise": remove_background_noise,
"selected_speaker_ids": selected_speaker_ids,
"trim_start_time": trim_start_time,
"trim_end_time": trim_end_time,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddVoiceResponseModel,
construct_type(
type_=AddVoiceResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Update a PVC voice sample - apply noise removal, or select speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
remove_background_noise : typing.Optional[bool]
If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse.
selected_speaker_ids : typing.Optional[typing.Sequence[str]]
Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones.
trim_start_time : typing.Optional[int]
The start time of the audio to be used for PVC training. Time should be in milliseconds
trim_end_time : typing.Optional[int]
The end time of the audio to be used for PVC training. Time should be in milliseconds
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddVoiceResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
async def delete(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[DeleteVoiceSampleResponseModel]:
"""
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteVoiceSampleResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteVoiceSampleResponseModel,
construct_type(
type_=DeleteVoiceSampleResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Delete a sample from a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteVoiceSampleResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/raw_client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> VoiceSamplePreviewResponseModel:
"""
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSamplePreviewResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSamplePreviewResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/audio/client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> VoiceSamplePreviewResponseModel:
"""
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSamplePreviewResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSamplePreviewResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/audio/client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[VoiceSamplePreviewResponseModel]:
"""
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSamplePreviewResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSamplePreviewResponseModel,
construct_type(
type_=VoiceSamplePreviewResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSamplePreviewResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/audio/raw_client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[VoiceSamplePreviewResponseModel]:
"""
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSamplePreviewResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSamplePreviewResponseModel,
construct_type(
type_=VoiceSamplePreviewResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the first 30 seconds of voice sample audio with or without noise removal.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSamplePreviewResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/audio/raw_client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> SpeakerSeparationResponseModel:
"""
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerSeparationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerSeparationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/client.py | MIT |
def separate(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> StartSpeakerSeparationResponseModel:
"""
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
StartSpeakerSeparationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.separate(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.separate(voice_id, sample_id, request_options=request_options)
return _response.data |
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
StartSpeakerSeparationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.separate(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
| separate | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> SpeakerSeparationResponseModel:
"""
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerSeparationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerSeparationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/client.py | MIT |
async def separate(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> StartSpeakerSeparationResponseModel:
"""
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
StartSpeakerSeparationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.separate(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.separate(voice_id, sample_id, request_options=request_options)
return _response.data |
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
StartSpeakerSeparationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.separate(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| separate | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[SpeakerSeparationResponseModel]:
"""
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[SpeakerSeparationResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
SpeakerSeparationResponseModel,
construct_type(
type_=SpeakerSeparationResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[SpeakerSeparationResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | MIT |
def separate(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[StartSpeakerSeparationResponseModel]:
"""
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[StartSpeakerSeparationResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers",
base_url=self._client_wrapper.get_environment().base,
method="POST",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
StartSpeakerSeparationResponseModel,
construct_type(
type_=StartSpeakerSeparationResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[StartSpeakerSeparationResponseModel]
Successful Response
| separate | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[SpeakerSeparationResponseModel]:
"""
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[SpeakerSeparationResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
SpeakerSeparationResponseModel,
construct_type(
type_=SpeakerSeparationResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the status of the speaker separation process and the list of detected speakers if complete.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[SpeakerSeparationResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | MIT |
async def separate(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[StartSpeakerSeparationResponseModel]:
"""
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[StartSpeakerSeparationResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/separate-speakers",
base_url=self._client_wrapper.get_environment().base,
method="POST",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
StartSpeakerSeparationResponseModel,
construct_type(
type_=StartSpeakerSeparationResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Start speaker separation process for a sample
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[StartSpeakerSeparationResponseModel]
Successful Response
| separate | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/raw_client.py | MIT |
def get(
self, voice_id: str, sample_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> SpeakerAudioResponseModel:
"""
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerAudioResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
speaker_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.get(voice_id, sample_id, speaker_id, request_options=request_options)
return _response.data |
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerAudioResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.speakers.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
speaker_id="VW7YKqPnjY4h39yTbx2L",
)
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> SpeakerAudioResponseModel:
"""
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerAudioResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
speaker_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, sample_id, speaker_id, request_options=request_options)
return _response.data |
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SpeakerAudioResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.speakers.audio.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
speaker_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/audio/client.py | MIT |
def get(
self, voice_id: str, sample_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[SpeakerAudioResponseModel]:
"""
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[SpeakerAudioResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers/{jsonable_encoder(speaker_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
SpeakerAudioResponseModel,
construct_type(
type_=SpeakerAudioResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[SpeakerAudioResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/audio/raw_client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, speaker_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[SpeakerAudioResponseModel]:
"""
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[SpeakerAudioResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/speakers/{jsonable_encoder(speaker_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
SpeakerAudioResponseModel,
construct_type(
type_=SpeakerAudioResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the separated audio for a specific speaker.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
speaker_id : str
Speaker ID to be used, you can use GET https://api.elevenlabs.io/v1/voices/{voice_id}/samples/{sample_id}/speakers to list all the available speakers for a sample.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[SpeakerAudioResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/speakers/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/speakers/audio/raw_client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> VoiceSampleVisualWaveformResponseModel:
"""
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSampleVisualWaveformResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.waveform.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
"""
_response = self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSampleVisualWaveformResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.samples.waveform.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/waveform/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/waveform/client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> VoiceSampleVisualWaveformResponseModel:
"""
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSampleVisualWaveformResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.waveform.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, sample_id, request_options=request_options)
return _response.data |
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSampleVisualWaveformResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.samples.waveform.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
sample_id="VW7YKqPnjY4h39yTbx2L",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/waveform/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/waveform/client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[VoiceSampleVisualWaveformResponseModel]:
"""
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSampleVisualWaveformResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSampleVisualWaveformResponseModel,
construct_type(
type_=VoiceSampleVisualWaveformResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSampleVisualWaveformResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/waveform/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/waveform/raw_client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[VoiceSampleVisualWaveformResponseModel]:
"""
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSampleVisualWaveformResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/waveform",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSampleVisualWaveformResponseModel,
construct_type(
type_=VoiceSampleVisualWaveformResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Retrieve the visual waveform of a voice sample.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
sample_id : str
Sample ID to be used
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSampleVisualWaveformResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/samples/waveform/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/samples/waveform/raw_client.py | MIT |
def request(
self,
voice_id: str,
*,
files: typing.List[core.File],
extra_text: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> RequestPvcManualVerificationResponseModel:
"""
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
RequestPvcManualVerificationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.verification.request(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
"""
_response = self._raw_client.request(
voice_id, files=files, extra_text=extra_text, request_options=request_options
)
return _response.data |
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
RequestPvcManualVerificationResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.pvc.verification.request(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
| request | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/client.py | MIT |
async def request(
self,
voice_id: str,
*,
files: typing.List[core.File],
extra_text: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> RequestPvcManualVerificationResponseModel:
"""
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
RequestPvcManualVerificationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.verification.request(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
"""
_response = await self._raw_client.request(
voice_id, files=files, extra_text=extra_text, request_options=request_options
)
return _response.data |
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
RequestPvcManualVerificationResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.verification.request(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
| request | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/client.py | MIT |
def request(
self,
voice_id: str,
*,
files: typing.List[core.File],
extra_text: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[RequestPvcManualVerificationResponseModel]:
"""
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[RequestPvcManualVerificationResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification",
base_url=self._client_wrapper.get_environment().base,
method="POST",
data={
"extra_text": extra_text,
},
files={
"files": files,
},
request_options=request_options,
omit=OMIT,
force_multipart=True,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
RequestPvcManualVerificationResponseModel,
construct_type(
type_=RequestPvcManualVerificationResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[RequestPvcManualVerificationResponseModel]
Successful Response
| request | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/raw_client.py | MIT |
async def request(
self,
voice_id: str,
*,
files: typing.List[core.File],
extra_text: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[RequestPvcManualVerificationResponseModel]:
"""
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[RequestPvcManualVerificationResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/verification",
base_url=self._client_wrapper.get_environment().base,
method="POST",
data={
"extra_text": extra_text,
},
files={
"files": files,
},
request_options=request_options,
omit=OMIT,
force_multipart=True,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
RequestPvcManualVerificationResponseModel,
construct_type(
type_=RequestPvcManualVerificationResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Request manual verification for a PVC voice.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
files : typing.List[core.File]
See core.File for more documentation
extra_text : typing.Optional[str]
Extra text to be used in the manual verification process.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[RequestPvcManualVerificationResponseModel]
Successful Response
| request | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/raw_client.py | MIT |
async def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
"""
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
None
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.verification.captcha.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, request_options=request_options)
return _response.data |
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
None
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.pvc.verification.captcha.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/captcha/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/captcha/client.py | MIT |
def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
"""
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[None]
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return HttpResponse(response=_response, data=None)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[None]
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/captcha/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/captcha/raw_client.py | MIT |
async def get(
self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[None]:
"""
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[None]
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/pvc/{jsonable_encoder(voice_id)}/captcha",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return AsyncHttpResponse(response=_response, data=None)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Get captcha for PVC voice verification.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[None]
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/pvc/verification/captcha/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/pvc/verification/captcha/raw_client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.Iterator[bytes]:
"""
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.Iterator[bytes]
Successful Response
"""
with self._raw_client.get(voice_id, sample_id, request_options=request_options) as r:
yield from r.data |
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.Iterator[bytes]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/samples/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/samples/audio/client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.AsyncIterator[bytes]:
"""
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.AsyncIterator[bytes]
Successful Response
"""
async with self._raw_client.get(voice_id, sample_id, request_options=request_options) as r:
async for _chunk in r.data:
yield _chunk |
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.AsyncIterator[bytes]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/samples/audio/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/samples/audio/client.py | MIT |
def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]:
"""
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
Successful Response
"""
with self._client_wrapper.httpx_client.stream(
f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
) as _response:
def _stream() -> HttpResponse[typing.Iterator[bytes]]:
try:
if 200 <= _response.status_code < 300:
_chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
return HttpResponse(
response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size))
)
_response.read()
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
yield _stream() |
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/samples/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/samples/audio/raw_client.py | MIT |
async def get(
self, voice_id: str, sample_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]:
"""
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
Successful Response
"""
async with self._client_wrapper.httpx_client.stream(
f"v1/voices/{jsonable_encoder(voice_id)}/samples/{jsonable_encoder(sample_id)}/audio",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
) as _response:
async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
try:
if 200 <= _response.status_code < 300:
_chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
return AsyncHttpResponse(
response=_response,
data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)),
)
await _response.aread()
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
yield await _stream() |
Returns the audio corresponding to a sample attached to a voice.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
sample_id : str
ID of the sample to be used. You can use the [Get voices](/docs/api-reference/voices/get) endpoint list all the available samples for a voice.
request_options : typing.Optional[RequestOptions]
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
Returns
-------
typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/samples/audio/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/samples/audio/raw_client.py | MIT |
def update(
self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None
) -> EditVoiceSettingsResponseModel:
"""
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
EditVoiceSettingsResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs, VoiceSettings
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.settings.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
request=VoiceSettings(
stability=1.0,
use_speaker_boost=True,
similarity_boost=1.0,
style=0.0,
speed=1.0,
),
)
"""
_response = self._raw_client.update(voice_id, request=request, request_options=request_options)
return _response.data |
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
EditVoiceSettingsResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs, VoiceSettings
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.voices.settings.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
request=VoiceSettings(
stability=1.0,
use_speaker_boost=True,
similarity_boost=1.0,
style=0.0,
speed=1.0,
),
)
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/client.py | MIT |
async def get_default(self, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings:
"""
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSettings
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.get_default()
asyncio.run(main())
"""
_response = await self._raw_client.get_default(request_options=request_options)
return _response.data |
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSettings
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.get_default()
asyncio.run(main())
| get_default | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/client.py | MIT |
async def get(self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> VoiceSettings:
"""
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSettings
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(voice_id, request_options=request_options)
return _response.data |
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
VoiceSettings
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.get(
voice_id="21m00Tcm4TlvDq8ikWAM",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/client.py | MIT |
async def update(
self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None
) -> EditVoiceSettingsResponseModel:
"""
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
EditVoiceSettingsResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs, VoiceSettings
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
request=VoiceSettings(
stability=1.0,
use_speaker_boost=True,
similarity_boost=1.0,
style=0.0,
speed=1.0,
),
)
asyncio.run(main())
"""
_response = await self._raw_client.update(voice_id, request=request, request_options=request_options)
return _response.data |
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
EditVoiceSettingsResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs, VoiceSettings
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.voices.settings.update(
voice_id="21m00Tcm4TlvDq8ikWAM",
request=VoiceSettings(
stability=1.0,
use_speaker_boost=True,
similarity_boost=1.0,
style=0.0,
speed=1.0,
),
)
asyncio.run(main())
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/client.py | MIT |
def get_default(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[VoiceSettings]:
"""
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSettings]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/voices/settings/default",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSettings,
construct_type(
type_=VoiceSettings, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSettings]
Successful Response
| get_default | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
def get(
self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[VoiceSettings]:
"""
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSettings]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/{jsonable_encoder(voice_id)}/settings",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSettings,
construct_type(
type_=VoiceSettings, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[VoiceSettings]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
def update(
self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[EditVoiceSettingsResponseModel]:
"""
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[EditVoiceSettingsResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/voices/{jsonable_encoder(voice_id)}/settings/edit",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json=convert_and_respect_annotation_metadata(object_=request, annotation=VoiceSettings, direction="write"),
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
EditVoiceSettingsResponseModel,
construct_type(
type_=EditVoiceSettingsResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[EditVoiceSettingsResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
async def get_default(
self, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[VoiceSettings]:
"""
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSettings]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/voices/settings/default",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSettings,
construct_type(
type_=VoiceSettings, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Gets the default settings for voices. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSettings]
Successful Response
| get_default | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
async def get(
self, voice_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[VoiceSettings]:
"""
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSettings]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/{jsonable_encoder(voice_id)}/settings",
base_url=self._client_wrapper.get_environment().base,
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
VoiceSettings,
construct_type(
type_=VoiceSettings, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Returns the settings for a specific voice. "similarity_boost" corresponds to"Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[VoiceSettings]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
async def update(
self, voice_id: str, *, request: VoiceSettings, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[EditVoiceSettingsResponseModel]:
"""
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[EditVoiceSettingsResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/voices/{jsonable_encoder(voice_id)}/settings/edit",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json=convert_and_respect_annotation_metadata(object_=request, annotation=VoiceSettings, direction="write"),
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
EditVoiceSettingsResponseModel,
construct_type(
type_=EditVoiceSettingsResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Edit your settings for a specific voice. "similarity_boost" corresponds to "Clarity + Similarity Enhancement" in the web app and "stability" corresponds to "Stability" slider in the web app.
Parameters
----------
voice_id : str
ID of the voice to be used. You can use the [Get voices](/docs/api-reference/voices/search) endpoint list all the available voices.
request : VoiceSettings
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[EditVoiceSettingsResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/voices/settings/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/voices/settings/raw_client.py | MIT |
def search(
self, *, name: str, request_options: typing.Optional[RequestOptions] = None
) -> typing.List[WorkspaceGroupByNameResponseModel]:
"""
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkspaceGroupByNameResponseModel]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.search(
name="name",
)
"""
_response = self._raw_client.search(name=name, request_options=request_options)
return _response.data |
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkspaceGroupByNameResponseModel]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.search(
name="name",
)
| search | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/client.py | MIT |
async def search(
self, *, name: str, request_options: typing.Optional[RequestOptions] = None
) -> typing.List[WorkspaceGroupByNameResponseModel]:
"""
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkspaceGroupByNameResponseModel]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.search(
name="name",
)
asyncio.run(main())
"""
_response = await self._raw_client.search(name=name, request_options=request_options)
return _response.data |
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[WorkspaceGroupByNameResponseModel]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.search(
name="name",
)
asyncio.run(main())
| search | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/client.py | MIT |
def search(
self, *, name: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]:
"""
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/groups/search",
base_url=self._client_wrapper.get_environment().base,
method="GET",
params={
"name": name,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[WorkspaceGroupByNameResponseModel],
construct_type(
type_=typing.List[WorkspaceGroupByNameResponseModel], # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]
Successful Response
| search | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/raw_client.py | MIT |
async def search(
self, *, name: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]:
"""
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/groups/search",
base_url=self._client_wrapper.get_environment().base,
method="GET",
params={
"name": name,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[WorkspaceGroupByNameResponseModel],
construct_type(
type_=typing.List[WorkspaceGroupByNameResponseModel], # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Searches for user groups in the workspace. Multiple or no groups may be returned.
Parameters
----------
name : str
Name of the target group.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.List[WorkspaceGroupByNameResponseModel]]
Successful Response
| search | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/raw_client.py | MIT |
def remove(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceGroupMemberResponseModel:
"""
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.members.remove(
group_id="group_id",
email="email",
)
"""
_response = self._raw_client.remove(group_id, email=email, request_options=request_options)
return _response.data |
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.members.remove(
group_id="group_id",
email="email",
)
| remove | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/client.py | MIT |
def add(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AddWorkspaceGroupMemberResponseModel:
"""
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.members.add(
group_id="group_id",
email="email",
)
"""
_response = self._raw_client.add(group_id, email=email, request_options=request_options)
return _response.data |
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.groups.members.add(
group_id="group_id",
email="email",
)
| add | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/client.py | MIT |
async def remove(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceGroupMemberResponseModel:
"""
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.members.remove(
group_id="group_id",
email="email",
)
asyncio.run(main())
"""
_response = await self._raw_client.remove(group_id, email=email, request_options=request_options)
return _response.data |
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.members.remove(
group_id="group_id",
email="email",
)
asyncio.run(main())
| remove | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/client.py | MIT |
async def add(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AddWorkspaceGroupMemberResponseModel:
"""
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.members.add(
group_id="group_id",
email="email",
)
asyncio.run(main())
"""
_response = await self._raw_client.add(group_id, email=email, request_options=request_options)
return _response.data |
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceGroupMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.groups.members.add(
group_id="group_id",
email="email",
)
asyncio.run(main())
| add | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/client.py | MIT |
def remove(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[DeleteWorkspaceGroupMemberResponseModel]:
"""
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceGroupMemberResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/workspace/groups/{jsonable_encoder(group_id)}/members/remove",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceGroupMemberResponseModel,
construct_type(
type_=DeleteWorkspaceGroupMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceGroupMemberResponseModel]
Successful Response
| remove | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/raw_client.py | MIT |
def add(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[AddWorkspaceGroupMemberResponseModel]:
"""
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceGroupMemberResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/workspace/groups/{jsonable_encoder(group_id)}/members",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceGroupMemberResponseModel,
construct_type(
type_=AddWorkspaceGroupMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceGroupMemberResponseModel]
Successful Response
| add | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/raw_client.py | MIT |
async def remove(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[DeleteWorkspaceGroupMemberResponseModel]:
"""
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceGroupMemberResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/workspace/groups/{jsonable_encoder(group_id)}/members/remove",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceGroupMemberResponseModel,
construct_type(
type_=DeleteWorkspaceGroupMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Removes a member from the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceGroupMemberResponseModel]
Successful Response
| remove | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/raw_client.py | MIT |
async def add(
self, group_id: str, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[AddWorkspaceGroupMemberResponseModel]:
"""
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceGroupMemberResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/workspace/groups/{jsonable_encoder(group_id)}/members",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceGroupMemberResponseModel,
construct_type(
type_=AddWorkspaceGroupMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Adds a member of your workspace to the specified group. This endpoint may only be called by workspace administrators.
Parameters
----------
group_id : str
The ID of the target group.
email : str
The email of the target workspace member.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceGroupMemberResponseModel]
Successful Response
| add | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/groups/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/groups/members/raw_client.py | MIT |
def create(
self,
*,
email: str,
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
workspace_permission: typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AddWorkspaceInviteResponseModel:
"""
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.create(
email="john.doe@testmail.com",
)
"""
_response = self._raw_client.create(
email=email, group_ids=group_ids, workspace_permission=workspace_permission, request_options=request_options
)
return _response.data |
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.create(
email="john.doe@testmail.com",
)
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
def create_batch(
self,
*,
emails: typing.Sequence[str],
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AddWorkspaceInviteResponseModel:
"""
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.create_batch(
emails=["emails"],
)
"""
_response = self._raw_client.create_batch(emails=emails, group_ids=group_ids, request_options=request_options)
return _response.data |
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.create_batch(
emails=["emails"],
)
| create_batch | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceInviteResponseModel:
"""
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.delete(
email="john.doe@testmail.com",
)
"""
_response = self._raw_client.delete(email=email, request_options=request_options)
return _response.data |
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceInviteResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.invites.delete(
email="john.doe@testmail.com",
)
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
async def create(
self,
*,
email: str,
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
workspace_permission: typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AddWorkspaceInviteResponseModel:
"""
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.create(
email="john.doe@testmail.com",
)
asyncio.run(main())
"""
_response = await self._raw_client.create(
email=email, group_ids=group_ids, workspace_permission=workspace_permission, request_options=request_options
)
return _response.data |
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.create(
email="john.doe@testmail.com",
)
asyncio.run(main())
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
async def create_batch(
self,
*,
emails: typing.Sequence[str],
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AddWorkspaceInviteResponseModel:
"""
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.create_batch(
emails=["emails"],
)
asyncio.run(main())
"""
_response = await self._raw_client.create_batch(
emails=emails, group_ids=group_ids, request_options=request_options
)
return _response.data |
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AddWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.create_batch(
emails=["emails"],
)
asyncio.run(main())
| create_batch | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
async def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceInviteResponseModel:
"""
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.delete(
email="john.doe@testmail.com",
)
asyncio.run(main())
"""
_response = await self._raw_client.delete(email=email, request_options=request_options)
return _response.data |
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceInviteResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.invites.delete(
email="john.doe@testmail.com",
)
asyncio.run(main())
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/client.py | MIT |
def create(
self,
*,
email: str,
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
workspace_permission: typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[AddWorkspaceInviteResponseModel]:
"""
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/invites/add",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
"group_ids": group_ids,
"workspace_permission": workspace_permission,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceInviteResponseModel,
construct_type(
type_=AddWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
def create_batch(
self,
*,
emails: typing.Sequence[str],
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[AddWorkspaceInviteResponseModel]:
"""
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/invites/add-bulk",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"emails": emails,
"group_ids": group_ids,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceInviteResponseModel,
construct_type(
type_=AddWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
| create_batch | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[DeleteWorkspaceInviteResponseModel]:
"""
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceInviteResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/invites",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceInviteResponseModel,
construct_type(
type_=DeleteWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceInviteResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
async def create(
self,
*,
email: str,
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
workspace_permission: typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[AddWorkspaceInviteResponseModel]:
"""
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/invites/add",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
"group_ids": group_ids,
"workspace_permission": workspace_permission,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceInviteResponseModel,
construct_type(
type_=AddWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Sends an email invitation to join your workspace to the provided email. If the user doesn't have an account they will be prompted to create one. If the user accepts this invite they will be added as a user to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators. If the user is already in the workspace a 400 error will be returned.
Parameters
----------
email : str
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
workspace_permission : typing.Optional[BodyInviteUserV1WorkspaceInvitesAddPostWorkspacePermission]
The workspace permission of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
| create | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
async def create_batch(
self,
*,
emails: typing.Sequence[str],
group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[AddWorkspaceInviteResponseModel]:
"""
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/invites/add-bulk",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"emails": emails,
"group_ids": group_ids,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
AddWorkspaceInviteResponseModel,
construct_type(
type_=AddWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Sends email invitations to join your workspace to the provided emails. Requires all email addresses to be part of a verified domain. If the users don't have an account they will be prompted to create one. If the users accept these invites they will be added as users to your workspace and your subscription using one of your seats. This endpoint may only be called by workspace administrators.
Parameters
----------
emails : typing.Sequence[str]
The email of the customer
group_ids : typing.Optional[typing.Sequence[str]]
The group ids of the user
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[AddWorkspaceInviteResponseModel]
Successful Response
| create_batch | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
async def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[DeleteWorkspaceInviteResponseModel]:
"""
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceInviteResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/invites",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceInviteResponseModel,
construct_type(
type_=DeleteWorkspaceInviteResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Invalidates an existing email invitation. The invitation will still show up in the inbox it has been delivered to, but activating it to join the workspace won't work. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
The email of the customer
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceInviteResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/invites/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/invites/raw_client.py | MIT |
def update(
self,
*,
email: str,
is_locked: typing.Optional[bool] = OMIT,
workspace_role: typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UpdateWorkspaceMemberResponseModel:
"""
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
UpdateWorkspaceMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.members.update(
email="email",
)
"""
_response = self._raw_client.update(
email=email, is_locked=is_locked, workspace_role=workspace_role, request_options=request_options
)
return _response.data |
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
UpdateWorkspaceMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.members.update(
email="email",
)
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/client.py | MIT |
def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceMemberResponseModel:
"""
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.members.delete(
email="email",
)
"""
_response = self._raw_client.delete(email=email, request_options=request_options)
return _response.data |
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceMemberResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.members.delete(
email="email",
)
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/client.py | MIT |
async def update(
self,
*,
email: str,
is_locked: typing.Optional[bool] = OMIT,
workspace_role: typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> UpdateWorkspaceMemberResponseModel:
"""
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
UpdateWorkspaceMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.members.update(
email="email",
)
asyncio.run(main())
"""
_response = await self._raw_client.update(
email=email, is_locked=is_locked, workspace_role=workspace_role, request_options=request_options
)
return _response.data |
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
UpdateWorkspaceMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.members.update(
email="email",
)
asyncio.run(main())
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/client.py | MIT |
async def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> DeleteWorkspaceMemberResponseModel:
"""
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.members.delete(
email="email",
)
asyncio.run(main())
"""
_response = await self._raw_client.delete(email=email, request_options=request_options)
return _response.data |
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
DeleteWorkspaceMemberResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.members.delete(
email="email",
)
asyncio.run(main())
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/client.py | MIT |
def update(
self,
*,
email: str,
is_locked: typing.Optional[bool] = OMIT,
workspace_role: typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[UpdateWorkspaceMemberResponseModel]:
"""
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[UpdateWorkspaceMemberResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/members",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
"is_locked": is_locked,
"workspace_role": workspace_role,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
UpdateWorkspaceMemberResponseModel,
construct_type(
type_=UpdateWorkspaceMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[UpdateWorkspaceMemberResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/raw_client.py | MIT |
def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[DeleteWorkspaceMemberResponseModel]:
"""
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceMemberResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/workspace/members",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceMemberResponseModel,
construct_type(
type_=DeleteWorkspaceMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[DeleteWorkspaceMemberResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/raw_client.py | MIT |
async def update(
self,
*,
email: str,
is_locked: typing.Optional[bool] = OMIT,
workspace_role: typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[UpdateWorkspaceMemberResponseModel]:
"""
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[UpdateWorkspaceMemberResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/members",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"email": email,
"is_locked": is_locked,
"workspace_role": workspace_role,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
UpdateWorkspaceMemberResponseModel,
construct_type(
type_=UpdateWorkspaceMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Updates attributes of a workspace member. Apart from the email identifier, all parameters will remain unchanged unless specified. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
is_locked : typing.Optional[bool]
Whether to lock or unlock the user account.
workspace_role : typing.Optional[BodyUpdateMemberV1WorkspaceMembersPostWorkspaceRole]
Role dictating permissions in the workspace.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[UpdateWorkspaceMemberResponseModel]
Successful Response
| update | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/raw_client.py | MIT |
async def delete(
self, *, email: str, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[DeleteWorkspaceMemberResponseModel]:
"""
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceMemberResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/workspace/members",
base_url=self._client_wrapper.get_environment().base,
method="DELETE",
json={
"email": email,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
DeleteWorkspaceMemberResponseModel,
construct_type(
type_=DeleteWorkspaceMemberResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Deletes a workspace member. This endpoint may only be called by workspace administrators.
Parameters
----------
email : str
Email of the target user.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[DeleteWorkspaceMemberResponseModel]
Successful Response
| delete | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/members/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/members/raw_client.py | MIT |
def get(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
request_options: typing.Optional[RequestOptions] = None,
) -> ResourceMetadataResponseModel:
"""
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
ResourceMetadataResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.get(
resource_id="resource_id",
resource_type="voice",
)
"""
_response = self._raw_client.get(resource_id, resource_type=resource_type, request_options=request_options)
return _response.data |
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
ResourceMetadataResponseModel
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.get(
resource_id="resource_id",
resource_type="voice",
)
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
def share(
self,
resource_id: str,
*,
role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Optional[typing.Any]:
"""
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.share(
resource_id="resource_id",
role="admin",
resource_type="voice",
)
"""
_response = self._raw_client.share(
resource_id,
role=role,
resource_type=resource_type,
user_email=user_email,
group_id=group_id,
workspace_api_key_id=workspace_api_key_id,
request_options=request_options,
)
return _response.data |
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.share(
resource_id="resource_id",
role="admin",
resource_type="voice",
)
| share | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
def unshare(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Optional[typing.Any]:
"""
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.unshare(
resource_id="resource_id",
resource_type="voice",
)
"""
_response = self._raw_client.unshare(
resource_id,
resource_type=resource_type,
user_email=user_email,
group_id=group_id,
workspace_api_key_id=workspace_api_key_id,
request_options=request_options,
)
return _response.data |
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
client.workspace.resources.unshare(
resource_id="resource_id",
resource_type="voice",
)
| unshare | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
async def get(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
request_options: typing.Optional[RequestOptions] = None,
) -> ResourceMetadataResponseModel:
"""
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
ResourceMetadataResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.get(
resource_id="resource_id",
resource_type="voice",
)
asyncio.run(main())
"""
_response = await self._raw_client.get(
resource_id, resource_type=resource_type, request_options=request_options
)
return _response.data |
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
ResourceMetadataResponseModel
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.get(
resource_id="resource_id",
resource_type="voice",
)
asyncio.run(main())
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
async def share(
self,
resource_id: str,
*,
role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Optional[typing.Any]:
"""
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.share(
resource_id="resource_id",
role="admin",
resource_type="voice",
)
asyncio.run(main())
"""
_response = await self._raw_client.share(
resource_id,
role=role,
resource_type=resource_type,
user_email=user_email,
group_id=group_id,
workspace_api_key_id=workspace_api_key_id,
request_options=request_options,
)
return _response.data |
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.share(
resource_id="resource_id",
role="admin",
resource_type="voice",
)
asyncio.run(main())
| share | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
async def unshare(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.Optional[typing.Any]:
"""
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.unshare(
resource_id="resource_id",
resource_type="voice",
)
asyncio.run(main())
"""
_response = await self._raw_client.unshare(
resource_id,
resource_type=resource_type,
user_email=user_email,
group_id=group_id,
workspace_api_key_id=workspace_api_key_id,
request_options=request_options,
)
return _response.data |
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
import asyncio
from elevenlabs import AsyncElevenLabs
client = AsyncElevenLabs(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.workspace.resources.unshare(
resource_id="resource_id",
resource_type="voice",
)
asyncio.run(main())
| unshare | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/client.py | MIT |
def get(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[ResourceMetadataResponseModel]:
"""
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[ResourceMetadataResponseModel]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}",
base_url=self._client_wrapper.get_environment().base,
method="GET",
params={
"resource_type": resource_type,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
ResourceMetadataResponseModel,
construct_type(
type_=ResourceMetadataResponseModel, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[ResourceMetadataResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
def share(
self,
resource_id: str,
*,
role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[typing.Optional[typing.Any]]:
"""
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.Optional[typing.Any]]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}/share",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"role": role,
"resource_type": resource_type,
"user_email": user_email,
"group_id": group_id,
"workspace_api_key_id": workspace_api_key_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.Optional[typing.Any],
construct_type(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.Optional[typing.Any]]
Successful Response
| share | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
def unshare(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[typing.Optional[typing.Any]]:
"""
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.Optional[typing.Any]]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}/unshare",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"resource_type": resource_type,
"user_email": user_email,
"group_id": group_id,
"workspace_api_key_id": workspace_api_key_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.Optional[typing.Any],
construct_type(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.Optional[typing.Any]]
Successful Response
| unshare | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
async def get(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[ResourceMetadataResponseModel]:
"""
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[ResourceMetadataResponseModel]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}",
base_url=self._client_wrapper.get_environment().base,
method="GET",
params={
"resource_type": resource_type,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
ResourceMetadataResponseModel,
construct_type(
type_=ResourceMetadataResponseModel, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Gets the metadata of a resource by ID.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[ResourceMetadataResponseModel]
Successful Response
| get | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
async def share(
self,
resource_id: str,
*,
role: BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
"""
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.Optional[typing.Any]]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}/share",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"role": role,
"resource_type": resource_type,
"user_email": user_email,
"group_id": group_id,
"workspace_api_key_id": workspace_api_key_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.Optional[typing.Any],
construct_type(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Grants a role on a workspace resource to a user or a group. It overrides any existing role this user/service account/group/workspace api key has on the resource. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be shared with the service account associated with the api key. You must have admin access to the resource to share it.
Parameters
----------
resource_id : str
The ID of the target resource.
role : BodyShareWorkspaceResourceV1WorkspaceResourcesResourceIdSharePostRole
Role to update the target principal with.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.Optional[typing.Any]]
Successful Response
| share | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
async def unshare(
self,
resource_id: str,
*,
resource_type: WorkspaceResourceType,
user_email: typing.Optional[str] = OMIT,
group_id: typing.Optional[str] = OMIT,
workspace_api_key_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
"""
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.Optional[typing.Any]]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/workspace/resources/{jsonable_encoder(resource_id)}/unshare",
base_url=self._client_wrapper.get_environment().base,
method="POST",
json={
"resource_type": resource_type,
"user_email": user_email,
"group_id": group_id,
"workspace_api_key_id": workspace_api_key_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.Optional[typing.Any],
construct_type(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
HttpValidationError,
construct_type(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) |
Removes any existing role on a workspace resource from a user, service account, group or workspace api key. To target a user or service account, pass only the user email. The user must be in your workspace. To target a group, pass only the group id. To target a workspace api key, pass the api key id. The resource will be unshared from the service account associated with the api key. You must have admin access to the resource to unshare it. You cannot remove permissions from the user who created the resource.
Parameters
----------
resource_id : str
The ID of the target resource.
resource_type : WorkspaceResourceType
Resource type of the target resource.
user_email : typing.Optional[str]
The email of the user or service account.
group_id : typing.Optional[str]
The ID of the target group. To target the permissions principals have by default on this resource, use the value 'default'.
workspace_api_key_id : typing.Optional[str]
The ID of the target workspace API key. This isn't the same as the key itself that would you pass in the header for authentication. Workspace admins can find this in the workspace settings UI.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.Optional[typing.Any]]
Successful Response
| unshare | python | elevenlabs/elevenlabs-python | src/elevenlabs/workspace/resources/raw_client.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/src/elevenlabs/workspace/resources/raw_client.py | MIT |
def test_live_conversation():
"""Test a live conversation with actual audio I/O"""
api_key = os.getenv("ELEVENLABS_API_KEY")
if not api_key:
raise ValueError("ELEVENLABS_API_KEY environment variable missing.")
agent_id = os.getenv("AGENT_ID")
if not api_key or not agent_id:
raise ValueError("AGENT_ID environment variable missing.")
client = ElevenLabs(api_key=api_key)
# Create conversation handlers
def on_agent_response(text: str):
print(f"Agent: {text}")
def on_user_transcript(text: str):
print(f"You: {text}")
def on_latency(ms: int):
print(f"Latency: {ms}ms")
# Initialize client tools
client_tools = ClientTools()
def test(parameters):
print("Sync tool called with parameters:", parameters)
return "Tool called successfully"
async def test_async(parameters):
# Simulate some async work
await asyncio.sleep(10)
print("Async tool called with parameters:", parameters)
return "Tool called successfully"
client_tools.register("test", test)
client_tools.register("test_async", test_async, is_async=True)
# Initialize conversation
conversation = Conversation(
client=client,
agent_id=agent_id,
requires_auth=False,
audio_interface=DefaultAudioInterface(),
callback_agent_response=on_agent_response,
callback_user_transcript=on_user_transcript,
callback_latency_measurement=on_latency,
client_tools=client_tools,
)
# Start the conversation
conversation.start_session()
# Let it run for 100 seconds
time.sleep(100)
# End the conversation
conversation.end_session()
conversation.wait_for_session_end()
# Get the conversation ID for reference
conversation_id = conversation._conversation_id
print(f"Conversation ID: {conversation_id}") | Test a live conversation with actual audio I/O | test_live_conversation | python | elevenlabs/elevenlabs-python | tests/e2e_test_convai.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/tests/e2e_test_convai.py | MIT |
def create_mock_websocket(messages=None):
"""Helper to create a mock websocket with predefined responses"""
mock_ws = MagicMock()
if messages is None:
messages = [
{
"type": "conversation_initiation_metadata",
"conversation_initiation_metadata_event": {"conversation_id": TEST_CONVERSATION_ID},
},
{"type": "agent_response", "agent_response_event": {"agent_response": "Hello there!"}},
]
def response_generator():
for msg in messages:
yield json.dumps(msg)
while True:
yield '{"type": "keep_alive"}'
mock_ws.recv = MagicMock(side_effect=response_generator())
return mock_ws | Helper to create a mock websocket with predefined responses | create_mock_websocket | python | elevenlabs/elevenlabs-python | tests/test_convai.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/tests/test_convai.py | MIT |
def test_sts() -> None:
"""Test basic speech-to-speech generation."""
client = ElevenLabs()
audio_file = open(DEFAULT_VOICE_FILE, "rb")
try:
audio_stream = client.speech_to_speech.convert(voice_id=DEFAULT_VOICE, audio=audio_file)
audio = b"".join(chunk for chunk in audio_stream)
assert isinstance(audio, bytes), "Combined audio should be bytes"
if not IN_GITHUB:
play(audio)
finally:
audio_file.close() | Test basic speech-to-speech generation. | test_sts | python | elevenlabs/elevenlabs-python | tests/test_sts.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/tests/test_sts.py | MIT |
async def test_stt_convert():
"""Test basic speech-to-text conversion."""
client = ElevenLabs()
audio_file = open(DEFAULT_VOICE_FILE, "rb")
transcription = client.speech_to_text.convert(
file=audio_file,
model_id="scribe_v1"
)
assert isinstance(transcription.text, str)
assert len(transcription.text) > 0
assert isinstance(transcription.words, list)
assert len(transcription.words) > 0 | Test basic speech-to-text conversion. | test_stt_convert | python | elevenlabs/elevenlabs-python | tests/test_stt.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/tests/test_stt.py | MIT |
def test_tts_convert() -> None:
"""Test basic text-to-speech generation."""
client = ElevenLabs()
audio_generator = client.text_to_speech.convert(text=DEFAULT_TEXT, voice_id=DEFAULT_VOICE, model_id=DEFAULT_MODEL)
audio = b"".join(audio_generator)
assert isinstance(audio, bytes), "TTS should return bytes"
if not IN_GITHUB:
play(audio) | Test basic text-to-speech generation. | test_tts_convert | python | elevenlabs/elevenlabs-python | tests/test_tts.py | https://github.com/elevenlabs/elevenlabs-python/blob/master/tests/test_tts.py | MIT |
Subsets and Splits
Django Code with Docstrings
Filters Python code examples from Django repository that contain Django-related code, helping identify relevant code snippets for understanding Django framework usage patterns.
SQL Console for Shuu12121/python-treesitter-filtered-datasetsV2
Retrieves specific code examples from the Flask repository but doesn't provide meaningful analysis or patterns beyond basic data retrieval.
HTTPX Repo Code and Docstrings
Retrieves specific code examples from the httpx repository, which is useful for understanding how particular libraries are used but doesn't provide broader analytical insights about the dataset.
Requests Repo Docstrings & Code
Retrieves code examples with their docstrings and file paths from the requests repository, providing basic filtering but limited analytical value beyond finding specific code samples.
Quart Repo Docstrings & Code
Retrieves code examples with their docstrings from the Quart repository, providing basic code samples but offering limited analytical value for understanding broader patterns or relationships in the dataset.