A Python client for the DeepAI API with support for chat completions, TTS, STT, and image generation
Project description
DeepAI Python Client
โ ๏ธ Educational Purpose Notice
This package is created solely for educational and learning purposes. It is designed to help developers understand API integration, Python package development, and programming concepts.
If you represent any organization or service and have concerns about this educational project, please feel free to reach out to us politely. We are committed to resolving any issues through friendly communication and will gladly address your concerns or remove the package if requested. No legal proceedings are necessary - just send us a message!
A comprehensive Python client for the DeepAI API, providing easy access to chat completions, text-to-speech, speech-to-text, and image generation services.
๐ Features
- Chat Completions: OpenAI-compatible interface with multiple models (
standard,online,math) - Character Chat Styles: Over 50+ character styles including
goku,gojo_9,ai-code,mathematics - Text-to-Speech (TTS): Convert text to natural speech
- Speech-to-Text (STT): Transcribe audio files to text
- Image Generation: Create images from text descriptions
- Async Support: Full async/await support for all operations
- Session Management: Automatic chat history management
- File Uploads: Support for multipart file uploads
- Type Safety: Full TypeScript-style type hints
๐ฆ Installation
pip install deepai-python
For development:
pip install deepai-python[dev]
๐ง Quick Start
Basic Chat Completion
from deepai import DeepAI
client = DeepAI()
response = client.chat.completions.create(
model="standard",
chat_style="chatgpt-alternative",
messages=[{"role": "user", "content": "Hello, how are you?"}]
)
print(response['choices'][0]['message']['content'])
Character Chat (Anime Style)
response = client.chat.completions.create(
model="standard",
chat_style="goku", # Dragon Ball Z Goku style
messages=[{"role": "user", "content": "Tell me about your training!"}]
)
Math Problems
from deepai import ChatMath
math_client = ChatMath(api_key="your-api-key")
response = math_client.create(
messages=[{"role": "user", "content": "What is 25 ร 35? Show steps."}],
model="math"
)
Text-to-Speech
from deepai import TextToSpeech
tts = TextToSpeech(api_key="your-api-key")
audio_response = tts.speak(
text="Hello, this is a test of text to speech!",
voice="en-US-AriaNeural"
)
# Save audio file
with open("output.wav", "wb") as f:
f.write(audio_response['audio_data'])
Async Usage
import asyncio
from deepai import AsyncDeepAI
async def main():
client = AsyncDeepAI()
response = await client.chat.completions.create(
model="online",
chat_style="ai-code",
messages=[{"role": "user", "content": "Latest AI news?"}]
)
print(response['choices'][0]['message']['content'])
asyncio.run(main())
๐ Documentation
๐ ๏ธ Available Models
- standard: General-purpose chat model
- online: Web-enabled model with real-time information
- math: Specialized model for mathematical problems
๐ญ Popular Chat Styles
chatgpt-alternative: Standard AI assistantgoku: Dragon Ball Z Goku personalitygojo_9: Jujutsu Kaisen Gojo Satoruai-code: Programming-focused responsesmathematics: Math-oriented explanations- And 50+ more characters and styles!
๐ Project Structure
deepai-package/
โโโ src/deepai/ # Main package
โ โโโ clients/ # Client implementations
โ โ โโโ sync.py # Synchronous clients
โ โ โโโ async_client.py # Asynchronous clients
โ โ โโโ specialized.py # Specialized clients
โ โโโ utils/ # Utility modules
โ โ โโโ types.py # Type definitions
โ โ โโโ helpers.py # Helper functions
โ โโโ __init__.py # Package exports
โโโ tests/ # Test suite
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
โโโ pyproject.toml # Project configuration
๐งช Testing
# Run tests
pytest
# Run with coverage
pytest --cov=src/deepai
# Run specific test
pytest tests/test_chat.py
๐ค Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run tests:
pytest - Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
๐ก Support
If you encounter any issues or have questions, please:
- Check the documentation
- Look through existing issues
- Create a new issue with detailed information
Made with โค๏ธ for the AI community
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 deepai_python-0.0.1.tar.gz.
File metadata
- Download URL: deepai_python-0.0.1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dcd46901a201bb87c4955644a81d36ed8a7aec2a327976dd6d598bc1b870212
|
|
| MD5 |
ce4220fefc0aa60ee55c7cf9391f6f10
|
|
| BLAKE2b-256 |
cf84affd3e1db7a9ce53929f5e8d09ce1fbcaac7907d93ce8a15bb8939978b17
|
File details
Details for the file deepai_python-0.0.1-py3-none-any.whl.
File metadata
- Download URL: deepai_python-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1b3fc7edc20bc75ce8e036238f1eccf5b4d274ef6a21aa1a7e7d64292607a6
|
|
| MD5 |
e1f45ee8fb32b58177a28cfbf4948f45
|
|
| BLAKE2b-256 |
a27db48924be625662f6757ee959606b7ea78387f1914fd017c947703ac73125
|