spacr.qt.ai.prompts

System prompts used by the AI console.

Two shapes:

Functions

default_system_prompt(→ str)

Return the spaCR-aware assistant persona used for freeform chat.

error_explainer_prompt(→ str)

Return the system prompt that turns a traceback into a numbered fix list.

tool_approval_note(→ str)

Tell the assistant how tool approval works in spaCR's console (GitHub #147).

wrap_error_for_prompt(→ str)

Turn a raw traceback into the user message body sent to the model.

Module Contents

spacr.qt.ai.prompts.default_system_prompt() → str[source]

Return the spaCR-aware assistant persona used for freeform chat.

spacr.qt.ai.prompts.error_explainer_prompt() → str[source]

Return the system prompt that turns a traceback into a numbered fix list.

spacr.qt.ai.prompts.tool_approval_note(provider_name: str) → str[source]

Tell the assistant how tool approval works in spaCR’s console (GitHub #147).

The vendor CLIs run non-interactively, so they cannot show their own approval prompt. For Claude Code spaCR asks the user itself after the reply and resumes the session when the user allows the call; the other CLIs have no such route, so the assistant hands the command over instead.

Parameters:

provider_name – the provider’s short id, such as "claude".

Returns:

the paragraph to append to the system prompt.

spacr.qt.ai.prompts.wrap_error_for_prompt(traceback_text: str, active_app: str = '') → str[source]

Turn a raw traceback into the user message body sent to the model.

Parameters:

traceback_text – the raw traceback text; surrounding whitespace is stripped and the rest is placed inside a fenced code block.