Skip to content

Commit 759ab50

Browse files
Merge pull request #54 from JigsawStack/rm/tts-promptEngine
rm tts and promptEngine
2 parents a35eb29 + 35feeb2 commit 759ab50

File tree

7 files changed

+4
-591
lines changed

7 files changed

+4
-591
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ test_web.py
2323
.eggs/
2424
.conda/
2525

26+
2627
main.py
2728
.python-version
2829
pyproject.toml
2930
uv.lock
3031

31-
.ruff_cache/
32+
.ruff_cache/

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ To learn more about all available JigsawStack AI services, view the [Documentati
1818
| ----------------- | -------------------------------------------------- |
1919
| **👉 General** | Translation, Summarization, Sentiment Analysis |
2020
| **🌐 Web** | AI Web Scraping, AI Web Search |
21-
| **🎵 Audio** | Text to Speech, Speech to Text |
21+
| **🎵 Audio** | Speech to Text |
2222
| **👀 Vision** | vOCR, Object Detection |
23-
| **🧠 LLMs** | Prompt Engine |
2423
| **🖼️ Generative** | AI Image (Flux, SD, SDXL-Fast & more), HTML to Any |
2524
| **✅ Validation** | Email, NSFW images, profanity & more |
2625

@@ -58,13 +57,6 @@ params = {
5857
result = jigsaw.web.ai_scrape(params)
5958
```
6059

61-
Text To Speech Example:
62-
63-
```py
64-
params = {"text": "Hello, how are you doing?"}
65-
result = jigsaw.audio.text_to_speech(params)
66-
```
67-
6860
Speech To Text Example:
6961

7062
```py

jigsawstack/__init__.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from .sentiment import Sentiment, AsyncSentiment
1212
from .validate import Validate, AsyncValidate
1313
from .summary import Summary, AsyncSummary
14-
from .prompt_engine import PromptEngine, AsyncPromptEngine
1514
from .embedding import Embedding, AsyncEmbedding
1615
from .exceptions import JigsawStackError
1716
from .image_generation import ImageGeneration, AsyncImageGeneration
@@ -25,7 +24,6 @@ class JigsawStack:
2524
file: Store
2625
web: Web
2726
search: Search
28-
prompt_engine: PromptEngine
2927
classification: Classification
3028
api_key: str
3129
api_url: str
@@ -104,11 +102,6 @@ def __init__(
104102
disable_request_logging=disable_request_logging,
105103
)
106104

107-
self.prompt_engine = PromptEngine(
108-
api_key=api_key,
109-
api_url=api_url,
110-
disable_request_logging=disable_request_logging,
111-
)
112105
self.embedding = Embedding(
113106
api_key=api_key,
114107
api_url=api_url,
@@ -135,7 +128,6 @@ class AsyncJigsawStack:
135128
vision: AsyncVision
136129
image_generation: AsyncImageGeneration
137130
store: AsyncStore
138-
prompt_engine: AsyncPromptEngine
139131
api_key: str
140132
api_url: str
141133
disable_request_logging: bool
@@ -220,11 +212,7 @@ def __init__(
220212
disable_request_logging=disable_request_logging,
221213
)
222214

223-
self.prompt_engine = AsyncPromptEngine(
224-
api_key=api_key,
225-
api_url=api_url,
226-
disable_request_logging=disable_request_logging,
227-
)
215+
228216
self.embedding = AsyncEmbedding(
229217
api_key=api_key,
230218
api_url=api_url,

jigsawstack/audio.py

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,6 @@
99
from .helpers import build_path
1010

1111

12-
class TextToSpeechParams(TypedDict):
13-
text: str
14-
accent: NotRequired[SupportedAccents]
15-
speaker_clone_url: NotRequired[str]
16-
speaker_clone_file_store_key: NotRequired[str]
17-
return_type: NotRequired[Literal["url", "binary", "base64"]]
18-
19-
20-
class TTSCloneParams(TypedDict):
21-
url: NotRequired[str]
22-
file_store_key: NotRequired[str]
23-
name: str
24-
25-
26-
class ListTTSVoiceClonesParams(TypedDict):
27-
limit: NotRequired[int]
28-
page: NotRequired[int]
29-
30-
31-
class TextToSpeechResponse(TypedDict):
32-
success: bool
33-
text: str
34-
chunks: List[object]
35-
3612

3713
class SpeechToTextParams(TypedDict):
3814
url: NotRequired[str]
@@ -115,51 +91,6 @@ def speech_to_text(
11591
).perform_with_content()
11692
return resp
11793

118-
def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
119-
path = "/ai/tts"
120-
resp = Request(
121-
config=self.config,
122-
path=path,
123-
params=cast(Dict[Any, Any], params),
124-
verb="post",
125-
).perform_with_content()
126-
return resp
127-
128-
def speaker_voice_accents(self) -> TextToSpeechResponse:
129-
path = "/ai/tts"
130-
resp = Request(
131-
config=self.config, path=path, params={}, verb="get"
132-
).perform_with_content()
133-
return resp
134-
135-
def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
136-
path = "/ai/tts/clone"
137-
resp = Request(
138-
config=self.config,
139-
path=path,
140-
params=cast(Dict[Any, Any], params),
141-
verb="post",
142-
).perform_with_content()
143-
144-
return resp
145-
146-
def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
147-
path = "/ai/tts/clone"
148-
resp = Request(
149-
config=self.config,
150-
path=path,
151-
params=cast(Dict[Any, Any], params),
152-
verb="get",
153-
).perform_with_content()
154-
return resp
155-
156-
def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
157-
path = f"/ai/tts/clone/{voice_id}"
158-
resp = Request(
159-
config=self.config, path=path, params={}, verb="delete"
160-
).perform_with_content()
161-
return resp
162-
16394

16495
class AsyncAudio(ClientConfig):
16596
config: AsyncRequestConfig
@@ -215,51 +146,3 @@ async def speech_to_text(
215146
).perform_with_content()
216147
return resp
217148

218-
async def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
219-
path = "/ai/tts"
220-
resp = await AsyncRequest(
221-
config=self.config,
222-
path=path,
223-
params=cast(Dict[Any, Any], params),
224-
verb="post",
225-
).perform_with_content()
226-
return resp
227-
228-
async def speaker_voice_accents(self) -> TextToSpeechResponse:
229-
path = "/ai/tts"
230-
resp = await AsyncRequest(
231-
config=self.config,
232-
path=path,
233-
params={},
234-
verb="get",
235-
).perform_with_content()
236-
return resp
237-
238-
async def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
239-
path = "/ai/tts/clone"
240-
resp = await AsyncRequest(
241-
config=self.config,
242-
path=path,
243-
params=cast(Dict[Any, Any], params),
244-
verb="post",
245-
).perform_with_content()
246-
return resp
247-
248-
async def list_clones(
249-
self, params: ListTTSVoiceClonesParams
250-
) -> TextToSpeechResponse:
251-
path = "/ai/tts/clone"
252-
resp = await AsyncRequest(
253-
config=self.config,
254-
path=path,
255-
params=cast(Dict[Any, Any], params),
256-
verb="get",
257-
).perform_with_content()
258-
return resp
259-
260-
async def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
261-
path = f"/ai/tts/clone/{voice_id}"
262-
resp = await AsyncRequest(
263-
config=self.config, path=path, params={}, verb="delete"
264-
).perform_with_content()
265-
return resp

0 commit comments

Comments
 (0)