rails_ai 0.1.0

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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec_status +96 -0
  3. data/AGENT_GUIDE.md +513 -0
  4. data/Appraisals +49 -0
  5. data/COMMERCIAL_LICENSE_TEMPLATE.md +92 -0
  6. data/FEATURES.md +204 -0
  7. data/LEGAL_PROTECTION_GUIDE.md +222 -0
  8. data/LICENSE +62 -0
  9. data/LICENSE_SUMMARY.md +74 -0
  10. data/MIT-LICENSE +62 -0
  11. data/PERFORMANCE.md +300 -0
  12. data/PROVIDERS.md +495 -0
  13. data/README.md +454 -0
  14. data/Rakefile +11 -0
  15. data/SPEED_OPTIMIZATIONS.md +217 -0
  16. data/STRUCTURE.md +139 -0
  17. data/USAGE_GUIDE.md +288 -0
  18. data/app/channels/ai_stream_channel.rb +33 -0
  19. data/app/components/ai/prompt_component.rb +25 -0
  20. data/app/controllers/concerns/ai/context_aware.rb +77 -0
  21. data/app/controllers/concerns/ai/streaming.rb +41 -0
  22. data/app/helpers/ai_helper.rb +164 -0
  23. data/app/jobs/ai/generate_embedding_job.rb +25 -0
  24. data/app/jobs/ai/generate_summary_job.rb +25 -0
  25. data/app/models/concerns/ai/embeddable.rb +38 -0
  26. data/app/views/rails_ai/dashboard/index.html.erb +51 -0
  27. data/config/routes.rb +19 -0
  28. data/lib/generators/rails_ai/install/install_generator.rb +38 -0
  29. data/lib/rails_ai/agents/agent_manager.rb +258 -0
  30. data/lib/rails_ai/agents/agent_team.rb +243 -0
  31. data/lib/rails_ai/agents/base_agent.rb +331 -0
  32. data/lib/rails_ai/agents/collaboration.rb +238 -0
  33. data/lib/rails_ai/agents/memory.rb +116 -0
  34. data/lib/rails_ai/agents/message_bus.rb +95 -0
  35. data/lib/rails_ai/agents/specialized_agents.rb +391 -0
  36. data/lib/rails_ai/agents/task_queue.rb +111 -0
  37. data/lib/rails_ai/cache.rb +14 -0
  38. data/lib/rails_ai/config.rb +40 -0
  39. data/lib/rails_ai/context.rb +7 -0
  40. data/lib/rails_ai/context_analyzer.rb +86 -0
  41. data/lib/rails_ai/engine.rb +48 -0
  42. data/lib/rails_ai/events.rb +9 -0
  43. data/lib/rails_ai/image_context.rb +110 -0
  44. data/lib/rails_ai/performance.rb +231 -0
  45. data/lib/rails_ai/provider.rb +8 -0
  46. data/lib/rails_ai/providers/anthropic_adapter.rb +256 -0
  47. data/lib/rails_ai/providers/base.rb +60 -0
  48. data/lib/rails_ai/providers/dummy_adapter.rb +29 -0
  49. data/lib/rails_ai/providers/gemini_adapter.rb +509 -0
  50. data/lib/rails_ai/providers/openai_adapter.rb +535 -0
  51. data/lib/rails_ai/providers/secure_anthropic_adapter.rb +206 -0
  52. data/lib/rails_ai/providers/secure_openai_adapter.rb +284 -0
  53. data/lib/rails_ai/railtie.rb +48 -0
  54. data/lib/rails_ai/redactor.rb +12 -0
  55. data/lib/rails_ai/security/api_key_manager.rb +82 -0
  56. data/lib/rails_ai/security/audit_logger.rb +46 -0
  57. data/lib/rails_ai/security/error_handler.rb +62 -0
  58. data/lib/rails_ai/security/input_validator.rb +176 -0
  59. data/lib/rails_ai/security/secure_file_handler.rb +45 -0
  60. data/lib/rails_ai/security/secure_http_client.rb +177 -0
  61. data/lib/rails_ai/security.rb +0 -0
  62. data/lib/rails_ai/version.rb +5 -0
  63. data/lib/rails_ai/window_context.rb +103 -0
  64. data/lib/rails_ai.rb +502 -0
  65. data/monitoring/ci_setup_guide.md +214 -0
  66. data/monitoring/enhanced_monitoring_script.rb +237 -0
  67. data/monitoring/google_alerts_setup.md +42 -0
  68. data/monitoring_log_20250921.txt +0 -0
  69. data/monitoring_script.rb +161 -0
  70. data/rails_ai.gemspec +54 -0
  71. data/scripts/security_scanner.rb +353 -0
  72. data/setup_monitoring.sh +163 -0
  73. data/wiki/API-Documentation.md +734 -0
  74. data/wiki/Architecture-Overview.md +672 -0
  75. data/wiki/Contributing-Guide.md +407 -0
  76. data/wiki/Development-Setup.md +532 -0
  77. data/wiki/Home.md +278 -0
  78. data/wiki/Installation-Guide.md +527 -0
  79. data/wiki/Quick-Start.md +186 -0
  80. data/wiki/README.md +135 -0
  81. data/wiki/Release-Process.md +467 -0
  82. metadata +385 -0
@@ -0,0 +1,527 @@
1
+ # Installation Guide
2
+
3
+ Complete guide for installing and setting up Rails AI in your Rails application.
4
+
5
+ ## ๐Ÿ“‹ Prerequisites
6
+
7
+ ### System Requirements
8
+
9
+ - **Ruby**: 2.7+ (3.x recommended)
10
+ - **Rails**: 5.2+ (8.0 recommended)
11
+ - **Bundler**: Latest version
12
+ - **Git**: For version control
13
+
14
+ ### Optional Dependencies
15
+
16
+ - **Redis**: For advanced caching (recommended for production)
17
+ - **PostgreSQL/MySQL**: For database operations
18
+ - **Node.js**: For frontend assets (if using view components)
19
+
20
+ ## ๐Ÿš€ Quick Installation
21
+
22
+ ### 1. Add to Gemfile
23
+
24
+ ```ruby
25
+ # Gemfile
26
+ gem 'rails_ai'
27
+ ```
28
+
29
+ ### 2. Install Dependencies
30
+
31
+ ```bash
32
+ bundle install
33
+ ```
34
+
35
+ ### 3. Run Generator
36
+
37
+ ```bash
38
+ rails generate rails_ai:install
39
+ ```
40
+
41
+ ### 4. Configure
42
+
43
+ ```ruby
44
+ # config/initializers/rails_ai.rb
45
+ RailsAi.configure do |config|
46
+ config.provider = :openai
47
+ config.api_key = ENV['OPENAI_API_KEY']
48
+ config.cache_ttl = 1.hour
49
+ end
50
+ ```
51
+
52
+ ### 5. Set Environment Variables
53
+
54
+ ```bash
55
+ # .env
56
+ OPENAI_API_KEY=your_openai_api_key_here
57
+ ```
58
+
59
+ ## ๐Ÿ”ง Detailed Installation
60
+
61
+ ### Step 1: Add Gem to Gemfile
62
+
63
+ ```ruby
64
+ # Gemfile
65
+ gem 'rails_ai'
66
+
67
+ # Optional: Add specific version
68
+ gem 'rails_ai', '~> 0.1.0'
69
+
70
+ # Optional: Add from GitHub
71
+ gem 'rails_ai', git: 'https://github.com/yourusername/rails_ai.git'
72
+ ```
73
+
74
+ ### Step 2: Install Dependencies
75
+
76
+ ```bash
77
+ # Install gems
78
+ bundle install
79
+
80
+ # Verify installation
81
+ bundle list | grep rails_ai
82
+ ```
83
+
84
+ ### Step 3: Run Installation Generator
85
+
86
+ ```bash
87
+ # Run the installer
88
+ rails generate rails_ai:install
89
+
90
+ # This creates:
91
+ # - config/initializers/rails_ai.rb
92
+ # - app/controllers/concerns/ai/
93
+ # - app/helpers/ai_helper.rb
94
+ # - app/views/ai/
95
+ ```
96
+
97
+ ### Step 4: Configure Rails AI
98
+
99
+ ```ruby
100
+ # config/initializers/rails_ai.rb
101
+ RailsAi.configure do |config|
102
+ # Provider configuration
103
+ config.provider = :openai
104
+ config.default_model = "gpt-4o-mini"
105
+
106
+ # API configuration
107
+ config.api_key = ENV['OPENAI_API_KEY']
108
+
109
+ # Caching configuration
110
+ config.cache_ttl = 1.hour
111
+ config.enable_compression = true
112
+
113
+ # Performance configuration
114
+ config.connection_pool_size = 10
115
+ config.enable_performance_monitoring = true
116
+
117
+ # Development configuration
118
+ config.stub_responses = Rails.env.development?
119
+ end
120
+ ```
121
+
122
+ ### Step 5: Set Environment Variables
123
+
124
+ ```bash
125
+ # .env (for development)
126
+ OPENAI_API_KEY=your_openai_api_key_here
127
+
128
+ # .env.production (for production)
129
+ OPENAI_API_KEY=your_production_api_key_here
130
+ ```
131
+
132
+ ### Step 6: Configure Caching (Optional)
133
+
134
+ #### Redis (Recommended)
135
+
136
+ ```ruby
137
+ # config/environments/production.rb
138
+ Rails.application.configure do
139
+ config.cache_store = :redis_cache_store, {
140
+ url: ENV['REDIS_URL'],
141
+ namespace: 'rails_ai'
142
+ }
143
+ end
144
+ ```
145
+
146
+ #### Memory Store (Development)
147
+
148
+ ```ruby
149
+ # config/environments/development.rb
150
+ Rails.application.configure do
151
+ config.cache_store = :memory_store
152
+ end
153
+ ```
154
+
155
+ ## ๐ŸŽฏ Rails Version Specific Setup
156
+
157
+ ### Rails 8.0
158
+
159
+ ```ruby
160
+ # config/application.rb
161
+ module YourApp
162
+ class Application < Rails::Application
163
+ # Rails 8.0 specific configuration
164
+ config.load_defaults 8.0
165
+
166
+ # Enable Rails AI
167
+ config.rails_ai.enabled = true
168
+ end
169
+ end
170
+ ```
171
+
172
+ ### Rails 7.x
173
+
174
+ ```ruby
175
+ # config/application.rb
176
+ module YourApp
177
+ class Application < Rails::Application
178
+ # Rails 7.x specific configuration
179
+ config.load_defaults 7.0
180
+
181
+ # Enable Rails AI
182
+ config.rails_ai.enabled = true
183
+ end
184
+ end
185
+ ```
186
+
187
+ ### Rails 6.x
188
+
189
+ ```ruby
190
+ # config/application.rb
191
+ module YourApp
192
+ class Application < Rails::Application
193
+ # Rails 6.x specific configuration
194
+ config.load_defaults 6.0
195
+
196
+ # Enable Rails AI
197
+ config.rails_ai.enabled = true
198
+ end
199
+ end
200
+ ```
201
+
202
+ ### Rails 5.2
203
+
204
+ ```ruby
205
+ # config/application.rb
206
+ module YourApp
207
+ class Application < Rails::Application
208
+ # Rails 5.2 specific configuration
209
+ config.load_defaults 5.2
210
+
211
+ # Enable Rails AI
212
+ config.rails_ai.enabled = true
213
+ end
214
+ end
215
+ ```
216
+
217
+ ## ๐Ÿ” API Key Setup
218
+
219
+ ### OpenAI
220
+
221
+ 1. **Get API Key**
222
+ - Visit [OpenAI Platform](https://platform.openai.com/)
223
+ - Create account or sign in
224
+ - Go to API Keys section
225
+ - Create new secret key
226
+
227
+ 2. **Set Environment Variable**
228
+ ```bash
229
+ export OPENAI_API_KEY=your_api_key_here
230
+ ```
231
+
232
+ 3. **Verify Setup**
233
+ ```ruby
234
+ # rails console
235
+ RailsAi.chat("Hello")
236
+ ```
237
+
238
+ ### Anthropic (Future)
239
+
240
+ ```ruby
241
+ # config/initializers/rails_ai.rb
242
+ RailsAi.configure do |config|
243
+ config.provider = :anthropic
244
+ config.api_key = ENV['ANTHROPIC_API_KEY']
245
+ end
246
+ ```
247
+
248
+ ### Custom Provider
249
+
250
+ ```ruby
251
+ # config/initializers/rails_ai.rb
252
+ RailsAi.configure do |config|
253
+ config.provider = :custom
254
+ config.api_key = ENV['CUSTOM_API_KEY']
255
+ config.api_url = ENV['CUSTOM_API_URL']
256
+ end
257
+ ```
258
+
259
+ ## ๐Ÿงช Testing Setup
260
+
261
+ ### RSpec
262
+
263
+ ```ruby
264
+ # spec/rails_helper.rb
265
+ RSpec.configure do |config|
266
+ # Include Rails AI helpers
267
+ config.include RailsAi::TestHelpers
268
+
269
+ # Configure for testing
270
+ config.before(:each) do
271
+ RailsAi.configure do |ai_config|
272
+ ai_config.provider = :dummy
273
+ ai_config.stub_responses = true
274
+ end
275
+ end
276
+ end
277
+ ```
278
+
279
+ ### Test Configuration
280
+
281
+ ```ruby
282
+ # spec/support/rails_ai.rb
283
+ RSpec.configure do |config|
284
+ config.before(:suite) do
285
+ RailsAi.configure do |ai_config|
286
+ ai_config.provider = :dummy
287
+ ai_config.stub_responses = true
288
+ ai_config.cache_ttl = 1.minute
289
+ end
290
+ end
291
+ end
292
+ ```
293
+
294
+ ## ๏ฟฝ๏ฟฝ Production Setup
295
+
296
+ ### Environment Variables
297
+
298
+ ```bash
299
+ # .env.production
300
+ OPENAI_API_KEY=your_production_api_key
301
+ REDIS_URL=redis://your-redis-server:6379
302
+ RAILS_AI_CACHE_TTL=3600
303
+ RAILS_AI_CONNECTION_POOL_SIZE=20
304
+ ```
305
+
306
+ ### Production Configuration
307
+
308
+ ```ruby
309
+ # config/environments/production.rb
310
+ Rails.application.configure do
311
+ # Rails AI production configuration
312
+ config.rails_ai.cache_ttl = 24.hours
313
+ config.rails_ai.connection_pool_size = 20
314
+ config.rails_ai.enable_compression = true
315
+ config.rails_ai.enable_performance_monitoring = true
316
+ end
317
+ ```
318
+
319
+ ### Caching Setup
320
+
321
+ ```ruby
322
+ # config/environments/production.rb
323
+ Rails.application.configure do
324
+ # Redis caching for production
325
+ config.cache_store = :redis_cache_store, {
326
+ url: ENV['REDIS_URL'],
327
+ namespace: 'rails_ai',
328
+ expires_in: 24.hours
329
+ }
330
+ end
331
+ ```
332
+
333
+ ## ๐Ÿ”ง Advanced Configuration
334
+
335
+ ### Custom Models
336
+
337
+ ```ruby
338
+ # config/initializers/rails_ai.rb
339
+ RailsAi.configure do |config|
340
+ config.default_model = "gpt-4o-mini"
341
+
342
+ # Custom models for different operations
343
+ config.models = {
344
+ chat: "gpt-4o-mini",
345
+ image: "dall-e-3",
346
+ video: "sora",
347
+ audio: "tts-1",
348
+ embedding: "text-embedding-3-small"
349
+ }
350
+ end
351
+ ```
352
+
353
+ ### Rate Limiting
354
+
355
+ ```ruby
356
+ # config/initializers/rails_ai.rb
357
+ RailsAi.configure do |config|
358
+ config.rate_limiting = {
359
+ enabled: true,
360
+ requests_per_minute: 60,
361
+ requests_per_hour: 1000
362
+ }
363
+ end
364
+ ```
365
+
366
+ ### Content Filtering
367
+
368
+ ```ruby
369
+ # config/initializers/rails_ai.rb
370
+ RailsAi.configure do |config|
371
+ config.content_filtering = {
372
+ enabled: true,
373
+ redact_emails: true,
374
+ redact_phones: true,
375
+ redact_ssn: true
376
+ }
377
+ end
378
+ ```
379
+
380
+ ## ๐Ÿณ Docker Setup
381
+
382
+ ### Dockerfile
383
+
384
+ ```dockerfile
385
+ FROM ruby:3.2.0
386
+
387
+ # Install system dependencies
388
+ RUN apt-get update && apt-get install -y \
389
+ build-essential \
390
+ libpq-dev \
391
+ nodejs \
392
+ npm
393
+
394
+ # Set working directory
395
+ WORKDIR /app
396
+
397
+ # Copy Gemfile
398
+ COPY Gemfile Gemfile.lock ./
399
+
400
+ # Install gems
401
+ RUN bundle install
402
+
403
+ # Copy application code
404
+ COPY . .
405
+
406
+ # Expose port
407
+ EXPOSE 3000
408
+
409
+ # Start application
410
+ CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
411
+ ```
412
+
413
+ ### Docker Compose
414
+
415
+ ```yaml
416
+ version: '3.8'
417
+
418
+ services:
419
+ app:
420
+ build: .
421
+ ports:
422
+ - "3000:3000"
423
+ environment:
424
+ - RAILS_ENV=production
425
+ - OPENAI_API_KEY=${OPENAI_API_KEY}
426
+ - REDIS_URL=redis://redis:6379
427
+ depends_on:
428
+ - redis
429
+
430
+ redis:
431
+ image: redis:7-alpine
432
+ ports:
433
+ - "6379:6379"
434
+ ```
435
+
436
+ ## ๐Ÿ” Verification
437
+
438
+ ### Test Installation
439
+
440
+ ```ruby
441
+ # rails console
442
+ RailsAi.chat("Hello, world!")
443
+ # => "Hello! How can I help you today?"
444
+
445
+ RailsAi.generate_image("A beautiful sunset")
446
+ # => "data:image/png;base64,..."
447
+
448
+ RailsAi.metrics
449
+ # => { chat: { count: 1, total_duration: 0.5, ... } }
450
+ ```
451
+
452
+ ### Check Configuration
453
+
454
+ ```ruby
455
+ # rails console
456
+ RailsAi.config.provider
457
+ # => :openai
458
+
459
+ RailsAi.config.default_model
460
+ # => "gpt-4o-mini"
461
+
462
+ RailsAi.config.cache_ttl
463
+ # => 3600
464
+ ```
465
+
466
+ ## ๐Ÿšจ Troubleshooting
467
+
468
+ ### Common Issues
469
+
470
+ #### 1. API Key Not Set
471
+
472
+ ```bash
473
+ # Error: API key not found
474
+ # Solution: Set environment variable
475
+ export OPENAI_API_KEY=your_api_key_here
476
+ ```
477
+
478
+ #### 2. Gem Not Found
479
+
480
+ ```bash
481
+ # Error: Could not find gem 'rails_ai'
482
+ # Solution: Run bundle install
483
+ bundle install
484
+ ```
485
+
486
+ #### 3. Configuration Not Loaded
487
+
488
+ ```ruby
489
+ # Error: Configuration not found
490
+ # Solution: Check initializer file
491
+ # config/initializers/rails_ai.rb should exist
492
+ ```
493
+
494
+ #### 4. Cache Not Working
495
+
496
+ ```ruby
497
+ # Error: Cache not working
498
+ # Solution: Check cache store configuration
499
+ Rails.cache.class
500
+ # Should return a cache store class
501
+ ```
502
+
503
+ ### Debug Mode
504
+
505
+ ```ruby
506
+ # Enable debug logging
507
+ Rails.logger.level = :debug
508
+
509
+ # Check Rails AI configuration
510
+ RailsAi.config.inspect
511
+
512
+ # Check provider
513
+ RailsAi.provider.class
514
+ ```
515
+
516
+ ## ๐Ÿ“š Next Steps
517
+
518
+ After installation, check out these guides:
519
+
520
+ - [Quick Start](Quick-Start.md) - Get up and running quickly
521
+ - [Basic Usage](Basic-Usage.md) - Learn the basics
522
+ - [Configuration](Configuration.md) - Advanced configuration
523
+ - [API Documentation](API-Documentation.md) - Complete API reference
524
+
525
+ ---
526
+
527
+ **Rails AI is now installed and ready to use!** ๐Ÿš€
@@ -0,0 +1,186 @@
1
+ # Quick Start Guide
2
+
3
+ Get up and running with Rails AI in 5 minutes!
4
+
5
+ ## ๐Ÿš€ Installation
6
+
7
+ ### 1. Add to Gemfile
8
+
9
+ ```ruby
10
+ gem 'rails_ai'
11
+ ```
12
+
13
+ ### 2. Install and Configure
14
+
15
+ ```bash
16
+ bundle install
17
+ rails generate rails_ai:install
18
+ ```
19
+
20
+ ### 3. Set API Key
21
+
22
+ ```bash
23
+ export OPENAI_API_KEY=your_api_key_here
24
+ ```
25
+
26
+ ## โšก Basic Usage
27
+
28
+ ### Text Generation
29
+
30
+ ```ruby
31
+ # Simple chat
32
+ RailsAi.chat("Write a blog post about Ruby on Rails")
33
+
34
+ # Streaming response
35
+ RailsAi.stream("Explain quantum computing") do |token|
36
+ puts token
37
+ end
38
+ ```
39
+
40
+ ### Image Generation
41
+
42
+ ```ruby
43
+ # Generate image
44
+ image = RailsAi.generate_image("A beautiful sunset over mountains")
45
+
46
+ # Analyze image
47
+ analysis = RailsAi.analyze_image(image, "What do you see?")
48
+ ```
49
+
50
+ ### Context-Aware AI
51
+
52
+ ```ruby
53
+ # With user context
54
+ RailsAi.analyze_image_with_context(
55
+ image,
56
+ "What do you see?",
57
+ user_context: { id: 1, role: "admin" },
58
+ window_context: { controller: "PostsController" }
59
+ )
60
+ ```
61
+
62
+ ## ๐ŸŽจ Rails Integration
63
+
64
+ ### In Controllers
65
+
66
+ ```ruby
67
+ class PostsController < ApplicationController
68
+ include RailsAi::ContextAware
69
+
70
+ def generate_content
71
+ content = generate_with_context("Write a blog post about #{@post.title}")
72
+ render json: { content: content }
73
+ end
74
+ end
75
+ ```
76
+
77
+ ### In Views
78
+
79
+ ```erb
80
+ <!-- AI Chat Interface -->
81
+ <%= render RailsAi::PromptComponent.new(
82
+ prompt: "Ask me anything",
83
+ stream_id: ai_stream_id
84
+ ) %>
85
+
86
+ <!-- Image Generation Form -->
87
+ <%= form_with url: ai_generate_image_path do |form| %>
88
+ <%= form.text_area :prompt, placeholder: "Describe the image" %>
89
+ <%= form.submit "Generate Image" %>
90
+ <% end %>
91
+ ```
92
+
93
+ ### In Models
94
+
95
+ ```ruby
96
+ class Article < ApplicationRecord
97
+ include RailsAi::Embeddable
98
+
99
+ def generate_summary!
100
+ RailsAi.summarize(content)
101
+ end
102
+ end
103
+ ```
104
+
105
+ ## ๐Ÿ”ง Configuration
106
+
107
+ ```ruby
108
+ # config/initializers/rails_ai.rb
109
+ RailsAi.configure do |config|
110
+ config.provider = :openai
111
+ config.default_model = "gpt-4o-mini"
112
+ config.cache_ttl = 1.hour
113
+ config.enable_performance_monitoring = true
114
+ end
115
+ ```
116
+
117
+ ## ๐Ÿงช Testing
118
+
119
+ ```ruby
120
+ # In your tests
121
+ RSpec.describe "AI Features" do
122
+ before do
123
+ RailsAi.configure do |config|
124
+ config.provider = :dummy
125
+ config.stub_responses = true
126
+ end
127
+ end
128
+
129
+ it "generates content" do
130
+ result = RailsAi.chat("Hello")
131
+ expect(result).to be_a(String)
132
+ end
133
+ end
134
+ ```
135
+
136
+ ## ๐ŸŽฏ Common Use Cases
137
+
138
+ ### Content Generation
139
+
140
+ ```ruby
141
+ # Blog posts
142
+ post = RailsAi.chat("Write a blog post about #{topic}")
143
+
144
+ # Product descriptions
145
+ description = RailsAi.chat("Write a product description for #{product_name}")
146
+
147
+ # Email content
148
+ email = RailsAi.chat("Write a marketing email about #{campaign}")
149
+ ```
150
+
151
+ ### Image Processing
152
+
153
+ ```ruby
154
+ # Generate product images
155
+ image = RailsAi.generate_image("Product photo of #{product_name}")
156
+
157
+ # Analyze user uploads
158
+ analysis = RailsAi.analyze_image(uploaded_file, "Is this appropriate for our site?")
159
+
160
+ # Create variations
161
+ variations = RailsAi.create_variation(existing_image)
162
+ ```
163
+
164
+ ### Data Analysis
165
+
166
+ ```ruby
167
+ # Sentiment analysis
168
+ sentiment = RailsAi.classify(user_feedback, ["positive", "negative", "neutral"])
169
+
170
+ # Extract information
171
+ entities = RailsAi.extract_entities("Apple Inc. was founded by Steve Jobs")
172
+
173
+ # Summarize content
174
+ summary = RailsAi.summarize(long_document)
175
+ ```
176
+
177
+ ## ๐Ÿš€ Next Steps
178
+
179
+ - [Basic Usage](Basic-Usage.md) - Learn more features
180
+ - [Configuration](Configuration.md) - Advanced setup
181
+ - [API Documentation](API-Documentation.md) - Complete reference
182
+ - [Contributing Guide](Contributing-Guide.md) - Contribute to the project
183
+
184
+ ---
185
+
186
+ **You're ready to build AI-powered Rails applications!** ๐Ÿš€