Skip to main content

A Python client for the DeepAI API with support for chat completions, TTS, STT, and image generation

Project description

DeepAI Python Client

PyPI version Python 3.8+ License: MIT

โš ๏ธ 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 assistant
  • goku: Dragon Ball Z Goku personality
  • gojo_9: Jujutsu Kaisen Gojo Satoru
  • ai-code: Programming-focused responses
  • mathematics: 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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run tests: pytest
  5. 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:

  1. Check the documentation
  2. Look through existing issues
  3. Create a new issue with detailed information

Made with โค๏ธ for the AI community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepai_python-0.0.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepai_python-0.0.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

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

Hashes for deepai_python-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1dcd46901a201bb87c4955644a81d36ed8a7aec2a327976dd6d598bc1b870212
MD5 ce4220fefc0aa60ee55c7cf9391f6f10
BLAKE2b-256 cf84affd3e1db7a9ce53929f5e8d09ce1fbcaac7907d93ce8a15bb8939978b17

See more details on using hashes here.

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

Hashes for deepai_python-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c1b3fc7edc20bc75ce8e036238f1eccf5b4d274ef6a21aa1a7e7d64292607a6
MD5 e1f45ee8fb32b58177a28cfbf4948f45
BLAKE2b-256 a27db48924be625662f6757ee959606b7ea78387f1914fd017c947703ac73125

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page