A Python SDK for Inworld
Project description
inworld-sdk
A Python SDK for interacting with Inworld's platform.
Description
This SDK provides a Python interface for working with Inworld's services, making it easy to integrate AI characters into your applications.
Currently, this SDK only supports the TTS API.
Installation
You can install the package using pip:
pip install inworld-sdk
For development installation:
# Clone the repository
git clone https://github.com/MichaelSolati/inworld-sdk-python.git
cd inworld-sdk-python
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows, use: .\venv\Scripts\activate
# Install the package in development mode with all dependencies
pip install -e .
Basic Usage
import asyncio
import base64
import io
import simpleaudio as sa
from inworld_sdk import InworldClient
async def main():
# Initialize the client
client = InworldClient(api_key="<YOUR_API_KEY>")
# Example: Get voices
voices = await client.tts.voices()
print(voices)
# Example: Synthesize and play speech
text = "Hello! This is a test of the Inworld TTS system."
synthesizedSpeech = await client.tts.synthesizeSpeech(text)
audio_content = synthesizedSpeech.get("audioContent")
decoded_audio = base64.b64decode(audio_content)
wav_file = io.BytesIO(decoded_audio)
play_obj = sa.WaveObject.from_wave_file(wav_file)
play_obj.play().wait_done()
if __name__ == "__main__":
asyncio.run(main())
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inworld_sdk-0.6.0.tar.gz.
File metadata
- Download URL: inworld_sdk-0.6.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4f5630b49ae03216a6c18cc1b7517667c1783d5663b7a44d2996a117baec5aa
|
|
| MD5 |
52c59f1f94f6723b8ef18df28e2d8597
|
|
| BLAKE2b-256 |
643bc123f72e290dd002055c435e67cfd6fb23bd3bee9d397bf2995f8ee67fb7
|
Provenance
The following attestation bundles were made for inworld_sdk-0.6.0.tar.gz:
Publisher:
release.yml on MichaelSolati/inworld-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inworld_sdk-0.6.0.tar.gz -
Subject digest:
c4f5630b49ae03216a6c18cc1b7517667c1783d5663b7a44d2996a117baec5aa - Sigstore transparency entry: 243715010
- Sigstore integration time:
-
Permalink:
MichaelSolati/inworld-sdk-python@673bbdcad85aff26956722f8922b2d3a6aeb4e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/MichaelSolati
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@673bbdcad85aff26956722f8922b2d3a6aeb4e93 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file inworld_sdk-0.6.0-py3-none-any.whl.
File metadata
- Download URL: inworld_sdk-0.6.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fa08685b0fcef4342722b6893891281a2139b5e7dac2c453e01755ea692c112
|
|
| MD5 |
6b6a88f24aa87a70a4f380c4703cbde4
|
|
| BLAKE2b-256 |
6803b0fee7abd94eec0e282979cf2404aa56c4c8424e643d91e6adf32a8ed51c
|
Provenance
The following attestation bundles were made for inworld_sdk-0.6.0-py3-none-any.whl:
Publisher:
release.yml on MichaelSolati/inworld-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inworld_sdk-0.6.0-py3-none-any.whl -
Subject digest:
8fa08685b0fcef4342722b6893891281a2139b5e7dac2c453e01755ea692c112 - Sigstore transparency entry: 243715012
- Sigstore integration time:
-
Permalink:
MichaelSolati/inworld-sdk-python@673bbdcad85aff26956722f8922b2d3a6aeb4e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/MichaelSolati
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@673bbdcad85aff26956722f8922b2d3a6aeb4e93 -
Trigger Event:
workflow_dispatch
-
Statement type: