Skip to main content

A new package designed to facilitate structured and reliable analysis of user input related to software refactoring in the context of LLM capabilities. It accepts a user's discussion or question about

Project description

refactor-llm-analyzer

PyPI version License: MIT Downloads LinkedIn

refactor-llm-analyzer is a Python package designed to facilitate structured and reliable analysis of user input related to software refactoring in the context of large language models (LLMs). It processes text-based discussions or questions to extract key themes, concerns, or strategies, enabling consistent interpretation and supporting automated decision-making or knowledge extraction. The package uses pattern matching and LLM capabilities to produce structured summaries or insights from user input.

Installation

Install the package via pip:

pip install refactor_llm_analyzer

Usage

Here's an example of how to use the package:

from refactor_llm_analyzer import refactor_llm_analyzer

user_input = "How can I improve the readability of my code by refactoring the functions?"
response = refactor_llm_analyzer(user_input)
print(response)

Parameters

  • user_input (str): The user input text to process.
  • llm (Optional[BaseChatModel]): An optional LangChain LLM instance to use. If not provided, the default ChatLLM7 will be used.
  • api_key (Optional[str]): The API key for LLM7. If not provided, it will be retrieved from the environment variable LLM7_API_KEY.

Supporting External Language Models

This package uses ChatLLM7 from the langchain_llm7 module by default. Developers can supply their own language model instances for flexibility and customization. Supported integrations include:

  • OpenAI GPT models
  • Anthropic models
  • Google Generative AI

Example of using a custom LLM

from langchain_openai import ChatOpenAI
from refactor_llm_analyzer import refactor_llm_analyzer

llm = ChatOpenAI()
response = refactor_llm_analyzer(user_input, llm=llm)
print(response)
from langchain_anthropic import ChatAnthropic
from refactor_llm_analyzer import refactor_llm_analyzer

llm = ChatAnthropic()
response = refactor_llm_analyzer(user_input, llm=llm)
print(response)
from langchain_google_genai import ChatGoogleGenerativeAI
from refactor_llm_analyzer import refactor_llm_analyzer

llm = ChatGoogleGenerativeAI()
response = refactor_llm_analyzer(user_input, llm=llm)
print(response)

Rate Limits and API Keys

The default rate limits for LLM7’s free tier are sufficient for most use cases. To increase limits, pass your API key via the environment variable LLM7_API_KEY or directly when calling the function:

response = refactor_llm_analyzer(user_input, api_key="your_api_key")

You can obtain a free API key by registering at https://token.llm7.io/.

Resources

Contact and Support

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

refactor_llm_analyzer-2025.12.21134750.tar.gz (5.7 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 refactor_llm_analyzer-2025.12.21134750.tar.gz.

File metadata

File hashes

Hashes for refactor_llm_analyzer-2025.12.21134750.tar.gz
Algorithm Hash digest
SHA256 f078244e4255b16285cfb8bf6eebe7a9601c7ec2708c4c7209ad6042966cd1c1
MD5 21cfa8a46d8fbffc3455f5735c057faa
BLAKE2b-256 5c4a800931ca03f259f01d6c0bca7799976993013e4b1c796db43c28f54fff84

See more details on using hashes here.

File details

Details for the file refactor_llm_analyzer-2025.12.21134750-py3-none-any.whl.

File metadata

File hashes

Hashes for refactor_llm_analyzer-2025.12.21134750-py3-none-any.whl
Algorithm Hash digest
SHA256 53c2c02a9d373f7796aaee00b40a2e040ea497046f2435b71dc773b25d2752b3
MD5 4a9a7501616ab26758c7b05fabf1211b
BLAKE2b-256 ce5c0f7e8cda24e2b63238295cbed1b0e39d824ee6cfe423ddbe6dff68c78b54

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