contai
Описание
Коннектор с AI генераторами для Rails моделей. Подключает внешние API с генераторами для создания контента в различных полях моделей.
Языки
- Ruby76,2%
- JavaScript19%
- CSS4,3%
- Shell0,5%
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
10 месяцев назад
README.md
Contai
AI content generation for Rails models. Integrate external AI APIs seamlessly into your Rails applications.
Installation
Add this line to your application's Gemfile:
And then execute:
$ bundle install
Usage
Basic Setup
Include in your model and configure it:Contai::Generatable
Generate Content
Supported Providers
OpenAI
Claude
N8N Webhook
Custom HTTP
Configuration
Configure global defaults:
HTTP Headers Configuration
You can configure HTTP headers in three ways:
- Global default headers in the initializer (applies to all HTTP-based providers):
- Provider-specific headers in your model:
- Combining both - provider headers will be merged with default headers:
Routes
Add to your routes file:
Error Handling
The gem provides comprehensive error handling:
Testing
Test your models with Contai:
Development
After checking out the repo, run:
Contributing
- Fork it
- Create your feature branch (
)git checkout -b my-new-feature - Commit your changes (
)git commit -am 'Add some feature' - Push to the branch (
)git push origin my-new-feature - Create new Pull Request
License
The gem is available as open source under the terms of the CAPAA License.