|
1 | 1 | <div align="center"> |
2 | 2 | <h1>EasilyAI</h1> |
| 3 | + <p><em>A unified Python library for AI services</em></p> |
| 4 | + |
3 | 5 | <p> |
4 | | - <p align="center"> |
5 | | - <a href="https://pypi.org/project/easilyai"><img src="https://img.shields.io/pypi/v/easilyai.svg" alt="PyPI"></a> |
6 | | - <a href="tox.ini"><img src="https://img.shields.io/pypi/pyversions/easilyai" alt="Supported Python Versions"></a> |
7 | | - <a href="https://pypi.org/project/easilyai"><img src="https://img.shields.io/pypi/dm/easilyai" alt="PyPI Downloads"></a> |
8 | | - <a href="LICENSE"><img src="https://img.shields.io/github/license/GustyCube/EasilyAI" alt="License"></a> |
9 | | - <a href="https://app.deepsource.com/gh/GustyCube/EasilyAI/"> |
10 | | - <img src="https://app.deepsource.com/gh/GustyCube/EasilyAI.svg/?label=code+coverage&show_trend=true&token=Vidoy6h5_sKpG-0YdVA_ISy_"alt="DeepSource</a> |
11 | | - <a href="https://github.com/gustycube/EasilyAI/graphs/contributors"> |
12 | | - <img src="https://img.shields.io/github/contributors/gustycube/easilyai.svg" alt="Contributors"> |
13 | | -</a> |
14 | | - |
15 | | -</p> |
| 6 | + <a href="https://pypi.org/project/easilyai"><img src="https://img.shields.io/pypi/v/easilyai?style=flat-square&color=blue" alt="PyPI Version"></a> |
| 7 | + <a href="https://github.com/GustyCube/EasilyAI/actions/workflows/python-publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/GustyCube/EasilyAI/python-publish.yml?style=flat-square&label=CI%2FCD" alt="CI/CD Status"></a> |
| 8 | + <a href="https://github.com/GustyCube/EasilyAI/actions/workflows/docs.yml"><img src="https://img.shields.io/github/actions/workflow/status/GustyCube/EasilyAI/docs.yml?style=flat-square&label=docs" alt="Docs Status"></a> |
| 9 | + <a href="https://app.deepsource.com/gh/GustyCube/EasilyAI/"><img src="https://app.deepsource.com/gh/GustyCube/EasilyAI.svg/?label=code+coverage&show_trend=true&token=Vidoy6h5_sKpG-0YdVA_ISy_&style=flat-square" alt="Code Coverage"></a> |
| 10 | + <a href="https://pypi.org/project/easilyai"><img src="https://img.shields.io/pypi/dm/easilyai?style=flat-square&color=green" alt="Downloads"></a> |
| 11 | + <a href="https://pypi.org/project/easilyai"><img src="https://img.shields.io/pypi/pyversions/easilyai?style=flat-square" alt="Python Versions"></a> |
| 12 | + <a href="LICENSE"><img src="https://img.shields.io/github/license/GustyCube/EasilyAI?style=flat-square" alt="License"></a> |
| 13 | + <a href="https://github.com/GustyCube/EasilyAI/graphs/contributors"><img src="https://img.shields.io/github/contributors/GustyCube/EasilyAI?style=flat-square" alt="Contributors"></a> |
16 | 14 | </p> |
17 | 15 | </div> |
18 | 16 |
|
19 | | -**EasilyAI** is a Python library that simplifies AI app development by integrating popular AI services like **OpenAI** and **Ollama**. It provides a clean, unified interface for text generation, image generation, and text-to-speech (TTS) tasks. |
| 17 | +## Overview |
| 18 | + |
| 19 | +**EasilyAI** is a powerful Python library that simplifies AI application development by providing a unified interface for multiple AI services including **OpenAI**, **Anthropic**, **Google Gemini**, **X.AI Grok**, and **Ollama**. Whether you need text generation, image creation, or text-to-speech functionality, EasilyAI offers a consistent API that makes switching between providers effortless. |
20 | 20 |
|
21 | 21 | --- |
22 | 22 |
|
23 | | -## Features |
24 | | -- **App Creation**: Simplify initializing AI services like OpenAI and Ollama. |
25 | | -- **Text-to-Speech**: Convert text to speech with OpenAI's TTS API (with voice selection). |
26 | | -- **Custom AI Support**: Integrate and register custom AI models. |
27 | | -- **Unified Request Handling**: Automatically determine task types like text, image, or TTS requests. |
28 | | -- **Pipeline Support**: Chain multiple tasks into a seamless workflow. |
| 23 | +## 🚀 Key Features |
29 | 24 |
|
30 | | ---- |
| 25 | +- **🔄 Multi-Provider Support**: Seamlessly switch between OpenAI, Anthropic, Google Gemini, X.AI Grok, and Ollama |
| 26 | +- **📝 Text Generation**: Advanced language models for chat, completion, and creative writing |
| 27 | +- **🎨 Image Generation**: Create stunning visuals with DALL-E and other image models |
| 28 | +- **🗣️ Text-to-Speech**: High-quality voice synthesis with multiple voice options |
| 29 | +- **🔗 Pipeline System**: Chain multiple AI operations into powerful workflows |
| 30 | +- **🛠️ Custom AI Integration**: Easily extend with your own AI services |
| 31 | +- **⚡ Unified API**: One consistent interface for all providers and tasks |
| 32 | +- **🎯 Auto Task Detection**: Intelligent request routing based on content type |
31 | 33 |
|
32 | | -## Installation |
| 34 | +--- |
33 | 35 |
|
34 | | -Install the library via pip: |
| 36 | +## 📦 Installation |
35 | 37 |
|
36 | 38 | ```bash |
37 | 39 | pip install easilyai |
38 | 40 | ``` |
39 | 41 |
|
40 | | ---- |
41 | | - |
42 | | -## Quick Start |
43 | | - |
44 | | -### 1. Create an AI App |
| 42 | +## 🚀 Quick Start |
45 | 43 |
|
46 | | -Create an app for OpenAI: |
| 44 | +Get up and running in minutes with these simple examples: |
47 | 45 |
|
| 46 | +### Basic Text Generation |
48 | 47 | ```python |
49 | 48 | import easilyai |
50 | 49 |
|
51 | | -# Initialize an OpenAI App |
| 50 | +# Create an app with your preferred provider |
52 | 51 | app = easilyai.create_app( |
53 | 52 | name="my_ai_app", |
54 | | - service="openai", |
55 | | - apikey="YOUR_OPENAI_API_KEY", |
| 53 | + service="openai", # or "anthropic", "gemini", "grok", "ollama" |
| 54 | + apikey="YOUR_API_KEY", |
56 | 55 | model="gpt-4" |
57 | 56 | ) |
58 | 57 |
|
59 | | -# Make a request |
60 | | -response = app.request("Tell me a joke about AI.") |
| 58 | +# Generate text |
| 59 | +response = app.request("Explain quantum computing in simple terms") |
61 | 60 | print(response) |
62 | 61 | ``` |
63 | 62 |
|
64 | | ---- |
65 | | - |
66 | | -### 2. Generate Text-to-Speech |
67 | | - |
68 | | -Create a dedicated TTS app and specify the model and voice: |
69 | | - |
| 63 | +### Text-to-Speech |
70 | 64 | ```python |
71 | | -# Initialize a TTS App |
| 65 | +# Create a TTS app |
72 | 66 | tts_app = easilyai.create_tts_app( |
73 | 67 | name="my_tts_app", |
74 | 68 | service="openai", |
75 | | - apikey="YOUR_OPENAI_API_KEY", |
| 69 | + apikey="YOUR_API_KEY", |
76 | 70 | model="tts-1" |
77 | 71 | ) |
78 | 72 |
|
79 | 73 | # Convert text to speech |
80 | | -output_file = tts_app.request_tts( |
81 | | - text="Hello, I am your AI assistant!", |
82 | | - tts_model="tts-1", |
| 74 | +tts_app.request_tts( |
| 75 | + text="Hello from EasilyAI!", |
83 | 76 | voice="onyx", |
84 | | - output_file="hello_ai.mp3" |
| 77 | + output_file="greeting.mp3" |
85 | 78 | ) |
86 | | -print(f"TTS output saved to: {output_file}") |
87 | 79 | ``` |
88 | 80 |
|
89 | | ---- |
90 | | - |
91 | | -### 3. Use Pipelines |
92 | | - |
93 | | -Chain multiple tasks (text generation, image generation, and TTS): |
94 | | - |
| 81 | +### AI Pipeline |
95 | 82 | ```python |
96 | | -# Create a pipeline |
| 83 | +# Chain multiple AI operations |
97 | 84 | pipeline = easilyai.EasilyAIPipeline(app) |
| 85 | +pipeline.add_task("generate_text", "Write a haiku about coding") |
| 86 | +pipeline.add_task("generate_image", "A serene coding environment") |
98 | 87 |
|
99 | | -# Add tasks |
100 | | -pipeline.add_task("generate_text", "Write a poem about AI and nature.") |
101 | | -pipeline.add_task("generate_image", "A futuristic city with flying cars.") |
102 | | -pipeline.add_task("text_to_speech", "Here is a talking car in a futuristic world!") |
103 | | - |
104 | | -# Run the pipeline |
105 | 88 | results = pipeline.run() |
106 | | - |
107 | | -# Print results |
108 | | -for task_result in results: |
109 | | - print(f"Task: {task_result['task']}\nResult: {task_result['result']}\n") |
110 | | -``` |
111 | | - |
112 | | ---- |
113 | | - |
114 | | -### 4. Register Custom AI Services |
115 | | - |
116 | | -Integrate your own AI models into EasilyAI: |
117 | | - |
118 | | -```python |
119 | | -from easilyai.custom_ai import CustomAIService, register_custom_ai |
120 | | - |
121 | | -# Define a custom AI service |
122 | | -class MyCustomAI(CustomAIService): |
123 | | - def generate_text(self, prompt): |
124 | | - return f"Custom AI response for: {prompt}" |
125 | | - |
126 | | - def text_to_speech(self, text, **kwargs): |
127 | | - return f"Custom TTS Output: {text}" |
128 | | - |
129 | | -# Register the custom AI |
130 | | -register_custom_ai("my_custom_ai", MyCustomAI) |
131 | | - |
132 | | -# Use the custom AI |
133 | | -custom_app = easilyai.create_app(name="custom_app", service="my_custom_ai", model="v1") |
134 | | -print(custom_app.request("What is 2 + 2?")) |
135 | 89 | ``` |
136 | 90 |
|
137 | | ---- |
138 | | - |
139 | | -## Supported Services |
140 | | - |
141 | | -1. **OpenAI** |
142 | | - - Text Generation (ChatGPT models like `gpt-4o`) |
143 | | - - Image Generation (`dall-e-3`) |
144 | | - - Text-to-Speech (`tts-1`, voices: `onyx`, `alloy`, etc.) |
145 | | - |
146 | | -2. **Ollama** |
147 | | - - Local LLM text generation (e.g., `llama3.1`). |
148 | | - |
149 | | -3. **Custom AI** |
150 | | - - Extend functionality by registering your own AI services. |
151 | | - |
152 | | ---- |
153 | | - |
154 | | -## Error Handling |
| 91 | +## 🛠️ Supported AI Providers |
155 | 92 |
|
156 | | -EasilyAI includes robust error handling with informative, emoji-coded messages. |
| 93 | +| Provider | Text Generation | Image Generation | Text-to-Speech | |
| 94 | +|----------|:---------------:|:----------------:|:--------------:| |
| 95 | +| **OpenAI** | ✅ | ✅ | ✅ | |
| 96 | +| **Anthropic** | ✅ | ❌ | ❌ | |
| 97 | +| **Google Gemini** | ✅ | ❌ | ❌ | |
| 98 | +| **X.AI Grok** | ✅ | ❌ | ❌ | |
| 99 | +| **Ollama** | ✅ | ❌ | ❌ | |
| 100 | +| **Custom AI** | ✅ | ✅ | ✅ | |
157 | 101 |
|
158 | | -Examples: |
159 | | -- 🔐 **Missing API Key**: "No API key provided! Add your API key to initialize the service." |
160 | | -- 🚫 **Invalid Request**: "The request is invalid. Please check your inputs." |
161 | | -- 🌐 **Connection Error**: "Unable to connect to the API. Ensure the server is running." |
162 | | -- ⏳ **Rate Limit Exceeded**: "Too many requests! Wait and try again." |
| 102 | +## 📚 Documentation |
163 | 103 |
|
164 | | ---- |
165 | | - |
166 | | -## Future Features |
167 | | - |
168 | | -- Full support for additional TTS providers. |
169 | | -- Model-specific optimizations. |
170 | | -- Enhanced CLI tools for developers. |
171 | | - |
172 | | ---- |
173 | | - |
174 | | -## Contributing |
| 104 | +For comprehensive guides, API reference, and advanced usage examples, visit our documentation: |
175 | 105 |
|
176 | | -Contributions are welcome! To contribute: |
177 | | -1. Fork the repository. |
178 | | -2. Create a new branch. |
179 | | -3. Submit a pull request with detailed changes. |
| 106 | +**[📖 View Full Documentation →](https://gustycube.github.io/EasilyAI/overview.html)** |
180 | 107 |
|
181 | | ---- |
182 | | - |
183 | | -## License |
184 | | - |
185 | | -This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details. |
| 108 | +## 🤝 Contributing |
186 | 109 |
|
187 | | ---- |
188 | | - |
189 | | -## Links |
| 110 | +We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details. |
190 | 111 |
|
191 | | -- Documentation: [coming soon] |
192 | | -- GitHub Repository: https://github.com/GustyCube/EasilyAI |
| 112 | +## 📄 License |
193 | 113 |
|
194 | | ---- |
| 114 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
195 | 115 |
|
196 | | -## Contact |
| 116 | +## 🔗 Links |
197 | 117 |
|
198 | | -For questions, bugs, or feature requests, please reach out to **GustyCube** at **gc@gustycube.xyz**. |
| 118 | +- **Documentation**: https://gustycube.github.io/EasilyAI/overview.html |
| 119 | +- **PyPI Package**: https://pypi.org/project/easilyai |
| 120 | +- **GitHub Repository**: https://github.com/GustyCube/EasilyAI |
| 121 | +- **Issues & Support**: https://github.com/GustyCube/EasilyAI/issues |
0 commit comments