AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.
Project description
ask-ai
🌍 Readme:
English ·
فارسی ·
中文 ·
Türkçe ·
العربية ·
Русский ·
Español ·
日本語
AI Made Simple.
One unified Python client for OpenAI, Claude, Gemini, Groq & more.
Stop rewriting AI code for every provider. Use one line. Switch models anytime.
⚡ Why ask-ai?
- No SDK lock-in: Don't learn 5 different libraries. Learn one.
- Unified API:
ai.ask()works for text, images, and audio across all providers. - Production Ready: Built-in type safety, error handling, and environment management.
- Zero-Config: Auto-detects API keys from your environment.
🚀 The Golden Example
See the power of ask-ai in 3 lines of code:
from ask_ai import OpenAI, Anthropic, Google
prompt = "Explain quantum computing in one sentence."
# Switch providers instantly
print("OpenAI: ", OpenAI().ask(prompt))
print("Claude: ", Anthropic().ask(prompt))
print("Gemini: ", Google().ask(prompt))
📦 Installation
pip install askai-python
📖 Quick Start
1. Setup
Export your API keys (or pass them explicitly).
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
2. Standard Usage
from ask_ai import OpenAI
ai = OpenAI()
print(ai.ask("Hello, World!"))
3. Advanced Usage
Control temperature, top_p, and system personas for professional results.
ai.advanced(
temperature=0.7,
prompt="You are a senior DevOps engineer."
)
print(ai.ask("How do I optimize a Dockerfile?"))
🔌 Supported Providers
| Provider | Class | Feature Set |
|---|---|---|
| OpenAI | OpenAI |
All Models (GPT-4o, o1, etc.) |
| Anthropic | Anthropic |
All Models (Claude 3.5, Opus) |
Google |
All Models (Gemini 1.5 Pro/Flash) | |
| Groq | Groq |
All Models (Llama 3, Mixtral) |
| Azure | Azure |
All Deployments |
| OpenRouter | OpenRouter |
All Models (100+) |
⭐ Support the Project
If this project saved you time, please consider giving it a star on GitHub! It helps us grow.
Built by Hossein Ghorbani | GitHub.
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
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 askai_python-0.1.2.tar.gz.
File metadata
- Download URL: askai_python-0.1.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
712c2134aa1063de0a74ae86293c4963373c198659d5e63395efd950827d921a
|
|
| MD5 |
b997c711b09b323fcea3464843f8c723
|
|
| BLAKE2b-256 |
df3adb9926a5bc76b4b4c3758a6fc1e1d9000594a62dadfcaa75d3b50dcc3377
|
File details
Details for the file askai_python-0.1.2-py3-none-any.whl.
File metadata
- Download URL: askai_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62abe0e6c8a29517a9919d3d262502bfa70b57bc4220c64b07a86e7cc1046e68
|
|
| MD5 |
f47a4d07b4da275ee5e83e3f7ac9cd70
|
|
| BLAKE2b-256 |
026e04af90280eea4543406a88a6becc20beba5a66ce3ef1ac5b8f4c83b8ff0e
|