diff --git a/deepgram/clients/auth/v1/async_client.py b/deepgram/clients/auth/v1/async_client.py index 5a45ab2d..18f1a4e4 100644 --- a/deepgram/clients/auth/v1/async_client.py +++ b/deepgram/clients/auth/v1/async_client.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: MIT import logging +from typing import Optional from ....utils import verboselogs from ....options import DeepgramClientOptions @@ -28,23 +29,48 @@ def __init__(self, config: DeepgramClientOptions): self._endpoint = "v1/auth/grant" super().__init__(config) - async def grant_token(self): + async def grant_token(self, ttl_seconds: Optional[int] = None): """ - Generates a temporary JWT with a 30 second TTL. + Generates a temporary JWT with a configurable TTL. + + Args: + ttl_seconds (int, optional): Time to live in seconds for the token. + Must be between 1 and 3600 seconds. Defaults to 30 seconds. Returns: GrantTokenResponse: An object containing the authentication token and its expiration time. Raises: DeepgramTypeError: Raised for known API errors. + ValueError: Raised when ttl_seconds is not within valid range. """ self._logger.debug("AuthRestClient.grant_token ENTER") + # Validate ttl_seconds if provided + if ttl_seconds is not None: + if not isinstance(ttl_seconds, int) or isinstance(ttl_seconds, bool) or ttl_seconds < 1 or ttl_seconds > 3600: + raise ValueError("ttl_seconds must be an integer between 1 and 3600") + url = f"{self._config.url}/{self._endpoint}" self._logger.info("url: %s", url) - result = await self.post( - url, headers={"Authorization": f"Token {self._config.api_key}"} - ) + + # Prepare request body + request_body = {} + if ttl_seconds is not None: + request_body["ttl_seconds"] = ttl_seconds + + # Make the request + if request_body: + result = await self.post( + url, + headers={"Authorization": f"Token {self._config.api_key}"}, + json=request_body + ) + else: + result = await self.post( + url, headers={"Authorization": f"Token {self._config.api_key}"} + ) + self._logger.info("json: %s", result) res = GrantTokenResponse.from_json(result) self._logger.verbose("result: %s", res) diff --git a/deepgram/clients/auth/v1/client.py b/deepgram/clients/auth/v1/client.py index 38f97dae..4aac31fa 100644 --- a/deepgram/clients/auth/v1/client.py +++ b/deepgram/clients/auth/v1/client.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: MIT import logging +from typing import Optional from ....utils import verboselogs from ....options import DeepgramClientOptions @@ -28,23 +29,48 @@ def __init__(self, config: DeepgramClientOptions): self._endpoint = "v1/auth/grant" super().__init__(config) - def grant_token(self): + def grant_token(self, ttl_seconds: Optional[int] = None): """ - Generates a temporary JWT with a 30 second TTL. + Generates a temporary JWT with a configurable TTL. + + Args: + ttl_seconds (int, optional): Time to live in seconds for the token. + Must be between 1 and 3600 seconds. Defaults to 30 seconds. Returns: GrantTokenResponse: An object containing the authentication token and its expiration time. Raises: DeepgramTypeError: Raised for known API errors. + ValueError: Raised when ttl_seconds is not within valid range. """ self._logger.debug("AuthRestClient.grant_token ENTER") + # Validate ttl_seconds if provided + if ttl_seconds is not None: + if not isinstance(ttl_seconds, int) or isinstance(ttl_seconds, bool) or ttl_seconds < 1 or ttl_seconds > 3600: + raise ValueError("ttl_seconds must be an integer between 1 and 3600") + url = f"{self._config.url}/{self._endpoint}" self._logger.info("url: %s", url) - result = self.post( - url, headers={"Authorization": f"Token {self._config.api_key}"} - ) + + # Prepare request body + request_body = {} + if ttl_seconds is not None: + request_body["ttl_seconds"] = ttl_seconds + + # Make the request + if request_body: + result = self.post( + url, + headers={"Authorization": f"Token {self._config.api_key}"}, + json=request_body + ) + else: + result = self.post( + url, headers={"Authorization": f"Token {self._config.api_key}"} + ) + self._logger.info("json: %s", result) res = GrantTokenResponse.from_json(result) self._logger.verbose("result: %s", res) diff --git a/examples/auth/async_token/main.py b/examples/auth/async_token/main.py index e93effb6..20a1f88b 100644 --- a/examples/auth/async_token/main.py +++ b/examples/auth/async_token/main.py @@ -23,8 +23,25 @@ async def main(): ) # STEP 2 Call the grant_token method on the auth rest class + print("Testing async grant_token with default TTL (30 seconds)...") response = await deepgram.asyncauth.v("1").grant_token() - print(f"response: {response}\n\n") + print(f"Default TTL response: {response}\n") + + # STEP 3 Call the grant_token method with custom TTL + print("Testing async grant_token with custom TTL (300 seconds)...") + response_custom = await deepgram.asyncauth.v("1").grant_token(ttl_seconds=300) + print(f"Custom TTL response: {response_custom}\n") + + # STEP 4 Test boundary values + print("Testing async grant_token with minimum TTL (1 second)...") + response_min = await deepgram.asyncauth.v("1").grant_token(ttl_seconds=1) + print(f"Minimum TTL response: {response_min}\n") + + print("Testing async grant_token with maximum TTL (3600 seconds)...") + response_max = await deepgram.asyncauth.v("1").grant_token(ttl_seconds=3600) + print(f"Maximum TTL response: {response_max}\n") + + print("✅ All async grant_token tests completed successfully!") except Exception as e: print(f"Exception: {e}") diff --git a/examples/auth/bearer_token_demo/main.py b/examples/auth/bearer_token_demo/main.py index b444e8d8..2dbf2b36 100644 --- a/examples/auth/bearer_token_demo/main.py +++ b/examples/auth/bearer_token_demo/main.py @@ -30,9 +30,9 @@ def main(): f"API client created with auth: {api_client._config.headers.get('Authorization', 'Not set')}" ) - # STEP 2 Use the API key client to get an access token - print("\nStep 2: Getting access token...") - response = api_client.auth.v("1").grant_token() + # STEP 2 Use the API key client to get an access token with custom TTL + print("\nStep 2: Getting access token with custom TTL (600 seconds)...") + response = api_client.auth.v("1").grant_token(ttl_seconds=600) access_token = response.access_token print(f"Access token received: {access_token[:20]}...{access_token[-10:]}") print(f"Token expires in: {response.expires_in} seconds") diff --git a/examples/auth/token/main.py b/examples/auth/token/main.py index bf724c0e..d88b6037 100644 --- a/examples/auth/token/main.py +++ b/examples/auth/token/main.py @@ -22,8 +22,25 @@ def main(): ) # STEP 2 Call the grant_token method on the auth rest class + print("Testing grant_token with default TTL (30 seconds)...") response = deepgram.auth.v("1").grant_token() - print(f"response: {response}\n\n") + print(f"Default TTL response: {response}\n") + + # STEP 3 Call the grant_token method with custom TTL + print("Testing grant_token with custom TTL (300 seconds)...") + response_custom = deepgram.auth.v("1").grant_token(ttl_seconds=300) + print(f"Custom TTL response: {response_custom}\n") + + # STEP 4 Test boundary values + print("Testing grant_token with minimum TTL (1 second)...") + response_min = deepgram.auth.v("1").grant_token(ttl_seconds=1) + print(f"Minimum TTL response: {response_min}\n") + + print("Testing grant_token with maximum TTL (3600 seconds)...") + response_max = deepgram.auth.v("1").grant_token(ttl_seconds=3600) + print(f"Maximum TTL response: {response_max}\n") + + print("✅ All grant_token tests completed successfully!") except Exception as e: print(f"Exception: {e}") diff --git a/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json b/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json index 215a886a..c392a97c 100644 --- a/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json +++ b/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json @@ -1 +1 @@ -{"metadata": {"transaction_key": "deprecated", "request_id": "ecae8f5b-ce66-40e3-b66c-41f6e2affe68", "sha256": "5324da68ede209a16ac69a38e8cd29cee4d754434a041166cda3a1f5e0b24566", "created": "2025-06-22T16:50:02.280Z", "duration": 17.566313, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}, "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 0, "output_tokens": 0}}, "results": {"channels": [{"alternatives": [{"transcript": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "confidence": 0.9991429, "words": [{"word": "yep", "start": 5.52, "end": 6.2400002, "confidence": 0.92345256, "punctuated_word": "Yep."}, {"word": "i", "start": 6.96, "end": 7.2799997, "confidence": 0.5776232, "punctuated_word": "I"}, {"word": "said", "start": 7.2799997, "end": 7.52, "confidence": 0.9052255, "punctuated_word": "said"}, {"word": "it", "start": 7.52, "end": 7.68, "confidence": 0.9979741, "punctuated_word": "it"}, {"word": "before", "start": 7.68, "end": 8.08, "confidence": 0.89339817, "punctuated_word": "before,"}, {"word": "and", "start": 8.08, "end": 8.16, "confidence": 0.99981827, "punctuated_word": "and"}, {"word": "i'll", "start": 8.16, "end": 8.4, "confidence": 0.99961734, "punctuated_word": "I'll"}, {"word": "say", "start": 8.4, "end": 8.48, "confidence": 0.99941754, "punctuated_word": "say"}, {"word": "it", "start": 8.48, "end": 8.639999, "confidence": 0.99959713, "punctuated_word": "it"}, {"word": "again", "start": 8.639999, "end": 8.96, "confidence": 0.95283747, "punctuated_word": "again."}, {"word": "life", "start": 10.071313, "end": 10.311313, "confidence": 0.9990012, "punctuated_word": "Life"}, {"word": "moves", "start": 10.311313, "end": 10.631312, "confidence": 0.9996643, "punctuated_word": "moves"}, {"word": "pretty", "start": 10.631312, "end": 11.031313, "confidence": 0.99988604, "punctuated_word": "pretty"}, {"word": "fast", "start": 11.031313, "end": 11.671312, "confidence": 0.99896836, "punctuated_word": "fast."}, {"word": "you", "start": 12.071312, "end": 12.311313, "confidence": 0.9201446, "punctuated_word": "You"}, {"word": "don't", "start": 12.311313, "end": 12.551312, "confidence": 0.99986017, "punctuated_word": "don't"}, {"word": "stop", "start": 12.551312, "end": 12.791312, "confidence": 0.99976414, "punctuated_word": "stop"}, {"word": "and", "start": 12.791312, "end": 12.951312, "confidence": 0.998522, "punctuated_word": "and"}, {"word": "look", "start": 12.951312, "end": 13.111313, "confidence": 0.9998677, "punctuated_word": "look"}, {"word": "around", "start": 13.111313, "end": 13.351313, "confidence": 0.9998548, "punctuated_word": "around"}, {"word": "once", "start": 13.351313, "end": 13.671312, "confidence": 0.9991429, "punctuated_word": "once"}, {"word": "in", "start": 13.671312, "end": 13.831312, "confidence": 0.9976286, "punctuated_word": "in"}, {"word": "a", "start": 13.831312, "end": 13.911312, "confidence": 0.9850873, "punctuated_word": "a"}, {"word": "while", "start": 13.911312, "end": 14.391312, "confidence": 0.9349425, "punctuated_word": "while,"}, {"word": "you", "start": 14.711312, "end": 14.871312, "confidence": 0.99921596, "punctuated_word": "you"}, {"word": "could", "start": 14.871312, "end": 15.031313, "confidence": 0.99974436, "punctuated_word": "could"}, {"word": "miss", "start": 15.031313, "end": 15.271313, "confidence": 0.9997111, "punctuated_word": "miss"}, {"word": "it", "start": 15.271313, "end": 15.5113125, "confidence": 0.9989148, "punctuated_word": "it."}], "paragraphs": {"transcript": "\nYep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "paragraphs": [{"sentences": [{"text": "Yep.", "start": 5.52, "end": 6.2400002}, {"text": "I said it before, and I'll say it again.", "start": 6.96, "end": 8.96}, {"text": "Life moves pretty fast.", "start": 10.071313, "end": 11.671312}, {"text": "You don't stop and look around once in a while, you could miss it.", "start": 12.071312, "end": 15.5113125}], "start": 5.52, "end": 15.5113125, "num_words": 28}]}}]}], "summary": {"result": "success", "short": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it."}}} \ No newline at end of file +{"metadata": {"transaction_key": "deprecated", "request_id": "b8631296-99ec-4279-b619-875c9dc671b2", "sha256": "5324da68ede209a16ac69a38e8cd29cee4d754434a041166cda3a1f5e0b24566", "created": "2025-07-17T15:22:07.411Z", "duration": 17.566313, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}, "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 0, "output_tokens": 0}}, "results": {"channels": [{"alternatives": [{"transcript": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "confidence": 0.999143, "words": [{"word": "yep", "start": 5.52, "end": 6.2400002, "confidence": 0.92342806, "punctuated_word": "Yep."}, {"word": "i", "start": 6.96, "end": 7.2799997, "confidence": 0.57757515, "punctuated_word": "I"}, {"word": "said", "start": 7.2799997, "end": 7.52, "confidence": 0.9052356, "punctuated_word": "said"}, {"word": "it", "start": 7.52, "end": 7.68, "confidence": 0.99797314, "punctuated_word": "it"}, {"word": "before", "start": 7.68, "end": 8.08, "confidence": 0.8933872, "punctuated_word": "before,"}, {"word": "and", "start": 8.08, "end": 8.16, "confidence": 0.99981827, "punctuated_word": "and"}, {"word": "i'll", "start": 8.16, "end": 8.4, "confidence": 0.99961716, "punctuated_word": "I'll"}, {"word": "say", "start": 8.4, "end": 8.48, "confidence": 0.99941766, "punctuated_word": "say"}, {"word": "it", "start": 8.48, "end": 8.639999, "confidence": 0.999597, "punctuated_word": "it"}, {"word": "again", "start": 8.639999, "end": 8.96, "confidence": 0.9528253, "punctuated_word": "again."}, {"word": "life", "start": 10.071313, "end": 10.311313, "confidence": 0.9990013, "punctuated_word": "Life"}, {"word": "moves", "start": 10.311313, "end": 10.631312, "confidence": 0.9996643, "punctuated_word": "moves"}, {"word": "pretty", "start": 10.631312, "end": 11.031313, "confidence": 0.99988604, "punctuated_word": "pretty"}, {"word": "fast", "start": 11.031313, "end": 11.671312, "confidence": 0.9989686, "punctuated_word": "fast."}, {"word": "you", "start": 12.071312, "end": 12.311313, "confidence": 0.92013294, "punctuated_word": "You"}, {"word": "don't", "start": 12.311313, "end": 12.551312, "confidence": 0.99986017, "punctuated_word": "don't"}, {"word": "stop", "start": 12.551312, "end": 12.791312, "confidence": 0.99976414, "punctuated_word": "stop"}, {"word": "and", "start": 12.791312, "end": 12.951312, "confidence": 0.99852246, "punctuated_word": "and"}, {"word": "look", "start": 12.951312, "end": 13.111313, "confidence": 0.9998677, "punctuated_word": "look"}, {"word": "around", "start": 13.111313, "end": 13.351313, "confidence": 0.9998548, "punctuated_word": "around"}, {"word": "once", "start": 13.351313, "end": 13.671312, "confidence": 0.999143, "punctuated_word": "once"}, {"word": "in", "start": 13.671312, "end": 13.831312, "confidence": 0.9976291, "punctuated_word": "in"}, {"word": "a", "start": 13.831312, "end": 13.911312, "confidence": 0.98508644, "punctuated_word": "a"}, {"word": "while", "start": 13.911312, "end": 14.391312, "confidence": 0.9349461, "punctuated_word": "while,"}, {"word": "you", "start": 14.711312, "end": 14.871312, "confidence": 0.99921596, "punctuated_word": "you"}, {"word": "could", "start": 14.871312, "end": 15.031313, "confidence": 0.99974436, "punctuated_word": "could"}, {"word": "miss", "start": 15.031313, "end": 15.271313, "confidence": 0.9997112, "punctuated_word": "miss"}, {"word": "it", "start": 15.271313, "end": 15.5113125, "confidence": 0.99891484, "punctuated_word": "it."}], "paragraphs": {"transcript": "\nYep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "paragraphs": [{"sentences": [{"text": "Yep.", "start": 5.52, "end": 6.2400002}, {"text": "I said it before, and I'll say it again.", "start": 6.96, "end": 8.96}, {"text": "Life moves pretty fast.", "start": 10.071313, "end": 11.671312}, {"text": "You don't stop and look around once in a while, you could miss it.", "start": 12.071312, "end": 15.5113125}], "start": 5.52, "end": 15.5113125, "num_words": 28}]}}]}], "summary": {"result": "success", "short": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it."}}} \ No newline at end of file diff --git a/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json b/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json index 513d9889..8cae69b3 100644 --- a/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json +++ b/tests/response_data/listen/rest/a231370d439312b1a404bb6ad8de955e900ec8eae9a906329af8cc672e6ec7ba-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json @@ -1 +1 @@ -{"metadata": {"transaction_key": "deprecated", "request_id": "5d242bca-5769-41c3-999d-87fafa37549b", "sha256": "95dc40091b6a8456a1554ddfc4f163768217afd66bee70a10c74bb52805cd0d9", "created": "2025-06-22T16:50:00.494Z", "duration": 19.097937, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}, "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 63, "output_tokens": 43}}, "results": {"channels": [{"alternatives": [{"transcript": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "confidence": 0.9977379, "words": [{"word": "we", "start": 0.32, "end": 0.79999995, "confidence": 0.8624594, "punctuated_word": "We,"}, {"word": "the", "start": 0.79999995, "end": 0.96, "confidence": 0.9988009, "punctuated_word": "the"}, {"word": "people", "start": 0.96, "end": 1.1999999, "confidence": 0.9702921, "punctuated_word": "people"}, {"word": "of", "start": 1.1999999, "end": 1.4399999, "confidence": 0.92611325, "punctuated_word": "of"}, {"word": "the", "start": 1.4399999, "end": 1.5999999, "confidence": 0.99689424, "punctuated_word": "The"}, {"word": "united", "start": 1.5999999, "end": 1.92, "confidence": 0.99693954, "punctuated_word": "United"}, {"word": "states", "start": 1.92, "end": 2.56, "confidence": 0.98952484, "punctuated_word": "States,"}, {"word": "in", "start": 2.56, "end": 2.72, "confidence": 0.99842346, "punctuated_word": "in"}, {"word": "order", "start": 2.72, "end": 2.96, "confidence": 0.9999378, "punctuated_word": "order"}, {"word": "to", "start": 2.96, "end": 3.12, "confidence": 0.9960312, "punctuated_word": "to"}, {"word": "form", "start": 3.12, "end": 3.28, "confidence": 0.99930143, "punctuated_word": "form"}, {"word": "a", "start": 3.28, "end": 3.4399998, "confidence": 0.9991948, "punctuated_word": "a"}, {"word": "more", "start": 3.4399998, "end": 3.6799998, "confidence": 0.99967265, "punctuated_word": "more"}, {"word": "perfect", "start": 3.6799998, "end": 3.9199998, "confidence": 0.9996804, "punctuated_word": "perfect"}, {"word": "union", "start": 3.9199998, "end": 4.56, "confidence": 0.96661377, "punctuated_word": "union,"}, {"word": "establish", "start": 4.72, "end": 5.2, "confidence": 0.9780056, "punctuated_word": "establish"}, {"word": "justice", "start": 5.2, "end": 6.08, "confidence": 0.99622726, "punctuated_word": "justice,"}, {"word": "ensure", "start": 6.08, "end": 6.3999996, "confidence": 0.9690141, "punctuated_word": "ensure"}, {"word": "domestic", "start": 6.3999996, "end": 6.8799996, "confidence": 0.97970927, "punctuated_word": "domestic"}, {"word": "tranquility", "start": 6.8799996, "end": 7.52, "confidence": 0.9949531, "punctuated_word": "tranquility,"}, {"word": "provide", "start": 7.792875, "end": 8.352875, "confidence": 0.99955326, "punctuated_word": "provide"}, {"word": "for", "start": 8.352875, "end": 8.512875, "confidence": 0.99970573, "punctuated_word": "for"}, {"word": "the", "start": 8.512875, "end": 8.672874, "confidence": 0.9984457, "punctuated_word": "the"}, {"word": "common", "start": 8.672874, "end": 8.912875, "confidence": 0.9994067, "punctuated_word": "common"}, {"word": "defense", "start": 8.912875, "end": 9.6328745, "confidence": 0.989704, "punctuated_word": "defense,"}, {"word": "promote", "start": 9.6328745, "end": 9.952875, "confidence": 0.9921375, "punctuated_word": "promote"}, {"word": "the", "start": 9.952875, "end": 10.192875, "confidence": 0.9944133, "punctuated_word": "the"}, {"word": "general", "start": 10.192875, "end": 10.512875, "confidence": 0.9995796, "punctuated_word": "general"}, {"word": "welfare", "start": 10.512875, "end": 11.152875, "confidence": 0.9714061, "punctuated_word": "welfare,"}, {"word": "and", "start": 11.152875, "end": 11.232875, "confidence": 0.999673, "punctuated_word": "and"}, {"word": "secure", "start": 11.232875, "end": 11.552875, "confidence": 0.9994294, "punctuated_word": "secure"}, {"word": "the", "start": 11.552875, "end": 11.792875, "confidence": 0.99942917, "punctuated_word": "the"}, {"word": "blessings", "start": 11.792875, "end": 12.112875, "confidence": 0.9974213, "punctuated_word": "blessings"}, {"word": "of", "start": 12.112875, "end": 12.272875, "confidence": 0.99958605, "punctuated_word": "of"}, {"word": "liberty", "start": 12.272875, "end": 12.672874, "confidence": 0.996736, "punctuated_word": "liberty"}, {"word": "to", "start": 12.672874, "end": 12.912874, "confidence": 0.99031293, "punctuated_word": "to"}, {"word": "ourselves", "start": 12.912874, "end": 13.312875, "confidence": 0.99862087, "punctuated_word": "ourselves"}, {"word": "and", "start": 13.312875, "end": 13.552875, "confidence": 0.87775034, "punctuated_word": "and"}, {"word": "our", "start": 13.552875, "end": 13.712875, "confidence": 0.997166, "punctuated_word": "our"}, {"word": "posterity", "start": 13.712875, "end": 14.592875, "confidence": 0.9914988, "punctuated_word": "posterity"}, {"word": "to", "start": 14.592875, "end": 14.832874, "confidence": 0.6025369, "punctuated_word": "to"}, {"word": "ordain", "start": 14.832874, "end": 15.312875, "confidence": 0.99850905, "punctuated_word": "ordain"}, {"word": "and", "start": 15.312875, "end": 15.472875, "confidence": 0.9984875, "punctuated_word": "and"}, {"word": "establish", "start": 15.472875, "end": 15.952875, "confidence": 0.99775887, "punctuated_word": "establish"}, {"word": "this", "start": 15.952875, "end": 16.272875, "confidence": 0.99880767, "punctuated_word": "this"}, {"word": "constitution", "start": 16.272875, "end": 16.912874, "confidence": 0.9585388, "punctuated_word": "constitution"}, {"word": "for", "start": 16.912874, "end": 17.152874, "confidence": 0.99841416, "punctuated_word": "for"}, {"word": "the", "start": 17.152874, "end": 17.312874, "confidence": 0.998071, "punctuated_word": "The"}, {"word": "united", "start": 17.312874, "end": 17.632875, "confidence": 0.9977379, "punctuated_word": "United"}, {"word": "states", "start": 17.632875, "end": 17.952875, "confidence": 0.999585, "punctuated_word": "States"}, {"word": "of", "start": 17.952875, "end": 18.192875, "confidence": 0.99960726, "punctuated_word": "Of"}, {"word": "america", "start": 18.192875, "end": 18.592875, "confidence": 0.99715734, "punctuated_word": "America."}], "paragraphs": {"transcript": "\nWe, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "paragraphs": [{"sentences": [{"text": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "start": 0.32, "end": 18.592875}], "start": 0.32, "end": 18.592875, "num_words": 52}]}}]}], "summary": {"result": "success", "short": "Speaker 1 discusses the goal of establishing a more perfect union, justice, and the common defense for the United States of America, in order to secure the blessings of liberty and establish the constitution for the country."}}} \ No newline at end of file +{"metadata": {"transaction_key": "deprecated", "request_id": "af93ae73-07b4-4e6f-96b8-8cb2396a3ea9", "sha256": "95dc40091b6a8456a1554ddfc4f163768217afd66bee70a10c74bb52805cd0d9", "created": "2025-07-17T15:22:01.954Z", "duration": 19.097937, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}, "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 63, "output_tokens": 43}}, "results": {"channels": [{"alternatives": [{"transcript": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "confidence": 0.9977375, "words": [{"word": "we", "start": 0.32, "end": 0.79999995, "confidence": 0.86245584, "punctuated_word": "We,"}, {"word": "the", "start": 0.79999995, "end": 0.96, "confidence": 0.99880075, "punctuated_word": "the"}, {"word": "people", "start": 0.96, "end": 1.1999999, "confidence": 0.9702976, "punctuated_word": "people"}, {"word": "of", "start": 1.1999999, "end": 1.4399999, "confidence": 0.92612505, "punctuated_word": "of"}, {"word": "the", "start": 1.4399999, "end": 1.5999999, "confidence": 0.9968947, "punctuated_word": "The"}, {"word": "united", "start": 1.5999999, "end": 1.92, "confidence": 0.99693966, "punctuated_word": "United"}, {"word": "states", "start": 1.92, "end": 2.56, "confidence": 0.9895243, "punctuated_word": "States,"}, {"word": "in", "start": 2.56, "end": 2.72, "confidence": 0.9984237, "punctuated_word": "in"}, {"word": "order", "start": 2.72, "end": 2.96, "confidence": 0.9999379, "punctuated_word": "order"}, {"word": "to", "start": 2.96, "end": 3.12, "confidence": 0.9960299, "punctuated_word": "to"}, {"word": "form", "start": 3.12, "end": 3.28, "confidence": 0.99930143, "punctuated_word": "form"}, {"word": "a", "start": 3.28, "end": 3.4399998, "confidence": 0.99919444, "punctuated_word": "a"}, {"word": "more", "start": 3.4399998, "end": 3.6799998, "confidence": 0.99967265, "punctuated_word": "more"}, {"word": "perfect", "start": 3.6799998, "end": 3.9199998, "confidence": 0.9996805, "punctuated_word": "perfect"}, {"word": "union", "start": 3.9199998, "end": 4.56, "confidence": 0.96661425, "punctuated_word": "union,"}, {"word": "establish", "start": 4.72, "end": 5.2, "confidence": 0.9780067, "punctuated_word": "establish"}, {"word": "justice", "start": 5.2, "end": 6.08, "confidence": 0.99622726, "punctuated_word": "justice,"}, {"word": "ensure", "start": 6.08, "end": 6.3999996, "confidence": 0.96901906, "punctuated_word": "ensure"}, {"word": "domestic", "start": 6.3999996, "end": 6.8799996, "confidence": 0.9797146, "punctuated_word": "domestic"}, {"word": "tranquility", "start": 6.8799996, "end": 7.52, "confidence": 0.9949539, "punctuated_word": "tranquility,"}, {"word": "provide", "start": 7.792875, "end": 8.352875, "confidence": 0.99955326, "punctuated_word": "provide"}, {"word": "for", "start": 8.352875, "end": 8.512875, "confidence": 0.99970573, "punctuated_word": "for"}, {"word": "the", "start": 8.512875, "end": 8.672874, "confidence": 0.99844533, "punctuated_word": "the"}, {"word": "common", "start": 8.672874, "end": 8.912875, "confidence": 0.9994067, "punctuated_word": "common"}, {"word": "defense", "start": 8.912875, "end": 9.6328745, "confidence": 0.9897019, "punctuated_word": "defense,"}, {"word": "promote", "start": 9.6328745, "end": 9.952875, "confidence": 0.9921347, "punctuated_word": "promote"}, {"word": "the", "start": 9.952875, "end": 10.192875, "confidence": 0.9944115, "punctuated_word": "the"}, {"word": "general", "start": 10.192875, "end": 10.512875, "confidence": 0.9995796, "punctuated_word": "general"}, {"word": "welfare", "start": 10.512875, "end": 11.152875, "confidence": 0.97140217, "punctuated_word": "welfare,"}, {"word": "and", "start": 11.152875, "end": 11.232875, "confidence": 0.9996729, "punctuated_word": "and"}, {"word": "secure", "start": 11.232875, "end": 11.552875, "confidence": 0.9994293, "punctuated_word": "secure"}, {"word": "the", "start": 11.552875, "end": 11.792875, "confidence": 0.99942905, "punctuated_word": "the"}, {"word": "blessings", "start": 11.792875, "end": 12.112875, "confidence": 0.9974203, "punctuated_word": "blessings"}, {"word": "of", "start": 12.112875, "end": 12.272875, "confidence": 0.99958616, "punctuated_word": "of"}, {"word": "liberty", "start": 12.272875, "end": 12.672874, "confidence": 0.99673575, "punctuated_word": "liberty"}, {"word": "to", "start": 12.672874, "end": 12.912874, "confidence": 0.99031353, "punctuated_word": "to"}, {"word": "ourselves", "start": 12.912874, "end": 13.312875, "confidence": 0.99862075, "punctuated_word": "ourselves"}, {"word": "and", "start": 13.312875, "end": 13.552875, "confidence": 0.8777888, "punctuated_word": "and"}, {"word": "our", "start": 13.552875, "end": 13.712875, "confidence": 0.997166, "punctuated_word": "our"}, {"word": "posterity", "start": 13.712875, "end": 14.592875, "confidence": 0.9914963, "punctuated_word": "posterity"}, {"word": "to", "start": 14.592875, "end": 14.832874, "confidence": 0.60252225, "punctuated_word": "to"}, {"word": "ordain", "start": 14.832874, "end": 15.312875, "confidence": 0.9985095, "punctuated_word": "ordain"}, {"word": "and", "start": 15.312875, "end": 15.472875, "confidence": 0.9984877, "punctuated_word": "and"}, {"word": "establish", "start": 15.472875, "end": 15.952875, "confidence": 0.9977585, "punctuated_word": "establish"}, {"word": "this", "start": 15.952875, "end": 16.272875, "confidence": 0.99880767, "punctuated_word": "this"}, {"word": "constitution", "start": 16.272875, "end": 16.912874, "confidence": 0.95854074, "punctuated_word": "constitution"}, {"word": "for", "start": 16.912874, "end": 17.152874, "confidence": 0.9984143, "punctuated_word": "for"}, {"word": "the", "start": 17.152874, "end": 17.312874, "confidence": 0.99807125, "punctuated_word": "The"}, {"word": "united", "start": 17.312874, "end": 17.632875, "confidence": 0.9977375, "punctuated_word": "United"}, {"word": "states", "start": 17.632875, "end": 17.952875, "confidence": 0.999585, "punctuated_word": "States"}, {"word": "of", "start": 17.952875, "end": 18.192875, "confidence": 0.9996074, "punctuated_word": "Of"}, {"word": "america", "start": 18.192875, "end": 18.592875, "confidence": 0.9971571, "punctuated_word": "America."}], "paragraphs": {"transcript": "\nWe, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "paragraphs": [{"sentences": [{"text": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "start": 0.32, "end": 18.592875}], "start": 0.32, "end": 18.592875, "num_words": 52}]}}]}], "summary": {"result": "success", "short": "Speaker 1 discusses the goal of establishing a more perfect union, justice, and the common defense for the United States of America, in order to secure the blessings of liberty and establish the constitution for the country."}}} \ No newline at end of file diff --git a/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json b/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json index 57be902b..c4c0e9e1 100644 --- a/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json +++ b/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-29e7c8100617f70da4ae9da1921cb5071a01219f4780ca70930b0a370ed2163a-response.json @@ -1 +1 @@ -{"metadata": {"transaction_key": "deprecated", "request_id": "0e91145a-2e66-4384-9956-b68b9ec6703f", "sha256": "5324da68ede209a16ac69a38e8cd29cee4d754434a041166cda3a1f5e0b24566", "created": "2025-06-22T16:50:01.511Z", "duration": 17.566313, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}}, "results": {"channels": [{"alternatives": [{"transcript": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "confidence": 0.9991429, "words": [{"word": "yep", "start": 5.52, "end": 6.2400002, "confidence": 0.92345256, "punctuated_word": "Yep."}, {"word": "i", "start": 6.96, "end": 7.2799997, "confidence": 0.5776232, "punctuated_word": "I"}, {"word": "said", "start": 7.2799997, "end": 7.52, "confidence": 0.9052255, "punctuated_word": "said"}, {"word": "it", "start": 7.52, "end": 7.68, "confidence": 0.9979741, "punctuated_word": "it"}, {"word": "before", "start": 7.68, "end": 8.08, "confidence": 0.89339817, "punctuated_word": "before,"}, {"word": "and", "start": 8.08, "end": 8.16, "confidence": 0.99981827, "punctuated_word": "and"}, {"word": "i'll", "start": 8.16, "end": 8.4, "confidence": 0.99961734, "punctuated_word": "I'll"}, {"word": "say", "start": 8.4, "end": 8.48, "confidence": 0.99941754, "punctuated_word": "say"}, {"word": "it", "start": 8.48, "end": 8.639999, "confidence": 0.99959713, "punctuated_word": "it"}, {"word": "again", "start": 8.639999, "end": 8.96, "confidence": 0.95283747, "punctuated_word": "again."}, {"word": "life", "start": 10.071313, "end": 10.311313, "confidence": 0.9990012, "punctuated_word": "Life"}, {"word": "moves", "start": 10.311313, "end": 10.631312, "confidence": 0.9996643, "punctuated_word": "moves"}, {"word": "pretty", "start": 10.631312, "end": 11.031313, "confidence": 0.99988604, "punctuated_word": "pretty"}, {"word": "fast", "start": 11.031313, "end": 11.671312, "confidence": 0.99896836, "punctuated_word": "fast."}, {"word": "you", "start": 12.071312, "end": 12.311313, "confidence": 0.9201446, "punctuated_word": "You"}, {"word": "don't", "start": 12.311313, "end": 12.551312, "confidence": 0.99986017, "punctuated_word": "don't"}, {"word": "stop", "start": 12.551312, "end": 12.791312, "confidence": 0.99976414, "punctuated_word": "stop"}, {"word": "and", "start": 12.791312, "end": 12.951312, "confidence": 0.998522, "punctuated_word": "and"}, {"word": "look", "start": 12.951312, "end": 13.111313, "confidence": 0.9998677, "punctuated_word": "look"}, {"word": "around", "start": 13.111313, "end": 13.351313, "confidence": 0.9998548, "punctuated_word": "around"}, {"word": "once", "start": 13.351313, "end": 13.671312, "confidence": 0.9991429, "punctuated_word": "once"}, {"word": "in", "start": 13.671312, "end": 13.831312, "confidence": 0.9976286, "punctuated_word": "in"}, {"word": "a", "start": 13.831312, "end": 13.911312, "confidence": 0.9850873, "punctuated_word": "a"}, {"word": "while", "start": 13.911312, "end": 14.391312, "confidence": 0.9349425, "punctuated_word": "while,"}, {"word": "you", "start": 14.711312, "end": 14.871312, "confidence": 0.99921596, "punctuated_word": "you"}, {"word": "could", "start": 14.871312, "end": 15.031313, "confidence": 0.99974436, "punctuated_word": "could"}, {"word": "miss", "start": 15.031313, "end": 15.271313, "confidence": 0.9997111, "punctuated_word": "miss"}, {"word": "it", "start": 15.271313, "end": 15.5113125, "confidence": 0.9989148, "punctuated_word": "it."}], "paragraphs": {"transcript": "\nYep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "paragraphs": [{"sentences": [{"text": "Yep.", "start": 5.52, "end": 6.2400002}, {"text": "I said it before, and I'll say it again.", "start": 6.96, "end": 8.96}, {"text": "Life moves pretty fast.", "start": 10.071313, "end": 11.671312}, {"text": "You don't stop and look around once in a while, you could miss it.", "start": 12.071312, "end": 15.5113125}], "start": 5.52, "end": 15.5113125, "num_words": 28}]}}]}]}} \ No newline at end of file +{"metadata": {"transaction_key": "deprecated", "request_id": "426529dd-f7d5-4295-99ea-6c6baf31721e", "sha256": "5324da68ede209a16ac69a38e8cd29cee4d754434a041166cda3a1f5e0b24566", "created": "2025-07-17T15:22:05.147Z", "duration": 17.566313, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}}, "results": {"channels": [{"alternatives": [{"transcript": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "confidence": 0.99914277, "words": [{"word": "yep", "start": 5.52, "end": 6.2400002, "confidence": 0.92339367, "punctuated_word": "Yep."}, {"word": "i", "start": 6.96, "end": 7.2799997, "confidence": 0.5775679, "punctuated_word": "I"}, {"word": "said", "start": 7.2799997, "end": 7.52, "confidence": 0.905148, "punctuated_word": "said"}, {"word": "it", "start": 7.52, "end": 7.68, "confidence": 0.9979728, "punctuated_word": "it"}, {"word": "before", "start": 7.68, "end": 8.08, "confidence": 0.89340186, "punctuated_word": "before,"}, {"word": "and", "start": 8.08, "end": 8.16, "confidence": 0.99981827, "punctuated_word": "and"}, {"word": "i'll", "start": 8.16, "end": 8.4, "confidence": 0.9996171, "punctuated_word": "I'll"}, {"word": "say", "start": 8.4, "end": 8.48, "confidence": 0.99941766, "punctuated_word": "say"}, {"word": "it", "start": 8.48, "end": 8.639999, "confidence": 0.9995969, "punctuated_word": "it"}, {"word": "again", "start": 8.639999, "end": 8.96, "confidence": 0.95281684, "punctuated_word": "again."}, {"word": "life", "start": 10.071313, "end": 10.311313, "confidence": 0.99900085, "punctuated_word": "Life"}, {"word": "moves", "start": 10.311313, "end": 10.631312, "confidence": 0.9996644, "punctuated_word": "moves"}, {"word": "pretty", "start": 10.631312, "end": 11.031313, "confidence": 0.99988604, "punctuated_word": "pretty"}, {"word": "fast", "start": 11.031313, "end": 11.671312, "confidence": 0.99896824, "punctuated_word": "fast."}, {"word": "you", "start": 12.071312, "end": 12.311313, "confidence": 0.9201969, "punctuated_word": "You"}, {"word": "don't", "start": 12.311313, "end": 12.551312, "confidence": 0.99986005, "punctuated_word": "don't"}, {"word": "stop", "start": 12.551312, "end": 12.791312, "confidence": 0.99976414, "punctuated_word": "stop"}, {"word": "and", "start": 12.791312, "end": 12.951312, "confidence": 0.99852175, "punctuated_word": "and"}, {"word": "look", "start": 12.951312, "end": 13.111313, "confidence": 0.9998677, "punctuated_word": "look"}, {"word": "around", "start": 13.111313, "end": 13.351313, "confidence": 0.9998548, "punctuated_word": "around"}, {"word": "once", "start": 13.351313, "end": 13.671312, "confidence": 0.99914277, "punctuated_word": "once"}, {"word": "in", "start": 13.671312, "end": 13.831312, "confidence": 0.9976291, "punctuated_word": "in"}, {"word": "a", "start": 13.831312, "end": 13.911312, "confidence": 0.98508126, "punctuated_word": "a"}, {"word": "while", "start": 13.911312, "end": 14.391312, "confidence": 0.9348942, "punctuated_word": "while,"}, {"word": "you", "start": 14.711312, "end": 14.871312, "confidence": 0.9992155, "punctuated_word": "you"}, {"word": "could", "start": 14.871312, "end": 15.031313, "confidence": 0.99974424, "punctuated_word": "could"}, {"word": "miss", "start": 15.031313, "end": 15.271313, "confidence": 0.9997111, "punctuated_word": "miss"}, {"word": "it", "start": 15.271313, "end": 15.5113125, "confidence": 0.99891484, "punctuated_word": "it."}], "paragraphs": {"transcript": "\nYep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.", "paragraphs": [{"sentences": [{"text": "Yep.", "start": 5.52, "end": 6.2400002}, {"text": "I said it before, and I'll say it again.", "start": 6.96, "end": 8.96}, {"text": "Life moves pretty fast.", "start": 10.071313, "end": 11.671312}, {"text": "You don't stop and look around once in a while, you could miss it.", "start": 12.071312, "end": 15.5113125}], "start": 5.52, "end": 15.5113125, "num_words": 28}]}}]}]}} \ No newline at end of file diff --git a/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json b/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json index 7b36c86c..98da5fd7 100644 --- a/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json +++ b/tests/response_data/listen/rest/c4e1c0031174878d8f0e3dbd87916ee16d56f1c610ac525af5712ea37226a455-a17f4880c5b4cf124ac54d06d77c9f0ab7f3fe1052ff1c7b090f7eaf8ede5b76-response.json @@ -1 +1 @@ -{"metadata": {"transaction_key": "deprecated", "request_id": "1c35794b-875a-43f7-b296-88fa998de33c", "sha256": "95dc40091b6a8456a1554ddfc4f163768217afd66bee70a10c74bb52805cd0d9", "created": "2025-06-22T16:49:58.862Z", "duration": 19.097937, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}}, "results": {"channels": [{"alternatives": [{"transcript": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "confidence": 0.9977379, "words": [{"word": "we", "start": 0.32, "end": 0.79999995, "confidence": 0.8624594, "punctuated_word": "We,"}, {"word": "the", "start": 0.79999995, "end": 0.96, "confidence": 0.9988009, "punctuated_word": "the"}, {"word": "people", "start": 0.96, "end": 1.1999999, "confidence": 0.9702921, "punctuated_word": "people"}, {"word": "of", "start": 1.1999999, "end": 1.4399999, "confidence": 0.92611325, "punctuated_word": "of"}, {"word": "the", "start": 1.4399999, "end": 1.5999999, "confidence": 0.99689424, "punctuated_word": "The"}, {"word": "united", "start": 1.5999999, "end": 1.92, "confidence": 0.99693954, "punctuated_word": "United"}, {"word": "states", "start": 1.92, "end": 2.56, "confidence": 0.98952484, "punctuated_word": "States,"}, {"word": "in", "start": 2.56, "end": 2.72, "confidence": 0.99842346, "punctuated_word": "in"}, {"word": "order", "start": 2.72, "end": 2.96, "confidence": 0.9999378, "punctuated_word": "order"}, {"word": "to", "start": 2.96, "end": 3.12, "confidence": 0.9960312, "punctuated_word": "to"}, {"word": "form", "start": 3.12, "end": 3.28, "confidence": 0.99930143, "punctuated_word": "form"}, {"word": "a", "start": 3.28, "end": 3.4399998, "confidence": 0.9991948, "punctuated_word": "a"}, {"word": "more", "start": 3.4399998, "end": 3.6799998, "confidence": 0.99967265, "punctuated_word": "more"}, {"word": "perfect", "start": 3.6799998, "end": 3.9199998, "confidence": 0.9996804, "punctuated_word": "perfect"}, {"word": "union", "start": 3.9199998, "end": 4.56, "confidence": 0.96661377, "punctuated_word": "union,"}, {"word": "establish", "start": 4.72, "end": 5.2, "confidence": 0.9780056, "punctuated_word": "establish"}, {"word": "justice", "start": 5.2, "end": 6.08, "confidence": 0.99622726, "punctuated_word": "justice,"}, {"word": "ensure", "start": 6.08, "end": 6.3999996, "confidence": 0.9690141, "punctuated_word": "ensure"}, {"word": "domestic", "start": 6.3999996, "end": 6.8799996, "confidence": 0.97970927, "punctuated_word": "domestic"}, {"word": "tranquility", "start": 6.8799996, "end": 7.52, "confidence": 0.9949531, "punctuated_word": "tranquility,"}, {"word": "provide", "start": 7.792875, "end": 8.352875, "confidence": 0.99955326, "punctuated_word": "provide"}, {"word": "for", "start": 8.352875, "end": 8.512875, "confidence": 0.99970573, "punctuated_word": "for"}, {"word": "the", "start": 8.512875, "end": 8.672874, "confidence": 0.9984457, "punctuated_word": "the"}, {"word": "common", "start": 8.672874, "end": 8.912875, "confidence": 0.9994067, "punctuated_word": "common"}, {"word": "defense", "start": 8.912875, "end": 9.6328745, "confidence": 0.989704, "punctuated_word": "defense,"}, {"word": "promote", "start": 9.6328745, "end": 9.952875, "confidence": 0.9921375, "punctuated_word": "promote"}, {"word": "the", "start": 9.952875, "end": 10.192875, "confidence": 0.9944133, "punctuated_word": "the"}, {"word": "general", "start": 10.192875, "end": 10.512875, "confidence": 0.9995796, "punctuated_word": "general"}, {"word": "welfare", "start": 10.512875, "end": 11.152875, "confidence": 0.9714061, "punctuated_word": "welfare,"}, {"word": "and", "start": 11.152875, "end": 11.232875, "confidence": 0.999673, "punctuated_word": "and"}, {"word": "secure", "start": 11.232875, "end": 11.552875, "confidence": 0.9994294, "punctuated_word": "secure"}, {"word": "the", "start": 11.552875, "end": 11.792875, "confidence": 0.99942917, "punctuated_word": "the"}, {"word": "blessings", "start": 11.792875, "end": 12.112875, "confidence": 0.9974213, "punctuated_word": "blessings"}, {"word": "of", "start": 12.112875, "end": 12.272875, "confidence": 0.99958605, "punctuated_word": "of"}, {"word": "liberty", "start": 12.272875, "end": 12.672874, "confidence": 0.996736, "punctuated_word": "liberty"}, {"word": "to", "start": 12.672874, "end": 12.912874, "confidence": 0.99031293, "punctuated_word": "to"}, {"word": "ourselves", "start": 12.912874, "end": 13.312875, "confidence": 0.99862087, "punctuated_word": "ourselves"}, {"word": "and", "start": 13.312875, "end": 13.552875, "confidence": 0.87775034, "punctuated_word": "and"}, {"word": "our", "start": 13.552875, "end": 13.712875, "confidence": 0.997166, "punctuated_word": "our"}, {"word": "posterity", "start": 13.712875, "end": 14.592875, "confidence": 0.9914988, "punctuated_word": "posterity"}, {"word": "to", "start": 14.592875, "end": 14.832874, "confidence": 0.6025369, "punctuated_word": "to"}, {"word": "ordain", "start": 14.832874, "end": 15.312875, "confidence": 0.99850905, "punctuated_word": "ordain"}, {"word": "and", "start": 15.312875, "end": 15.472875, "confidence": 0.9984875, "punctuated_word": "and"}, {"word": "establish", "start": 15.472875, "end": 15.952875, "confidence": 0.99775887, "punctuated_word": "establish"}, {"word": "this", "start": 15.952875, "end": 16.272875, "confidence": 0.99880767, "punctuated_word": "this"}, {"word": "constitution", "start": 16.272875, "end": 16.912874, "confidence": 0.9585388, "punctuated_word": "constitution"}, {"word": "for", "start": 16.912874, "end": 17.152874, "confidence": 0.99841416, "punctuated_word": "for"}, {"word": "the", "start": 17.152874, "end": 17.312874, "confidence": 0.998071, "punctuated_word": "The"}, {"word": "united", "start": 17.312874, "end": 17.632875, "confidence": 0.9977379, "punctuated_word": "United"}, {"word": "states", "start": 17.632875, "end": 17.952875, "confidence": 0.999585, "punctuated_word": "States"}, {"word": "of", "start": 17.952875, "end": 18.192875, "confidence": 0.99960726, "punctuated_word": "Of"}, {"word": "america", "start": 18.192875, "end": 18.592875, "confidence": 0.99715734, "punctuated_word": "America."}], "paragraphs": {"transcript": "\nWe, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "paragraphs": [{"sentences": [{"text": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "start": 0.32, "end": 18.592875}], "start": 0.32, "end": 18.592875, "num_words": 52}]}}]}]}} \ No newline at end of file +{"metadata": {"transaction_key": "deprecated", "request_id": "381456da-c8ff-49b7-9edd-32fd79754db7", "sha256": "95dc40091b6a8456a1554ddfc4f163768217afd66bee70a10c74bb52805cd0d9", "created": "2025-07-17T15:22:00.853Z", "duration": 19.097937, "channels": 1, "models": ["3b3aabe4-608a-46ac-9585-7960a25daf1a"], "model_info": {"3b3aabe4-608a-46ac-9585-7960a25daf1a": {"name": "general-nova-3", "version": "2024-12-20.0", "arch": "nova-3"}}}, "results": {"channels": [{"alternatives": [{"transcript": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "confidence": 0.9977373, "words": [{"word": "we", "start": 0.32, "end": 0.79999995, "confidence": 0.8623352, "punctuated_word": "We,"}, {"word": "the", "start": 0.79999995, "end": 0.96, "confidence": 0.9987993, "punctuated_word": "the"}, {"word": "people", "start": 0.96, "end": 1.1999999, "confidence": 0.970258, "punctuated_word": "people"}, {"word": "of", "start": 1.1999999, "end": 1.4399999, "confidence": 0.925995, "punctuated_word": "of"}, {"word": "the", "start": 1.4399999, "end": 1.5999999, "confidence": 0.9968941, "punctuated_word": "The"}, {"word": "united", "start": 1.5999999, "end": 1.92, "confidence": 0.9969405, "punctuated_word": "United"}, {"word": "states", "start": 1.92, "end": 2.56, "confidence": 0.9895228, "punctuated_word": "States,"}, {"word": "in", "start": 2.56, "end": 2.72, "confidence": 0.99842215, "punctuated_word": "in"}, {"word": "order", "start": 2.72, "end": 2.96, "confidence": 0.9999378, "punctuated_word": "order"}, {"word": "to", "start": 2.96, "end": 3.12, "confidence": 0.99602926, "punctuated_word": "to"}, {"word": "form", "start": 3.12, "end": 3.28, "confidence": 0.99930143, "punctuated_word": "form"}, {"word": "a", "start": 3.28, "end": 3.4399998, "confidence": 0.9991947, "punctuated_word": "a"}, {"word": "more", "start": 3.4399998, "end": 3.6799998, "confidence": 0.9996723, "punctuated_word": "more"}, {"word": "perfect", "start": 3.6799998, "end": 3.9199998, "confidence": 0.9996803, "punctuated_word": "perfect"}, {"word": "union", "start": 3.9199998, "end": 4.56, "confidence": 0.96657944, "punctuated_word": "union,"}, {"word": "establish", "start": 4.72, "end": 5.2, "confidence": 0.9780286, "punctuated_word": "establish"}, {"word": "justice", "start": 5.2, "end": 6.08, "confidence": 0.9962243, "punctuated_word": "justice,"}, {"word": "ensure", "start": 6.08, "end": 6.3999996, "confidence": 0.969012, "punctuated_word": "ensure"}, {"word": "domestic", "start": 6.3999996, "end": 6.8799996, "confidence": 0.9797084, "punctuated_word": "domestic"}, {"word": "tranquility", "start": 6.8799996, "end": 7.52, "confidence": 0.9949529, "punctuated_word": "tranquility,"}, {"word": "provide", "start": 7.792875, "end": 8.352875, "confidence": 0.99955326, "punctuated_word": "provide"}, {"word": "for", "start": 8.352875, "end": 8.512875, "confidence": 0.9997055, "punctuated_word": "for"}, {"word": "the", "start": 8.512875, "end": 8.672874, "confidence": 0.9984444, "punctuated_word": "the"}, {"word": "common", "start": 8.672874, "end": 8.912875, "confidence": 0.9994067, "punctuated_word": "common"}, {"word": "defense", "start": 8.912875, "end": 9.6328745, "confidence": 0.9897144, "punctuated_word": "defense,"}, {"word": "promote", "start": 9.6328745, "end": 9.952875, "confidence": 0.99213976, "punctuated_word": "promote"}, {"word": "the", "start": 9.952875, "end": 10.192875, "confidence": 0.99441224, "punctuated_word": "the"}, {"word": "general", "start": 10.192875, "end": 10.512875, "confidence": 0.9995796, "punctuated_word": "general"}, {"word": "welfare", "start": 10.512875, "end": 11.152875, "confidence": 0.97138923, "punctuated_word": "welfare,"}, {"word": "and", "start": 11.152875, "end": 11.232875, "confidence": 0.99967265, "punctuated_word": "and"}, {"word": "secure", "start": 11.232875, "end": 11.552875, "confidence": 0.9994293, "punctuated_word": "secure"}, {"word": "the", "start": 11.552875, "end": 11.792875, "confidence": 0.9994287, "punctuated_word": "the"}, {"word": "blessings", "start": 11.792875, "end": 12.112875, "confidence": 0.9974183, "punctuated_word": "blessings"}, {"word": "of", "start": 12.112875, "end": 12.272875, "confidence": 0.9995859, "punctuated_word": "of"}, {"word": "liberty", "start": 12.272875, "end": 12.672874, "confidence": 0.99673635, "punctuated_word": "liberty"}, {"word": "to", "start": 12.672874, "end": 12.912874, "confidence": 0.9903262, "punctuated_word": "to"}, {"word": "ourselves", "start": 12.912874, "end": 13.312875, "confidence": 0.9986204, "punctuated_word": "ourselves"}, {"word": "and", "start": 13.312875, "end": 13.552875, "confidence": 0.8778037, "punctuated_word": "and"}, {"word": "our", "start": 13.552875, "end": 13.712875, "confidence": 0.9971621, "punctuated_word": "our"}, {"word": "posterity", "start": 13.712875, "end": 14.592875, "confidence": 0.99150026, "punctuated_word": "posterity"}, {"word": "to", "start": 14.592875, "end": 14.832874, "confidence": 0.6021897, "punctuated_word": "to"}, {"word": "ordain", "start": 14.832874, "end": 15.312875, "confidence": 0.99850893, "punctuated_word": "ordain"}, {"word": "and", "start": 15.312875, "end": 15.472875, "confidence": 0.99848676, "punctuated_word": "and"}, {"word": "establish", "start": 15.472875, "end": 15.952875, "confidence": 0.9977576, "punctuated_word": "establish"}, {"word": "this", "start": 15.952875, "end": 16.272875, "confidence": 0.9988072, "punctuated_word": "this"}, {"word": "constitution", "start": 16.272875, "end": 16.912874, "confidence": 0.95849353, "punctuated_word": "constitution"}, {"word": "for", "start": 16.912874, "end": 17.152874, "confidence": 0.9984144, "punctuated_word": "for"}, {"word": "the", "start": 17.152874, "end": 17.312874, "confidence": 0.99807066, "punctuated_word": "The"}, {"word": "united", "start": 17.312874, "end": 17.632875, "confidence": 0.9977373, "punctuated_word": "United"}, {"word": "states", "start": 17.632875, "end": 17.952875, "confidence": 0.99958485, "punctuated_word": "States"}, {"word": "of", "start": 17.952875, "end": 18.192875, "confidence": 0.9996069, "punctuated_word": "Of"}, {"word": "america", "start": 18.192875, "end": 18.592875, "confidence": 0.99715674, "punctuated_word": "America."}], "paragraphs": {"transcript": "\nWe, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "paragraphs": [{"sentences": [{"text": "We, the people of The United States, in order to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense, promote the general welfare, and secure the blessings of liberty to ourselves and our posterity to ordain and establish this constitution for The United States Of America.", "start": 0.32, "end": 18.592875}], "start": 0.32, "end": 18.592875, "num_words": 52}]}}]}]}} \ No newline at end of file diff --git a/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-42fc5ed98cabc1fa1a2f276301c27c46dd15f6f5187cd93d944cc94fa81c8469-response.json b/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-42fc5ed98cabc1fa1a2f276301c27c46dd15f6f5187cd93d944cc94fa81c8469-response.json index 7b791168..f716c473 100644 --- a/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-42fc5ed98cabc1fa1a2f276301c27c46dd15f6f5187cd93d944cc94fa81c8469-response.json +++ b/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-42fc5ed98cabc1fa1a2f276301c27c46dd15f6f5187cd93d944cc94fa81c8469-response.json @@ -1 +1 @@ -{"channel": {"alternatives": [{"transcript": "Ensure domestic tranquility.", "confidence": 0.9897461, "words": [{"word": "ensure", "start": 6.251818, "end": 6.6427274, "confidence": 0.9897461, "punctuated_word": "Ensure"}, {"word": "domestic", "start": 6.6427274, "end": 7.1427274, "confidence": 0.99658203, "punctuated_word": "domestic"}, {"word": "tranquility", "start": 7.19, "end": 7.4245453, "confidence": 0.9248047, "punctuated_word": "tranquility."}]}]}, "metadata": {"model_info": {"name": "general", "version": "2024-01-26.8851", "arch": "base"}, "request_id": "5d642704-e08c-4820-b01d-296094ca1806", "model_uuid": "1ed36bac-f71c-4f3f-a31f-02fd6525c489"}, "type": "Results", "channel_index": [0, 1], "duration": 1.73, "start": 5.9, "is_final": true, "from_finalize": false, "speech_final": true} \ No newline at end of file +{"channel": {"alternatives": [{"transcript": "Establish justice.", "confidence": 0.99121094, "words": [{"word": "establish", "start": 4.9031577, "end": 5.2978945, "confidence": 0.5019531, "punctuated_word": "Establish"}, {"word": "justice", "start": 5.2978945, "end": 5.6926312, "confidence": 0.99121094, "punctuated_word": "justice."}]}]}, "metadata": {"model_info": {"name": "general", "version": "2024-01-26.8851", "arch": "base"}, "request_id": "11eac141-b29b-4c78-9852-255494d81752", "model_uuid": "1ed36bac-f71c-4f3f-a31f-02fd6525c489"}, "type": "Results", "channel_index": [0, 1], "duration": 1.5100002, "start": 4.39, "is_final": true, "from_finalize": false, "speech_final": true} \ No newline at end of file diff --git a/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-d7334c26cf6468c191e05ff5e8151da9b67985c66ab177e9446fd14bbafd70df-response.json b/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-d7334c26cf6468c191e05ff5e8151da9b67985c66ab177e9446fd14bbafd70df-response.json index c6d147ae..a13cb057 100644 --- a/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-d7334c26cf6468c191e05ff5e8151da9b67985c66ab177e9446fd14bbafd70df-response.json +++ b/tests/response_data/listen/websocket/ed5bfd217988aa8cad492f63f79dc59f5f02fb9b85befe6f6ce404b8f19aaa0d-d7334c26cf6468c191e05ff5e8151da9b67985c66ab177e9446fd14bbafd70df-response.json @@ -1 +1 @@ -{"channel": {"alternatives": [{"transcript": "", "confidence": 0.0, "words": []}]}, "metadata": {"model_info": {"name": "general", "version": "2024-01-26.8851", "arch": "base"}, "request_id": "1f152e70-3e61-4c47-be1d-9c739793087b", "model_uuid": "1ed36bac-f71c-4f3f-a31f-02fd6525c489"}, "type": "Results", "channel_index": [0, 1], "duration": 0.74, "start": 0.0, "is_final": true, "from_finalize": false, "speech_final": true} \ No newline at end of file +{"channel": {"alternatives": [{"transcript": "", "confidence": 0.0, "words": []}]}, "metadata": {"model_info": {"name": "general", "version": "2024-01-26.8851", "arch": "base"}, "request_id": "8b67585a-18da-49dd-9dc5-6d4eb4566a7b", "model_uuid": "1ed36bac-f71c-4f3f-a31f-02fd6525c489"}, "type": "Results", "channel_index": [0, 1], "duration": 0.74, "start": 0.0, "is_final": true, "from_finalize": false, "speech_final": true} \ No newline at end of file diff --git a/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-error.json b/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-error.json index 867856eb..48188e6f 100644 --- a/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-error.json +++ b/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-error.json @@ -1 +1 @@ -{"actual": "The potential for voice-based interfaces in conversational AI applications is discussed, with a focus on voice-premised and wearable devices. The speakers emphasize the benefits of voice quality, including natural speech flow, and the potential for AI to be more human than humans in speech recognition. They also mention their involvement in machine learning and their plans to expand their waitlist for a speech-to-text model. They expect to release generally early next year, but if working on real-time AI agent use cases, they can join their waitlist to jumpstart their development in production.", "expected": ["*"]} \ No newline at end of file +{"actual": "The potential for voice-based interfaces in conversational AI applications is discussed, with a focus on voice-premises and wearable devices. The success of voice-first experiences and tools, including DeepgramQuad, is highlighted, with a focus on improving customer outcomes and speed and efficiency for everyday exchanges. The speakers emphasize the benefits of voice quality, including natural speech flow, and the potential for AI agents to be more human than humans in speech recognition. They also mention their involvement in machine learning and their plans to expand their waitlist for a speech-to-text model. They expect to release generally early next year, but if working on any real-time AI agent use cases, they can join their waitlist to jumpstart their development in production.", "expected": ["*"]} \ No newline at end of file diff --git a/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-response.json b/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-response.json index c3bf1b5e..950b867a 100644 --- a/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-response.json +++ b/tests/response_data/read/rest/3917a1c81c08e360c0d4bba0ff9ebd645e610e4149483e5f2888a2c5df388b37-23e873efdfd4d680286fda14ff8f10864218311e79efc92ecc82bce3e574c366-response.json @@ -1 +1 @@ -{"metadata": {"request_id": "e8a1f89b-1bb3-427d-beab-d5d54007989c", "created": "2025-06-22T16:50:16.009Z", "language": "en", "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 1855, "output_tokens": 112}}, "results": {"summary": {"text": "The potential for voice-based interfaces in conversational AI applications is discussed, with a focus on voice-premised and wearable devices. The speakers emphasize the benefits of voice quality, including natural speech flow, and the potential for AI to be more human than humans in speech recognition. They also mention their involvement in machine learning and their plans to expand their waitlist for a speech-to-text model. They expect to release generally early next year, but if working on real-time AI agent use cases, they can join their waitlist to jumpstart their development in production."}}} \ No newline at end of file +{"metadata": {"request_id": "7fc42aa3-74ad-438d-ba79-5e21265a7ad5", "created": "2025-07-17T15:22:21.790Z", "language": "en", "summary_info": {"model_uuid": "67875a7f-c9c4-48a0-aa55-5bdb8a91c34a", "input_tokens": 1855, "output_tokens": 146}}, "results": {"summary": {"text": "The potential for voice-based interfaces in conversational AI applications is discussed, with a focus on voice-premises and wearable devices. The success of voice-first experiences and tools, including DeepgramQuad, is highlighted, with a focus on improving customer outcomes and speed and efficiency for everyday exchanges. The speakers emphasize the benefits of voice quality, including natural speech flow, and the potential for AI agents to be more human than humans in speech recognition. They also mention their involvement in machine learning and their plans to expand their waitlist for a speech-to-text model. They expect to release generally early next year, but if working on any real-time AI agent use cases, they can join their waitlist to jumpstart their development in production."}}} \ No newline at end of file diff --git a/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef-response.json b/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef-response.json index 8c7af9ef..e3c6658e 100644 --- a/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef-response.json +++ b/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef-response.json @@ -1 +1 @@ -{"content_type": "audio/wav", "request_id": "edbab00e-5de4-4d6a-a074-0b7bb0cc056a", "model_uuid": "0bb159e1-5c0a-48fb-aa29-ed7c0401f116", "model_name": "aura-2-thalia-en", "characters": 13, "transfer_encoding": "chunked", "date": "Sun, 22 Jun 2025 16:50:16 GMT"} \ No newline at end of file +{"content_type": "audio/wav", "request_id": "22f2829e-7bcd-4ed6-9d92-6414fe121722", "model_uuid": "0bb159e1-5c0a-48fb-aa29-ed7c0401f116", "model_name": "aura-2-thalia-en", "characters": 13, "transfer_encoding": "chunked", "date": "Thu, 17 Jul 2025 15:22:22 GMT"} \ No newline at end of file diff --git a/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef.wav b/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef.wav index 20bf4f36..1f926aa7 100644 Binary files a/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef.wav and b/tests/response_data/speak/rest/1fe0ad339338a9d6cffbab2c7ace41ba5387b5fe7906854795702dce91034fd3-f8c3bf62a9aa3e6fc1619c250e48abe7519373d3edf41be62eb5dc45199af2ef.wav differ diff --git a/tests/unit_test/test_unit_grant_token.py b/tests/unit_test/test_unit_grant_token.py new file mode 100644 index 00000000..ca35252f --- /dev/null +++ b/tests/unit_test/test_unit_grant_token.py @@ -0,0 +1,304 @@ +# Copyright 2024 Deepgram SDK contributors. All Rights Reserved. +# Use of this source code is governed by a MIT license that can be found in the LICENSE file. +# SPDX-License-Identifier: MIT + +import pytest +from unittest.mock import patch, MagicMock + +from deepgram import DeepgramClient + + +class TestGrantTokenTTL: + """Test the TTL functionality for grant_token""" + + def test_grant_token_default_ttl(self): + """Test grant_token with default TTL (no ttl_seconds specified)""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-access-token-default" + mock_response.expires_in = 30 + + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token without ttl_seconds + response = api_client.auth.v("1").grant_token() + + assert response.access_token == "mock-access-token-default" + assert response.expires_in == 30 + assert mock_grant_token.called + + def test_grant_token_custom_ttl(self): + """Test grant_token with custom TTL values""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-access-token-custom" + mock_response.expires_in = 300 + + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token with custom ttl_seconds + response = api_client.auth.v("1").grant_token(ttl_seconds=300) + + assert response.access_token == "mock-access-token-custom" + assert response.expires_in == 300 + assert mock_grant_token.called + + def test_grant_token_ttl_validation_valid_values(self): + """Test that valid TTL values are accepted""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-access-token-valid" + mock_response.expires_in = 1800 + + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Test valid boundary values + valid_values = [1, 30, 300, 1800, 3600] + + for ttl in valid_values: + response = api_client.auth.v("1").grant_token(ttl_seconds=ttl) + assert response.access_token == "mock-access-token-valid" + + def test_grant_token_ttl_validation_invalid_values(self): + """Test that invalid TTL values raise ValueError""" + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Test invalid values + invalid_values = [0, -1, 3601, 10000, "300", 30.5, None] + + for invalid_ttl in invalid_values: + if invalid_ttl is None: + continue # None should be valid (default) + + with pytest.raises(ValueError, match="ttl_seconds must be an integer between 1 and 3600"): + api_client.auth.v("1").grant_token(ttl_seconds=invalid_ttl) + + def test_grant_token_workflow_with_custom_ttl(self): + """Test the complete workflow from API key to access token with custom TTL""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-access-token-custom-workflow" + mock_response.expires_in = 1800 + + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Step 1: Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Step 2: Use API key to fetch access token with custom TTL + response = api_client.auth.v("1").grant_token(ttl_seconds=1800) + access_token = response.access_token + expires_in = response.expires_in + + assert access_token == "mock-access-token-custom-workflow" + assert expires_in == 1800 + assert mock_grant_token.called + + # Step 3: Create new client with the fetched access token + bearer_client = DeepgramClient(access_token=access_token) + bearer_auth_header = bearer_client._config.headers.get( + 'Authorization', '') + + assert bearer_auth_header == "Bearer mock-access-token-custom-workflow" + + # Verify both clients have correct auth headers + assert api_client._config.headers.get( + 'Authorization') == "Token mock-api-key" + assert bearer_client._config.headers.get( + 'Authorization') == "Bearer mock-access-token-custom-workflow" + + +class TestAsyncGrantTokenTTL: + """Test the TTL functionality for async grant_token""" + + @pytest.mark.asyncio + async def test_async_grant_token_default_ttl(self): + """Test async grant_token with default TTL""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-async-access-token-default" + mock_response.expires_in = 30 + + with patch('deepgram.clients.auth.v1.async_client.AsyncAuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token without ttl_seconds + response = await api_client.asyncauth.v("1").grant_token() + + assert response.access_token == "mock-async-access-token-default" + assert response.expires_in == 30 + assert mock_grant_token.called + + @pytest.mark.asyncio + async def test_async_grant_token_custom_ttl(self): + """Test async grant_token with custom TTL values""" + # Mock the grant_token response + mock_response = MagicMock() + mock_response.access_token = "mock-async-access-token-custom" + mock_response.expires_in = 600 + + with patch('deepgram.clients.auth.v1.async_client.AsyncAuthRESTClient.grant_token') as mock_grant_token: + mock_grant_token.return_value = mock_response + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token with custom ttl_seconds + response = await api_client.asyncauth.v("1").grant_token(ttl_seconds=600) + + assert response.access_token == "mock-async-access-token-custom" + assert response.expires_in == 600 + assert mock_grant_token.called + + @pytest.mark.asyncio + async def test_async_grant_token_ttl_validation_invalid_values(self): + """Test that invalid TTL values raise ValueError in async client""" + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Test invalid values + invalid_values = [0, -1, 3601, 10000, "300", 30.5] + + for invalid_ttl in invalid_values: + with pytest.raises(ValueError, match="ttl_seconds must be an integer between 1 and 3600"): + await api_client.asyncauth.v("1").grant_token(ttl_seconds=invalid_ttl) + + +class TestGrantTokenRequestBody: + """Test that the request body is properly formatted for TTL requests""" + + def test_grant_token_request_body_with_ttl(self): + """Test that ttl_seconds is properly included in the request body""" + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.post') as mock_post: + mock_post.return_value = '{"access_token": "test-token", "expires_in": 300}' + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token with ttl_seconds + api_client.auth.v("1").grant_token(ttl_seconds=300) + + # Verify the post method was called with the correct parameters + mock_post.assert_called_once() + args, kwargs = mock_post.call_args + + # Check that json parameter contains ttl_seconds + assert 'json' in kwargs + assert kwargs['json'] == {'ttl_seconds': 300} + + # Check that headers contain the authorization + assert 'headers' in kwargs + assert kwargs['headers']['Authorization'] == "Token mock-api-key" + + def test_grant_token_request_body_without_ttl(self): + """Test that no request body is sent when ttl_seconds is not specified""" + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.post') as mock_post: + mock_post.return_value = '{"access_token": "test-token", "expires_in": 30}' + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token without ttl_seconds + api_client.auth.v("1").grant_token() + + # Verify the post method was called with the correct parameters + mock_post.assert_called_once() + args, kwargs = mock_post.call_args + + # Check that json parameter is not included + assert 'json' not in kwargs + + # Check that headers contain the authorization + assert 'headers' in kwargs + assert kwargs['headers']['Authorization'] == "Token mock-api-key" + + @pytest.mark.asyncio + async def test_async_grant_token_request_body_with_ttl(self): + """Test that ttl_seconds is properly included in the async request body""" + with patch('deepgram.clients.auth.v1.async_client.AsyncAuthRESTClient.post') as mock_post: + mock_post.return_value = '{"access_token": "test-token", "expires_in": 600}' + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Call grant_token with ttl_seconds + await api_client.asyncauth.v("1").grant_token(ttl_seconds=600) + + # Verify the post method was called with the correct parameters + mock_post.assert_called_once() + args, kwargs = mock_post.call_args + + # Check that json parameter contains ttl_seconds + assert 'json' in kwargs + assert kwargs['json'] == {'ttl_seconds': 600} + + # Check that headers contain the authorization + assert 'headers' in kwargs + assert kwargs['headers']['Authorization'] == "Token mock-api-key" + + +class TestGrantTokenEdgeCases: + """Test edge cases and error conditions for grant_token""" + + def test_grant_token_boundary_values(self): + """Test TTL boundary values (1 and 3600 seconds)""" + with patch('deepgram.clients.auth.v1.client.AuthRESTClient.post') as mock_post: + mock_post.return_value = '{"access_token": "test-token", "expires_in": 1}' + + # Create client with mock API key + api_client = DeepgramClient(api_key="mock-api-key") + + # Test minimum value (1 second) + response = api_client.auth.v("1").grant_token(ttl_seconds=1) + assert response.access_token == "test-token" + + # Test maximum value (3600 seconds) + mock_post.return_value = '{"access_token": "test-token", "expires_in": 3600}' + response = api_client.auth.v("1").grant_token(ttl_seconds=3600) + assert response.access_token == "test-token" + + # Verify both calls were made + assert mock_post.call_count == 2 + + def test_grant_token_type_validation(self): + """Test that non-integer types raise ValueError""" + # Create client with mock API key - validation happens before any HTTP request + api_client = DeepgramClient(api_key="mock-api-key") + + # Test various invalid types + invalid_types = ["300", 30.5, [300], {"ttl": 300}, True, False] + + for invalid_type in invalid_types: + with pytest.raises(ValueError, match="ttl_seconds must be an integer between 1 and 3600"): + # This should raise ValueError in the validation step before making any HTTP request + api_client.auth.v("1").grant_token(ttl_seconds=invalid_type) + + def test_grant_token_range_validation(self): + """Test that out-of-range values raise ValueError""" + # Create client with mock API key - validation happens before any HTTP request + api_client = DeepgramClient(api_key="mock-api-key") + + # Test values outside the valid range + invalid_ranges = [0, -1, -100, 3601, 10000, 86400] + + for invalid_value in invalid_ranges: + with pytest.raises(ValueError, match="ttl_seconds must be an integer between 1 and 3600"): + # This should raise ValueError in the validation step before making any HTTP request + api_client.auth.v("1").grant_token(ttl_seconds=invalid_value) \ No newline at end of file