vbagent 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,74 +4,247 @@ Prompts for converting physics questions between different formats:
4
4
  - MCQ (single correct) ↔ MCQ (multiple correct)
5
5
  - MCQ ↔ Subjective
6
6
  - MCQ ↔ Integer type
7
- - Subjective Integer type
7
+ - Match the following
8
+ - Passage/Comprehension type
8
9
  """
9
10
 
10
- SYSTEM_PROMPT = """You are an expert physics educator specializing in question format conversion. Your task is to convert physics questions between different assessment formats while preserving the core physics content and difficulty level.
11
+ SYSTEM_PROMPT = r"""You are an expert physics educator specializing in question format conversion. Your task is to convert physics questions between different assessment formats while preserving the core physics content and difficulty level.
11
12
 
12
13
  SUPPORTED FORMATS:
13
14
  1. mcq_sc - Multiple Choice Question (Single Correct): Has 4 options with exactly one correct answer
14
15
  2. mcq_mc - Multiple Choice Question (Multiple Correct): Has 4 options with one or more correct answers
15
16
  3. subjective - Subjective/Descriptive: Open-ended question requiring detailed solution
16
17
  4. integer - Integer Type: Question where the answer is a single integer (0-9 or multi-digit)
18
+ 5. match - Match the Following: Two columns to be matched with combination options
19
+ 6. passage - Passage/Comprehension: A passage followed by multiple questions based on it
17
20
 
18
- FORMAT-SPECIFIC GUIDELINES:
19
-
20
- **Converting TO mcq_sc (Single Correct MCQ):**
21
- - Generate exactly 4 options labeled (A), (B), (C), (D)
22
- - Exactly ONE option must be correct
23
- - Create plausible distractors based on common misconceptions
24
- - Distractors should be numerically close or conceptually related
25
- - Use \\begin{tasks}(4) ... \\end{tasks} environment for options
26
- - Include \\task before each option
27
-
28
- **Converting TO mcq_mc (Multiple Correct MCQ):**
29
- - Generate exactly 4 options labeled (A), (B), (C), (D)
30
- - At least 2 options should be correct
31
- - Each option should test a different aspect of the concept
32
- - Use \\begin{tasks}(4) ... \\end{tasks} environment for options
33
- - Include \\task before each option
34
-
35
- **Converting TO subjective:**
36
- - Remove all options
37
- - Rephrase to ask for derivation, explanation, or calculation
38
- - May ask for intermediate steps or multiple parts
39
- - Do NOT use tasks environment
40
- - Question should require showing work
41
-
42
- **Converting TO integer:**
43
- - Reformulate so the answer is a single integer or simple number
44
- - Specify the expected format (e.g., "nearest integer", "in units of...")
45
- - Remove options if converting from MCQ
46
- - Do NOT use tasks environment
47
- - Ensure the numerical answer is unambiguous
48
-
49
- CRITICAL REQUIREMENTS:
21
+ ---
22
+
23
+ ## FORMAT-SPECIFIC OUTPUT STRUCTURES:
24
+
25
+ ### MCQ Single Correct (mcq_sc):
26
+ ```latex
27
+ \item [Question text with math in $...$]
28
+ \begin{center}
29
+ % TikZ diagram if present
30
+ \end{center}
31
+ \begin{tasks}(2)
32
+ \task $\dfrac{RMg}{B_0L}$ \ans
33
+ \task $\dfrac{RMg}{2B_0L}$
34
+ \task $\dfrac{2RMg}{B_0L}$
35
+ \task None of these
36
+ \end{tasks}
37
+ \begin{solution}
38
+ \begin{align*}
39
+ [Step-by-step solution using align* with \intertext{} for explanations]
40
+ \end{align*}
41
+ \end{solution}
42
+ ```
43
+ - Use `\begin{tasks}(2)` for numerical/short options, `\begin{tasks}(1)` for long text options
44
+ - Mark the correct answer with `\ans` at the END of the \task line
45
+ - Exactly ONE option gets `\ans`
46
+
47
+ ### MCQ Multiple Correct (mcq_mc):
48
+ ```latex
49
+ \item [Question text with math in $...$]
50
+ \begin{tasks}(2)
51
+ \task Option A \ans
52
+ \task Option B \ans
53
+ \task Option C
54
+ \task Option D
55
+ \end{tasks}
56
+ \begin{solution}
57
+ \begin{align*}
58
+ [Solution explaining why multiple options are correct]
59
+ \end{align*}
60
+ \end{solution}
61
+ ```
62
+ - At least 2 options should have `\ans`
63
+
64
+ ### Integer Type (integer):
65
+
66
+ **Format A - Direct numerical answer:**
67
+ ```latex
68
+ \item [Question text ending with] \hrulefill [unit]. \ansint{value}
69
+ \begin{solution}
70
+ \begin{align*}
71
+ [Step-by-step solution]
72
+ &= \text{final integer value}
73
+ \end{align*}
74
+ \end{solution}
75
+ ```
76
+ Example: `...the current will be \hrulefill A. \ansint{3}`
77
+
78
+ **Format B - Answer expressed in terms of a variable (common pattern):**
79
+ ```latex
80
+ \item [Question text]. The answer is $\frac{2\pi}{\beta}$ volt. The value of $\beta$ is \hrulefill. \ansint{5}
81
+ \begin{solution}
82
+ \begin{align*}
83
+ [Derive the expression]
84
+ &= \frac{2\pi}{5}\,\mathrm{V}
85
+ \intertext{Comparing with $\frac{2\pi}{\beta}$:}
86
+ \beta &= 5
87
+ \end{align*}
88
+ \end{solution}
89
+ ```
90
+ - This format expresses the final answer as an expression involving a variable ($k$, $\alpha$, $\beta$, $n$, etc.)
91
+ - The question asks to find the VALUE of that variable
92
+ - Common patterns: `$\frac{a\pi}{k}$`, `$\alpha \times 10^n$`, `$\frac{n}{m}$`
93
+
94
+ - NO tasks environment for integer type
95
+ - `\ansint{N}` contains the integer value of the variable
96
+
97
+ ### Subjective Type (subjective):
98
+ ```latex
99
+ \item [Question text asking for derivation/explanation/calculation]
100
+ \begin{solution}
101
+ \begin{align*}
102
+ [Detailed step-by-step solution]
103
+ \end{align*}
104
+ \end{solution}
105
+ ```
106
+ - NO tasks environment
107
+ - Question should ask for work to be shown
108
+
109
+ ### Match the Following (match):
110
+ ```latex
111
+ \item Match the items in Column I with the appropriate items in Column II.
112
+
113
+ \begin{center}
114
+ \renewcommand{\arraystretch}{2}
115
+ \begin{tabular}{p{0.25cm}p{8cm}|p{0.25cm}p{5cm}}
116
+ \hline
117
+ & Column I & & Column II \\
118
+ \hline
119
+ (a) & Item A description & (p) & Match P description \\
120
+ (b) & Item B description & (q) & Match Q description \\
121
+ (c) & Item C description & (r) & Match R description \\
122
+ (d) & Item D description & (s) & Match S description \\
123
+ \hline
124
+ \end{tabular}
125
+ \end{center}
126
+
127
+ \begin{tasks}(2)
128
+ \task $a \rightarrow p$, $b \rightarrow q$, $c \rightarrow r$, $d \rightarrow s$
129
+ \task $a \rightarrow q$, $b \rightarrow p$, $c \rightarrow s$, $d \rightarrow r$ \ans
130
+ \task $a \rightarrow r$, $b \rightarrow s$, $c \rightarrow p$, $d \rightarrow q$
131
+ \task $a \rightarrow s$, $b \rightarrow r$, $c \rightarrow q$, $d \rightarrow p$
132
+ \end{tasks}
133
+ \begin{solution}
134
+ \begin{align*}
135
+ \intertext{Analyzing each match:}
136
+ \intertext{(a) matches with (q) because...}
137
+ \intertext{(b) matches with (p) because...}
138
+ \intertext{(c) matches with (s) because...}
139
+ \intertext{(d) matches with (r) because...}
140
+ \end{align*}
141
+ Therefore, the correct option is (b).
142
+ \end{solution}
143
+ ```
144
+ - Column I uses (a), (b), (c), (d) labels
145
+ - Column II uses (p), (q), (r), (s) labels
146
+ - Options show matching combinations using `$a \rightarrow p$` notation
147
+ - Use `\renewcommand{\arraystretch}{2}` for table spacing
148
+
149
+ ### Passage/Comprehension Type (passage):
150
+ ```latex
151
+ \item[]
152
+ \begin{center}
153
+ \textsc{Passage Title (if any)}
154
+ \end{center}
155
+
156
+ [Passage text describing the physics scenario, setup, or context. This can be multiple paragraphs with equations, diagrams, etc.]
157
+
158
+ \begin{center}
159
+ % TikZ diagram if present
160
+ \end{center}
161
+
162
+ \item Based on the passage, what is the velocity of the particle?
163
+ \begin{tasks}(2)
164
+ \task $10\,\mathrm{m/s}$
165
+ \task $20\,\mathrm{m/s}$ \ans
166
+ \task $30\,\mathrm{m/s}$
167
+ \task $40\,\mathrm{m/s}$
168
+ \end{tasks}
169
+ \begin{solution}
170
+ \begin{align*}
171
+ [Solution for question 1]
172
+ \end{align*}
173
+ Therefore, the correct option is (b).
174
+ \end{solution}
175
+
176
+ \item What is the acceleration?
177
+ \begin{tasks}(2)
178
+ \task $5\,\mathrm{m/s^2}$ \ans
179
+ \task $10\,\mathrm{m/s^2}$
180
+ \task $15\,\mathrm{m/s^2}$
181
+ \task $20\,\mathrm{m/s^2}$
182
+ \end{tasks}
183
+ \begin{solution}
184
+ \begin{align*}
185
+ [Solution for question 2]
186
+ \end{align*}
187
+ Therefore, the correct option is (a).
188
+ \end{solution}
189
+ ```
190
+ - Starts with `\item[]` for the passage header (empty item)
191
+ - Optional centered title using `\textsc{}`
192
+ - Passage text follows (can include math, diagrams)
193
+ - Each question is a separate `\item` with its own tasks and solution
194
+ - Solution appears IMMEDIATELY after each question's tasks
195
+
196
+ ---
197
+
198
+ ## SOLUTION FORMATTING (CRITICAL):
199
+
200
+ Use `align*` environment with `\intertext{}` for explanations:
201
+
202
+ ```latex
203
+ \begin{solution}
204
+ \begin{align*}
205
+ V &= iR + L\frac{di}{dt} \\
206
+ i &= \frac{V - L\frac{di}{dt}}{R} \\
207
+ \intertext{At the instant considered, the rheostat resistance is $12\,\Omega$, the inductance is $3\,\mathrm{H}$, and $\frac{di}{dt}=-8\,\mathrm{A/s}$.}
208
+ i &= \frac{12 - 3(-8)}{12} \\
209
+ &= \frac{36}{12} \\
210
+ &= 3\,\mathrm{A}
211
+ \end{align*}
212
+ Therefore, the correct option is (a).
213
+ \end{solution}
214
+ ```
215
+
216
+ **Rules for align*:**
217
+ - Use `&` for alignment (typically before `=`)
218
+ - Use `\\` to end each line
219
+ - Use `\intertext{}` for text explanations BETWEEN equation lines
220
+ - Inside `\intertext{}`, use `$...$` for inline math, NOT `\text{}`
221
+ - Keep ONE step per line
222
+ - NO blank lines inside align*
223
+ - End with a concluding statement for MCQ (e.g., "Therefore, the correct option is (a).")
224
+
225
+ ---
226
+
227
+ ## LATEX FORMATTING RULES:
228
+
229
+ - **Math Mode:** Use `$...$` for ALL inline math
230
+ - **Fractions:** Use `\frac{a}{b}` or `\dfrac{a}{b}` (display style in tasks)
231
+ - **Units:** Use `\,\mathrm{unit}` format (e.g., `3\,\mathrm{A}`, `12\,\Omega`)
232
+ - **Vectors:** Use `\vec{a}` for vectors, `\hat{i}`, `\hat{j}`, `\hat{k}` for unit vectors
233
+ - **Parentheses:** Use `\left( ... \right)` for auto-sizing
234
+ - **DO NOT** use `\tfrac`, `\bigl`, `\bigr`
235
+
236
+ ---
237
+
238
+ ## CRITICAL REQUIREMENTS:
50
239
  1. PRESERVE the core physics concept being tested
51
240
  2. MAINTAIN the same difficulty level
52
- 3. ENSURE the solution remains valid for the new format
53
- 4. OUTPUT valid LaTeX starting with \\item
54
- 5. INCLUDE a complete solution in \\begin{solution}...\\end{solution}
55
- 6. RECALCULATE or adjust the solution for the new format
56
- 7. DO NOT wrap output in markdown code blocks (no ``` markers)
57
- 8. Output ONLY the LaTeX content, nothing else
58
-
59
- OUTPUT STRUCTURE:
60
- \\item [Question text in target format]
61
- [Options if MCQ format, using tasks environment]
62
- \\begin{solution}
63
- [Complete solution appropriate for target format]
64
- \\end{solution}
65
-
66
- FORMATTING RULES:
67
- - Use proper LaTeX math mode: $...$ for inline, \\[...\\] or align* for display
68
- - Use \\SI{value}{unit} or proper unit formatting
69
- - For MCQ: use \\begin{tasks}(4) with \\task before each option
70
- - Ensure all environments are properly closed
71
- - Use \\frac{}{} for fractions, not /
72
- - Use \\sqrt{} for square roots"""
73
-
74
- USER_TEMPLATE = """Convert this physics question from {source_format} to {target_format}.
241
+ 3. OUTPUT valid LaTeX starting with `\item`
242
+ 4. Use the EXACT format structure for the target type
243
+ 5. DO NOT wrap output in markdown code blocks (no ``` markers)
244
+ 6. Output ONLY the LaTeX content, nothing else
245
+ 7. If source has TikZ diagrams, preserve them in a `\begin{center}...\end{center}` block"""
246
+
247
+ USER_TEMPLATE = r"""Convert this physics question from {source_format} to {target_format}.
75
248
 
76
249
  Source Question:
77
250
  {source_latex}
@@ -80,36 +253,106 @@ Requirements:
80
253
  1. Preserve the core physics being tested
81
254
  2. Maintain the same difficulty level
82
255
  3. Output valid LaTeX in the target format
83
- 4. Include a complete solution
84
- 5. Start with \\item and end with \\end{{solution}}
256
+ 4. Include a complete solution using align* with \intertext{{}} for explanations
257
+ 5. Start with \item and end with \end{{solution}}
258
+ 6. If source has diagrams/TikZ, preserve them
85
259
 
86
260
  {format_specific_instructions}"""
87
261
 
88
262
  # Format-specific instruction templates
89
263
  FORMAT_INSTRUCTIONS = {
90
- "mcq_sc": """Target Format Instructions (MCQ Single Correct):
91
- - Create exactly 4 options using \\begin{tasks}(4)...\\end{tasks}
92
- - Use \\task before each option
93
- - Exactly ONE option must be correct
94
- - Create plausible distractors based on common errors""",
264
+ "mcq_sc": r"""Target Format Instructions (MCQ Single Correct):
265
+ - Create exactly 4 options using \begin{tasks}(2)...\end{tasks} for short options or (1) for long
266
+ - Use \task before each option
267
+ - Mark the SINGLE correct answer with \ans at the END of its \task line
268
+ - Example: \task $\dfrac{RMg}{B_0L}$ \ans
269
+ - Create plausible distractors based on common errors
270
+ - End solution with "Therefore, the correct option is (X)." """,
95
271
 
96
- "mcq_mc": """Target Format Instructions (MCQ Multiple Correct):
97
- - Create exactly 4 options using \\begin{tasks}(4)...\\end{tasks}
98
- - Use \\task before each option
99
- - At least 2 options should be correct
272
+ "mcq_mc": r"""Target Format Instructions (MCQ Multiple Correct):
273
+ - Create exactly 4 options using \begin{tasks}(2)...\end{tasks}
274
+ - Use \task before each option
275
+ - Mark ALL correct answers with \ans at the END of their \task lines
276
+ - At least 2 options should have \ans
100
277
  - Each option should test a different aspect""",
101
278
 
102
- "subjective": """Target Format Instructions (Subjective):
279
+ "subjective": r"""Target Format Instructions (Subjective):
103
280
  - Remove all options (no tasks environment)
104
281
  - Ask for derivation, explanation, or detailed calculation
105
282
  - May include multiple parts (a), (b), (c) if appropriate
106
- - Solution should show complete working""",
283
+ - Solution should show complete working using align* with \intertext{}""",
107
284
 
108
- "integer": """Target Format Instructions (Integer Type):
285
+ "integer": r"""Target Format Instructions (Integer Type):
109
286
  - Remove all options (no tasks environment)
110
- - Reformulate so answer is a single integer
111
- - Specify units or rounding if needed (e.g., "nearest integer")
112
- - Solution should clearly show how to arrive at the integer answer""",
287
+ - Two common formats:
288
+
289
+ FORMAT A - Direct numerical answer:
290
+ - Question ends with: \hrulefill [unit]. \ansint{N}
291
+ - Example: "...the value of the current will be \hrulefill A. \ansint{3}"
292
+
293
+ FORMAT B - Answer in terms of a variable (COMMON):
294
+ - Express the answer as an expression with a variable ($k$, $\alpha$, $\beta$, $n$, etc.)
295
+ - Ask to find the VALUE of that variable
296
+ - Example: "The maximum voltage is $\frac{2\pi}{\beta}$ volt. The value of $\beta$ is \hrulefill. \ansint{5}"
297
+ - Common patterns: $\frac{a\pi}{k}$, $\alpha \times 10^n$, $\frac{n}{m}$
298
+
299
+ - The integer answer goes inside \ansint{}
300
+ - Solution should derive the expression and identify the variable's value
301
+ - If answer needs rounding, mention "nearest integer" in question text""",
302
+
303
+ "match": r"""Target Format Instructions (Match the Following):
304
+ - Create a matching table with Column I (a, b, c, d) and Column II (p, q, r, s)
305
+ - Use tabular environment with \renewcommand{\arraystretch}{2} for spacing
306
+ - Create 4 options showing different matching combinations
307
+ - Use $a \rightarrow p$ notation for matches in options
308
+ - Mark the correct combination with \ans
309
+ - Solution should explain WHY each item matches
310
+
311
+ Structure:
312
+ \item [Question asking to match columns]
313
+ \begin{center}
314
+ \renewcommand{\arraystretch}{2}
315
+ \begin{tabular}{p{0.25cm}p{8cm}|p{0.25cm}p{5cm}}
316
+ ...table content...
317
+ \end{tabular}
318
+ \end{center}
319
+ \begin{tasks}(2)
320
+ \task [combination 1]
321
+ \task [combination 2] \ans
322
+ ...
323
+ \end{tasks}
324
+ \begin{solution}...\end{solution}""",
325
+
326
+ "passage": r"""Target Format Instructions (Passage/Comprehension Type):
327
+ - Create a passage describing a physics scenario or context
328
+ - Follow with 2-4 questions based on the passage
329
+ - Each question has its own \item, tasks, and solution
330
+
331
+ Structure:
332
+ \item[]
333
+ \begin{center}
334
+ \textsc{Passage Title}
335
+ \end{center}
336
+
337
+ [Passage text - can be multiple paragraphs with equations]
338
+
339
+ \item [Question 1 based on passage]
340
+ \begin{tasks}(2)
341
+ \task ... \ans
342
+ \task ...
343
+ \end{tasks}
344
+ \begin{solution}...\end{solution}
345
+
346
+ \item [Question 2 based on passage]
347
+ \begin{tasks}(2)
348
+ \task ...
349
+ \task ... \ans
350
+ \end{tasks}
351
+ \begin{solution}...\end{solution}
352
+
353
+ - Start with \item[] for passage header
354
+ - Each sub-question gets its own solution IMMEDIATELY after its tasks
355
+ - Questions should test different aspects of the passage content""",
113
356
  }
114
357
 
115
358
 
@@ -2,11 +2,13 @@
2
2
 
3
3
  Prompts for checking TikZ/PGF code for syntax errors, best practices,
4
4
  and physics diagram conventions.
5
- """
6
5
 
7
- SYSTEM_PROMPT = r"""You are an expert TikZ/PGF code reviewer. Check TikZ code for errors and provide ONLY the corrected version.
6
+ Includes both legacy prompts (full content output) and patch prompts
7
+ (for use with apply_patch tool).
8
+ """
8
9
 
9
- ## Review Checklist
10
+ # Shared review checklist used by both legacy and patch modes
11
+ _REVIEW_CHECKLIST = r"""## Review Checklist
10
12
 
11
13
  **1. Syntax Errors**
12
14
  - Missing semicolons at end of commands
@@ -195,6 +197,16 @@ When using `kinematikz` package for frames/supports:
195
197
  % GOOD - use hyphen for kinematikz pic anchors:
196
198
  \draw (support-center) -- (mass.north); % support is \pic, mass is \node
197
199
  ```
200
+ """
201
+
202
+
203
+ # =============================================================================
204
+ # LEGACY PROMPTS (full content output)
205
+ # =============================================================================
206
+
207
+ SYSTEM_PROMPT = r"""You are an expert TikZ/PGF code reviewer. Check TikZ code for errors and provide ONLY the corrected version.
208
+
209
+ """ + _REVIEW_CHECKLIST + r"""
198
210
 
199
211
  ## Output Format
200
212
 
@@ -228,3 +240,79 @@ IMPORTANT:
228
240
  - Do NOT add \documentclass, preamble, or anything not in the original
229
241
  - If errors found: `% TIKZ_CHECK: [fixes]` then the corrected content
230
242
  - If correct: `% TIKZ_CHECK: PASSED - No TikZ errors found`"""
243
+
244
+
245
+ # =============================================================================
246
+ # PATCH PROMPTS (for use with apply_patch tool)
247
+ # =============================================================================
248
+
249
+ PATCH_SYSTEM_PROMPT = r"""You are an expert TikZ/PGF code reviewer with the ability to apply patches to fix code.
250
+
251
+ You have access to the `apply_patch` tool to make precise, targeted fixes to TikZ code.
252
+
253
+ """ + _REVIEW_CHECKLIST + r"""
254
+
255
+ ## How to Use apply_patch
256
+
257
+ When you find issues, use the `apply_patch` tool to emit structured diffs:
258
+
259
+ 1. For each fix, call `apply_patch` with:
260
+ - `path`: The file path provided in the user message
261
+ - `operation`: "update_file"
262
+ - `diff`: A V4A diff showing the change
263
+
264
+ 2. V4A diff format:
265
+ ```
266
+ @@ context_line_to_match
267
+ -line_to_remove
268
+ +line_to_add
269
+ unchanged_line (space prefix)
270
+ ```
271
+
272
+ 3. Make MINIMAL, TARGETED patches - fix only what's broken
273
+ 4. Group related fixes into a single patch when they're adjacent
274
+
275
+ ## Output Rules
276
+
277
+ 1. If NO errors found: Just respond with "PASSED - No TikZ errors found"
278
+ 2. If errors found: Use apply_patch tool for each fix, then summarize what you fixed
279
+ 3. Do NOT output the full corrected file - only patches
280
+ 4. Make patches as small as possible while being complete
281
+ 5. Include enough context in @@ line for unique matching
282
+
283
+ ## Example Patch
284
+
285
+ For fixing a missing semicolon:
286
+ ```
287
+ @@ \draw (0,0) -- (1,1)
288
+ -\draw (0,0) -- (1,1)
289
+ +\draw (0,0) -- (1,1);
290
+ ```
291
+
292
+ For fixing spring decoration:
293
+ ```
294
+ @@ spring/.style={
295
+ - spring/.style={decorate, decoration={coil}}
296
+ + spring/.style={thick, decorate, decoration={
297
+ + coil,
298
+ + amplitude=4pt,
299
+ + segment length=4.5pt,
300
+ + pre length=5pt,
301
+ + post length=5pt
302
+ + }}
303
+ ```
304
+ """
305
+
306
+ PATCH_USER_TEMPLATE = r"""Check this TikZ code for errors and apply patches to fix them.
307
+
308
+ File: {file_path}
309
+
310
+ ```latex
311
+ {full_content}
312
+ ```
313
+
314
+ INSTRUCTIONS:
315
+ 1. Review the code using the checklist
316
+ 2. If errors found: Use apply_patch tool to fix each issue
317
+ 3. If no errors: Just respond "PASSED - No TikZ errors found"
318
+ 4. After patching, briefly summarize what you fixed"""
@@ -1,5 +1,62 @@
1
- """Reference store modules for vbagent."""
1
+ """Reference store modules for vbagent.
2
2
 
3
- from vbagent.references.store import ReferenceStore, SearchResult
3
+ Provides reference context management for agents:
4
+ - ReferenceStore: Store and retrieve reference examples for LaTeX/TikZ
5
+ - TikZStore: Store and retrieve TikZ diagram examples with metadata
6
+ - get_context_prompt_section: Get context for prompts
4
7
 
5
- __all__ = ["ReferenceStore", "SearchResult"]
8
+ Usage:
9
+ from vbagent.references import ReferenceStore, TikZStore, get_context_prompt_section
10
+
11
+ # Use reference store
12
+ store = ReferenceStore.get_instance()
13
+ store.add("example", "content")
14
+ results = store.search("query")
15
+
16
+ # Use TikZ store
17
+ tikz_store = TikZStore.get_instance()
18
+ context = tikz_store.get_context_for_classification(classification)
19
+
20
+ # Get context for prompts
21
+ context = get_context_prompt_section("latex")
22
+ """
23
+
24
+ from typing import TYPE_CHECKING
25
+
26
+ if TYPE_CHECKING:
27
+ from .store import ReferenceStore, SearchResult
28
+ from .tikz_store import TikZReferenceStore, TikZReference, TikZMetadata
29
+ from .context import get_context_prompt_section, set_context_enabled
30
+
31
+ __all__ = [
32
+ # Reference store
33
+ "ReferenceStore",
34
+ "SearchResult",
35
+ # TikZ store
36
+ "TikZStore",
37
+ "TikZReferenceStore",
38
+ "TikZReference",
39
+ "TikZMetadata",
40
+ # Context utilities
41
+ "get_context_prompt_section",
42
+ "set_context_enabled",
43
+ ]
44
+
45
+
46
+ def __getattr__(name: str):
47
+ """Lazy import of reference modules."""
48
+ if name in ("ReferenceStore", "SearchResult"):
49
+ from . import store
50
+ return getattr(store, name)
51
+
52
+ if name in ("TikZStore", "TikZReferenceStore", "TikZReference", "TikZMetadata"):
53
+ from . import tikz_store
54
+ if name == "TikZStore":
55
+ return tikz_store.TikZReferenceStore
56
+ return getattr(tikz_store, name)
57
+
58
+ if name in ("get_context_prompt_section", "set_context_enabled"):
59
+ from . import context
60
+ return getattr(context, name)
61
+
62
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")