Skip to main content

ModerateFocus

PyPI version License: MIT Downloads LinkedIn

Analyzing Community Moderation and Platform Policies

Overview ModerateFocus is a Python package that helps analyze user-submitted text queries about community moderation or platform policies. It uses a Large Language Model (LLM) to generate reasoned explanations and extract key points using pattern matching. This ensures consistent, non-opinionated output, helping users understand common moderation pitfalls without delving into sensitive or subjective areas.

Installation

pip install moderatefocus

Usage

from moderatefocus import moderatefocus

response = moderatefocus(user_input, api_key="your_api_key_here")
print(response)  # Output: list of extracted key points

Parameters

  • user_input: str - the user input text to process
  • api_key: Optional[str] - the API key for LLM7, if not provided, the default ChatLLM7 will be used
  • llm: Optional[BaseChatModel] - the langchain LLM instance to use, if not provided, the default ChatLLM7 will be used

Using Custom LLM Instances You can safely pass your own LLM instance (based on langchain if you want to use another LLM. For example:

from langchain_openai import ChatOpenAI
from moderatefocus import moderatefocus

llm = ChatOpenAI()
response = moderatefocus(user_input, llm=llm)

Using Another LLM You can use another LLM like anthropic or google. For example:

from langchain_anthropic import ChatAnthropic
from moderatefocus import moderatefocus

llm = ChatAnthropic()
response = moderatefocus(user_input, llm=llm)

or google:

from langchain_google_genai import ChatGoogleGenerativeAI
from moderatefocus import moderatefocus

llm = ChatGoogleGenerativeAI()
response = moderatefocus(user_input, llm=llm)

API Key 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 for LLM7, you can pass your own API key via environment variable LLM7_API_KEY or via passing it directly like moderatefocus(user_input, api_key="your_api_key_here"). You can get a free API key by registering at https://token.llm7.io/.

Author Eugene Evstafev (hi@eugene.plus)

GitHub https://github.com/chigwell

License MIT License

Metadata

Release files for moderatefocus 2025.12.21103715

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moderatefocus 2025.12.21103715
File Size Uploaded
moderatefocus-2025.12.21103715.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moderatefocus 2025.12.21103715
File Interpreter ABI Platform
moderatefocus-2025.12.21103715-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / moderatefocus-2025.12.21103715.tar.gz

Download URL moderatefocus-2025.12.21103715.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df51ae233a33af5d960dd3773926e1f09a4e5ccedd7e9978981f642f0de1a1b0
BLAKE2b-256 checksum
How to use checksums
57d62a22ecf1d62c0bb17df8422012356002946ea15b7048a49f4df59b7d379a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / moderatefocus-2025.12.21103715-py3-none-any.whl

Download URL moderatefocus-2025.12.21103715-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02cf46527da4757d059633d4344191c9b6161aab50863315f9c77e475e561402
BLAKE2b-256 checksum
How to use checksums
6af49e5a3917084dc724e0c2c91a25759ed600f80f4565335d665bbbd9e1b6cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

2025.12.21103715 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page