Orchestrator API Reference
Auto-generated API documentation for VBAgent orchestrator and tool wrappers.
Tool Wrappers
tool_wrappers
Tool wrapper functions for core vbagent commands.
This module provides wrapper functions that adapt existing vbagent CLI commands into tool functions that can be registered with the ToolRegistry and called by the orchestrator or MCP server.
classify_tool
Classify a physics question image to extract metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
str
|
Path to the physics question image file |
required |
output
|
Optional[str]
|
Output JSON file path for saving results |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing classification metadata: - question_type: Type of question (mcq_sc, subjective, etc.) - difficulty: Difficulty level - topic: Main topic - subtopic: Subtopic - has_diagram: Whether question has a diagram - diagram_type: Type of diagram if present - num_options: Number of options for MCQ - requires_calculus: Whether calculus is required - confidence: Classification confidence (0-1) - key_concepts: List of key physics concepts - output_path: Path where output was saved (if output specified) |
scan_tool
scan_tool(image: str, question_type: Optional[str] = None, output: Optional[str] = None, compile: bool = False) -> dict[str, Any]
Scan a physics question image to extract LaTeX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
str
|
Path to the physics question image file |
required |
question_type
|
Optional[str]
|
Override question type (skips classification). Valid values: mcq_sc, mcq_mc, subjective, assertion_reason, passage, match |
None
|
output
|
Optional[str]
|
Output TeX file path for saving results |
None
|
compile
|
bool
|
Whether to compile LaTeX to validate |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: - latex: Extracted LaTeX code - has_diagram: Whether the question has a diagram - diagram_description: Description of the diagram if present - question_type: Detected or provided question type - output_path: Path where output was saved (if output specified) |
tikz_tool
tikz_tool(description: Optional[str] = None, image: Optional[str] = None, tex: Optional[str] = None, output: Optional[str] = None, compile: bool = False) -> dict[str, Any]
Generate TikZ diagram code for physics diagrams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
description
|
Optional[str]
|
Text description of the diagram to generate |
None
|
image
|
Optional[str]
|
Path to a diagram image file |
None
|
tex
|
Optional[str]
|
Path to TeX file with problem text |
None
|
output
|
Optional[str]
|
Output TeX file path for saving the generated TikZ code |
None
|
compile
|
bool
|
Whether to compile TikZ to validate |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: - tikz_code: Generated TikZ/PGF code - output_path: Path where output was saved (if output specified) |
variant_tool
variant_tool(variant_type: str, tex: Optional[str] = None, image: Optional[str] = None, count: int = 1, output: Optional[str] = None, compile: bool = False) -> dict[str, Any]
Generate problem variants.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variant_type
|
str
|
Type of variant to generate. Valid values: numerical, context, conceptual, calculus, multi |
required |
tex
|
Optional[str]
|
Path to TeX file containing problem(s) |
None
|
image
|
Optional[str]
|
Path to image file (will be scanned first) |
None
|
count
|
int
|
Number of variants to generate per problem (default: 1) |
1
|
output
|
Optional[str]
|
Output TeX file path for saving results |
None
|
compile
|
bool
|
Whether to compile variants to validate |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: - variants: List of generated variant LaTeX strings - variant_type: Type of variant generated - count: Number of variants generated - output_path: Path where output was saved (if output specified) |
convert_tool
convert_tool(target_format: str, tex: Optional[str] = None, image: Optional[str] = None, source_format: Optional[str] = None, output: Optional[str] = None) -> dict[str, Any]
Convert physics questions between different formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_format
|
str
|
Target format for conversion. Valid values: mcq_sc, mcq_mc, subjective, integer, match, passage |
required |
tex
|
Optional[str]
|
Path to TeX file containing the question |
None
|
image
|
Optional[str]
|
Path to physics question image (will be scanned first) |
None
|
source_format
|
Optional[str]
|
Source format (auto-detected if not specified). Valid values: mcq_sc, mcq_mc, subjective, integer, match, passage |
None
|
output
|
Optional[str]
|
Output TeX file path for saving results |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: - converted_latex: Converted LaTeX code - source_format: Source format (detected or provided) - target_format: Target format - output_path: Path where output was saved (if output specified) |
generate_problem_tool
generate_problem_tool(idea: str, topic: str, concepts: Optional[list[str]] = None, question_type: str = 'passage', num_questions: int = 2, difficulty: str = 'medium', with_diagram: bool = True, output_dir: str = 'agentic/generated', run_pipeline: bool = True) -> dict[str, Any]
Generate a complete problem from an idea or concept description.
Uses Agent 5 (Idea Generator) to create a problem, then optionally runs the full pipeline (TikZ generation, classification, difficulty assessment).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idea
|
str
|
Description of the problem idea (e.g., "double block friction system") |
required |
topic
|
str
|
Topic for the problem (e.g., "Mechanics", "Thermodynamics") |
required |
concepts
|
Optional[list[str]]
|
List of specific concepts to cover (optional) |
None
|
question_type
|
str
|
Type of question (mcq_sc, mcq_mc, passage, subjective, etc.) |
'passage'
|
num_questions
|
int
|
Number of questions (for passage type) |
2
|
difficulty
|
str
|
Target difficulty level (easy, medium, hard) |
'medium'
|
with_diagram
|
bool
|
Whether to include diagrams |
True
|
output_dir
|
str
|
Directory to save generated files |
'agentic/generated'
|
run_pipeline
|
bool
|
Whether to run full pipeline (classification, TikZ, difficulty) |
True
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary containing: - problem_latex: Generated problem LaTeX - solution_latex: Generated solution LaTeX - idea_latex: Core concepts and ideas - diagram_description: Description of diagram if generated - saved_to: Path where problem was saved - metadata: Classification and difficulty metadata (if run_pipeline=True) |
register_core_tools
Register all core vbagent tools with the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry
|
ToolRegistry
|
ToolRegistry instance to register tools with |
required |