A new package designed to assist users in understanding and resolving errors in program execution. Users can input error messages or descriptions of unexpected program behavior, and the package will u
Project description
debugscribe
A small yet powerful helper package that turns error messages or unexpected program behaviour into structured, step‑by‑step troubleshooting guidance.
It sends your problem description to LLM7 (or any other LLM you provide), matches the LLM’s reply against a strict regex pattern using llmatch-messages, and returns a plain list of strings containing the recommended fix steps.
Main function –
debugscribe().
Package name –debugscribe
Features
| Feature | Details |
|---|---|
| LLM‑agnostic | Uses ChatLLM7 by default, but you can pass any langchain BaseChatModel. |
| Structured output | Output is filtered through a regex; you get clean, consistently formatted text. |
| Quick installation | One pip command. |
| Easy integration | Works in scripts, Jupyter notebooks, or any Python project. |
Installation
pip install debugscribe
The package pulls in its dependencies automatically:
langchain-corelangchain-llm7– the default LLM7 wrapperllmatch-messages– for regex‑based validation
Quick Start
Simple usage
from debugscribe import debugscribe
error_msg = """
Traceback (most recent call last):
File "/home/user/app.py", line 5, in <module>
main()
File "/home/user/app.py", line 2, in main
x = 1/0
ZeroDivisionError: division by zero
"""
steps = debugscribe(error_msg)
for i, step in enumerate(steps, 1):
print(f"{i}. {step}")
Using a custom LLM instead of LLM7
You can hand‑off any langchain model.
Here are a few popular examples.
OpenAI
from langchain_openai import ChatOpenAI
from debugscribe import debugscribe
llm = ChatOpenAI() # automatically picks up OpenAI API key from env
response = debugscribe(error_msg, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from debugscribe import debugscribe
llm = ChatAnthropic() # needs ANTHROPIC_API_KEY
response = debugscribe(error_msg, llm=llm)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from debugscribe import debugscribe
llm = ChatGoogleGenerativeAI() # needs GOOGLE_API_KEY
response = debugscribe(error_msg, llm=llm)
Tip – The default
ChatLLM7is accessed withfrom langchain_llm7 import ChatLLM7; it will pick up the free‑tier rate limits unless you provide your ownapi_keyor setLLM7_API_KEYin the environment.
Parameters
debugscribe(
user_input: str,
api_key: Optional[str] = None,
llm: Optional[BaseChatModel] = None
) -> List[str]
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The raw error message or behaviour description you want to debug. |
llm |
Optional[BaseChatModel] |
Any langchain LLM instance. If omitted, a ChatLLM7 instance is created. |
api_key |
Optional[str] |
API key for LLM7. If omitted, the library checks the LLM7_API_KEY environment variable or falls back to the default free‑tier key. |
Behind the scenes
- Prompt construction – The function stitches together a system prompt and the user input according to a pattern defined in
prompts.py. - LLM call –
llmatch()fromllmatch-messagessends the request via the chosen LLM. - Regex validation – The LLM’s reply is matched against a compiled pattern; only well‑formed replies are surfaced.
- Return value – A list of strings, each a distinct step for resolution.
Getting an LLM7 API key
The default free tier offers generous limits suitable for most developers.
If you require higher limits, acquire an API key at https://token.llm7.io/ and either:
export LLM7_API_KEY="my_awesome_key"
or pass it directly:
response = debugscribe(error_msg, api_key="my_awesome_key")
Contributing & Issues
Pull requests are welcome! For bug reports, questions, or suggestions, open an issue in the dedicated GitHub Issues tracker:
https://github.com/chigwell/debugscribe/issues
Contact
- Author: Eugene Evstafev
- Email: hi@euegne.plus
- GitHub: @chigwell
License
MIT © Eugene Evstafev
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 debugscribe-2025.12.21165719.tar.gz.
File metadata
- Download URL: debugscribe-2025.12.21165719.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34cc605c0f7551d1c96d67cf38c155e84e4f832e388c0051f7739a99018de022
|
|
| MD5 |
45bff92b1fd12138097c234c93f3c49f
|
|
| BLAKE2b-256 |
3332eeb9493d9aa253cad4e5a292f90136fda96ac0a13c3e293e548f928ceb74
|
File details
Details for the file debugscribe-2025.12.21165719-py3-none-any.whl.
File metadata
- Download URL: debugscribe-2025.12.21165719-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
8d6813ed7793275d84c6231adafa14679393317f232cfb6fd087b65fd52d1684
|
|
| MD5 |
7521dc65a5417cb93697b866c6d74b86
|
|
| BLAKE2b-256 |
2ff49c425fe594dab68cea0be005bbe2adfe7f3f7548e362df91b2d667702e14
|