A new package would help developers understand and apply the Rails Delegated Type pattern by analyzing their text-based descriptions of database relationships or use cases. It would take a user's inpu
Project description
Rails Delegated Analyzer
Rails Delegated Analyzer is a Python package designed to help developers understand and apply the Rails Delegated Type pattern. It analyzes text-based descriptions of database relationships or use cases and provides structured explanations for implementing delegated types in Rails applications.
Features
- Analyzes user input about data models or scenarios
- Provides structured explanations for implementing delegated types
- Assists in designing polymorphic-like structures in Rails applications
- Supports custom LLM instances for flexible usage
Installation
pip install rails_delegated_analyzer
Usage
Basic Usage
from rails_delegated_analyzer import rails_delegated_analyzer
user_input = "Describe your data model or scenario here."
response = rails_delegated_analyzer(user_input)
print(response)
Using a Custom LLM Instance
The package uses ChatLLM7 from langchain_llm7 by default. However, you can safely pass your own LLM instance if you want to use another LLM.
Example with OpenAI
from langchain_openai import ChatOpenAI
from rails_delegated_analyzer import rails_delegated_analyzer
llm = ChatOpenAI()
response = rails_delegated_analyzer(user_input, llm=llm)
print(response)
Example with Anthropic
from langchain_anthropic import ChatAnthropic
from rails_delegated_analyzer import rails_delegated_analyzer
llm = ChatAnthropic()
response = rails_delegated_analyzer(user_input, llm=llm)
print(response)
Example with Google
from langchain_google_genai import ChatGoogleGenerativeAI
from rails_delegated_analyzer import rails_delegated_analyzer
llm = ChatGoogleGenerativeAI()
response = rails_delegated_analyzer(user_input, llm=llm)
print(response)
Using a Custom API Key
If you want to use a custom API key for LLM7, you can pass it directly or via an environment variable.
Using Environment Variable
export LLM7_API_KEY="your_api_key"
Passing API Key Directly
from rails_delegated_analyzer import rails_delegated_analyzer
user_input = "Describe your data model or scenario here."
response = rails_delegated_analyzer(user_input, api_key="your_api_key")
print(response)
Rate Limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you need higher rate limits, you can get a free API key by registering at LLM7.
Issues
If you encounter any issues, please report them on the GitHub issues page.
Author
- Eugene Evstafev - chigwell
- Email: hi@eugene.plus
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rails_delegated_analyzer-2025.12.21150543.tar.gz.
File metadata
- Download URL: rails_delegated_analyzer-2025.12.21150543.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b520ef78947ac7e5762a4f4a6252edf9334b7afa81bd15cd2381836a4940ce
|
|
| MD5 |
3018e55090c27f98857f60f3ff41352e
|
|
| BLAKE2b-256 |
e41c6b64949da6cf48e071f4ae15caadd5901d3eda815c438eb52971fb5c8b4d
|
File details
Details for the file rails_delegated_analyzer-2025.12.21150543-py3-none-any.whl.
File metadata
- Download URL: rails_delegated_analyzer-2025.12.21150543-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7247fb94ae00b6a947106eadf68822b1b3fbb62798a531d3a8c9f04bea55dfae
|
|
| MD5 |
e5cd1d46288a34f72be2d855d2577f8f
|
|
| BLAKE2b-256 |
491125fbe0a9bf3e85d065473a2308d4ee847bf709d2f07b8a9d5f944caccd0b
|