spacr.qt.ai.settings¶
Persist AI Console preferences through Qt application settings.
The module stores provider response speed, the optional system-prompt
override, error-reporting preferences, the reports filed automatically from
this profile, and console-context sharing. Values persist across application
sessions through PySide6.QtCore.QSettings.
Functions¶
|
Where this profile already filed a report with this fingerprint. |
|
Return whether a failed run is reported as a GitHub issue. |
|
Return whether new console output is attached to AI questions. |
|
Return the validated response-speed preference. |
|
Return whether pipeline errors are routed to the AI Console. |
|
Return the stored system-prompt override or the spaCR default. |
|
Return whether a non-empty system-prompt override is stored. |
|
Return command-line arguments for the selected provider and speed. |
|
Record that a report with this fingerprint was filed automatically. |
|
Remove the stored system-prompt override. |
|
Store the GitHub issue-filing preference. |
|
Store the console-context sharing preference. |
|
Store the response-speed preference. |
|
Store the pipeline-error routing preference. |
|
Store a system-prompt override. |
Module Contents¶
- spacr.qt.ai.settings.auto_filed_url(fingerprint: str) str[source]¶
Where this profile already filed a report with this fingerprint.
- Parameters:
fingerprint – a traceback fingerprint from
spacr.qt.ai.issue_report.fingerprint_of().- Returns:
the issue URL, or
""when this profile has not filed it.
- spacr.qt.ai.settings.get_auto_file_issues() bool[source]¶
Return whether a failed run is reported as a GitHub issue.
This is the switch for reporting as a whole. How a report is sent is
spacr.qt.preferences.get_issue_prompt_mode(): with ‘always’ it is filed automatically, with ‘ask’ a “File as issue” button opens it in a preview first, and with ‘never’ nothing is filed.- Returns:
the stored choice, or
DEFAULT_AUTO_FILE_ISSUESfor a profile that never made one; reporting is on by default. A stored False, from the installer’s consent page or from this switch, is kept.
- spacr.qt.ai.settings.get_console_aware() bool[source]¶
Return whether new console output is attached to AI questions.
The preference defaults to
True. The console panel reports the amount of context attached to each message and applies its own output-length and traceback retention rules.
- spacr.qt.ai.settings.get_response_speed() str[source]¶
Return the validated response-speed preference.
- Returns:
{“fast”, “balanced”, “deep”} – Stored speed, or
DEFAULT_SPEEDif the stored value is absent or invalid.
- spacr.qt.ai.settings.get_route_errors_through_ai() bool[source]¶
Return whether pipeline errors are routed to the AI Console.
The preference is effective only when an AI provider is configured. It defaults to
True.
- spacr.qt.ai.settings.get_system_prompt() str[source]¶
Return the stored system-prompt override or the spaCR default.
- Returns:
str – Non-empty stored override, otherwise the value returned by
default_system_prompt().
- spacr.qt.ai.settings.is_system_prompt_overridden() bool[source]¶
Return whether a non-empty system-prompt override is stored.
- spacr.qt.ai.settings.provider_args(provider_name: str) List[str][source]¶
Return command-line arguments for the selected provider and speed.
- Parameters:
provider_name (str) – Provider identifier used as a key in
SPEED_MAP.- Returns:
list of str – Additional command-line arguments. Unknown providers or unmapped speed levels return an empty list.
- spacr.qt.ai.settings.remember_auto_filed(fingerprint: str, url: str) None[source]¶
Record that a report with this fingerprint was filed automatically.
The same crash is then never filed twice from this profile, however many times the run is repeated. The oldest entries are dropped beyond
AUTO_FILED_LIMIT.- Parameters:
fingerprint – the report’s fingerprint.
url – the issue it was filed as, or commented on.
- spacr.qt.ai.settings.set_auto_file_issues(enabled: bool) None[source]¶
Store the GitHub issue-filing preference.
- Parameters:
enabled – whether reports may be filed as GitHub issues automatically; coerced with
bool()and saved underai/auto_file_issuesin spaCR’sQSettings.
- spacr.qt.ai.settings.set_console_aware(enabled: bool) None[source]¶
Store the console-context sharing preference.
- Parameters:
enabled – whether console context may be shared with the AI assistant; coerced with
bool()and saved underai/console_awarein spaCR’sQSettings.
- spacr.qt.ai.settings.set_response_speed(speed: str) None[source]¶
Store the response-speed preference.
- Parameters:
speed ({"fast", "balanced", "deep"}) – Provider-independent speed label.
- Raises:
ValueError – If
speedis not supported.