Skip to content

API Reference parrot_tools.code_toolkit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.code_toolkit

View source

Code toolkit for spec-driven coding tasks.

The toolkit exposes high-level coding operations through AbstractToolkit while keeping execution behind provider classes. The Codex SDK integration is lazy because the SDK is experimental and optional.

Alias AbstractToolkit

Re-exported from parrot_tools.toolkit.AbstractToolkit.

Class CodeToolkit

Toolkit for delegating coding tasks to Codex-compatible providers.

Parameter Type Default Description
provider CodingProvider
default_model str | None None

Method CodeToolkit.implement_spec

Implement the bugfix or feature described in a specification file.

implement_spec(spec_file: str, repo_path: str, test_command: str | None = None, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
spec_file str
repo_path str
test_command str | None None
model str | None None

Returns: CodingTaskResult

Method CodeToolkit.fix_bug

Fix the bug described in a specification file.

fix_bug(spec_file: str, repo_path: str, test_command: str | None = None, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
spec_file str
repo_path str
test_command str | None None
model str | None None

Returns: CodingTaskResult

Method CodeToolkit.review_diff

Review the repository diff against the specification file.

review_diff(spec_file: str, repo_path: str, test_command: str | None = None, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
spec_file str
repo_path str
test_command str | None None
model str | None None

Returns: CodingTaskResult

Method CodeToolkit.generate_tests

Generate or update tests required by a specification file.

generate_tests(spec_file: str, repo_path: str, test_command: str | None = None, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
spec_file str
repo_path str
test_command str | None None
model str | None None

Returns: CodingTaskResult

Method CodeToolkit.explain_patch

Explain an existing patch in the context of a repository.

explain_patch(patch_file: str, repo_path: str, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
patch_file str
repo_path str
model str | None None

Returns: CodingTaskResult

Class CodexProvider

Coding provider backed by the experimental OpenAI Codex SDK.

Parameter Type Default Description
skip_git_repo_check bool False

Method CodexProvider.run_task

Run a coding task with the OpenAI Codex SDK.

run_task(task: CodingTask, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
task CodingTask
model str | None None

Returns: CodingTaskResult

Method CodexProvider.build_prompt

Build a Codex prompt from a coding task and specification text.

build_prompt(task: CodingTask, spec: str) -> str

Parameter Type Default Description
task CodingTask
spec str

Returns: str

Method CodexProvider.parse_result

Parse a Codex SDK result object without repository diff context.

parse_result(result: Any) -> CodingTaskResult

Parameter Type Default Description
result Any

Returns: CodingTaskResult

Class CodingProvider

Provider protocol implemented by coding backends.

Method CodingProvider.run_task

Run a coding task and return a structured result.

run_task(task: CodingTask, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
task CodingTask
model str | None None

Returns: CodingTaskResult

Class CodingTask

Artifact describing a coding task to execute against a repository.

Parameter Type Default Description
repo_path Path
spec_path Path
objective str
branch_name str | None None
test_command str | None None
files_in_scope list[str] | None None
constraints list[str] list()

Fields:

Field Type Default Description
repo_path Path
spec_path Path
objective str
branch_name str | None None
test_command str | None None
files_in_scope list[str] | None None
constraints list[str] field(default_factory=list)

Class CodingTaskInput

Shared input fields for code toolkit tools.

Fields:

Field Type Default Description
spec_file str Path to the specification file.
repo_path str Path to the repository to work on.
test_command str | None None Optional command the provider should run to validate the change.
model str | None None Optional provider-specific model override.

Class CodingTaskResult

Structured result returned by coding providers.

Parameter Type Default Description
success bool
summary str
changed_files list[str]
diff str | None
tests_run list[str]
test_output str | None
remaining_risks list[str]

Fields:

Field Type Default Description
success bool
summary str
changed_files list[str]
diff str | None
tests_run list[str]
test_output str | None
remaining_risks list[str]

Class ExplainPatchInput

Input for explaining an existing patch or diff.

Fields:

Field Type Default Description
patch_file str Path to a patch or diff file.
repo_path str Path to the repository the patch applies to.
model str | None None Optional provider-specific model override.

Class MinimaxProvider

Coding provider backed by Nvidia-hosted Minimax-compatible models.

Parameter Type Default Description
client NvidiaClient | None None
default_model str 'minimaxai/minimax-m3'

Method MinimaxProvider.run_task

Ask the Nvidia client to produce a structured coding plan/result.

run_task(task: CodingTask, model: str | None = None) -> CodingTaskResult

Parameter Type Default Description
task CodingTask
model str | None None

Returns: CodingTaskResult

Method MinimaxProvider.build_prompt

Build a structured-output prompt for Minimax-compatible models.

build_prompt(task: CodingTask, spec: str) -> str

Parameter Type Default Description
task CodingTask
spec str

Returns: str

Function parse_frontmatter

Parse a small YAML-like frontmatter block without adding dependencies.

parse_frontmatter(text: str) -> dict[str, Any]

Parameter Type Default Description
text str

Returns: dict[str, Any]

Alias tool_schema

Re-exported from parrot_tools.decorators.tool_schema.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally