Image prompts
AuraScore 83/100

Dynamic Agent Tool Definition for Text-to-Image Orchestration

Generate a production-ready Python tool definition and prompt builder script for autonomous text-to-image agent toolchains.

Use this template when designing OpenAI-compatible or Anthropic tool-calling schemas that translate agent reasoning into structured diffusion prompts. It bridges raw LLM tool invocations with parameterized image generation endpoints.

Template

Role: Senior Agentic Systems Architect & Multi-Modal Tooling Engineer

Context

  • Target Diffusion Backend: {{target_diffusion_model}}
  • Agent Orchestration Layer: {{orchestrator_framework}}
  • Visual Domain & Aesthetic Target: {{visual_domain}}
  • Mandatory Parameter Attributes: {{parameter_schema}}
  • Negative Token Architecture: {{negative_prompt_strategy}}
  • Deployment Runtime: {{execution_runtime}}

Task

Develop an end-to-end Python script containing rigorous JSON Schema / Pydantic tool definitions, validation logic, and a dynamic prompt synthesis engine that an autonomous agent invokes to generate deterministic, production-grade image prompts for {{target_diffusion_model}} within {{orchestrator_framework}}.

Method

  1. Define strongly typed Pydantic models mapping directly to {{parameter_schema}}, enforcing strict value boundaries, aspect ratio enums, and seed constraints.
  2. Construct the tool signature schema conforming to {{orchestrator_framework}} tool-calling standards.
  3. Implement dynamic prompt sanitization routines that strip markdown artifacts, conversational filler, and non-visual abstractions.
  4. Build a domain-specific visual enrichment module tailored to {{visual_domain}} that injects lighting, composition, and technical camera tokens.
  5. Integrate {{negative_prompt_strategy}} into a dedicated negative prompt assembler.
  6. Implement the primary execution function with asynchronous dispatch handlers formatted for {{execution_runtime}}.
  7. Add structured logging that records incoming agent thoughts, transformed prompt tokens, and resolved API payload parameters.

Constraints

  • The script MUST be fully executable Python without placeholder functions, pseudo-code, or unhandled exceptions.
  • MUST NOT hardcode API credentials; consume environment variables via configuration classes.
  • All prompt-building functions MUST enforce deterministic string formatting.
  • Code MUST include comprehensive type hints and docstrings for agent self-discovery.

Output format

Provide the response as a single, multi-section Python script containing:

  1. Environment imports and Pydantic schema declarations.
  2. Tool definition metadata object for {{orchestrator_framework}}.
  3. Prompt translation and enrichment helper classes.
  4. The primary asynchronous entrypoint function.
  5. An executable __main__ block demonstrating a simulated agent tool call payload.

Self-review

  • Verify all variables ({{target_diffusion_model}}, {{orchestrator_framework}}, {{visual_domain}}, {{parameter_schema}}, {{negative_prompt_strategy}}, {{execution_runtime}}) are explicitly handled.
  • Confirm the script validates edge cases such as missing parameters or out-of-bound aspect ratios.
  • Ensure no placeholder tokens remain in prompt synthesis templates.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

design-visual
design-image-prompts
autonomous-agents-workflows
autonomous-agents
tool-calling
image-generation