Classes
ActionableSuggestion
9
▼
A structured, actionable suggestion for fixing an error.
ActionableSuggestion
9
▼
A structured, actionable suggestion for fixing an error.
Attributes
| Name | Type | Description |
|---|---|---|
fix |
str
|
Short one-line fix description |
explanation |
str
|
Longer explanation of what went wrong |
docs_url |
str | None
|
Link to documentation |
before_snippet |
str | None
|
Example of broken code |
after_snippet |
str | None
|
Example of fixed code |
check_files |
list[str]
|
Files to investigate for this error |
related_codes |
list[str]
|
Related error codes |
grep_patterns |
list[str]
|
Patterns to search for in codebase |
Methods
to_dict
0
dict[str, Any]
▼
Convert to dictionary.
to_dict
0
dict[str, Any]
▼
def to_dict(self) -> dict[str, Any]
Returns
dict[str, Any]
Functions
get_suggestion
2
ActionableSuggestion | N…
▼
Get actionable suggestion for an error.
get_suggestion
2
ActionableSuggestion | N…
▼
def get_suggestion(category: str, error_key: str) -> ActionableSuggestion | None
Parameters
| Name | Type | Description |
|---|---|---|
category |
str |
Error category (directive, config, template, etc.) |
error_key |
str |
Specific error identifier |
Returns
ActionableSuggestion | None
get_suggestion_dict
2
dict[str, Any] | None
▼
Get suggestion as dictionary.
get_suggestion_dict
2
dict[str, Any] | None
▼
def get_suggestion_dict(category: str, error_key: str) -> dict[str, Any] | None
Parameters
| Name | Type | Description |
|---|---|---|
category |
str |
Error category |
error_key |
str |
Specific error identifier |
Returns
dict[str, Any] | None
enhance_error_context
3
dict[str, Any]
▼
Enhance error context dict with actionable suggestion.
enhance_error_context
3
dict[str, Any]
▼
def enhance_error_context(context: dict[str, Any], category: str, error_key: str) -> dict[str, Any]
Parameters
| Name | Type | Description |
|---|---|---|
context |
dict[str, Any] |
Existing error context dict |
category |
str |
Error category |
error_key |
str |
Specific error identifier |
Returns
dict[str, Any]
format_suggestion
3
str | None
▼
Format suggestion as a string for logging.
format_suggestion
3
str | None
▼
def format_suggestion(category: str, error_key: str, *, include_snippets: bool = False) -> str | None
Parameters
| Name | Type | Description |
|---|---|---|
category |
str |
Error category |
error_key |
str |
Specific error identifier |
include_snippets |
bool |
Whether to include code snippets Default:False
|
Returns
str | None
format_suggestion_full
2
str | None
▼
Format full suggestion with all details.
format_suggestion_full
2
str | None
▼
def format_suggestion_full(category: str, error_key: str) -> str | None
Parameters
| Name | Type | Description |
|---|---|---|
category |
str |
Error category |
error_key |
str |
Specific error identifier |
Returns
str | None
get_attribute_error_suggestion
1
str | None
▼
Get actionable suggestion for AttributeError based on error message.
Pattern-m…
get_attribute_error_suggestion
1
str | None
▼
def get_attribute_error_suggestion(error_msg: str) -> str | None
Get actionable suggestion for AttributeError based on error message.
Pattern-matches the error message against known migrations and returns a formatted suggestion string.
Parameters
| Name | Type | Description |
|---|---|---|
error_msg |
str |
The error message from AttributeError |
Returns
str | None
get_all_suggestions_for_category
1
dict[str, ActionableSugg…
▼
Get all suggestions for a category.
get_all_suggestions_for_category
1
dict[str, ActionableSugg…
▼
def get_all_suggestions_for_category(category: str) -> dict[str, ActionableSuggestion]
Parameters
| Name | Type | Description |
|---|---|---|
category |
str |
Error category |
Returns
dict[str, ActionableSuggestion]
search_suggestions
1
list[tuple[str, str, Act…
▼
Search suggestions by keyword.
search_suggestions
1
list[tuple[str, str, Act…
▼
def search_suggestions(query: str) -> list[tuple[str, str, ActionableSuggestion]]
Parameters
| Name | Type | Description |
|---|---|---|
query |
str |
Search query (searches fix, explanation, and patterns) |
Returns
list[tuple[str, str, ActionableSuggestion]]