Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ test_web.py
.eggs/
.conda/


main.py
.python-version
pyproject.toml
uv.lock

.ruff_cache/
.ruff_cache/
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ To learn more about all available JigsawStack AI services, view the [Documentati
| ----------------- | -------------------------------------------------- |
| **👉 General** | Translation, Summarization, Sentiment Analysis |
| **🌐 Web** | AI Web Scraping, AI Web Search |
| **🎵 Audio** | Text to Speech, Speech to Text |
| **🎵 Audio** | Speech to Text |
| **👀 Vision** | vOCR, Object Detection |
| **🧠 LLMs** | Prompt Engine |
| **🖼️ Generative** | AI Image (Flux, SD, SDXL-Fast & more), HTML to Any |
| **✅ Validation** | Email, NSFW images, profanity & more |

Expand Down Expand Up @@ -58,13 +57,6 @@ params = {
result = jigsaw.web.ai_scrape(params)
```

Text To Speech Example:

```py
params = {"text": "Hello, how are you doing?"}
result = jigsaw.audio.text_to_speech(params)
```

Speech To Text Example:

```py
Expand Down
14 changes: 1 addition & 13 deletions jigsawstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .sentiment import Sentiment, AsyncSentiment
from .validate import Validate, AsyncValidate
from .summary import Summary, AsyncSummary
from .prompt_engine import PromptEngine, AsyncPromptEngine
from .embedding import Embedding, AsyncEmbedding
from .exceptions import JigsawStackError
from .image_generation import ImageGeneration, AsyncImageGeneration
Expand All @@ -25,7 +24,6 @@ class JigsawStack:
file: Store
web: Web
search: Search
prompt_engine: PromptEngine
classification: Classification
api_key: str
api_url: str
Expand Down Expand Up @@ -104,11 +102,6 @@ def __init__(
disable_request_logging=disable_request_logging,
)

self.prompt_engine = PromptEngine(
api_key=api_key,
api_url=api_url,
disable_request_logging=disable_request_logging,
)
self.embedding = Embedding(
api_key=api_key,
api_url=api_url,
Expand All @@ -135,7 +128,6 @@ class AsyncJigsawStack:
vision: AsyncVision
image_generation: AsyncImageGeneration
store: AsyncStore
prompt_engine: AsyncPromptEngine
api_key: str
api_url: str
disable_request_logging: bool
Expand Down Expand Up @@ -220,11 +212,7 @@ def __init__(
disable_request_logging=disable_request_logging,
)

self.prompt_engine = AsyncPromptEngine(
api_key=api_key,
api_url=api_url,
disable_request_logging=disable_request_logging,
)

self.embedding = AsyncEmbedding(
api_key=api_key,
api_url=api_url,
Expand Down
117 changes: 0 additions & 117 deletions jigsawstack/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,6 @@
from .helpers import build_path


class TextToSpeechParams(TypedDict):
text: str
accent: NotRequired[SupportedAccents]
speaker_clone_url: NotRequired[str]
speaker_clone_file_store_key: NotRequired[str]
return_type: NotRequired[Literal["url", "binary", "base64"]]


class TTSCloneParams(TypedDict):
url: NotRequired[str]
file_store_key: NotRequired[str]
name: str


class ListTTSVoiceClonesParams(TypedDict):
limit: NotRequired[int]
page: NotRequired[int]


class TextToSpeechResponse(TypedDict):
success: bool
text: str
chunks: List[object]


class SpeechToTextParams(TypedDict):
url: NotRequired[str]
Expand Down Expand Up @@ -115,51 +91,6 @@ def speech_to_text(
).perform_with_content()
return resp

def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
path = "/ai/tts"
resp = Request(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="post",
).perform_with_content()
return resp

def speaker_voice_accents(self) -> TextToSpeechResponse:
path = "/ai/tts"
resp = Request(
config=self.config, path=path, params={}, verb="get"
).perform_with_content()
return resp

def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = Request(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="post",
).perform_with_content()

return resp

def list_clones(self, params: ListTTSVoiceClonesParams) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = Request(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="get",
).perform_with_content()
return resp

def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
path = f"/ai/tts/clone/{voice_id}"
resp = Request(
config=self.config, path=path, params={}, verb="delete"
).perform_with_content()
return resp


class AsyncAudio(ClientConfig):
config: AsyncRequestConfig
Expand Down Expand Up @@ -215,51 +146,3 @@ async def speech_to_text(
).perform_with_content()
return resp

async def text_to_speech(self, params: TextToSpeechParams) -> TextToSpeechResponse:
path = "/ai/tts"
resp = await AsyncRequest(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="post",
).perform_with_content()
return resp

async def speaker_voice_accents(self) -> TextToSpeechResponse:
path = "/ai/tts"
resp = await AsyncRequest(
config=self.config,
path=path,
params={},
verb="get",
).perform_with_content()
return resp

async def create_clone(self, params: TTSCloneParams) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = await AsyncRequest(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="post",
).perform_with_content()
return resp

async def list_clones(
self, params: ListTTSVoiceClonesParams
) -> TextToSpeechResponse:
path = "/ai/tts/clone"
resp = await AsyncRequest(
config=self.config,
path=path,
params=cast(Dict[Any, Any], params),
verb="get",
).perform_with_content()
return resp

async def delete_clone(self, voice_id: str) -> TextToSpeechResponse:
path = f"/ai/tts/clone/{voice_id}"
resp = await AsyncRequest(
config=self.config, path=path, params={}, verb="delete"
).perform_with_content()
return resp
Loading