Skip to content

Commit 22a74aa

Browse files
committed
rm tts and promptEngine
1 parent 33fd9b1 commit 22a74aa

File tree

7 files changed

+8
-577
lines changed

7 files changed

+8
-577
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ test.py
2121
test_web.py
2222

2323
.eggs/
24-
.conda/
24+
.conda/
25+
26+
.python-version
27+
main.py
28+
pyproject.toml
29+
uv.lock

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
@@ -24,7 +23,6 @@ class JigsawStack:
2423
file: Store
2524
web: Web
2625
search: Search
27-
prompt_engine: PromptEngine
2826
api_key: str
2927
api_url: str
3028
disable_request_logging: bool
@@ -102,11 +100,6 @@ def __init__(
102100
disable_request_logging=disable_request_logging,
103101
)
104102

105-
self.prompt_engine = PromptEngine(
106-
api_key=api_key,
107-
api_url=api_url,
108-
disable_request_logging=disable_request_logging,
109-
)
110103
self.embedding = Embedding(
111104
api_key=api_key,
112105
api_url=api_url,
@@ -127,7 +120,6 @@ class AsyncJigsawStack:
127120
vision: AsyncVision
128121
image_generation: AsyncImageGeneration
129122
store: AsyncStore
130-
prompt_engine: AsyncPromptEngine
131123
api_key: str
132124
api_url: str
133125
disable_request_logging: bool
@@ -212,11 +204,7 @@ def __init__(
212204
disable_request_logging=disable_request_logging,
213205
)
214206

215-
self.prompt_engine = AsyncPromptEngine(
216-
api_key=api_key,
217-
api_url=api_url,
218-
disable_request_logging=disable_request_logging,
219-
)
207+
220208
self.embedding = AsyncEmbedding(
221209
api_key=api_key,
222210
api_url=api_url,

jigsawstack/audio.py

Lines changed: 0 additions & 103 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]
@@ -102,36 +78,6 @@ def speech_to_text(self, blob: Union[SpeechToTextParams, bytes], options: Option
10278
resp = Request(config=self.config, path=path, params=options, data=blob, headers=headers, verb="post").perform_with_content()
10379
return resp
10480

105-
def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
106-
path = "/ai/tts"
107-
resp = Request(
108-
config=self.config,
109-
path=path,
110-
params=cast(Dict[Any, Any], params),
111-
verb="post",
112-
).perform_with_content()
113-
return resp
114-
115-
def speaker_voice_accents(self) -> TextToSpeechResponse:
116-
path = "/ai/tts"
117-
resp = Request(config=self.config, path=path, params={}, verb="get").perform_with_content()
118-
return resp
119-
120-
def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
121-
path = "/ai/tts/clone"
122-
resp = Request(config=self.config, path=path, params=cast(Dict[Any, Any], params), verb="post").perform_with_content()
123-
124-
return resp
125-
126-
def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
127-
path = "/ai/tts/clone"
128-
resp = Request(config=self.config, path=path, params=cast(Dict[Any, Any], params), verb="get").perform_with_content()
129-
return resp
130-
131-
def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
132-
path = f"/ai/tts/clone/{voice_id}"
133-
resp = Request(config=self.config, path=path, params={}, verb="delete").perform_with_content()
134-
return resp
13581

13682

13783
class AsyncAudio(ClientConfig):
@@ -186,52 +132,3 @@ async def speech_to_text(
186132
).perform_with_content()
187133
return resp
188134

189-
async def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
190-
path = "/ai/tts"
191-
resp = await AsyncRequest(
192-
config=self.config,
193-
path=path,
194-
params=cast(Dict[Any, Any], params),
195-
verb="post",
196-
).perform_with_content()
197-
return resp
198-
199-
async def speaker_voice_accents(self) -> TextToSpeechResponse:
200-
path = "/ai/tts"
201-
resp = await AsyncRequest(
202-
config=self.config,
203-
path=path,
204-
params={},
205-
verb="get",
206-
).perform_with_content()
207-
return resp
208-
209-
async def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
210-
path = "/ai/tts/clone"
211-
resp = await AsyncRequest(
212-
config=self.config,
213-
path=path,
214-
params=cast(Dict[Any, Any], params),
215-
verb="post"
216-
).perform_with_content()
217-
return resp
218-
219-
async def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
220-
path = "/ai/tts/clone"
221-
resp = await AsyncRequest(
222-
config=self.config,
223-
path=path,
224-
params=cast(Dict[Any, Any], params),
225-
verb="get"
226-
).perform_with_content()
227-
return resp
228-
229-
async def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
230-
path = f"/ai/tts/clone/{voice_id}"
231-
resp = await AsyncRequest(
232-
config=self.config,
233-
path=path,
234-
params={},
235-
verb="delete"
236-
).perform_with_content()
237-
return resp

0 commit comments

Comments
 (0)