|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIU. - OpenAI API > !Image Generation Settings > AIU. - Artificial Intelligence Utility |
MiniRobotLanguage (MRL)
AIU.GetImageResponseFormat
Retrieve the Current Image Response Format
Intention
GetImageResponseFormat Command: Checking the Image Output Format
The GetImageResponseFormat command retrieves the current response format setting for images generated by the OpenAI DALL-E 3 API, such as 'url' or 'b64_json'.
This helps you verify or utilize the format in your scripts.
It’s part of the AIU - OpenAI API suite.
This command returns the current setting for how DALL-E 3 image generation responses are formatted, as previously set by AIU.SetImageResponseFormat.
The result can be stored in a variable or placed on the Top of Stack (TOS) if no variable is specified.
Retrieving the image response format is useful for:
•Verification: Confirm the current format before generating images.
•Dynamic Handling: Adjust script logic based on whether 'url' or 'b64_json' is set.
•Debugging: Ensure compatibility with downstream operations.
Call the command with an optional variable to store the result. If omitted, the format is pushed to the TOS.
The default format is 'url' unless changed via AIU.SetImageResponseFormat.
Example Usage
AIU.SetImageResponseFormat|b64_json
AIU.GetImageResponseFormat|$$FMT
DBP.Current Format: $$FMT
This retrieves 'b64_json' as the current format.
Illustration
┌──────────────────────┐
│ Current Format │
├──────────────────────┤
│ b64_json │
└──────────────────────┘
Example output after setting the format.
Syntax
AIU.GetImageResponseFormat[|P1]
AIU.Get_ImageResponseFormat[|P1]
Parameter Explanation
P1 - (Optional) The variable where the current format ('url' or 'b64_json') will be stored. If omitted, the value is placed on the Top of Stack (TOS).
Example
AIU.GetImageResponseFormat|$$RES
DBP.Response Format: $$RES
AIU.GetImageResponseFormat
POP.$$STA
DBP.Format from Stack: $$STA
ENR.
Remarks
- Returns 'url' by default if not previously set.
- The format affects how AIU.GenerateURL and AIU.GenerateFile process responses.
Limitations
- Only reflects the current setting and does not validate its compatibility with the API.
See also: