generate_model_with_provider
Turns a natural-language description into a printable 3D model via an external AI provider, audits for printability, and retries with feedback from failed attempts.
Instructions
Generate a printable design via an external AI provider.
The cloud, provider-backed creation path: hands a natural-language
description to an external idea-to-3D service, audits the candidate
for printability and design correctness, and can perform one or
more corrective retries using feedback from failed attempts.
This is NOT the default. It needs a configured provider (the user
supplies their own API key). For most custom objects the free,
keyless path is to author the OpenSCAD yourself and compile it with
``compile_scad`` — no provider required. Reach for this tool when
the shape is organic or photo-derived and hard to express in
OpenSCAD AND a provider is configured.
For the user-facing saved-goal flow (capturing duty / environment /
materials / safety so the audit and post-print review can verify
the result against the user's intent), call this through
``design_session(verb="generate", session_id=...)`` rather than
calling ``generate_model_with_provider`` directly.
Provider notes:
- ``auto`` prefers Gemini for idea-to-CAD when available.
- ``openscad`` is intentionally rejected here because it compiles
code; it does not turn a natural-language idea into geometry.
No-provider fallback:
- If no cloud provider is configured this raises NO_PROVIDER. Do
NOT ask the user to set an API key — fall back to writing the
OpenSCAD yourself and compiling it with compile_scad. That free,
local path is the default for custom objects; cloud providers are
an opt-in the user supplies their own key for (best for organic
or photo-based shapes OpenSCAD can't easily reach).
Args:
requirements: Natural-language description of the part to create.
provider: ``auto``, ``gemini``, ``meshy``, ``tripo3d``, or ``stability``.
material: Optional material target (e.g. ``"petg"``).
printer_model: Optional printer model ID (e.g. ``"bambu_a1"``).
style: Optional style hint for providers that support it.
output_dir: Optional directory for generated files.
build_volume_x: Optional build volume X override in mm.
build_volume_y: Optional build volume Y override in mm.
build_volume_z: Optional build volume Z override in mm.
nozzle_diameter: Printer nozzle diameter in mm.
layer_height: Printer layer height in mm.
max_overhang_angle: Supportless overhang threshold in degrees.
timeout: Max seconds to wait per generation attempt.
max_attempts: Max corrective generation attempts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | ||
| timeout | No | ||
| material | No | ||
| provider | No | auto | |
| output_dir | No | ||
| layer_height | No | ||
| max_attempts | No | ||
| requirements | Yes | ||
| printer_model | No | ||
| build_volume_x | No | ||
| build_volume_y | No | ||
| build_volume_z | No | ||
| nozzle_diameter | No | ||
| max_overhang_angle | No |