askai-python 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- askai_python-0.1.3/PKG-INFO +134 -0
- askai_python-0.1.3/PYPI_README.md +116 -0
- askai_python-0.1.3/askai_python.egg-info/PKG-INFO +134 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/askai_python.egg-info/SOURCES.txt +1 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/pyproject.toml +2 -2
- askai_python-0.1.2/PKG-INFO +0 -129
- askai_python-0.1.2/askai_python.egg-info/PKG-INFO +0 -129
- {askai_python-0.1.2 → askai_python-0.1.3}/LICENSE +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/README.md +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/__init__.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/__main__.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/base.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/cli.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/config.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/exceptions.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/media.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/__init__.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/anthropic_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/azure_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/google_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/groq_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/openai_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/ask_ai/providers/openrouter_provider.py +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/askai_python.egg-info/dependency_links.txt +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/askai_python.egg-info/requires.txt +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/askai_python.egg-info/top_level.txt +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/setup.cfg +0 -0
- {askai_python-0.1.2 → askai_python-0.1.3}/tests/test_core.py +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: askai-python
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.
|
|
5
|
+
Author-email: Hossein Ghorbani <hosseingh1068@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://hosseinghorbani0.ir/
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/Hosseinghorbani0/ask-ai/issues
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: openai>=1.0.0
|
|
13
|
+
Requires-Dist: groq
|
|
14
|
+
Requires-Dist: google-generativeai
|
|
15
|
+
Requires-Dist: anthropic
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# askai-python 🚀
|
|
20
|
+
|
|
21
|
+
**AI Made Stupid Simple.** One unified Python client for OpenAI, Claude, Gemini, Groq, and Azure.
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/askai-python/)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
[](https://github.com/Hosseinghorbani0/ask-ai)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ⚡ What is askai-python?
|
|
30
|
+
|
|
31
|
+
`askai-python` is a lightweight, zero-dependency-logic wrapper that provides a **single API** for all major AI providers. Stop learning multiple SDKs; just call `.ask()` and get your answer.
|
|
32
|
+
|
|
33
|
+
- **Unified Interface**: One syntax for OpenAI, Anthropic, Google, and more.
|
|
34
|
+
- **Zero-Config**: Seamlessly uses environment variables for API keys.
|
|
35
|
+
- **Smart Media**: Easy handling of images and audio (Provider permitting).
|
|
36
|
+
- **Production Grade**: Built-in robust error handling and type hints.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install askai-python
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚀 Examples & Tutorials
|
|
49
|
+
|
|
50
|
+
### 1. Basic Usage (The 3-Line Magic)
|
|
51
|
+
```python
|
|
52
|
+
from ask_ai import OpenAI
|
|
53
|
+
|
|
54
|
+
ai = OpenAI() # Auto-loads OPENAI_API_KEY from env
|
|
55
|
+
print(ai.ask("What is the capital of France?").text)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Multi-Provider Mastery
|
|
59
|
+
Switching between top-tier models has never been easier:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from ask_ai import OpenAI, Anthropic, Google
|
|
63
|
+
|
|
64
|
+
prompt = "Explain quantum computing to a 5-year-old."
|
|
65
|
+
|
|
66
|
+
# OpenAI (GPT-4o)
|
|
67
|
+
print(OpenAI().ask(prompt).text)
|
|
68
|
+
|
|
69
|
+
# Anthropic (Claude 3.5 Sonnet)
|
|
70
|
+
print(Anthropic().ask(prompt).text)
|
|
71
|
+
|
|
72
|
+
# Google (Gemini 1.5 Pro)
|
|
73
|
+
print(Google().ask(prompt).text)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Advanced Configuration (System Personas)
|
|
77
|
+
You can set a system prompt and temperature globally for an instance or per-request.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from ask_ai import OpenAI
|
|
81
|
+
|
|
82
|
+
ai = OpenAI()
|
|
83
|
+
|
|
84
|
+
# Global config
|
|
85
|
+
ai.advanced(
|
|
86
|
+
prompt="You are a sarcastic robot from the year 3000.",
|
|
87
|
+
temperature=0.9
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
print(ai.ask("What is love?").text)
|
|
91
|
+
|
|
92
|
+
# Per-request override
|
|
93
|
+
print(ai.ask("What is 1+1?", temperature=0.1).text)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Handling Structured Exceptions
|
|
97
|
+
Build reliable apps by catching specific AI errors:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from ask_ai import OpenAI
|
|
101
|
+
from ask_ai.exceptions import AskAIError, APIKeyError
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
ai = OpenAI(api_key="invalid-key")
|
|
105
|
+
ai.ask("Hello")
|
|
106
|
+
except APIKeyError:
|
|
107
|
+
print("Check your API keys!")
|
|
108
|
+
except AskAIError as e:
|
|
109
|
+
print(f"An AI error occurred: {e}")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🔌 Supported Providers
|
|
115
|
+
|
|
116
|
+
| Provider | Class | Capabilities |
|
|
117
|
+
|----------|-------|-------------|
|
|
118
|
+
| **OpenAI** | `OpenAI` | Text, Images (DALL-E), Vision |
|
|
119
|
+
| **Anthropic** | `Anthropic` | Text, Vision (Claude 3.5) |
|
|
120
|
+
| **Google** | `Google` | Text, Images, Video, Audio |
|
|
121
|
+
| **Groq** | `Groq` | Ultra-fast Llama 3 & Mixtral |
|
|
122
|
+
| **Azure** | `Azure` | Enterprise-grade OpenAI |
|
|
123
|
+
| **OpenRouter**| `OpenRouter`| 100+ community models |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🔗 Important Links
|
|
128
|
+
|
|
129
|
+
- **GitHub Repository**: [Hosseinghorbani0/ask-ai](https://github.com/Hosseinghorbani0/ask-ai) (Star us! ⭐)
|
|
130
|
+
- **Official Website**: [hosseinghorbani0.ir](https://hosseinghorbani0.ir/)
|
|
131
|
+
- **Bug Tracker**: [Report an Issue](https://github.com/Hosseinghorbani0/ask-ai/issues)
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
*Built with ❤️ by [Hossein Ghorbani](https://github.com/Hosseinghorbani0).*
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# askai-python 🚀
|
|
2
|
+
|
|
3
|
+
**AI Made Stupid Simple.** One unified Python client for OpenAI, Claude, Gemini, Groq, and Azure.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/askai-python/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/Hosseinghorbani0/ask-ai)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ⚡ What is askai-python?
|
|
12
|
+
|
|
13
|
+
`askai-python` is a lightweight, zero-dependency-logic wrapper that provides a **single API** for all major AI providers. Stop learning multiple SDKs; just call `.ask()` and get your answer.
|
|
14
|
+
|
|
15
|
+
- **Unified Interface**: One syntax for OpenAI, Anthropic, Google, and more.
|
|
16
|
+
- **Zero-Config**: Seamlessly uses environment variables for API keys.
|
|
17
|
+
- **Smart Media**: Easy handling of images and audio (Provider permitting).
|
|
18
|
+
- **Production Grade**: Built-in robust error handling and type hints.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 📦 Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install askai-python
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🚀 Examples & Tutorials
|
|
31
|
+
|
|
32
|
+
### 1. Basic Usage (The 3-Line Magic)
|
|
33
|
+
```python
|
|
34
|
+
from ask_ai import OpenAI
|
|
35
|
+
|
|
36
|
+
ai = OpenAI() # Auto-loads OPENAI_API_KEY from env
|
|
37
|
+
print(ai.ask("What is the capital of France?").text)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Multi-Provider Mastery
|
|
41
|
+
Switching between top-tier models has never been easier:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from ask_ai import OpenAI, Anthropic, Google
|
|
45
|
+
|
|
46
|
+
prompt = "Explain quantum computing to a 5-year-old."
|
|
47
|
+
|
|
48
|
+
# OpenAI (GPT-4o)
|
|
49
|
+
print(OpenAI().ask(prompt).text)
|
|
50
|
+
|
|
51
|
+
# Anthropic (Claude 3.5 Sonnet)
|
|
52
|
+
print(Anthropic().ask(prompt).text)
|
|
53
|
+
|
|
54
|
+
# Google (Gemini 1.5 Pro)
|
|
55
|
+
print(Google().ask(prompt).text)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Advanced Configuration (System Personas)
|
|
59
|
+
You can set a system prompt and temperature globally for an instance or per-request.
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from ask_ai import OpenAI
|
|
63
|
+
|
|
64
|
+
ai = OpenAI()
|
|
65
|
+
|
|
66
|
+
# Global config
|
|
67
|
+
ai.advanced(
|
|
68
|
+
prompt="You are a sarcastic robot from the year 3000.",
|
|
69
|
+
temperature=0.9
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
print(ai.ask("What is love?").text)
|
|
73
|
+
|
|
74
|
+
# Per-request override
|
|
75
|
+
print(ai.ask("What is 1+1?", temperature=0.1).text)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 4. Handling Structured Exceptions
|
|
79
|
+
Build reliable apps by catching specific AI errors:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from ask_ai import OpenAI
|
|
83
|
+
from ask_ai.exceptions import AskAIError, APIKeyError
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
ai = OpenAI(api_key="invalid-key")
|
|
87
|
+
ai.ask("Hello")
|
|
88
|
+
except APIKeyError:
|
|
89
|
+
print("Check your API keys!")
|
|
90
|
+
except AskAIError as e:
|
|
91
|
+
print(f"An AI error occurred: {e}")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🔌 Supported Providers
|
|
97
|
+
|
|
98
|
+
| Provider | Class | Capabilities |
|
|
99
|
+
|----------|-------|-------------|
|
|
100
|
+
| **OpenAI** | `OpenAI` | Text, Images (DALL-E), Vision |
|
|
101
|
+
| **Anthropic** | `Anthropic` | Text, Vision (Claude 3.5) |
|
|
102
|
+
| **Google** | `Google` | Text, Images, Video, Audio |
|
|
103
|
+
| **Groq** | `Groq` | Ultra-fast Llama 3 & Mixtral |
|
|
104
|
+
| **Azure** | `Azure` | Enterprise-grade OpenAI |
|
|
105
|
+
| **OpenRouter**| `OpenRouter`| 100+ community models |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🔗 Important Links
|
|
110
|
+
|
|
111
|
+
- **GitHub Repository**: [Hosseinghorbani0/ask-ai](https://github.com/Hosseinghorbani0/ask-ai) (Star us! ⭐)
|
|
112
|
+
- **Official Website**: [hosseinghorbani0.ir](https://hosseinghorbani0.ir/)
|
|
113
|
+
- **Bug Tracker**: [Report an Issue](https://github.com/Hosseinghorbani0/ask-ai/issues)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
*Built with ❤️ by [Hossein Ghorbani](https://github.com/Hosseinghorbani0).*
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: askai-python
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.
|
|
5
|
+
Author-email: Hossein Ghorbani <hosseingh1068@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://hosseinghorbani0.ir/
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/Hosseinghorbani0/ask-ai/issues
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: openai>=1.0.0
|
|
13
|
+
Requires-Dist: groq
|
|
14
|
+
Requires-Dist: google-generativeai
|
|
15
|
+
Requires-Dist: anthropic
|
|
16
|
+
Requires-Dist: requests
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# askai-python 🚀
|
|
20
|
+
|
|
21
|
+
**AI Made Stupid Simple.** One unified Python client for OpenAI, Claude, Gemini, Groq, and Azure.
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/askai-python/)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
[](https://github.com/Hosseinghorbani0/ask-ai)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ⚡ What is askai-python?
|
|
30
|
+
|
|
31
|
+
`askai-python` is a lightweight, zero-dependency-logic wrapper that provides a **single API** for all major AI providers. Stop learning multiple SDKs; just call `.ask()` and get your answer.
|
|
32
|
+
|
|
33
|
+
- **Unified Interface**: One syntax for OpenAI, Anthropic, Google, and more.
|
|
34
|
+
- **Zero-Config**: Seamlessly uses environment variables for API keys.
|
|
35
|
+
- **Smart Media**: Easy handling of images and audio (Provider permitting).
|
|
36
|
+
- **Production Grade**: Built-in robust error handling and type hints.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install askai-python
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚀 Examples & Tutorials
|
|
49
|
+
|
|
50
|
+
### 1. Basic Usage (The 3-Line Magic)
|
|
51
|
+
```python
|
|
52
|
+
from ask_ai import OpenAI
|
|
53
|
+
|
|
54
|
+
ai = OpenAI() # Auto-loads OPENAI_API_KEY from env
|
|
55
|
+
print(ai.ask("What is the capital of France?").text)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Multi-Provider Mastery
|
|
59
|
+
Switching between top-tier models has never been easier:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from ask_ai import OpenAI, Anthropic, Google
|
|
63
|
+
|
|
64
|
+
prompt = "Explain quantum computing to a 5-year-old."
|
|
65
|
+
|
|
66
|
+
# OpenAI (GPT-4o)
|
|
67
|
+
print(OpenAI().ask(prompt).text)
|
|
68
|
+
|
|
69
|
+
# Anthropic (Claude 3.5 Sonnet)
|
|
70
|
+
print(Anthropic().ask(prompt).text)
|
|
71
|
+
|
|
72
|
+
# Google (Gemini 1.5 Pro)
|
|
73
|
+
print(Google().ask(prompt).text)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Advanced Configuration (System Personas)
|
|
77
|
+
You can set a system prompt and temperature globally for an instance or per-request.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from ask_ai import OpenAI
|
|
81
|
+
|
|
82
|
+
ai = OpenAI()
|
|
83
|
+
|
|
84
|
+
# Global config
|
|
85
|
+
ai.advanced(
|
|
86
|
+
prompt="You are a sarcastic robot from the year 3000.",
|
|
87
|
+
temperature=0.9
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
print(ai.ask("What is love?").text)
|
|
91
|
+
|
|
92
|
+
# Per-request override
|
|
93
|
+
print(ai.ask("What is 1+1?", temperature=0.1).text)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Handling Structured Exceptions
|
|
97
|
+
Build reliable apps by catching specific AI errors:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from ask_ai import OpenAI
|
|
101
|
+
from ask_ai.exceptions import AskAIError, APIKeyError
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
ai = OpenAI(api_key="invalid-key")
|
|
105
|
+
ai.ask("Hello")
|
|
106
|
+
except APIKeyError:
|
|
107
|
+
print("Check your API keys!")
|
|
108
|
+
except AskAIError as e:
|
|
109
|
+
print(f"An AI error occurred: {e}")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🔌 Supported Providers
|
|
115
|
+
|
|
116
|
+
| Provider | Class | Capabilities |
|
|
117
|
+
|----------|-------|-------------|
|
|
118
|
+
| **OpenAI** | `OpenAI` | Text, Images (DALL-E), Vision |
|
|
119
|
+
| **Anthropic** | `Anthropic` | Text, Vision (Claude 3.5) |
|
|
120
|
+
| **Google** | `Google` | Text, Images, Video, Audio |
|
|
121
|
+
| **Groq** | `Groq` | Ultra-fast Llama 3 & Mixtral |
|
|
122
|
+
| **Azure** | `Azure` | Enterprise-grade OpenAI |
|
|
123
|
+
| **OpenRouter**| `OpenRouter`| 100+ community models |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🔗 Important Links
|
|
128
|
+
|
|
129
|
+
- **GitHub Repository**: [Hosseinghorbani0/ask-ai](https://github.com/Hosseinghorbani0/ask-ai) (Star us! ⭐)
|
|
130
|
+
- **Official Website**: [hosseinghorbani0.ir](https://hosseinghorbani0.ir/)
|
|
131
|
+
- **Bug Tracker**: [Report an Issue](https://github.com/Hosseinghorbani0/ask-ai/issues)
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
*Built with ❤️ by [Hossein Ghorbani](https://github.com/Hosseinghorbani0).*
|
|
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "askai-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more."
|
|
9
|
-
readme = "
|
|
9
|
+
readme = "PYPI_README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
11
11
|
license = {text = "MIT"}
|
|
12
12
|
authors = [
|
askai_python-0.1.2/PKG-INFO
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: askai-python
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.
|
|
5
|
-
Author-email: Hossein Ghorbani <hosseingh1068@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://hosseinghorbani0.ir/
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/Hosseinghorbani0/ask-ai/issues
|
|
9
|
-
Requires-Python: >=3.8
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Requires-Dist: openai>=1.0.0
|
|
13
|
-
Requires-Dist: groq
|
|
14
|
-
Requires-Dist: google-generativeai
|
|
15
|
-
Requires-Dist: anthropic
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
# ask-ai
|
|
20
|
-
|
|
21
|
-
<p align="center">
|
|
22
|
-
🌍 <b>Readme:</b>
|
|
23
|
-
<a href="README.md"><img src="https://flagcdn.com/20x15/us.png" alt="English"> English</a> ·
|
|
24
|
-
<a href="docs/README_fa.md"><img src="https://flagcdn.com/20x15/ir.png" alt="Persian"> فارسی</a> ·
|
|
25
|
-
<a href="docs/README_zh.md"><img src="https://flagcdn.com/20x15/cn.png" alt="Chinese"> 中文</a> ·
|
|
26
|
-
<a href="docs/README_tr.md"><img src="https://flagcdn.com/20x15/tr.png" alt="Turkish"> Türkçe</a> ·
|
|
27
|
-
<a href="docs/README_ar.md"><img src="https://flagcdn.com/20x15/sa.png" alt="Arabic"> العربية</a> ·
|
|
28
|
-
<a href="docs/README_ru.md"><img src="https://flagcdn.com/20x15/ru.png" alt="Russian"> Русский</a> ·
|
|
29
|
-
<a href="docs/README_es.md"><img src="https://flagcdn.com/20x15/es.png" alt="Spanish"> Español</a> ·
|
|
30
|
-
<a href="docs/README_ja.md"><img src="https://flagcdn.com/20x15/jp.png" alt="Japanese"> 日本語</a>
|
|
31
|
-
</p>
|
|
32
|
-
|
|
33
|
-
<p align="center">
|
|
34
|
-
<b>AI Made Simple.</b><br/>
|
|
35
|
-
One unified Python client for OpenAI, Claude, Gemini, Groq & more.
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
> Stop rewriting AI code for every provider. Use one line. Switch models anytime.
|
|
39
|
-
|
|
40
|
-
[](https://opensource.org/licenses/MIT)
|
|
41
|
-
[](https://www.python.org/downloads/)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## ⚡ Why ask-ai?
|
|
46
|
-
|
|
47
|
-
- **No SDK lock-in**: Don't learn 5 different libraries. Learn one.
|
|
48
|
-
- **Unified API**: `ai.ask()` works for text, images, and audio across all providers.
|
|
49
|
-
- **Production Ready**: Built-in type safety, error handling, and environment management.
|
|
50
|
-
- **Zero-Config**: Auto-detects API keys from your environment.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 🚀 The Golden Example
|
|
55
|
-
|
|
56
|
-
See the power of `ask-ai` in 3 lines of code:
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from ask_ai import OpenAI, Anthropic, Google
|
|
60
|
-
|
|
61
|
-
prompt = "Explain quantum computing in one sentence."
|
|
62
|
-
|
|
63
|
-
# Switch providers instantly
|
|
64
|
-
print("OpenAI: ", OpenAI().ask(prompt))
|
|
65
|
-
print("Claude: ", Anthropic().ask(prompt))
|
|
66
|
-
print("Gemini: ", Google().ask(prompt))
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 📦 Installation
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
pip install askai-python
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## 📖 Quick Start
|
|
80
|
-
|
|
81
|
-
### 1. Setup
|
|
82
|
-
Export your API keys (or pass them explicitly).
|
|
83
|
-
```bash
|
|
84
|
-
export OPENAI_API_KEY="sk-..."
|
|
85
|
-
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### 2. Standard Usage
|
|
89
|
-
```python
|
|
90
|
-
from ask_ai import OpenAI
|
|
91
|
-
|
|
92
|
-
ai = OpenAI()
|
|
93
|
-
print(ai.ask("Hello, World!"))
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 3. Advanced Usage
|
|
97
|
-
Control `temperature`, `top_p`, and system personas for professional results.
|
|
98
|
-
```python
|
|
99
|
-
ai.advanced(
|
|
100
|
-
temperature=0.7,
|
|
101
|
-
prompt="You are a senior DevOps engineer."
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
print(ai.ask("How do I optimize a Dockerfile?"))
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 🔌 Supported Providers
|
|
110
|
-
|
|
111
|
-
| Provider | Class | Feature Set |
|
|
112
|
-
|----------|-------|-------------|
|
|
113
|
-
| **OpenAI** | `OpenAI` | All Models (GPT-4o, o1, etc.) |
|
|
114
|
-
| **Anthropic** | `Anthropic` | All Models (Claude 3.5, Opus) |
|
|
115
|
-
| **Google** | `Google` | All Models (Gemini 1.5 Pro/Flash) |
|
|
116
|
-
| **Groq** | `Groq` | All Models (Llama 3, Mixtral) |
|
|
117
|
-
| **Azure** | `Azure` | All Deployments |
|
|
118
|
-
| **OpenRouter**| `OpenRouter`| All Models (100+) |
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## ⭐ Support the Project
|
|
123
|
-
|
|
124
|
-
If this project saved you time, please consider giving it a star on GitHub! It helps us grow.
|
|
125
|
-
|
|
126
|
-
**[Give it a Star!](https://github.com/Hosseinghorbani0/ask-ai)**
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
*Built by [Hossein Ghorbani](https://hosseinghorbani0.ir/) | [GitHub](https://github.com/Hosseinghorbani0).*
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: askai-python
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.
|
|
5
|
-
Author-email: Hossein Ghorbani <hosseingh1068@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://hosseinghorbani0.ir/
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/Hosseinghorbani0/ask-ai/issues
|
|
9
|
-
Requires-Python: >=3.8
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Requires-Dist: openai>=1.0.0
|
|
13
|
-
Requires-Dist: groq
|
|
14
|
-
Requires-Dist: google-generativeai
|
|
15
|
-
Requires-Dist: anthropic
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
# ask-ai
|
|
20
|
-
|
|
21
|
-
<p align="center">
|
|
22
|
-
🌍 <b>Readme:</b>
|
|
23
|
-
<a href="README.md"><img src="https://flagcdn.com/20x15/us.png" alt="English"> English</a> ·
|
|
24
|
-
<a href="docs/README_fa.md"><img src="https://flagcdn.com/20x15/ir.png" alt="Persian"> فارسی</a> ·
|
|
25
|
-
<a href="docs/README_zh.md"><img src="https://flagcdn.com/20x15/cn.png" alt="Chinese"> 中文</a> ·
|
|
26
|
-
<a href="docs/README_tr.md"><img src="https://flagcdn.com/20x15/tr.png" alt="Turkish"> Türkçe</a> ·
|
|
27
|
-
<a href="docs/README_ar.md"><img src="https://flagcdn.com/20x15/sa.png" alt="Arabic"> العربية</a> ·
|
|
28
|
-
<a href="docs/README_ru.md"><img src="https://flagcdn.com/20x15/ru.png" alt="Russian"> Русский</a> ·
|
|
29
|
-
<a href="docs/README_es.md"><img src="https://flagcdn.com/20x15/es.png" alt="Spanish"> Español</a> ·
|
|
30
|
-
<a href="docs/README_ja.md"><img src="https://flagcdn.com/20x15/jp.png" alt="Japanese"> 日本語</a>
|
|
31
|
-
</p>
|
|
32
|
-
|
|
33
|
-
<p align="center">
|
|
34
|
-
<b>AI Made Simple.</b><br/>
|
|
35
|
-
One unified Python client for OpenAI, Claude, Gemini, Groq & more.
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
> Stop rewriting AI code for every provider. Use one line. Switch models anytime.
|
|
39
|
-
|
|
40
|
-
[](https://opensource.org/licenses/MIT)
|
|
41
|
-
[](https://www.python.org/downloads/)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## ⚡ Why ask-ai?
|
|
46
|
-
|
|
47
|
-
- **No SDK lock-in**: Don't learn 5 different libraries. Learn one.
|
|
48
|
-
- **Unified API**: `ai.ask()` works for text, images, and audio across all providers.
|
|
49
|
-
- **Production Ready**: Built-in type safety, error handling, and environment management.
|
|
50
|
-
- **Zero-Config**: Auto-detects API keys from your environment.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 🚀 The Golden Example
|
|
55
|
-
|
|
56
|
-
See the power of `ask-ai` in 3 lines of code:
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from ask_ai import OpenAI, Anthropic, Google
|
|
60
|
-
|
|
61
|
-
prompt = "Explain quantum computing in one sentence."
|
|
62
|
-
|
|
63
|
-
# Switch providers instantly
|
|
64
|
-
print("OpenAI: ", OpenAI().ask(prompt))
|
|
65
|
-
print("Claude: ", Anthropic().ask(prompt))
|
|
66
|
-
print("Gemini: ", Google().ask(prompt))
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 📦 Installation
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
pip install askai-python
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## 📖 Quick Start
|
|
80
|
-
|
|
81
|
-
### 1. Setup
|
|
82
|
-
Export your API keys (or pass them explicitly).
|
|
83
|
-
```bash
|
|
84
|
-
export OPENAI_API_KEY="sk-..."
|
|
85
|
-
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### 2. Standard Usage
|
|
89
|
-
```python
|
|
90
|
-
from ask_ai import OpenAI
|
|
91
|
-
|
|
92
|
-
ai = OpenAI()
|
|
93
|
-
print(ai.ask("Hello, World!"))
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 3. Advanced Usage
|
|
97
|
-
Control `temperature`, `top_p`, and system personas for professional results.
|
|
98
|
-
```python
|
|
99
|
-
ai.advanced(
|
|
100
|
-
temperature=0.7,
|
|
101
|
-
prompt="You are a senior DevOps engineer."
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
print(ai.ask("How do I optimize a Dockerfile?"))
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 🔌 Supported Providers
|
|
110
|
-
|
|
111
|
-
| Provider | Class | Feature Set |
|
|
112
|
-
|----------|-------|-------------|
|
|
113
|
-
| **OpenAI** | `OpenAI` | All Models (GPT-4o, o1, etc.) |
|
|
114
|
-
| **Anthropic** | `Anthropic` | All Models (Claude 3.5, Opus) |
|
|
115
|
-
| **Google** | `Google` | All Models (Gemini 1.5 Pro/Flash) |
|
|
116
|
-
| **Groq** | `Groq` | All Models (Llama 3, Mixtral) |
|
|
117
|
-
| **Azure** | `Azure` | All Deployments |
|
|
118
|
-
| **OpenRouter**| `OpenRouter`| All Models (100+) |
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## ⭐ Support the Project
|
|
123
|
-
|
|
124
|
-
If this project saved you time, please consider giving it a star on GitHub! It helps us grow.
|
|
125
|
-
|
|
126
|
-
**[Give it a Star!](https://github.com/Hosseinghorbani0/ask-ai)**
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
*Built by [Hossein Ghorbani](https://hosseinghorbani0.ir/) | [GitHub](https://github.com/Hosseinghorbani0).*
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|