vibe.assistant.system_prompt_builder¶
System prompt building for the assistant.
PromptConfig ¶
Configuration for system prompt building.
SystemPromptBuilder ¶
Builds system prompts for the assistant.
Responsibilities: - Load and render system prompt templates - Format draft blocks as markdown - Determine unanswered questions - Extract Q&A pairs from history for consolidated draft strategy
__init__ ¶
__init__(config: PromptConfig) -> None
Initialize the builder with configuration.
| Parameters: |
|
|---|
get_template ¶
get_template(template_config: dict[str, Any] | None = None) -> Template
Get the system prompt Jinja template.
| Parameters: |
|
|---|
| Returns: |
|
|---|
build ¶
build(current_state: dict[str, Any], draft_blocks: list[dict[str, Any]], unanswered_questions: list[dict[str, Any]], history: list[Message]) -> SystemMessage
Build the complete system prompt.
| Parameters: |
|
|---|
| Returns: |
|
|---|
format_draft_blocks ¶
format_draft_blocks(draft_blocks: list[dict[str, Any]]) -> str
Format draft blocks as markdown with semantic IDs.
| Parameters: |
|
|---|
| Returns: |
|
|---|
extract_qa_pairs ¶
Extract question-answer pairs from conversation history.
Q&A pairs are extracted by matching tool responses to ask_* tool calls in the assistant messages.
| Parameters: |
|
|---|
| Returns: |
|
|---|
inject_draft ¶
inject_draft(prompt_content: str, draft_blocks: list[dict[str, Any]]) -> str
Inject draft blocks content into system prompt for consolidated strategy.
| Parameters: |
|
|---|
| Returns: |
|
|---|