runapi-nemotron 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ """Nemotron client for RunAPI."""
2
+
3
+ from runapi.core import (
4
+ AuthenticationError,
5
+ InsufficientCreditsError,
6
+ NotFoundError,
7
+ RateLimitError,
8
+ TaskFailedError,
9
+ TaskTimeoutError,
10
+ ValidationError,
11
+ )
12
+
13
+ from .client import NemotronClient
14
+
15
+ __all__ = [
16
+ "NemotronClient",
17
+ "AuthenticationError",
18
+ "RateLimitError",
19
+ "InsufficientCreditsError",
20
+ "NotFoundError",
21
+ "ValidationError",
22
+ "TaskFailedError",
23
+ "TaskTimeoutError",
24
+ ]
@@ -0,0 +1,13 @@
1
+ """Nemotron audio transcription client."""
2
+
3
+ from typing import Any, Optional
4
+
5
+ from runapi.core import ProviderClient
6
+
7
+ from .resources.speech_to_text import SpeechToText
8
+
9
+
10
+ class NemotronClient(ProviderClient):
11
+ def __init__(self, api_key: Optional[str] = None, **options: Any) -> None:
12
+ super().__init__(api_key, **options)
13
+ self.speech_to_text = SpeechToText(self._http)
File without changes
File without changes
@@ -0,0 +1,53 @@
1
+ """Nemotron speech-to-text resource."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Optional
6
+
7
+ from runapi.core import Resource, RequestOptions
8
+
9
+ from ..types import CompletedSpeechToTextResponse, SpeechToTextResponse
10
+
11
+
12
+ class SpeechToText(Resource):
13
+ """Transcribe speech audio to text with Nemotron models."""
14
+
15
+ ENDPOINT = "/api/v1/nemotron/speech_to_text"
16
+
17
+ RESPONSE_CLASS = SpeechToTextResponse
18
+ COMPLETED_RESPONSE_CLASS = CompletedSpeechToTextResponse
19
+
20
+ def run(self, options: Optional[RequestOptions] = None, **params: Any) -> Any:
21
+ """Create a speech-to-text task and poll until it completes.
22
+
23
+ Args:
24
+ **params: Transcription parameters including model and source_audio_url.
25
+
26
+ Returns:
27
+ The completed speech-to-text response.
28
+ """
29
+ task = self.create(options=options, **params)
30
+ return self._poll_until_complete(lambda: self.get(task.id, options=options))
31
+
32
+ def create(self, options: Optional[RequestOptions] = None, **params: Any) -> Any:
33
+ """Create a speech-to-text task and return immediately with an id.
34
+
35
+ Args:
36
+ **params: Transcription parameters including model and source_audio_url.
37
+
38
+ Returns:
39
+ The task creation result with an id.
40
+ """
41
+ compacted = self._compact_params(params)
42
+ return self._request("post", self.ENDPOINT, body=compacted, options=options)
43
+
44
+ def get(self, id: str, options: Optional[RequestOptions] = None) -> Any:
45
+ """Fetch the current status of a speech-to-text task.
46
+
47
+ Args:
48
+ id: Task id.
49
+
50
+ Returns:
51
+ The current speech-to-text status.
52
+ """
53
+ return self._request("get", f"{self.ENDPOINT}/{id}", options=options)
@@ -0,0 +1,13 @@
1
+ from runapi.core import TaskResponse, optional, required
2
+
3
+ class SpeechToTextResponse(TaskResponse):
4
+ text = optional(str)
5
+ duration = optional(float)
6
+ url = optional(str)
7
+ expires_at = optional(str)
8
+
9
+ class CompletedSpeechToTextResponse(SpeechToTextResponse):
10
+ text = required(str)
11
+ duration = required(float)
12
+ url = required(str)
13
+ expires_at = required(str)
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.5
2
+ Name: runapi-nemotron
3
+ Version: 0.1.1
4
+ Summary: RunAPI Nemotron SDK for speech-to-text integration
5
+ Project-URL: Homepage, https://runapi.ai/models/nemotron
6
+ Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
7
+ Project-URL: Source, https://github.com/runapi-ai/nemotron-sdk
8
+ Project-URL: Issues, https://github.com/runapi-ai/nemotron-sdk/issues
9
+ Project-URL: Changelog, https://github.com/runapi-ai/nemotron-sdk/blob/main/CHANGELOG.md
10
+ Project-URL: Release Notes, https://github.com/runapi-ai/nemotron-sdk/releases/tag/python%2Fv0.1.1
11
+ Author-email: RunAPI <contact@runapi.ai>
12
+ License-Expression: Apache-2.0
13
+ License-File: LICENSE
14
+ Keywords: api,audio,golang,java,maven,nemotron,python,ruby,runapi,runapi-ai,sdk,speech-to-text,transcription,typescript
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: runapi-core~=0.12.0
23
+ Description-Content-Type: text/markdown
24
+
25
+ # Nemotron SDK for RunAPI
26
+
27
+ Transcribe audio with Nemotron 3.5 through the asynchronous speech-to-text API.
28
+ Create a task with `model: "nemotron-3.5-transcribe"` and `source_audio_url`, then fetch its result by task ID.
29
+ Optional `timestamps` includes word timestamps and `target_language` selects the transcription language. Omit `target_language` when `timestamps` is true.
30
+ Completed results contain `text`, fractional-second `duration`, a transcript `url`, and `expires_at`.
31
+
32
+ [Model documentation](https://runapi.ai/models/nemotron) · [Pricing](https://runapi.ai/models/nemotron) · [SDK guide](https://runapi.ai/docs/resources/sdks)
33
+
34
+ ```sh
35
+ pip install runapi-nemotron
36
+ ```
@@ -0,0 +1,10 @@
1
+ runapi/nemotron/__init__.py,sha256=lpIyrWFBVysouyoH2nA-vs5lYiDyCIlufDj7_QEz2_o,466
2
+ runapi/nemotron/client.py,sha256=f7qW-4xDmFTlK-InEvcZ0odQ7xuUfns_xLlobRqOPzI,388
3
+ runapi/nemotron/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ runapi/nemotron/types.py,sha256=k6AVx6XcEqYOddvqecg3YOsK5pkq9VzHC00MfvrgH4I,382
5
+ runapi/nemotron/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ runapi/nemotron/resources/speech_to_text.py,sha256=f5uRewx_srKVGj6mGvff3NnsK0qtHFotVpGDKZYurbo,1766
7
+ runapi_nemotron-0.1.1.dist-info/METADATA,sha256=XPgWzsdEcMNTxcQA-C-oXPDAg4GoyRZux-QPMz5vUjE,1855
8
+ runapi_nemotron-0.1.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
9
+ runapi_nemotron-0.1.1.dist-info/licenses/LICENSE,sha256=WgM-9PQPNsrN_FYBLsSajjvL-bi_9PDI3sTgR1mbdNY,1063
10
+ runapi_nemotron-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 RunAPI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.