@push.rocks/smartai 0.7.0 → 0.7.2
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.
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/package.json +1 -1
- package/readme.md +91 -10
- package/ts/00_commitinfo_data.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartai',
|
|
6
|
-
version: '0.7.
|
|
6
|
+
version: '0.7.2',
|
|
7
7
|
description: 'SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxxQkFBcUI7SUFDM0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLGtOQUFrTjtDQUNoTyxDQUFBIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartai",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/readme.md
CHANGED
|
@@ -45,15 +45,15 @@ const response = await ai.openaiProvider.chat({
|
|
|
45
45
|
|
|
46
46
|
Choose the right provider for your use case:
|
|
47
47
|
|
|
48
|
-
| Provider | Chat | Streaming | TTS | Vision | Documents | Research | Highlights |
|
|
49
|
-
|
|
50
|
-
| **OpenAI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | •
|
|
51
|
-
| **Anthropic** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | • Claude
|
|
52
|
-
| **Ollama** | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | • 100% local<br>• Privacy-first<br>• No API costs |
|
|
53
|
-
| **XAI** | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | • Grok models<br>• Real-time data<br>• Uncensored |
|
|
54
|
-
| **Perplexity** | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | • Web-aware<br>• Research-focused<br>• Sonar Pro models |
|
|
55
|
-
| **Groq** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | • 10x faster<br>• LPU inference<br>• Low latency |
|
|
56
|
-
| **Exo** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | • Distributed<br>• P2P compute<br>• Decentralized |
|
|
48
|
+
| Provider | Chat | Streaming | TTS | Vision | Documents | Research | Images | Highlights |
|
|
49
|
+
|----------|:----:|:---------:|:---:|:------:|:---------:|:--------:|:------:|------------|
|
|
50
|
+
| **OpenAI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | • gpt-image-1<br>• DALL-E 3<br>• Deep research API |
|
|
51
|
+
| **Anthropic** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | • Claude Sonnet 4.5<br>• Superior reasoning<br>• Web search API |
|
|
52
|
+
| **Ollama** | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | • 100% local<br>• Privacy-first<br>• No API costs |
|
|
53
|
+
| **XAI** | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | • Grok models<br>• Real-time data<br>• Uncensored |
|
|
54
|
+
| **Perplexity** | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ | • Web-aware<br>• Research-focused<br>• Sonar Pro models |
|
|
55
|
+
| **Groq** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | • 10x faster<br>• LPU inference<br>• Low latency |
|
|
56
|
+
| **Exo** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | • Distributed<br>• P2P compute<br>• Decentralized |
|
|
57
57
|
|
|
58
58
|
## 🎮 Core Features
|
|
59
59
|
|
|
@@ -216,6 +216,87 @@ const perplexityResearch = await ai.perplexityProvider.research({
|
|
|
216
216
|
- **Anthropic**: Web Search API with domain filtering
|
|
217
217
|
- **Perplexity**: Sonar and Sonar Pro models with built-in citations
|
|
218
218
|
|
|
219
|
+
### 🎨 Image Generation & Editing
|
|
220
|
+
|
|
221
|
+
Generate and edit images with OpenAI's cutting-edge models:
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
// Basic image generation with gpt-image-1
|
|
225
|
+
const image = await ai.openaiProvider.imageGenerate({
|
|
226
|
+
prompt: 'A futuristic robot assistant in a modern office, digital art',
|
|
227
|
+
model: 'gpt-image-1',
|
|
228
|
+
quality: 'high',
|
|
229
|
+
size: '1024x1024'
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// Save the generated image
|
|
233
|
+
const imageBuffer = Buffer.from(image.images[0].b64_json!, 'base64');
|
|
234
|
+
fs.writeFileSync('robot.png', imageBuffer);
|
|
235
|
+
|
|
236
|
+
// Advanced: Transparent background with custom format
|
|
237
|
+
const logo = await ai.openaiProvider.imageGenerate({
|
|
238
|
+
prompt: 'Minimalist mountain peak logo, geometric design',
|
|
239
|
+
model: 'gpt-image-1',
|
|
240
|
+
quality: 'high',
|
|
241
|
+
size: '1024x1024',
|
|
242
|
+
background: 'transparent',
|
|
243
|
+
outputFormat: 'png'
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// WebP with compression for web use
|
|
247
|
+
const webImage = await ai.openaiProvider.imageGenerate({
|
|
248
|
+
prompt: 'Product showcase: sleek smartphone on marble surface',
|
|
249
|
+
model: 'gpt-image-1',
|
|
250
|
+
quality: 'high',
|
|
251
|
+
size: '1536x1024',
|
|
252
|
+
outputFormat: 'webp',
|
|
253
|
+
outputCompression: 85
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
// Superior text rendering (gpt-image-1's strength)
|
|
257
|
+
const signage = await ai.openaiProvider.imageGenerate({
|
|
258
|
+
prompt: 'Vintage cafe sign saying "COFFEE & CODE" in hand-lettered typography',
|
|
259
|
+
model: 'gpt-image-1',
|
|
260
|
+
quality: 'high',
|
|
261
|
+
size: '1024x1024'
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// Generate multiple variations at once
|
|
265
|
+
const variations = await ai.openaiProvider.imageGenerate({
|
|
266
|
+
prompt: 'Abstract geometric pattern, colorful minimalist art',
|
|
267
|
+
model: 'gpt-image-1',
|
|
268
|
+
n: 3,
|
|
269
|
+
quality: 'medium',
|
|
270
|
+
size: '1024x1024'
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Edit an existing image
|
|
274
|
+
const editedImage = await ai.openaiProvider.imageEdit({
|
|
275
|
+
image: originalImageBuffer,
|
|
276
|
+
prompt: 'Add sunglasses and change the background to a beach sunset',
|
|
277
|
+
model: 'gpt-image-1',
|
|
278
|
+
quality: 'high'
|
|
279
|
+
});
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Image Generation Options:**
|
|
283
|
+
- `model`: 'gpt-image-1' | 'dall-e-3' | 'dall-e-2'
|
|
284
|
+
- `quality`: 'low' | 'medium' | 'high' | 'auto'
|
|
285
|
+
- `size`: Multiple aspect ratios up to 4096×4096
|
|
286
|
+
- `background`: 'transparent' | 'opaque' | 'auto'
|
|
287
|
+
- `outputFormat`: 'png' | 'jpeg' | 'webp'
|
|
288
|
+
- `outputCompression`: 0-100 for webp/jpeg
|
|
289
|
+
- `moderation`: 'low' | 'auto'
|
|
290
|
+
- `n`: Number of images (1-10)
|
|
291
|
+
|
|
292
|
+
**gpt-image-1 Advantages:**
|
|
293
|
+
- Superior text rendering in images
|
|
294
|
+
- Up to 4096×4096 resolution
|
|
295
|
+
- Transparent background support
|
|
296
|
+
- Advanced output formats (WebP with compression)
|
|
297
|
+
- Better prompt understanding
|
|
298
|
+
- Streaming support for progressive rendering
|
|
299
|
+
|
|
219
300
|
### 🔄 Persistent Conversations
|
|
220
301
|
|
|
221
302
|
Maintain context across interactions:
|
|
@@ -501,8 +582,8 @@ export PERPLEXITY_API_KEY=pplx-...
|
|
|
501
582
|
## 📈 Roadmap
|
|
502
583
|
|
|
503
584
|
- [x] Research & Web Search API
|
|
585
|
+
- [x] Image generation support (gpt-image-1, DALL-E 3, DALL-E 2)
|
|
504
586
|
- [ ] Streaming function calls
|
|
505
|
-
- [ ] Image generation support
|
|
506
587
|
- [ ] Voice input processing
|
|
507
588
|
- [ ] Fine-tuning integration
|
|
508
589
|
- [ ] Embedding support
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartai',
|
|
6
|
-
version: '0.7.
|
|
6
|
+
version: '0.7.2',
|
|
7
7
|
description: 'SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.'
|
|
8
8
|
}
|