Skip to content

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_tool(image: str, output: Optional[str] = None) -> dict[str, Any]

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(parent_spec_id: str, variant_type: str, count: int = 1, output_dir: str = 'agentic/authoring', seed: int = 0, human_review: bool = False, max_attempts: int = 3, concurrency: int = 2, max_lineage_depth: int = 2, max_variants_per_parent: int = 12) -> dict[str, Any]

Author controlled variants of an accepted canonical parent.

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, exam: str, subject: str, chapter: str, concepts: Optional[list[str]] = None, question_type: str = 'mcq_sc', count: int = 1, num_questions: int = 3, difficulty: str = 'medium', with_diagram: bool = True, output_dir: str = 'agentic/authoring', syllabus_path: Optional[str] = None, seed: int = 0, human_review: bool = False, max_attempts: int = 3, concurrency: int = 2, run_pipeline: bool = True) -> dict[str, Any]

Create syllabus-scoped problems through the canonical acceptance pipeline.

Draft-only generation is deliberately unavailable: every persisted result is independently solved, adjudicated, syllabus-checked, compiled, reviewed, and novelty-checked before it is counted as accepted coverage.

register_core_tools

register_core_tools(registry: ToolRegistry) -> None

Register all core vbagent tools with the registry.

Parameters:

Name Type Description Default
registry ToolRegistry

ToolRegistry instance to register tools with

required

register_generation_tools

register_generation_tools(registry: ToolRegistry) -> None

Register problem generation tools with the registry.

Parameters:

Name Type Description Default
registry ToolRegistry

ToolRegistry instance to register tools with

required