Skip to main content

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

PyPI version License: MIT Downloads LinkedIn

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rails_delegated_analyzer-2025.12.21150543.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file rails_delegated_analyzer-2025.12.21150543.tar.gz.

File metadata

File hashes

Hashes for rails_delegated_analyzer-2025.12.21150543.tar.gz
Algorithm Hash digest
SHA256 08b520ef78947ac7e5762a4f4a6252edf9334b7afa81bd15cd2381836a4940ce
MD5 3018e55090c27f98857f60f3ff41352e
BLAKE2b-256 e41c6b64949da6cf48e071f4ae15caadd5901d3eda815c438eb52971fb5c8b4d

See more details on using hashes here.

File details

Details for the file rails_delegated_analyzer-2025.12.21150543-py3-none-any.whl.

File metadata

File hashes

Hashes for rails_delegated_analyzer-2025.12.21150543-py3-none-any.whl
Algorithm Hash digest
SHA256 7247fb94ae00b6a947106eadf68822b1b3fbb62798a531d3a8c9f04bea55dfae
MD5 e5cd1d46288a34f72be2d855d2577f8f
BLAKE2b-256 491125fbe0a9bf3e85d065473a2308d4ee847bf709d2f07b8a9d5f944caccd0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page