diff --git a/LICENSE b/LICENSE index 809c01bc..9c299302 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Elevenlabs. +Copyright (c) 2026 Elevenlabs. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pyproject.toml b/pyproject.toml index d80fe7ec..6a200006 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "elevenlabs" -version = "v2.28.0" +version = "v2.29.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index b8782445..95e2a0e7 100644 --- a/reference.md +++ b/reference.md @@ -4490,7 +4490,7 @@ typing.Optional[core.File]` — See core.File for more documentation
-**mode:** `typing.Optional[DubbingCreateRequestMode]` — The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. +**mode:** `typing.Optional[DubbingCreateRequestMode]` — The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged.
@@ -6295,6 +6295,22 @@ typing.Optional[core.File]` — See core.File for more documentation
+**entity_detection:** `typing.Optional[SpeechToTextConvertRequestEntityDetection]` — Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. + +
+
+ +
+
+ +**keyterms:** `typing.Optional[typing.List[str]]` — A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 100. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"] + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9939,7 +9955,6 @@ client.conversational_ai.knowledge_base.list( folders_first=True, sort_direction="asc", sort_by="name", - use_typesense=True, cursor="cursor", ) @@ -10033,14 +10048,6 @@ client.conversational_ai.knowledge_base.list(
-**use_typesense:** `typing.Optional[bool]` — If set to true, the endpoint will use typesense DB to search for the documents). - -
-
- -
-
- **cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
@@ -17280,7 +17287,7 @@ typing.Optional[core.File]` — See core.File for more documentation An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. - + Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] @@ -18067,7 +18074,7 @@ typing.Optional[core.File]` — See core.File for more documentation An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. - + Example: [{"name": "Chapter A", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "A", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "B", "type": "tts_node"}]}, {"sub_type": "h1", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "C", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "D", "type": "tts_node"}]}]}, {"name": "Chapter B", "blocks": [{"sub_type": "p", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "E", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "F", "type": "tts_node"}]}, {"sub_type": "h2", "nodes": [{"voice_id": "6lCwbsX1yVjD49QmpkT0", "text": "G", "type": "tts_node"}, {"voice_id": "6lCwbsX1yVjD49QmpkT1", "text": "H", "type": "tts_node"}]}]}] @@ -21676,6 +21683,94 @@ client.workspace.resources.unshare(
+ +
+ + +
client.workspace.resources.copy_to_workspace(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Copies a workspace resource to another workspace. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.workspace.resources.copy_to_workspace( + resource_id="resource_id", + resource_type="voice", + target_user_id="target_user_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**resource_id:** `str` — The ID of the target resource. + +
+
+ +
+
+ +**resource_type:** `WorkspaceResourceType` — Resource type of the target resource. + +
+
+ +
+
+ +**target_user_id:** `str` — The ID of the target user. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py index 7a4e2436..23a0d628 100644 --- a/src/elevenlabs/__init__.py +++ b/src/elevenlabs/__init__.py @@ -721,6 +721,7 @@ DependentUnknownAgentIdentifier, DependentUnknownToolIdentifier, DetailedMusicResponse, + DetectedEntity, DialogueInput, DialogueInputResponseModel, DiscountResponseModel, @@ -878,6 +879,7 @@ KnowledgeBaseDocumentMetadataResponseModel, KnowledgeBaseDocumentType, KnowledgeBaseFolderPathSegmentResponseModel, + KnowledgeBaseFolderPathSegmentSummaryResponseModel, KnowledgeBaseLocator, KnowledgeBaseSortBy, KnowledgeBaseSummaryBatchSuccessfulResponseModel, @@ -1534,6 +1536,7 @@ SpeechToSpeechStreamRequestOutputFormat, ) from .speech_to_text import ( + SpeechToTextConvertRequestEntityDetection, SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestTimestampsGranularity, SpeechToTextConvertRequestWebhookMetadata, @@ -2322,6 +2325,7 @@ "DependentUnknownAgentIdentifier": ".types", "DependentUnknownToolIdentifier": ".types", "DetailedMusicResponse": ".types", + "DetectedEntity": ".types", "DialogueInput": ".types", "DialogueInputResponseModel": ".types", "DiscountResponseModel": ".types", @@ -2488,6 +2492,7 @@ "KnowledgeBaseDocumentMetadataResponseModel": ".types", "KnowledgeBaseDocumentType": ".types", "KnowledgeBaseFolderPathSegmentResponseModel": ".types", + "KnowledgeBaseFolderPathSegmentSummaryResponseModel": ".types", "KnowledgeBaseLocator": ".types", "KnowledgeBaseSortBy": ".types", "KnowledgeBaseSummaryBatchSuccessfulResponseModel": ".types", @@ -2778,6 +2783,7 @@ "SpeechToSpeechStreamRequestOutputFormat": ".speech_to_speech", "SpeechToTextCharacterResponseModel": ".types", "SpeechToTextChunkResponseModel": ".types", + "SpeechToTextConvertRequestEntityDetection": ".speech_to_text", "SpeechToTextConvertRequestFileFormat": ".speech_to_text", "SpeechToTextConvertRequestTimestampsGranularity": ".speech_to_text", "SpeechToTextConvertRequestWebhookMetadata": ".speech_to_text", @@ -3897,6 +3903,7 @@ def __dir__(): "DependentUnknownAgentIdentifier", "DependentUnknownToolIdentifier", "DetailedMusicResponse", + "DetectedEntity", "DialogueInput", "DialogueInputResponseModel", "DiscountResponseModel", @@ -4063,6 +4070,7 @@ def __dir__(): "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", "KnowledgeBaseFolderPathSegmentResponseModel", + "KnowledgeBaseFolderPathSegmentSummaryResponseModel", "KnowledgeBaseLocator", "KnowledgeBaseSortBy", "KnowledgeBaseSummaryBatchSuccessfulResponseModel", @@ -4353,6 +4361,7 @@ def __dir__(): "SpeechToSpeechStreamRequestOutputFormat", "SpeechToTextCharacterResponseModel", "SpeechToTextChunkResponseModel", + "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", diff --git a/src/elevenlabs/conversational_ai/knowledge_base/client.py b/src/elevenlabs/conversational_ai/knowledge_base/client.py index e6217789..cdf29204 100644 --- a/src/elevenlabs/conversational_ai/knowledge_base/client.py +++ b/src/elevenlabs/conversational_ai/knowledge_base/client.py @@ -55,7 +55,6 @@ def list( folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, - use_typesense: typing.Optional[bool] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: @@ -91,9 +90,6 @@ def list( sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by - use_typesense : typing.Optional[bool] - If set to true, the endpoint will use typesense DB to search for the documents). - cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. @@ -121,7 +117,6 @@ def list( folders_first=True, sort_direction="asc", sort_by="name", - use_typesense=True, cursor="cursor", ) """ @@ -135,7 +130,6 @@ def list( folders_first=folders_first, sort_direction=sort_direction, sort_by=sort_by, - use_typesense=use_typesense, cursor=cursor, request_options=request_options, ) @@ -232,7 +226,6 @@ async def list( folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, - use_typesense: typing.Optional[bool] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> GetKnowledgeBaseListResponseModel: @@ -268,9 +261,6 @@ async def list( sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by - use_typesense : typing.Optional[bool] - If set to true, the endpoint will use typesense DB to search for the documents). - cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. @@ -303,7 +293,6 @@ async def main() -> None: folders_first=True, sort_direction="asc", sort_by="name", - use_typesense=True, cursor="cursor", ) @@ -320,7 +309,6 @@ async def main() -> None: folders_first=folders_first, sort_direction=sort_direction, sort_by=sort_by, - use_typesense=use_typesense, cursor=cursor, request_options=request_options, ) diff --git a/src/elevenlabs/conversational_ai/knowledge_base/raw_client.py b/src/elevenlabs/conversational_ai/knowledge_base/raw_client.py index bc9c0a8c..0270540d 100644 --- a/src/elevenlabs/conversational_ai/knowledge_base/raw_client.py +++ b/src/elevenlabs/conversational_ai/knowledge_base/raw_client.py @@ -42,7 +42,6 @@ def list( folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, - use_typesense: typing.Optional[bool] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetKnowledgeBaseListResponseModel]: @@ -78,9 +77,6 @@ def list( sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by - use_typesense : typing.Optional[bool] - If set to true, the endpoint will use typesense DB to search for the documents). - cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. @@ -105,7 +101,6 @@ def list( "folders_first": folders_first, "sort_direction": sort_direction, "sort_by": sort_by, - "use_typesense": use_typesense, "cursor": cursor, }, request_options=request_options, @@ -217,7 +212,6 @@ async def list( folders_first: typing.Optional[bool] = None, sort_direction: typing.Optional[SortDirection] = None, sort_by: typing.Optional[KnowledgeBaseSortBy] = None, - use_typesense: typing.Optional[bool] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetKnowledgeBaseListResponseModel]: @@ -253,9 +247,6 @@ async def list( sort_by : typing.Optional[KnowledgeBaseSortBy] The field to sort the results by - use_typesense : typing.Optional[bool] - If set to true, the endpoint will use typesense DB to search for the documents). - cursor : typing.Optional[str] Used for fetching next page. Cursor is returned in the response. @@ -280,7 +271,6 @@ async def list( "folders_first": folders_first, "sort_direction": sort_direction, "sort_by": sort_by, - "use_typesense": use_typesense, "cursor": cursor, }, request_options=request_options, diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index c0f2a113..5f28be55 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "elevenlabs/v2.28.0", + "User-Agent": "elevenlabs/v2.29.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "v2.28.0", + "X-Fern-SDK-Version": "v2.29.0", **(self.get_custom_headers() or {}), } if self._api_key is not None: diff --git a/src/elevenlabs/dubbing/client.py b/src/elevenlabs/dubbing/client.py index 32dfac00..2dbf3f4e 100644 --- a/src/elevenlabs/dubbing/client.py +++ b/src/elevenlabs/dubbing/client.py @@ -197,7 +197,7 @@ def create( Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubbingCreateRequestMode] - The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. + The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. @@ -515,7 +515,7 @@ async def create( Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubbingCreateRequestMode] - The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. + The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. diff --git a/src/elevenlabs/dubbing/raw_client.py b/src/elevenlabs/dubbing/raw_client.py index 4d3887c4..95572caf 100644 --- a/src/elevenlabs/dubbing/raw_client.py +++ b/src/elevenlabs/dubbing/raw_client.py @@ -195,7 +195,7 @@ def create( Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubbingCreateRequestMode] - The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. + The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. @@ -536,7 +536,7 @@ async def create( Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices. mode : typing.Optional[DubbingCreateRequestMode] - The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. + The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged. csv_fps : typing.Optional[float] Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes. diff --git a/src/elevenlabs/speech_to_text/__init__.py b/src/elevenlabs/speech_to_text/__init__.py index 6c72544c..a21f0139 100644 --- a/src/elevenlabs/speech_to_text/__init__.py +++ b/src/elevenlabs/speech_to_text/__init__.py @@ -7,6 +7,7 @@ if typing.TYPE_CHECKING: from .types import ( + SpeechToTextConvertRequestEntityDetection, SpeechToTextConvertRequestFileFormat, SpeechToTextConvertRequestTimestampsGranularity, SpeechToTextConvertRequestWebhookMetadata, @@ -15,6 +16,7 @@ from . import transcripts from .transcripts import TranscriptsGetResponse _dynamic_imports: typing.Dict[str, str] = { + "SpeechToTextConvertRequestEntityDetection": ".types", "SpeechToTextConvertRequestFileFormat": ".types", "SpeechToTextConvertRequestTimestampsGranularity": ".types", "SpeechToTextConvertRequestWebhookMetadata": ".types", @@ -46,6 +48,7 @@ def __dir__(): __all__ = [ + "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", diff --git a/src/elevenlabs/speech_to_text/client.py b/src/elevenlabs/speech_to_text/client.py index 7f06d38e..966e1868 100644 --- a/src/elevenlabs/speech_to_text/client.py +++ b/src/elevenlabs/speech_to_text/client.py @@ -9,6 +9,7 @@ from ..core.request_options import RequestOptions from ..types.additional_formats import AdditionalFormats from .raw_client import AsyncRawSpeechToTextClient, RawSpeechToTextClient +from .types.speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .types.speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .types.speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .types.speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata @@ -58,6 +59,8 @@ def convert( seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, + entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, + keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextConvertResponse: """ @@ -119,6 +122,12 @@ def convert( webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. + entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] + Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. + + keyterms : typing.Optional[typing.List[str]] + A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 100. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -158,6 +167,8 @@ def convert( seed=seed, use_multi_channel=use_multi_channel, webhook_metadata=webhook_metadata, + entity_detection=entity_detection, + keyterms=keyterms, request_options=request_options, ) return _response.data @@ -209,6 +220,8 @@ async def convert( seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, + entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, + keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> SpeechToTextConvertResponse: """ @@ -270,6 +283,12 @@ async def convert( webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. + entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] + Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. + + keyterms : typing.Optional[typing.List[str]] + A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 100. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -317,6 +336,8 @@ async def main() -> None: seed=seed, use_multi_channel=use_multi_channel, webhook_metadata=webhook_metadata, + entity_detection=entity_detection, + keyterms=keyterms, request_options=request_options, ) return _response.data diff --git a/src/elevenlabs/speech_to_text/raw_client.py b/src/elevenlabs/speech_to_text/raw_client.py index 99dc7b89..7675e5ad 100644 --- a/src/elevenlabs/speech_to_text/raw_client.py +++ b/src/elevenlabs/speech_to_text/raw_client.py @@ -14,6 +14,7 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..types.additional_formats import AdditionalFormats from ..types.http_validation_error import HttpValidationError +from .types.speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .types.speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .types.speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .types.speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata @@ -48,6 +49,8 @@ def convert( seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, + entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, + keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SpeechToTextConvertResponse]: """ @@ -109,6 +112,12 @@ def convert( webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. + entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] + Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. + + keyterms : typing.Optional[typing.List[str]] + A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 100. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -139,6 +148,8 @@ def convert( "seed": seed, "use_multi_channel": use_multi_channel, "webhook_metadata": webhook_metadata, + "entity_detection": entity_detection, + "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), @@ -204,6 +215,8 @@ async def convert( seed: typing.Optional[int] = OMIT, use_multi_channel: typing.Optional[bool] = OMIT, webhook_metadata: typing.Optional[SpeechToTextConvertRequestWebhookMetadata] = OMIT, + entity_detection: typing.Optional[SpeechToTextConvertRequestEntityDetection] = OMIT, + keyterms: typing.Optional[typing.List[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SpeechToTextConvertResponse]: """ @@ -265,6 +278,12 @@ async def convert( webhook_metadata : typing.Optional[SpeechToTextConvertRequestWebhookMetadata] Optional metadata to be included in the webhook response. This should be a JSON string representing an object with a maximum depth of 2 levels and maximum size of 16KB. Useful for tracking internal IDs, job references, or other contextual information. + entity_detection : typing.Optional[SpeechToTextConvertRequestEntityDetection] + Detect entities in the transcript. Can be 'all' to detect all entities, a single entity type or category string, or a list of entity types/categories. Categories include 'pii', 'phi', 'pci', 'other', 'offensive_language'. When enabled, detected entities will be returned in the 'entities' field with their text, type, and character positions. + + keyterms : typing.Optional[typing.List[str]] + A list of keyterms to bias the transcription towards. The keyterms are words or phrases you want the model to recognise more accurately. The number of keyterms cannot exceed 100. The length of each keyterm must be less than 50 characters. Keyterms can contain at most 5 words (after normalisation). For example ["hello", "world", "technical term"] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -295,6 +314,8 @@ async def convert( "seed": seed, "use_multi_channel": use_multi_channel, "webhook_metadata": webhook_metadata, + "entity_detection": entity_detection, + "keyterms": keyterms, }, files={ **({"file": file} if file is not None else {}), diff --git a/src/elevenlabs/speech_to_text/types/__init__.py b/src/elevenlabs/speech_to_text/types/__init__.py index 02e03c47..57a3fce9 100644 --- a/src/elevenlabs/speech_to_text/types/__init__.py +++ b/src/elevenlabs/speech_to_text/types/__init__.py @@ -6,11 +6,13 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .speech_to_text_convert_request_entity_detection import SpeechToTextConvertRequestEntityDetection from .speech_to_text_convert_request_file_format import SpeechToTextConvertRequestFileFormat from .speech_to_text_convert_request_timestamps_granularity import SpeechToTextConvertRequestTimestampsGranularity from .speech_to_text_convert_request_webhook_metadata import SpeechToTextConvertRequestWebhookMetadata from .speech_to_text_convert_response import SpeechToTextConvertResponse _dynamic_imports: typing.Dict[str, str] = { + "SpeechToTextConvertRequestEntityDetection": ".speech_to_text_convert_request_entity_detection", "SpeechToTextConvertRequestFileFormat": ".speech_to_text_convert_request_file_format", "SpeechToTextConvertRequestTimestampsGranularity": ".speech_to_text_convert_request_timestamps_granularity", "SpeechToTextConvertRequestWebhookMetadata": ".speech_to_text_convert_request_webhook_metadata", @@ -40,6 +42,7 @@ def __dir__(): __all__ = [ + "SpeechToTextConvertRequestEntityDetection", "SpeechToTextConvertRequestFileFormat", "SpeechToTextConvertRequestTimestampsGranularity", "SpeechToTextConvertRequestWebhookMetadata", diff --git a/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_entity_detection.py b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_entity_detection.py new file mode 100644 index 00000000..8b406722 --- /dev/null +++ b/src/elevenlabs/speech_to_text/types/speech_to_text_convert_request_entity_detection.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SpeechToTextConvertRequestEntityDetection = typing.Union[str, typing.List[str]] diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py index 71143c83..341f6cd5 100644 --- a/src/elevenlabs/types/__init__.py +++ b/src/elevenlabs/types/__init__.py @@ -857,6 +857,7 @@ from .dependent_unknown_agent_identifier import DependentUnknownAgentIdentifier from .dependent_unknown_tool_identifier import DependentUnknownToolIdentifier from .detailed_music_response import DetailedMusicResponse + from .detected_entity import DetectedEntity from .dialogue_input import DialogueInput from .dialogue_input_response_model import DialogueInputResponseModel from .discount_response_model import DiscountResponseModel @@ -1046,6 +1047,9 @@ from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_document_type import KnowledgeBaseDocumentType from .knowledge_base_folder_path_segment_response_model import KnowledgeBaseFolderPathSegmentResponseModel + from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, + ) from .knowledge_base_locator import KnowledgeBaseLocator from .knowledge_base_sort_by import KnowledgeBaseSortBy from .knowledge_base_summary_batch_successful_response_model import KnowledgeBaseSummaryBatchSuccessfulResponseModel @@ -2412,6 +2416,7 @@ "DependentUnknownAgentIdentifier": ".dependent_unknown_agent_identifier", "DependentUnknownToolIdentifier": ".dependent_unknown_tool_identifier", "DetailedMusicResponse": ".detailed_music_response", + "DetectedEntity": ".detected_entity", "DialogueInput": ".dialogue_input", "DialogueInputResponseModel": ".dialogue_input_response_model", "DiscountResponseModel": ".discount_response_model", @@ -2569,6 +2574,7 @@ "KnowledgeBaseDocumentMetadataResponseModel": ".knowledge_base_document_metadata_response_model", "KnowledgeBaseDocumentType": ".knowledge_base_document_type", "KnowledgeBaseFolderPathSegmentResponseModel": ".knowledge_base_folder_path_segment_response_model", + "KnowledgeBaseFolderPathSegmentSummaryResponseModel": ".knowledge_base_folder_path_segment_summary_response_model", "KnowledgeBaseLocator": ".knowledge_base_locator", "KnowledgeBaseSortBy": ".knowledge_base_sort_by", "KnowledgeBaseSummaryBatchSuccessfulResponseModel": ".knowledge_base_summary_batch_successful_response_model", @@ -3883,6 +3889,7 @@ def __dir__(): "DependentUnknownAgentIdentifier", "DependentUnknownToolIdentifier", "DetailedMusicResponse", + "DetectedEntity", "DialogueInput", "DialogueInputResponseModel", "DiscountResponseModel", @@ -4040,6 +4047,7 @@ def __dir__(): "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", "KnowledgeBaseFolderPathSegmentResponseModel", + "KnowledgeBaseFolderPathSegmentSummaryResponseModel", "KnowledgeBaseLocator", "KnowledgeBaseSortBy", "KnowledgeBaseSummaryBatchSuccessfulResponseModel", diff --git a/src/elevenlabs/types/detected_entity.py b/src/elevenlabs/types/detected_entity.py new file mode 100644 index 00000000..7e182427 --- /dev/null +++ b/src/elevenlabs/types/detected_entity.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class DetectedEntity(UncheckedBaseModel): + text: str = pydantic.Field() + """ + The text that was identified as an entity. + """ + + entity_type: str = pydantic.Field() + """ + The type of entity detected (e.g., 'credit_card', 'email_address', 'person_name'). + """ + + start_char: int = pydantic.Field() + """ + Start character position in the transcript text. + """ + + end_char: int = pydantic.Field() + """ + End character position in the transcript text. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/get_knowledge_base_list_response_model_documents_item.py b/src/elevenlabs/types/get_knowledge_base_list_response_model_documents_item.py index 1fa06911..4362dbe4 100644 --- a/src/elevenlabs/types/get_knowledge_base_list_response_model_documents_item.py +++ b/src/elevenlabs/types/get_knowledge_base_list_response_model_documents_item.py @@ -22,6 +22,9 @@ GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -33,6 +36,7 @@ class GetKnowledgeBaseListResponseModelDocumentsItem_File(UncheckedBaseModel): supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] if IS_PYDANTIC_V2: @@ -53,6 +57,7 @@ class GetKnowledgeBaseListResponseModelDocumentsItem_Folder(UncheckedBaseModel): supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] children_count: int @@ -74,6 +79,7 @@ class GetKnowledgeBaseListResponseModelDocumentsItem_Text(UncheckedBaseModel): supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] if IS_PYDANTIC_V2: @@ -94,6 +100,7 @@ class GetKnowledgeBaseListResponseModelDocumentsItem_Url(UncheckedBaseModel): supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] url: str diff --git a/src/elevenlabs/types/get_knowledge_base_summary_file_response_model.py b/src/elevenlabs/types/get_knowledge_base_summary_file_response_model.py index f2c6ce26..23f0e93e 100644 --- a/src/elevenlabs/types/get_knowledge_base_summary_file_response_model.py +++ b/src/elevenlabs/types/get_knowledge_base_summary_file_response_model.py @@ -10,6 +10,9 @@ GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -24,6 +27,13 @@ class GetKnowledgeBaseSummaryFileResponseModel(UncheckedBaseModel): The ID of the parent folder, or null if the document is at the root level. """ + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( + default=None + ) + """ + The folder path segments leading to this entity, from root to parent folder. + """ + dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. diff --git a/src/elevenlabs/types/get_knowledge_base_summary_folder_response_model.py b/src/elevenlabs/types/get_knowledge_base_summary_folder_response_model.py index ec6d9518..cc5ab9ec 100644 --- a/src/elevenlabs/types/get_knowledge_base_summary_folder_response_model.py +++ b/src/elevenlabs/types/get_knowledge_base_summary_folder_response_model.py @@ -10,6 +10,9 @@ GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -24,6 +27,13 @@ class GetKnowledgeBaseSummaryFolderResponseModel(UncheckedBaseModel): The ID of the parent folder, or null if the document is at the root level. """ + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( + default=None + ) + """ + The folder path segments leading to this entity, from root to parent folder. + """ + dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. diff --git a/src/elevenlabs/types/get_knowledge_base_summary_text_response_model.py b/src/elevenlabs/types/get_knowledge_base_summary_text_response_model.py index 159ae1ad..8f0376f0 100644 --- a/src/elevenlabs/types/get_knowledge_base_summary_text_response_model.py +++ b/src/elevenlabs/types/get_knowledge_base_summary_text_response_model.py @@ -10,6 +10,9 @@ GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -24,6 +27,13 @@ class GetKnowledgeBaseSummaryTextResponseModel(UncheckedBaseModel): The ID of the parent folder, or null if the document is at the root level. """ + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( + default=None + ) + """ + The folder path segments leading to this entity, from root to parent folder. + """ + dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. diff --git a/src/elevenlabs/types/get_knowledge_base_summary_url_response_model.py b/src/elevenlabs/types/get_knowledge_base_summary_url_response_model.py index 90abf204..3e0d99fd 100644 --- a/src/elevenlabs/types/get_knowledge_base_summary_url_response_model.py +++ b/src/elevenlabs/types/get_knowledge_base_summary_url_response_model.py @@ -10,6 +10,9 @@ GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -24,6 +27,13 @@ class GetKnowledgeBaseSummaryUrlResponseModel(UncheckedBaseModel): The ID of the parent folder, or null if the document is at the root level. """ + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = pydantic.Field( + default=None + ) + """ + The folder path segments leading to this entity, from root to parent folder. + """ + dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] = pydantic.Field() """ This field is deprecated and will be removed in the future, use the separate endpoint to get dependent agents instead. diff --git a/src/elevenlabs/types/knowledge_base_folder_path_segment_summary_response_model.py b/src/elevenlabs/types/knowledge_base_folder_path_segment_summary_response_model.py new file mode 100644 index 00000000..ae3406e1 --- /dev/null +++ b/src/elevenlabs/types/knowledge_base_folder_path_segment_summary_response_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class KnowledgeBaseFolderPathSegmentSummaryResponseModel(UncheckedBaseModel): + id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/knowledge_base_summary_batch_successful_response_model_data.py b/src/elevenlabs/types/knowledge_base_summary_batch_successful_response_model_data.py index d5a035ab..d4c04861 100644 --- a/src/elevenlabs/types/knowledge_base_summary_batch_successful_response_model_data.py +++ b/src/elevenlabs/types/knowledge_base_summary_batch_successful_response_model_data.py @@ -22,6 +22,9 @@ GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem, ) from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel +from .knowledge_base_folder_path_segment_summary_response_model import ( + KnowledgeBaseFolderPathSegmentSummaryResponseModel, +) from .resource_access_info import ResourceAccessInfo @@ -33,6 +36,7 @@ class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_File(UncheckedBaseMod supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFileResponseModelDependentAgentsItem] if IS_PYDANTIC_V2: @@ -53,6 +57,7 @@ class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Folder(UncheckedBaseM supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryFolderResponseModelDependentAgentsItem] children_count: int @@ -74,6 +79,7 @@ class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Text(UncheckedBaseMod supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryTextResponseModelDependentAgentsItem] if IS_PYDANTIC_V2: @@ -94,6 +100,7 @@ class KnowledgeBaseSummaryBatchSuccessfulResponseModelData_Url(UncheckedBaseMode supported_usages: typing.List[DocumentUsageModeEnum] access_info: ResourceAccessInfo folder_parent_id: typing.Optional[str] = None + folder_path: typing.Optional[typing.List[KnowledgeBaseFolderPathSegmentSummaryResponseModel]] = None dependent_agents: typing.List[GetKnowledgeBaseSummaryUrlResponseModelDependentAgentsItem] url: str diff --git a/src/elevenlabs/types/prompt_agent_api_model_input.py b/src/elevenlabs/types/prompt_agent_api_model_input.py index cefe8237..e0423c38 100644 --- a/src/elevenlabs/types/prompt_agent_api_model_input.py +++ b/src/elevenlabs/types/prompt_agent_api_model_input.py @@ -98,6 +98,11 @@ class PromptAgentApiModelInput(UncheckedBaseModel): Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ + cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) + """ + Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. + """ + tools: typing.Optional[typing.List[PromptAgentApiModelInputToolsItem]] = pydantic.Field(default=None) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead diff --git a/src/elevenlabs/types/prompt_agent_api_model_output.py b/src/elevenlabs/types/prompt_agent_api_model_output.py index ca11d74c..123327cb 100644 --- a/src/elevenlabs/types/prompt_agent_api_model_output.py +++ b/src/elevenlabs/types/prompt_agent_api_model_output.py @@ -98,6 +98,11 @@ class PromptAgentApiModelOutput(UncheckedBaseModel): Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ + cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) + """ + Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. + """ + tools: typing.Optional[typing.List[PromptAgentApiModelOutputToolsItem]] = pydantic.Field(default=None) """ A list of tools that the agent can use over the course of the conversation, use tool_ids instead diff --git a/src/elevenlabs/types/prompt_agent_api_model_workflow_override_input.py b/src/elevenlabs/types/prompt_agent_api_model_workflow_override_input.py index 9678493e..f47278a8 100644 --- a/src/elevenlabs/types/prompt_agent_api_model_workflow_override_input.py +++ b/src/elevenlabs/types/prompt_agent_api_model_workflow_override_input.py @@ -102,6 +102,11 @@ class PromptAgentApiModelWorkflowOverrideInput(UncheckedBaseModel): Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ + cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) + """ + Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. + """ + tools: typing.Optional[typing.List[PromptAgentApiModelWorkflowOverrideInputToolsItem]] = pydantic.Field( default=None ) diff --git a/src/elevenlabs/types/prompt_agent_api_model_workflow_override_output.py b/src/elevenlabs/types/prompt_agent_api_model_workflow_override_output.py index 65cd1e52..74086ff2 100644 --- a/src/elevenlabs/types/prompt_agent_api_model_workflow_override_output.py +++ b/src/elevenlabs/types/prompt_agent_api_model_workflow_override_output.py @@ -104,6 +104,11 @@ class PromptAgentApiModelWorkflowOverrideOutput(UncheckedBaseModel): Configuration for backup LLM cascading. Can be disabled, use system defaults, or specify custom order. """ + cascade_timeout_seconds: typing.Optional[float] = pydantic.Field(default=None) + """ + Time in seconds before cascading to backup LLM. Must be between 2 and 15 seconds. + """ + tools: typing.Optional[typing.List[PromptAgentApiModelWorkflowOverrideOutputToolsItem]] = pydantic.Field( default=None ) diff --git a/src/elevenlabs/types/soft_timeout_config.py b/src/elevenlabs/types/soft_timeout_config.py index 9bdbff7f..0a14756e 100644 --- a/src/elevenlabs/types/soft_timeout_config.py +++ b/src/elevenlabs/types/soft_timeout_config.py @@ -22,6 +22,11 @@ class SoftTimeoutConfig(UncheckedBaseModel): Message to show when soft timeout is reached while waiting for LLM response """ + use_llm_generated_message: typing.Optional[bool] = pydantic.Field(default=None) + """ + If enabled, the soft timeout message will be generated dynamically instead of using the static message. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/soft_timeout_config_workflow_override.py b/src/elevenlabs/types/soft_timeout_config_workflow_override.py index 1c479b6a..2574ad2c 100644 --- a/src/elevenlabs/types/soft_timeout_config_workflow_override.py +++ b/src/elevenlabs/types/soft_timeout_config_workflow_override.py @@ -18,6 +18,11 @@ class SoftTimeoutConfigWorkflowOverride(UncheckedBaseModel): Message to show when soft timeout is reached while waiting for LLM response """ + use_llm_generated_message: typing.Optional[bool] = pydantic.Field(default=None) + """ + If enabled, the soft timeout message will be generated dynamically instead of using the static message. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/speech_to_text_chunk_response_model.py b/src/elevenlabs/types/speech_to_text_chunk_response_model.py index 6b99c271..99612c7c 100644 --- a/src/elevenlabs/types/speech_to_text_chunk_response_model.py +++ b/src/elevenlabs/types/speech_to_text_chunk_response_model.py @@ -6,6 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .additional_format_response_model import AdditionalFormatResponseModel +from .detected_entity import DetectedEntity from .speech_to_text_word_response_model import SpeechToTextWordResponseModel @@ -51,6 +52,11 @@ class SpeechToTextChunkResponseModel(UncheckedBaseModel): The transcription ID of the response. """ + entities: typing.Optional[typing.List[DetectedEntity]] = pydantic.Field(default=None) + """ + List of detected entities with their text, type, and character positions in the transcript. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/workspace/resources/client.py b/src/elevenlabs/workspace/resources/client.py index 052dc433..9f859fff 100644 --- a/src/elevenlabs/workspace/resources/client.py +++ b/src/elevenlabs/workspace/resources/client.py @@ -197,6 +197,54 @@ def unshare( ) return _response.data + def copy_to_workspace( + self, + resource_id: str, + *, + resource_type: WorkspaceResourceType, + target_user_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Any: + """ + Copies a workspace resource to another workspace. + + Parameters + ---------- + resource_id : str + The ID of the target resource. + + resource_type : WorkspaceResourceType + Resource type of the target resource. + + target_user_id : str + The ID of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Any + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.workspace.resources.copy_to_workspace( + resource_id="resource_id", + resource_type="voice", + target_user_id="target_user_id", + ) + """ + _response = self._raw_client.copy_to_workspace( + resource_id, resource_type=resource_type, target_user_id=target_user_id, request_options=request_options + ) + return _response.data + class AsyncResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -405,3 +453,59 @@ async def main() -> None: request_options=request_options, ) return _response.data + + async def copy_to_workspace( + self, + resource_id: str, + *, + resource_type: WorkspaceResourceType, + target_user_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Any: + """ + Copies a workspace resource to another workspace. + + Parameters + ---------- + resource_id : str + The ID of the target resource. + + resource_type : WorkspaceResourceType + Resource type of the target resource. + + target_user_id : str + The ID of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + 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.copy_to_workspace( + resource_id="resource_id", + resource_type="voice", + target_user_id="target_user_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.copy_to_workspace( + resource_id, resource_type=resource_type, target_user_id=target_user_id, request_options=request_options + ) + return _response.data diff --git a/src/elevenlabs/workspace/resources/raw_client.py b/src/elevenlabs/workspace/resources/raw_client.py index a58334e8..0720a6af 100644 --- a/src/elevenlabs/workspace/resources/raw_client.py +++ b/src/elevenlabs/workspace/resources/raw_client.py @@ -252,6 +252,77 @@ def unshare( 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) + def copy_to_workspace( + self, + resource_id: str, + *, + resource_type: WorkspaceResourceType, + target_user_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[typing.Any]: + """ + Copies a workspace resource to another workspace. + + Parameters + ---------- + resource_id : str + The ID of the target resource. + + resource_type : WorkspaceResourceType + Resource type of the target resource. + + target_user_id : str + The ID of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.Any] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/workspace/resources/{jsonable_encoder(resource_id)}/copy-to-workspace", + method="POST", + json={ + "resource_type": resource_type, + "target_user_id": target_user_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if _response is None or not _response.text.strip(): + return HttpResponse(response=_response, data=None) + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.Any, + construct_type( + type_=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) + class AsyncRawResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -483,3 +554,74 @@ async def unshare( 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) + + async def copy_to_workspace( + self, + resource_id: str, + *, + resource_type: WorkspaceResourceType, + target_user_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[typing.Any]: + """ + Copies a workspace resource to another workspace. + + Parameters + ---------- + resource_id : str + The ID of the target resource. + + resource_type : WorkspaceResourceType + Resource type of the target resource. + + target_user_id : str + The ID of the target user. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.Any] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/workspace/resources/{jsonable_encoder(resource_id)}/copy-to-workspace", + method="POST", + json={ + "resource_type": resource_type, + "target_user_id": target_user_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if _response is None or not _response.text.strip(): + return AsyncHttpResponse(response=_response, data=None) + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.Any, + construct_type( + type_=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)