OptionaladditionalAdditional model-specific parameters that will be passed through to the underlying model. For chat/LLM models, this can include parameters like temperature, topP, topK, etc. The AIPromptRunner will pass these through when building model-specific parameters.
OptionalagentOptional agent run ID to link this prompt execution to a parent agent run When provided, the AIPromptRun record will include this as AgentRunID for comprehensive execution tracking
OptionalapiOptional API keys to use for this prompt execution. When provided, these keys will override the global API keys for the specified driver classes. This allows for runtime API key configuration without modifying environment variables or global settings.
OptionalattemptNOTE: Only applies when prompt.OutputType is 'object'
If this parameter is set to true, the runner will attempt to repair JSON parsing errors with a two step process, after a normal attempt to parse the JSON as-is where an error occurs:
MJ: System category
This prompt will attempt to fix the JSON with a small LLM that knows how to emit proper JSONOptionalcancellationOptional cancellation token to abort the prompt execution When this signal is aborted, the execution will be cancelled and any running operations will be terminated as gracefully as possible
OptionalchildOptional array of child prompts to execute before this prompt.
When provided, the AIPromptRunner will:
This enables hierarchical prompt architectures where:
Each child prompt can specify its own execution parameters including models, validation, etc.
OptionalcleanWhether to clean validation syntax from the AI result. When true, the AIPromptRunner will automatically remove validation syntax (like ?, *, :type, :[N+], :!empty) from JSON keys in the AI's response.
Note: For JSON outputs with an OutputExample defined, validation syntax is ALWAYS cleaned automatically before validation, regardless of this setting. This parameter is only needed for edge cases where you want cleaning without an OutputExample.
Default: false
OptionalconfigurationOptional configuration ID for environment-specific behavior
OptionalcontextUser context for authentication and permissions
OptionalconversationOptional conversation messages for multi-turn conversations When provided, these messages will be combined with the rendered template for direct conversation-style prompting
OptionalcredentialOptional credential ID for per-request authentication override.
Takes highest priority in the credential resolution hierarchy:
Important: When any credential ID is set (priorities 1-4), the system uses the Credentials system exclusively and ignores legacy authentication methods (priorities 5-6). This ensures consistent, audited credential usage.
Use this for:
OptionaldataData context for template rendering and prompt execution
OptionaleffortOptional effort level override for this prompt execution (1-100).
Higher values request more thorough reasoning and analysis from AI models. Each provider maps the 1-100 scale to their specific effort parameters:
Precedence hierarchy (highest to lowest priority):
OptionalforceForces the model-selection step to evaluate credential availability for EVERY candidate model-vendor combination, even after a usable candidate has already been found.
By default (false) the runner short-circuits: it stops probing candidates as soon as the
highest-priority candidate with valid credentials is identified, and records the remaining
candidates as "not-evaluated" in the ModelSelection telemetry. This avoids unnecessary
credential/env-var lookups on every prompt run for fleets with many configured models.
Set this to true when you need a complete availability report for ALL candidates (e.g. an admin "which of my models are actually configured?" diagnostic), at the cost of probing credentials for every candidate.
Default: false
OptionalmaxOptional maximum length for error messages returned in results.
When set, error messages longer than this value will be truncated with "... [truncated]" appended. When undefined (default), error messages are returned in full without truncation.
This is useful for handling extremely long error messages (like provider-specific JSON dumps) while still allowing full error details when needed for debugging.
Default: undefined (no truncation)
OptionalmodelOptional prompt to use for model selection instead of the main prompt. When executing hierarchical prompts, this allows using a child prompt's model selection configuration instead of the parent prompt's configuration. If not specified, the main prompt's model selection will be used.
OptionalnativeOptional file artifacts that may be attached as native content blocks when the resolved LLM driver supports the file's MIME type natively.
The AIPromptRunner checks each entry against the driver's FileCapabilities after model selection. Files that pass the resolver are injected as content blocks in the last user message; others are left for artifact tool-based exploration.
OptionalonOptional callback for receiving execution progress updates Provides real-time information about the execution progress
OptionalonOptional callback fired immediately after the PromptRun record is created and saved. Provides the PromptRun ID for immediate tracking/monitoring purposes.
This callback is useful for:
The callback is invoked after the PromptRun is successfully saved but before the actual AI model execution begins. If the callback throws an error, it will be logged but won't fail the prompt execution.
The ID of the newly created AIPromptRun record
OptionalonOptional callback for receiving streaming content updates Called when AI models support streaming responses
OptionaloverrideOptional runtime override for prompt execution. When specified, these values take precedence over any model selection configuration in the prompt or modelSelectionPrompt. Currently supports model and vendor overrides, but can be extended for future needs.
Model selection precedence (highest to lowest):
For agents, the modelSelectionPrompt is determined by the agent's ModelSelectionMode:
Optional InternalparentInternal: Parent prompt run ID for hierarchical execution tracking. This is automatically set by the system when executing child prompts.
The AI prompt to execute. Note: Get prompts from AIEngine.Instance.Prompts after calling AIEngine.Config()
OptionalproviderOptional per-request metadata provider for multi-user server isolation. Set by BaseAgent when invoking prompts so prompt run records are saved via the same isolated provider as the rest of the agent execution. When omitted, falls back to the global Metadata.Provider.
OptionalrerunOptional ID of a previous prompt run to indicate this is a rerun. When provided, the new AIPromptRun record will have its RerunFromPromptRunID field set to this value, establishing a link between the original and rerun executions.
OptionalskipWhether to skip validation of the prompt output
OptionalsystemOptional system prompt override that bypasses template rendering. When provided, this exact system prompt will be used instead of rendering the prompt's template. This is useful for re-running prompts with the exact system prompt from a previous run.
OptionaltemplateOptional custom template data that augments the main data context
OptionaltemplateDetermines how the rendered template should be used in conversation messages 'system' - Add rendered template as system message (default) 'user' - Add rendered template as user message 'none' - Don't add rendered template to conversation
OptionaltimeoutOptional wall-clock bound, in milliseconds, applied to EACH model call this prompt makes
(per failover candidate / per validation retry / per parallel task — mirroring the parallel
coordinator's existing taskTimeoutMS semantics).
When set, AIPromptRunner composes this with cancellationToken (if any) into a single abort
signal: BOTH bounds apply and whichever fires first aborts the call. Exceeding the timeout
rejects with a typed AIPromptTimeoutError (classified as a retriable NetworkError), so it
flows into the normal failover/retry machinery instead of hanging forever.
When omitted (and the runner declares no DefaultPromptTimeoutMS), the model call is bounded
ONLY by cancellationToken — i.e. unbounded if no token is supplied.
OptionalverboseWhether to enable verbose logging during prompt execution. When true, detailed information about model selection, API key checking, and execution steps will be logged. Can also be controlled via MJ_AI_VERBOSE environment variable.
Parameters for executing an AI prompt