vbagent 0.1.1__tar.gz → 0.2.1__tar.gz
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.
- vbagent-0.2.1/PKG-INFO +1049 -0
- vbagent-0.2.1/README.md +1022 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/pyproject.toml +13 -4
- vbagent-0.2.1/vbagent/__init__.py +221 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/__init__.py +84 -1
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/base.py +4 -1
- vbagent-0.2.1/vbagent/agents/classifier.py +68 -0
- vbagent-0.2.1/vbagent/agents/compile_fixer.py +57 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/converter.py +2 -2
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/reviewer.py +2 -2
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/scanner.py +38 -14
- vbagent-0.2.1/vbagent/agents/tikz_checker.py +467 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/variant.py +74 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/check.py +750 -34
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/common.py +87 -25
- vbagent-0.2.1/vbagent/cli/config.py +425 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/convert.py +1 -1
- vbagent-0.2.1/vbagent/cli/init.py +248 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/main.py +15 -5
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/process.py +34 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/scan.py +27 -1
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/tikz.py +29 -1
- vbagent-0.2.1/vbagent/cli/util.py +327 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/variant.py +27 -0
- vbagent-0.2.1/vbagent/compile.py +444 -0
- vbagent-0.2.1/vbagent/config.py +665 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/__init__.py +41 -4
- vbagent-0.2.1/vbagent/prompts/__init__.py +120 -0
- vbagent-0.2.1/vbagent/prompts/classifier.py +65 -0
- vbagent-0.2.1/vbagent/prompts/converter.py +368 -0
- vbagent-0.2.1/vbagent/prompts/scanner/__init__.py +136 -0
- vbagent-0.2.1/vbagent/prompts/subjects/__init__.py +328 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/tikz_checker.py +91 -3
- vbagent-0.2.1/vbagent/references/__init__.py +62 -0
- vbagent-0.1.1/PKG-INFO +0 -383
- vbagent-0.1.1/README.md +0 -362
- vbagent-0.1.1/vbagent/__init__.py +0 -3
- vbagent-0.1.1/vbagent/agents/classifier.py +0 -39
- vbagent-0.1.1/vbagent/agents/tikz_checker.py +0 -153
- vbagent-0.1.1/vbagent/cli/config.py +0 -191
- vbagent-0.1.1/vbagent/config.py +0 -291
- vbagent-0.1.1/vbagent/prompts/__init__.py +0 -1
- vbagent-0.1.1/vbagent/prompts/classifier.py +0 -31
- vbagent-0.1.1/vbagent/prompts/converter.py +0 -125
- vbagent-0.1.1/vbagent/prompts/scanner/__init__.py +0 -71
- vbagent-0.1.1/vbagent/references/__init__.py +0 -5
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/alternate.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/clarity_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/grammar_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/idea.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/multi_variant.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/selector.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/solution_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/agents/tikz.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/__init__.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/alternate.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/batch.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/classify.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/idea.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/cli/ref.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/batch.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/classification.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/diff.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/idea.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/pipeline.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/review.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/scan.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/models/version_store.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/alternate.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/clarity_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/grammar_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/idea.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/reviewer.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/assertion_reason.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/common.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/match.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/mcq_mc.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/mcq_sc.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/passage.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/scanner/subjective.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/solution_checker.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/tikz.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/__init__.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/conceptual.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/conceptual_calculus.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/context.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/multi_context.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/prompts/variants/numerical.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/references/context.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/references/store.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/references/tikz_store.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/templates/__init__.py +0 -0
- {vbagent-0.1.1 → vbagent-0.2.1}/vbagent/templates/agentic_context.py +0 -0
vbagent-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: vbagent
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Physics question processing library and CLI - classification, LaTeX extraction, variant generation
|
|
5
|
+
Author: vaibhavblayer
|
|
6
|
+
Author-email: vaibhavblayer@gmail.com
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Provides-Extra: all
|
|
12
|
+
Provides-Extra: cli
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: click (>=8.1.0) ; extra == "all"
|
|
15
|
+
Requires-Dist: click (>=8.1.0) ; extra == "cli"
|
|
16
|
+
Requires-Dist: click (>=8.1.0) ; extra == "dev"
|
|
17
|
+
Requires-Dist: hypothesis (>=6.0.0) ; extra == "dev"
|
|
18
|
+
Requires-Dist: openai-agents (>=0.6.2)
|
|
19
|
+
Requires-Dist: pillow (>=10.0.0)
|
|
20
|
+
Requires-Dist: pydantic (>=2.0.0)
|
|
21
|
+
Requires-Dist: pytest (>=8.0.0) ; extra == "dev"
|
|
22
|
+
Requires-Dist: rich (>=13.0.0) ; extra == "all"
|
|
23
|
+
Requires-Dist: rich (>=13.0.0) ; extra == "cli"
|
|
24
|
+
Requires-Dist: rich (>=13.0.0) ; extra == "dev"
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# VBAgent
|
|
28
|
+
|
|
29
|
+
A multi-agent library and CLI tool for processing physics question images. Supports classification, LaTeX extraction, TikZ diagram generation, variant creation, and format conversion.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
### From PyPI
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Full installation (library + CLI)
|
|
37
|
+
pip install vbagent[all]
|
|
38
|
+
|
|
39
|
+
# Library only (no CLI dependencies)
|
|
40
|
+
pip install vbagent
|
|
41
|
+
|
|
42
|
+
# CLI only
|
|
43
|
+
pip install vbagent[cli]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From Source
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Clone the repository
|
|
50
|
+
git clone https://github.com/vaibhavblayer/vbagent.git
|
|
51
|
+
cd vbagent
|
|
52
|
+
|
|
53
|
+
# Install with pip
|
|
54
|
+
pip install .
|
|
55
|
+
|
|
56
|
+
# Or install in development mode
|
|
57
|
+
pip install -e ".[dev]"
|
|
58
|
+
|
|
59
|
+
# Or using Poetry
|
|
60
|
+
poetry install
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
- Python 3.12+
|
|
66
|
+
- OpenAI API key (set as `OPENAI_API_KEY` environment variable)
|
|
67
|
+
|
|
68
|
+
## Library Usage
|
|
69
|
+
|
|
70
|
+
VBAgent can be used as a Python library in your own projects:
|
|
71
|
+
|
|
72
|
+
### Quick Start
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from vbagent import classify, scan, generate_variant, generate_tikz
|
|
76
|
+
from vbagent.models import ClassificationResult, ScanResult
|
|
77
|
+
|
|
78
|
+
# Classify an image
|
|
79
|
+
classification = classify("question.png")
|
|
80
|
+
print(f"Type: {classification.question_type}")
|
|
81
|
+
print(f"Topic: {classification.topic}")
|
|
82
|
+
|
|
83
|
+
# Scan with classification
|
|
84
|
+
scan_result = scan("question.png", classification)
|
|
85
|
+
print(f"LaTeX: {scan_result.latex}")
|
|
86
|
+
|
|
87
|
+
# Generate a variant
|
|
88
|
+
variant = generate_variant(scan_result.latex, "numerical")
|
|
89
|
+
print(f"Variant: {variant}")
|
|
90
|
+
|
|
91
|
+
# Generate TikZ diagram
|
|
92
|
+
tikz = generate_tikz("A free body diagram showing forces on a block")
|
|
93
|
+
print(f"TikZ: {tikz}")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Configuration
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from vbagent import get_config, set_config, VBAgentConfig
|
|
100
|
+
|
|
101
|
+
# Get current config
|
|
102
|
+
config = get_config()
|
|
103
|
+
|
|
104
|
+
# Modify model settings
|
|
105
|
+
config.scanner.model = "gpt-5.2"
|
|
106
|
+
config.scanner.reasoning_effort = "high"
|
|
107
|
+
|
|
108
|
+
# Apply changes
|
|
109
|
+
set_config(config)
|
|
110
|
+
|
|
111
|
+
# Or configure specific agent
|
|
112
|
+
from vbagent.config import AgentModelConfig
|
|
113
|
+
config.variant = AgentModelConfig(
|
|
114
|
+
model="gpt-5.1",
|
|
115
|
+
reasoning_effort="medium",
|
|
116
|
+
temperature=0.7
|
|
117
|
+
)
|
|
118
|
+
set_config(config)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Available Functions
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
# Classification
|
|
125
|
+
from vbagent import classify
|
|
126
|
+
result = classify("image.png") # Returns ClassificationResult
|
|
127
|
+
|
|
128
|
+
# Scanning
|
|
129
|
+
from vbagent import scan, scan_with_type
|
|
130
|
+
result = scan("image.png", classification) # Returns ScanResult
|
|
131
|
+
result = scan_with_type("image.png", "mcq_sc") # Skip classification
|
|
132
|
+
|
|
133
|
+
# Variants
|
|
134
|
+
from vbagent import (
|
|
135
|
+
generate_variant,
|
|
136
|
+
generate_numerical_variant,
|
|
137
|
+
generate_context_variant,
|
|
138
|
+
generate_conceptual_variant,
|
|
139
|
+
generate_calculus_variant,
|
|
140
|
+
)
|
|
141
|
+
variant = generate_variant(latex, "numerical")
|
|
142
|
+
variant = generate_numerical_variant(latex)
|
|
143
|
+
|
|
144
|
+
# TikZ
|
|
145
|
+
from vbagent import generate_tikz, validate_tikz_output
|
|
146
|
+
tikz = generate_tikz("description", image_path="ref.png")
|
|
147
|
+
is_valid = validate_tikz_output(tikz)
|
|
148
|
+
|
|
149
|
+
# Ideas
|
|
150
|
+
from vbagent import extract_ideas, generate_idea_latex
|
|
151
|
+
ideas = extract_ideas(problem_latex, solution_latex) # Returns IdeaResult
|
|
152
|
+
idea_latex = generate_idea_latex(full_content)
|
|
153
|
+
|
|
154
|
+
# Alternates
|
|
155
|
+
from vbagent import generate_alternate
|
|
156
|
+
alternate = generate_alternate(problem, solution)
|
|
157
|
+
|
|
158
|
+
# QA Checkers
|
|
159
|
+
from vbagent import check_solution, check_grammar, check_clarity, check_tikz
|
|
160
|
+
passed, summary, corrected = check_solution(content)
|
|
161
|
+
passed, summary, corrected = check_grammar(content)
|
|
162
|
+
passed, summary, corrected = check_clarity(content)
|
|
163
|
+
passed, summary, corrected = check_tikz(content)
|
|
164
|
+
|
|
165
|
+
# Review
|
|
166
|
+
from vbagent import review_problem, review_problem_sync, ProblemContext
|
|
167
|
+
context = ProblemContext(...)
|
|
168
|
+
result = review_problem_sync(context) # Returns ReviewResult
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Models
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
from vbagent.models import (
|
|
175
|
+
ClassificationResult,
|
|
176
|
+
ScanResult,
|
|
177
|
+
IdeaResult,
|
|
178
|
+
PipelineResult,
|
|
179
|
+
ReviewResult,
|
|
180
|
+
Suggestion,
|
|
181
|
+
ReviewIssueType,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# Classification result fields
|
|
185
|
+
classification.question_type # mcq_sc, mcq_mc, subjective, etc.
|
|
186
|
+
classification.difficulty # easy, medium, hard
|
|
187
|
+
classification.topic # kinematics, thermodynamics, etc.
|
|
188
|
+
classification.has_diagram # bool
|
|
189
|
+
classification.diagram_type # graph, circuit, free_body, etc.
|
|
190
|
+
|
|
191
|
+
# Scan result fields
|
|
192
|
+
scan_result.latex
|
|
193
|
+
scan_result.has_diagram
|
|
194
|
+
scan_result.raw_diagram_description
|
|
195
|
+
|
|
196
|
+
# Idea result fields
|
|
197
|
+
ideas.concepts # List of physics concepts
|
|
198
|
+
ideas.formulas # List of key formulas
|
|
199
|
+
ideas.techniques # List of problem-solving techniques
|
|
200
|
+
ideas.difficulty_factors
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Prompts
|
|
204
|
+
|
|
205
|
+
Access and customize prompts:
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
from vbagent.prompts import (
|
|
209
|
+
get_scanner_prompt,
|
|
210
|
+
get_variant_prompt,
|
|
211
|
+
CLASSIFIER_PROMPT,
|
|
212
|
+
IDEA_PROMPT,
|
|
213
|
+
TIKZ_PROMPT,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
# Get scanner prompt for question type
|
|
217
|
+
prompt = get_scanner_prompt("mcq_sc")
|
|
218
|
+
|
|
219
|
+
# Get variant prompts
|
|
220
|
+
system_prompt, user_template = get_variant_prompt("numerical")
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### References
|
|
224
|
+
|
|
225
|
+
Manage reference context:
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
from vbagent.references import (
|
|
229
|
+
ReferenceStore,
|
|
230
|
+
TikZStore,
|
|
231
|
+
get_context_prompt_section,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
# Reference store
|
|
235
|
+
store = ReferenceStore.get_instance()
|
|
236
|
+
results = store.search("query")
|
|
237
|
+
|
|
238
|
+
# TikZ store
|
|
239
|
+
tikz_store = TikZStore.get_instance()
|
|
240
|
+
context = tikz_store.get_context_for_classification(classification)
|
|
241
|
+
|
|
242
|
+
# Get context for prompts
|
|
243
|
+
context = get_context_prompt_section("latex")
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Low-Level Agent Access
|
|
247
|
+
|
|
248
|
+
For advanced usage:
|
|
249
|
+
|
|
250
|
+
```python
|
|
251
|
+
from vbagent.agents import (
|
|
252
|
+
create_agent,
|
|
253
|
+
run_agent,
|
|
254
|
+
run_agent_sync,
|
|
255
|
+
encode_image,
|
|
256
|
+
create_image_message,
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
# Create custom agent
|
|
260
|
+
agent = create_agent(
|
|
261
|
+
name="MyAgent",
|
|
262
|
+
instructions="Your system prompt",
|
|
263
|
+
agent_type="scanner", # Uses scanner model config
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
# Run agent
|
|
267
|
+
result = run_agent_sync(agent, "Your input")
|
|
268
|
+
|
|
269
|
+
# With image
|
|
270
|
+
message = create_image_message("image.png", "Analyze this")
|
|
271
|
+
result = run_agent_sync(agent, message)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## CLI Usage
|
|
275
|
+
|
|
276
|
+
## Project Structure
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
vbagent/
|
|
280
|
+
├── pyproject.toml # Project config & dependencies
|
|
281
|
+
├── poetry.lock # Locked dependency versions
|
|
282
|
+
├── README.md # Documentation
|
|
283
|
+
│
|
|
284
|
+
├── vbagent/ # Main package
|
|
285
|
+
│ ├── __init__.py
|
|
286
|
+
│ ├── config.py # Configuration handling
|
|
287
|
+
│ │
|
|
288
|
+
│ ├── cli/ # CLI commands (Click-based)
|
|
289
|
+
│ │ ├── main.py # Entry point
|
|
290
|
+
│ │ ├── common.py # Shared CLI utilities
|
|
291
|
+
│ │ ├── scan.py # LaTeX extraction command
|
|
292
|
+
│ │ ├── classify.py # Classification command
|
|
293
|
+
│ │ ├── tikz.py # TikZ generation command
|
|
294
|
+
│ │ ├── variant.py # Variant generation command
|
|
295
|
+
│ │ ├── alternate.py # Alternate solutions command
|
|
296
|
+
│ │ ├── idea.py # Concept extraction command
|
|
297
|
+
│ │ ├── convert.py # Format conversion command
|
|
298
|
+
│ │ ├── process.py # Full pipeline command
|
|
299
|
+
│ │ ├── batch.py # Batch processing command
|
|
300
|
+
│ │ ├── check.py # QA review command
|
|
301
|
+
│ │ ├── ref.py # Reference management command
|
|
302
|
+
│ │ └── config.py # Config management command
|
|
303
|
+
│ │
|
|
304
|
+
│ ├── agents/ # AI agent implementations
|
|
305
|
+
│ │ ├── base.py # Base agent class
|
|
306
|
+
│ │ ├── scanner.py # LaTeX extraction agent
|
|
307
|
+
│ │ ├── classifier.py # Question type classifier
|
|
308
|
+
│ │ ├── tikz.py # TikZ diagram generator
|
|
309
|
+
│ │ ├── variant.py # Single variant generator
|
|
310
|
+
│ │ ├── multi_variant.py # Multi-context variant generator
|
|
311
|
+
│ │ ├── alternate.py # Alternate solution generator
|
|
312
|
+
│ │ ├── idea.py # Concept extractor
|
|
313
|
+
│ │ ├── converter.py # Format converter
|
|
314
|
+
│ │ ├── reviewer.py # QA reviewer
|
|
315
|
+
│ │ ├── selector.py # Problem selector
|
|
316
|
+
│ │ ├── solution_checker.py # Solution correctness checker
|
|
317
|
+
│ │ ├── grammar_checker.py # Grammar checker
|
|
318
|
+
│ │ ├── clarity_checker.py # Clarity checker
|
|
319
|
+
│ │ └── tikz_checker.py # TikZ code checker
|
|
320
|
+
│ │
|
|
321
|
+
│ ├── prompts/ # LLM prompt templates
|
|
322
|
+
│ │ ├── classifier.py # Classification prompts
|
|
323
|
+
│ │ ├── tikz.py # TikZ generation prompts
|
|
324
|
+
│ │ ├── alternate.py # Alternate solution prompts
|
|
325
|
+
│ │ ├── idea.py # Concept extraction prompts
|
|
326
|
+
│ │ ├── converter.py # Conversion prompts
|
|
327
|
+
│ │ ├── reviewer.py # Review prompts
|
|
328
|
+
│ │ ├── solution_checker.py # Solution check prompts
|
|
329
|
+
│ │ ├── grammar_checker.py # Grammar check prompts
|
|
330
|
+
│ │ ├── clarity_checker.py # Clarity check prompts
|
|
331
|
+
│ │ ├── tikz_checker.py # TikZ check prompts
|
|
332
|
+
│ │ │
|
|
333
|
+
│ │ ├── scanner/ # Question-type-specific scan prompts
|
|
334
|
+
│ │ │ ├── common.py # Shared scanner prompts
|
|
335
|
+
│ │ │ ├── mcq_sc.py # MCQ single correct
|
|
336
|
+
│ │ │ ├── mcq_mc.py # MCQ multiple correct
|
|
337
|
+
│ │ │ ├── assertion_reason.py
|
|
338
|
+
│ │ │ ├── match.py # Match the following
|
|
339
|
+
│ │ │ ├── passage.py # Passage/comprehension
|
|
340
|
+
│ │ │ └── subjective.py # Subjective/numerical
|
|
341
|
+
│ │ │
|
|
342
|
+
│ │ └── variants/ # Variant generation prompts
|
|
343
|
+
│ │ ├── numerical.py # Numerical variant prompts
|
|
344
|
+
│ │ ├── context.py # Context variant prompts
|
|
345
|
+
│ │ ├── conceptual.py # Conceptual variant prompts
|
|
346
|
+
│ │ ├── conceptual_calculus.py
|
|
347
|
+
│ │ └── multi_context.py
|
|
348
|
+
│ │
|
|
349
|
+
│ ├── models/ # Pydantic data models
|
|
350
|
+
│ │ ├── batch.py # Batch processing state
|
|
351
|
+
│ │ ├── classification.py # Question classification
|
|
352
|
+
│ │ ├── scan.py # Scan results
|
|
353
|
+
│ │ ├── idea.py # Extracted concepts
|
|
354
|
+
│ │ ├── review.py # Review results
|
|
355
|
+
│ │ ├── diff.py # Diff utilities
|
|
356
|
+
│ │ ├── pipeline.py # Pipeline state
|
|
357
|
+
│ │ └── version_store.py # Version tracking
|
|
358
|
+
│ │
|
|
359
|
+
│ ├── references/ # Reference context management
|
|
360
|
+
│ │ ├── store.py # Reference store
|
|
361
|
+
│ │ ├── context.py # Context builder
|
|
362
|
+
│ │ └── tikz_store.py # TikZ reference store
|
|
363
|
+
│ │
|
|
364
|
+
│ └── templates/ # Output templates
|
|
365
|
+
│ └── agentic_context.py # CONTEXT.md generator
|
|
366
|
+
│
|
|
367
|
+
├── prompt_kinds/ # Question type definitions
|
|
368
|
+
│ ├── mcq_sc_type.py # MCQ single correct
|
|
369
|
+
│ ├── mcq_mc_type.py # MCQ multiple correct
|
|
370
|
+
│ ├── assertion_reason_type.py
|
|
371
|
+
│ ├── match_type.py # Match the following
|
|
372
|
+
│ ├── passage_type.py # Passage/comprehension
|
|
373
|
+
│ ├── subjective_type.py # Subjective/numerical
|
|
374
|
+
│ ├── variant_numerical.py # Numerical variant type
|
|
375
|
+
│ ├── variant_context.py # Context variant type
|
|
376
|
+
│ ├── variant_conceptual.py # Conceptual variant type
|
|
377
|
+
│ ├── variant_conceptual_calculus.py
|
|
378
|
+
│ └── variant_numerical_context.py
|
|
379
|
+
│
|
|
380
|
+
└── tests/ # Test suite
|
|
381
|
+
├── test_scanner.py
|
|
382
|
+
├── test_classification.py
|
|
383
|
+
├── test_tikz.py
|
|
384
|
+
├── test_variant.py
|
|
385
|
+
├── test_alternate.py
|
|
386
|
+
├── test_idea.py
|
|
387
|
+
├── test_converter.py
|
|
388
|
+
├── test_batch.py
|
|
389
|
+
├── test_process.py
|
|
390
|
+
├── test_review.py
|
|
391
|
+
├── test_selector.py
|
|
392
|
+
├── test_context.py
|
|
393
|
+
├── test_reference_store.py
|
|
394
|
+
├── test_version_store.py
|
|
395
|
+
└── test_prompt_organization.py
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## Command Reference
|
|
399
|
+
|
|
400
|
+
### classify
|
|
401
|
+
|
|
402
|
+
Classify physics question image type.
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
vbagent classify -i <image> [-o <output.json>] [--json]
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
| Option | Description |
|
|
409
|
+
|--------|-------------|
|
|
410
|
+
| `-i, --image` | Path to physics question image (required) |
|
|
411
|
+
| `-o, --output` | Output JSON file path |
|
|
412
|
+
| `--json` | Output result as JSON to stdout |
|
|
413
|
+
|
|
414
|
+
### scan
|
|
415
|
+
|
|
416
|
+
Extract LaTeX from physics question image.
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
vbagent scan -i <image> [-t <tex>] [--type <type>] [-o <output.tex>]
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
| Option | Description |
|
|
423
|
+
|--------|-------------|
|
|
424
|
+
| `-i, --image` | Path to physics question image |
|
|
425
|
+
| `-t, --tex` | Path to existing TeX file (for re-processing) |
|
|
426
|
+
| `--type` | Override question type: `mcq_sc`, `mcq_mc`, `subjective`, `assertion_reason`, `passage`, `match` |
|
|
427
|
+
| `-o, --output` | Output TeX file path |
|
|
428
|
+
|
|
429
|
+
### tikz
|
|
430
|
+
|
|
431
|
+
Generate TikZ/PGF code for diagrams.
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
vbagent tikz [-i <image>] [-d <description>] [--ref <dir>...] [-o <output.tex>]
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
| Option | Description |
|
|
438
|
+
|--------|-------------|
|
|
439
|
+
| `-i, --image` | Path to diagram image |
|
|
440
|
+
| `-d, --description` | Text description of diagram to generate |
|
|
441
|
+
| `--ref` | Reference directories (can be used multiple times) |
|
|
442
|
+
| `-o, --output` | Output TeX file path |
|
|
443
|
+
|
|
444
|
+
### idea
|
|
445
|
+
|
|
446
|
+
Extract physics concepts and ideas from problems.
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
vbagent idea -t <tex> [-o <output.json>] [--json]
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
| Option | Description |
|
|
453
|
+
|--------|-------------|
|
|
454
|
+
| `-t, --tex` | Path to TeX file with problem and solution (required) |
|
|
455
|
+
| `-o, --output` | Output JSON file path |
|
|
456
|
+
| `--json` | Output result as JSON to stdout |
|
|
457
|
+
|
|
458
|
+
### alternate
|
|
459
|
+
|
|
460
|
+
Generate alternative solution methods.
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
vbagent alternate -t <tex> [--ideas <ideas.json>] [-n <count>] [-o <output.tex>]
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
| Option | Description |
|
|
467
|
+
|--------|-------------|
|
|
468
|
+
| `-t, --tex` | Path to TeX file with problem and solution (required) |
|
|
469
|
+
| `--ideas` | Path to ideas JSON file for context |
|
|
470
|
+
| `-n, --count` | Number of alternate solutions (default: 1) |
|
|
471
|
+
| `-o, --output` | Output TeX file path |
|
|
472
|
+
|
|
473
|
+
### variant
|
|
474
|
+
|
|
475
|
+
Generate problem variants with controlled modifications.
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
vbagent variant [-i <image>] [-t <tex>] --type <type> [-r <start> <end>] [-n <count>] [--context <file>...] [--ideas <ideas.json>] [-o <output.tex>]
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
| Option | Description |
|
|
482
|
+
|--------|-------------|
|
|
483
|
+
| `-i, --image` | Image file (will be scanned first) |
|
|
484
|
+
| `-t, --tex` | TeX file containing problem(s) |
|
|
485
|
+
| `--type` | Variant type: `numerical`, `context`, `conceptual`, `calculus`, `multi` (required) |
|
|
486
|
+
| `-r, --range` | Range of items to process (1-based inclusive) |
|
|
487
|
+
| `-n, --count` | Number of variants per problem (default: 1) |
|
|
488
|
+
| `--context` | Additional context files for multi variant |
|
|
489
|
+
| `--ideas` | Path to ideas JSON file |
|
|
490
|
+
| `-o, --output` | Output TeX file path |
|
|
491
|
+
|
|
492
|
+
### convert
|
|
493
|
+
|
|
494
|
+
Convert physics questions between formats.
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
vbagent convert [-i <image>] [-t <tex>] [--from <format>] --to <format> [-o <output.tex>]
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
| Option | Description |
|
|
501
|
+
|--------|-------------|
|
|
502
|
+
| `-i, --image` | Path to physics question image |
|
|
503
|
+
| `-t, --tex` | Path to TeX file |
|
|
504
|
+
| `--from` | Source format (auto-detected if not specified) |
|
|
505
|
+
| `--to` | Target format: `mcq_sc`, `mcq_mc`, `subjective`, `integer` (required) |
|
|
506
|
+
| `-o, --output` | Output TeX file path |
|
|
507
|
+
|
|
508
|
+
### process
|
|
509
|
+
|
|
510
|
+
Full pipeline: Classify → Scan → TikZ → Ideas → Variants.
|
|
511
|
+
|
|
512
|
+
```bash
|
|
513
|
+
vbagent process [-i <image>] [-t <tex>] [-r <start> <end>] [--variants <types>] [--alternate] [--ideas] [--ref <dir>...] [-o <output>] [--context] [-p <workers>]
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
| Option | Description |
|
|
517
|
+
|--------|-------------|
|
|
518
|
+
| `-i, --image` | Image file to process |
|
|
519
|
+
| `-t, --tex` | TeX file containing problems |
|
|
520
|
+
| `-r, --range` | Range to process (1-based inclusive) |
|
|
521
|
+
| `--variants` | Variant types (comma-separated) |
|
|
522
|
+
| `--alternate` | Generate alternate solutions |
|
|
523
|
+
| `--ideas` | Extract physics concepts |
|
|
524
|
+
| `--ref` | Reference directories for TikZ |
|
|
525
|
+
| `-o, --output` | Output directory (default: `agentic`) |
|
|
526
|
+
| `--context/--no-context` | Use reference context (default: yes) |
|
|
527
|
+
| `-p, --parallel` | Parallel workers (default: 1, max: 10) |
|
|
528
|
+
|
|
529
|
+
### batch
|
|
530
|
+
|
|
531
|
+
Batch processing with resume capability.
|
|
532
|
+
|
|
533
|
+
```bash
|
|
534
|
+
# Initialize batch
|
|
535
|
+
vbagent batch init [-i <images_dir>] [-o <output>] [--variants <types>] [--alternate] [--context]
|
|
536
|
+
|
|
537
|
+
# Continue processing
|
|
538
|
+
vbagent batch continue [--reset-failed]
|
|
539
|
+
|
|
540
|
+
# Check status
|
|
541
|
+
vbagent batch status
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
| Subcommand | Description |
|
|
545
|
+
|------------|-------------|
|
|
546
|
+
| `init` | Initialize and start batch processing |
|
|
547
|
+
| `continue` | Resume from where you left off |
|
|
548
|
+
| `status` | Show current progress |
|
|
549
|
+
|
|
550
|
+
#### batch init options
|
|
551
|
+
|
|
552
|
+
| Option | Description |
|
|
553
|
+
|--------|-------------|
|
|
554
|
+
| `-i, --images-dir` | Directory containing images (default: `./images`) |
|
|
555
|
+
| `-o, --output` | Output directory (default: `agentic`) |
|
|
556
|
+
| `--variants` | Variant types (default: all) |
|
|
557
|
+
| `--alternate/--no-alternate` | Generate alternates (default: yes) |
|
|
558
|
+
| `--context/--no-context` | Use reference context (default: yes) |
|
|
559
|
+
|
|
560
|
+
### check
|
|
561
|
+
|
|
562
|
+
QA review with interactive approval workflow.
|
|
563
|
+
|
|
564
|
+
```bash
|
|
565
|
+
# Start review session
|
|
566
|
+
vbagent check run [-c <count>] [-p <problem_id>] [-d <dir>]
|
|
567
|
+
|
|
568
|
+
# View history
|
|
569
|
+
vbagent check history [-p <problem_id>] [-f <file>] [-n <limit>]
|
|
570
|
+
|
|
571
|
+
# Apply suggestion
|
|
572
|
+
vbagent check apply <version_id> [-e]
|
|
573
|
+
|
|
574
|
+
# Resume session
|
|
575
|
+
vbagent check resume <session_id>
|
|
576
|
+
|
|
577
|
+
# Check/generate TikZ diagrams
|
|
578
|
+
vbagent check tikz [-d <dir>] [-c <count>] [--patch] [--ref-type <type>]
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
| Subcommand | Description |
|
|
582
|
+
|------------|-------------|
|
|
583
|
+
| `run` | Start a random QA review session |
|
|
584
|
+
| `init` | Initialize problem tracking database |
|
|
585
|
+
| `continue` | Continue from where you left off |
|
|
586
|
+
| `status` | Show check progress |
|
|
587
|
+
| `recheck` | Reset problems for rechecking |
|
|
588
|
+
| `alternate` | Generate alternate solutions |
|
|
589
|
+
| `idea` | Generate idea summaries |
|
|
590
|
+
| `solution` | Check solution correctness |
|
|
591
|
+
| `grammar` | Check grammar and spelling |
|
|
592
|
+
| `clarity` | Check clarity and conciseness |
|
|
593
|
+
| `tikz` | Check existing TikZ or generate from `\input{diagram}` placeholder |
|
|
594
|
+
| `apply` | Apply a stored suggestion |
|
|
595
|
+
| `history` | View suggestion history |
|
|
596
|
+
| `resume` | Resume interrupted session |
|
|
597
|
+
| `stats` | View review statistics |
|
|
598
|
+
|
|
599
|
+
#### check tikz options
|
|
600
|
+
|
|
601
|
+
| Option | Description |
|
|
602
|
+
|--------|-------------|
|
|
603
|
+
| `-d, --dir` | Directory or file to check (default: agentic) |
|
|
604
|
+
| `-c, --count` | Number of files to process (default: 5) |
|
|
605
|
+
| `-p, --problem-id` | Check specific problem by ID |
|
|
606
|
+
| `-i, --images-dir` | Directory containing images (auto-discovered if not set) |
|
|
607
|
+
| `--only-tikz` | Only check files with existing TikZ code |
|
|
608
|
+
| `--reset` | Re-check all files |
|
|
609
|
+
| `--patch` | Use apply_patch mode for precise edits |
|
|
610
|
+
| `--ref-type` | Filter references by diagram type (circuit, free_body, etc.) |
|
|
611
|
+
| `--prompt` | Additional instructions for the checker |
|
|
612
|
+
|
|
613
|
+
### ref
|
|
614
|
+
|
|
615
|
+
Manage reference context files.
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
# Add reference
|
|
619
|
+
vbagent ref add <category> <file> [-n <name>] [-d <description>]
|
|
620
|
+
|
|
621
|
+
# Remove reference
|
|
622
|
+
vbagent ref remove <category> <name>
|
|
623
|
+
|
|
624
|
+
# List references
|
|
625
|
+
vbagent ref list [-c <category>]
|
|
626
|
+
|
|
627
|
+
# Show reference content
|
|
628
|
+
vbagent ref show <category> <name>
|
|
629
|
+
|
|
630
|
+
# Enable/disable context
|
|
631
|
+
vbagent ref enable
|
|
632
|
+
vbagent ref disable
|
|
633
|
+
|
|
634
|
+
# Show status
|
|
635
|
+
vbagent ref status
|
|
636
|
+
|
|
637
|
+
# Set max examples
|
|
638
|
+
vbagent ref set-max <count>
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
| Subcommand | Description |
|
|
642
|
+
|------------|-------------|
|
|
643
|
+
| `add` | Add a reference file to a category |
|
|
644
|
+
| `remove` | Remove a reference file |
|
|
645
|
+
| `list` | List all reference files |
|
|
646
|
+
| `show` | Show content of a reference file |
|
|
647
|
+
| `enable` | Enable context usage in prompts |
|
|
648
|
+
| `disable` | Disable context usage |
|
|
649
|
+
| `status` | Show context configuration |
|
|
650
|
+
| `set-max` | Set maximum examples per category |
|
|
651
|
+
|
|
652
|
+
Categories: `tikz`, `latex`, `variants`, `problems`
|
|
653
|
+
|
|
654
|
+
#### ref tikz (TikZ references with metadata)
|
|
655
|
+
|
|
656
|
+
```bash
|
|
657
|
+
# Import from processed problem
|
|
658
|
+
vbagent ref tikz import <path> [-r <start> <end>] [-t <tikz_dir>] [-c <class_dir>]
|
|
659
|
+
|
|
660
|
+
# List TikZ references
|
|
661
|
+
vbagent ref tikz list [--diagram-type <type>] [--topic <topic>]
|
|
662
|
+
|
|
663
|
+
# Remove TikZ reference
|
|
664
|
+
vbagent ref tikz remove <ref_id>
|
|
665
|
+
|
|
666
|
+
# Show TikZ reference
|
|
667
|
+
vbagent ref tikz show <ref_id>
|
|
668
|
+
|
|
669
|
+
# Show statistics
|
|
670
|
+
vbagent ref tikz status
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
### config
|
|
674
|
+
|
|
675
|
+
Configure models and settings.
|
|
676
|
+
|
|
677
|
+
```bash
|
|
678
|
+
# Show current config
|
|
679
|
+
vbagent config show
|
|
680
|
+
|
|
681
|
+
# Set agent config
|
|
682
|
+
vbagent config set <agent_type> [--model <model>] [--reasoning <level>] [--temperature <temp>] [--max-tokens <tokens>]
|
|
683
|
+
|
|
684
|
+
# Reset to defaults
|
|
685
|
+
vbagent config reset
|
|
686
|
+
|
|
687
|
+
# List available models
|
|
688
|
+
vbagent config models
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
| Subcommand | Description |
|
|
692
|
+
|------------|-------------|
|
|
693
|
+
| `show` | Show current model configuration |
|
|
694
|
+
| `set` | Set model configuration for an agent |
|
|
695
|
+
| `reset` | Reset all configurations to defaults |
|
|
696
|
+
| `models` | List available models |
|
|
697
|
+
|
|
698
|
+
Agent types: `classifier`, `scanner`, `tikz`, `idea`, `alternate`, `variant`, `converter`, `default`
|
|
699
|
+
|
|
700
|
+
Reasoning levels: `low`, `medium`, `high`, `xhigh`
|
|
701
|
+
|
|
702
|
+
## CLI Usage
|
|
703
|
+
|
|
704
|
+
### Quick Start
|
|
705
|
+
|
|
706
|
+
```bash
|
|
707
|
+
# Scan a physics question image to LaTeX
|
|
708
|
+
vbagent scan -i question.png -o output.tex
|
|
709
|
+
|
|
710
|
+
# Classify a question type
|
|
711
|
+
vbagent classify -i question.png
|
|
712
|
+
|
|
713
|
+
# Generate TikZ diagram from image
|
|
714
|
+
vbagent tikz -i diagram.png -o diagram.tex
|
|
715
|
+
|
|
716
|
+
# Generate problem variants
|
|
717
|
+
vbagent variant -t problem.tex -o variants.tex
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### Commands
|
|
721
|
+
|
|
722
|
+
| Command | Description |
|
|
723
|
+
|---------|-------------|
|
|
724
|
+
| `classify` | Classify physics question image type |
|
|
725
|
+
| `scan` | Extract LaTeX from question image |
|
|
726
|
+
| `tikz` | Generate TikZ/PGF code for diagrams |
|
|
727
|
+
| `idea` | Extract physics concepts and ideas |
|
|
728
|
+
| `alternate` | Generate alternative solutions |
|
|
729
|
+
| `variant` | Generate problem variants (numerical, conceptual, context) |
|
|
730
|
+
| `convert` | Convert between question formats |
|
|
731
|
+
| `process` | Run full processing pipeline |
|
|
732
|
+
| `batch` | Batch process multiple images with resume capability |
|
|
733
|
+
| `ref` | Manage reference context files |
|
|
734
|
+
| `config` | Configure models and settings |
|
|
735
|
+
| `check` | QA review with interactive approval |
|
|
736
|
+
|
|
737
|
+
### Batch Processing
|
|
738
|
+
|
|
739
|
+
Process multiple images with automatic resume on interruption:
|
|
740
|
+
|
|
741
|
+
```bash
|
|
742
|
+
# Initialize batch processing
|
|
743
|
+
vbagent batch init -i ./images -o ./output
|
|
744
|
+
|
|
745
|
+
# Continue processing (resumes from where it left off)
|
|
746
|
+
vbagent batch continue
|
|
747
|
+
|
|
748
|
+
# Check status
|
|
749
|
+
vbagent batch status
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
### Full Pipeline
|
|
753
|
+
|
|
754
|
+
Process a single image through the complete pipeline:
|
|
755
|
+
|
|
756
|
+
```bash
|
|
757
|
+
# Basic processing (classify + scan + tikz)
|
|
758
|
+
vbagent process -i question.png
|
|
759
|
+
|
|
760
|
+
# With ideas extraction
|
|
761
|
+
vbagent process -i question.png --ideas
|
|
762
|
+
|
|
763
|
+
# With alternate solutions
|
|
764
|
+
vbagent process -i question.png --alternate
|
|
765
|
+
|
|
766
|
+
# With variant generation
|
|
767
|
+
vbagent process -i question.png --variants numerical,context
|
|
768
|
+
|
|
769
|
+
# Full pipeline with all features
|
|
770
|
+
vbagent process -i question.png --ideas --alternate --variants numerical,context,conceptual
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
Process a range of images:
|
|
774
|
+
|
|
775
|
+
```bash
|
|
776
|
+
# Process Problem_1.png through Problem_5.png
|
|
777
|
+
vbagent process -i images/Problem_1.png -r 1 5
|
|
778
|
+
|
|
779
|
+
# Process range with parallel workers (faster)
|
|
780
|
+
vbagent process -i images/Problem_1.png -r 1 10 --parallel 3
|
|
781
|
+
|
|
782
|
+
# Process range with all features
|
|
783
|
+
vbagent process -i images/Problem_1.png -r 1 5 --ideas --alternate --variants numerical
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
Process TeX file with multiple items:
|
|
787
|
+
|
|
788
|
+
```bash
|
|
789
|
+
# Process items 1-5 from a TeX file
|
|
790
|
+
vbagent process -t problems.tex --range 1 5
|
|
791
|
+
|
|
792
|
+
# With alternate solutions and ideas
|
|
793
|
+
vbagent process -t problems.tex --range 1 5 --alternate --ideas
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
Custom output directory:
|
|
797
|
+
|
|
798
|
+
```bash
|
|
799
|
+
vbagent process -i question.png -o ./my_output
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
#### Process Command Options
|
|
803
|
+
|
|
804
|
+
| Option | Description |
|
|
805
|
+
|--------|-------------|
|
|
806
|
+
| `-i, --image` | Image file to process |
|
|
807
|
+
| `-t, --tex` | TeX file containing problems |
|
|
808
|
+
| `-r, --range` | Range of items to process (1-based, inclusive) |
|
|
809
|
+
| `--variants` | Variant types (comma-separated: numerical,context,conceptual,calculus) |
|
|
810
|
+
| `--alternate` | Generate alternate solutions |
|
|
811
|
+
| `--ideas` | Extract physics concepts |
|
|
812
|
+
| `--ref` | Reference directories for TikZ |
|
|
813
|
+
| `-o, --output` | Output directory (default: agentic) |
|
|
814
|
+
| `--context` | Use reference context (default: yes) |
|
|
815
|
+
| `-p, --parallel` | Parallel workers for batch (default: 1, max: 10) |
|
|
816
|
+
|
|
817
|
+
#### Output Structure
|
|
818
|
+
|
|
819
|
+
```
|
|
820
|
+
agentic/
|
|
821
|
+
├── scans/problem_1.tex # Extracted LaTeX
|
|
822
|
+
├── classifications/problem_1.json # Question metadata
|
|
823
|
+
├── tikz/problem_1.tex # Generated TikZ diagrams
|
|
824
|
+
├── ideas/problem_1.json # Physics concepts (if --ideas)
|
|
825
|
+
├── alternates/problem_1.tex # Alternate solutions (if --alternate)
|
|
826
|
+
├── variants/
|
|
827
|
+
│ ├── numerical/problem_1.tex # Numerical variants
|
|
828
|
+
│ ├── context/problem_1.tex # Context variants
|
|
829
|
+
│ └── conceptual/problem_1.tex # Conceptual variants
|
|
830
|
+
└── CONTEXT.md # Documentation for AI agents
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
### Help
|
|
834
|
+
|
|
835
|
+
```bash
|
|
836
|
+
# General help
|
|
837
|
+
vbagent --help
|
|
838
|
+
|
|
839
|
+
# Command-specific help
|
|
840
|
+
vbagent scan --help
|
|
841
|
+
vbagent variant --help
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
### Scan Command
|
|
845
|
+
|
|
846
|
+
Extract LaTeX from physics question images:
|
|
847
|
+
|
|
848
|
+
```bash
|
|
849
|
+
# Basic scan with auto-classification
|
|
850
|
+
vbagent scan -i question.png
|
|
851
|
+
|
|
852
|
+
# Save output to file
|
|
853
|
+
vbagent scan -i question.png -o output.tex
|
|
854
|
+
|
|
855
|
+
# Override question type (skip classification)
|
|
856
|
+
vbagent scan -i question.png --type mcq_sc
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
### Variant Command
|
|
860
|
+
|
|
861
|
+
Generate problem variants with controlled modifications:
|
|
862
|
+
|
|
863
|
+
```bash
|
|
864
|
+
# Numerical variant (change numbers only)
|
|
865
|
+
vbagent variant -t problem.tex --type numerical
|
|
866
|
+
|
|
867
|
+
# Context variant (change scenario)
|
|
868
|
+
vbagent variant -t problem.tex --type context
|
|
869
|
+
|
|
870
|
+
# Generate multiple variants
|
|
871
|
+
vbagent variant -t problem.tex --type numerical --count 3
|
|
872
|
+
|
|
873
|
+
# Process range of items
|
|
874
|
+
vbagent variant -t problems.tex --type numerical -r 1 5
|
|
875
|
+
|
|
876
|
+
# Multi-context variant (combine problems)
|
|
877
|
+
vbagent variant --type multi --context p1.tex --context p2.tex -o combined.tex
|
|
878
|
+
|
|
879
|
+
# From image (scans first)
|
|
880
|
+
vbagent variant -i image.png --type numerical -o variant.tex
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
#### Variant Types
|
|
884
|
+
|
|
885
|
+
| Type | Description |
|
|
886
|
+
|------|-------------|
|
|
887
|
+
| `numerical` | Change only numbers, keep context |
|
|
888
|
+
| `context` | Change scenario, keep numbers |
|
|
889
|
+
| `conceptual` | Change physics concept |
|
|
890
|
+
| `calculus` | Add calculus elements |
|
|
891
|
+
| `multi` | Combine multiple problems |
|
|
892
|
+
|
|
893
|
+
### Alternate Command
|
|
894
|
+
|
|
895
|
+
Generate alternative solution methods:
|
|
896
|
+
|
|
897
|
+
```bash
|
|
898
|
+
# Generate one alternate solution
|
|
899
|
+
vbagent alternate -t problem.tex
|
|
900
|
+
|
|
901
|
+
# Generate multiple alternates
|
|
902
|
+
vbagent alternate -t problem.tex -n 3
|
|
903
|
+
|
|
904
|
+
# With ideas context
|
|
905
|
+
vbagent alternate -t problem.tex --ideas ideas.json
|
|
906
|
+
|
|
907
|
+
# Save to file
|
|
908
|
+
vbagent alternate -t problem.tex -n 2 -o alternates.tex
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
### Check Command (QA Review)
|
|
912
|
+
|
|
913
|
+
AI-powered quality review with interactive approval workflow:
|
|
914
|
+
|
|
915
|
+
```bash
|
|
916
|
+
# Start a review session (random 5 problems)
|
|
917
|
+
vbagent check run
|
|
918
|
+
|
|
919
|
+
# Review more problems
|
|
920
|
+
vbagent check run -c 10
|
|
921
|
+
|
|
922
|
+
# Review specific problem
|
|
923
|
+
vbagent check run -p Problem_42
|
|
924
|
+
|
|
925
|
+
# Review from specific directory
|
|
926
|
+
vbagent check run -d ./my_output
|
|
927
|
+
|
|
928
|
+
# View suggestion history
|
|
929
|
+
vbagent check history
|
|
930
|
+
|
|
931
|
+
# Apply a stored suggestion
|
|
932
|
+
vbagent check apply 42
|
|
933
|
+
|
|
934
|
+
# Resume interrupted session
|
|
935
|
+
vbagent check resume abc123
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
#### Check Subcommands
|
|
939
|
+
|
|
940
|
+
| Subcommand | Description |
|
|
941
|
+
|------------|-------------|
|
|
942
|
+
| `run` | Start a random QA review session |
|
|
943
|
+
| `history` | View suggestion history |
|
|
944
|
+
| `apply` | Apply a stored suggestion by ID |
|
|
945
|
+
| `resume` | Resume an interrupted session |
|
|
946
|
+
| `solution` | Check solution correctness |
|
|
947
|
+
| `grammar` | Check grammar and spelling |
|
|
948
|
+
| `clarity` | Check clarity and conciseness |
|
|
949
|
+
| `tikz` | Check/generate TikZ diagram code |
|
|
950
|
+
|
|
951
|
+
#### check tikz - TikZ Check and Generation
|
|
952
|
+
|
|
953
|
+
The `check tikz` command has two modes:
|
|
954
|
+
|
|
955
|
+
1. **Check Mode**: Reviews existing TikZ code for errors and best practices
|
|
956
|
+
2. **Generate Mode**: If a file has `\input{diagram}` placeholder but no TikZ, generates TikZ from the corresponding image
|
|
957
|
+
|
|
958
|
+
```bash
|
|
959
|
+
# Check/generate TikZ in default directory
|
|
960
|
+
vbagent check tikz
|
|
961
|
+
|
|
962
|
+
# Check specific directory or file
|
|
963
|
+
vbagent check tikz -d ./scans/
|
|
964
|
+
vbagent check tikz -d ./scans/Problem_1.tex
|
|
965
|
+
|
|
966
|
+
# Process multiple files
|
|
967
|
+
vbagent check tikz -c 10
|
|
968
|
+
|
|
969
|
+
# Use apply_patch mode (recommended)
|
|
970
|
+
vbagent check tikz --patch
|
|
971
|
+
|
|
972
|
+
# Filter by diagram type
|
|
973
|
+
vbagent check tikz --ref-type circuit
|
|
974
|
+
|
|
975
|
+
# Re-check all files
|
|
976
|
+
vbagent check tikz --reset
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
**Auto-discovery features:**
|
|
980
|
+
- Images are auto-found in `images/` sibling directory (e.g., `scans/Problem_1.tex` → `images/Problem_1.png`)
|
|
981
|
+
- Diagram type is auto-detected from classification metadata
|
|
982
|
+
- Reference examples are matched by diagram type
|
|
983
|
+
|
|
984
|
+
### TikZ Command
|
|
985
|
+
|
|
986
|
+
Generate TikZ/PGF code for diagrams:
|
|
987
|
+
|
|
988
|
+
```bash
|
|
989
|
+
# From image
|
|
990
|
+
vbagent tikz -i diagram.png
|
|
991
|
+
|
|
992
|
+
# With description
|
|
993
|
+
vbagent tikz -d "A block on an inclined plane with friction"
|
|
994
|
+
|
|
995
|
+
# Save to file
|
|
996
|
+
vbagent tikz -i diagram.png -o diagram.tex
|
|
997
|
+
|
|
998
|
+
# With reference directories
|
|
999
|
+
vbagent tikz -i diagram.png --ref ./tikz_examples/
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
### Idea Command
|
|
1003
|
+
|
|
1004
|
+
Extract physics concepts and ideas from problems:
|
|
1005
|
+
|
|
1006
|
+
```bash
|
|
1007
|
+
# From TeX file
|
|
1008
|
+
vbagent idea -t problem.tex
|
|
1009
|
+
|
|
1010
|
+
# Save to JSON
|
|
1011
|
+
vbagent idea -t problem.tex -o ideas.json
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
## Supported Question Types
|
|
1015
|
+
|
|
1016
|
+
- MCQ Single Correct
|
|
1017
|
+
- MCQ Multiple Correct
|
|
1018
|
+
- Assertion-Reason
|
|
1019
|
+
- Match the Following
|
|
1020
|
+
- Passage/Comprehension
|
|
1021
|
+
- Subjective/Numerical
|
|
1022
|
+
|
|
1023
|
+
## Variant Types
|
|
1024
|
+
|
|
1025
|
+
- **Numerical**: Change numerical values while preserving physics
|
|
1026
|
+
- **Conceptual**: Modify the underlying concept
|
|
1027
|
+
- **Context**: Change the real-world scenario
|
|
1028
|
+
|
|
1029
|
+
## Platform Support
|
|
1030
|
+
|
|
1031
|
+
Works on macOS, Windows, and Linux. Sleep prevention during batch processing is supported on all platforms.
|
|
1032
|
+
|
|
1033
|
+
## Development
|
|
1034
|
+
|
|
1035
|
+
```bash
|
|
1036
|
+
# Install dev dependencies
|
|
1037
|
+
pip install -e ".[dev]"
|
|
1038
|
+
|
|
1039
|
+
# Run tests
|
|
1040
|
+
pytest
|
|
1041
|
+
|
|
1042
|
+
# Run specific test
|
|
1043
|
+
pytest tests/test_scanner.py -v
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
## License
|
|
1047
|
+
|
|
1048
|
+
MIT
|
|
1049
|
+
|