|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Core Operations > AIX. - Grok / X - API |
MiniRobotLanguage (MRL)
AIX.Ask Vision
Ask a Vision-Based Question with an Image
Intention
AskVision Command: Querying Grok with Images
The Ask Vision command allows you to send a question to the Grok API along with an image, enabling vision-based analysis or descriptions.
This enhances your ability to interact with AI by combining text prompts with visual data.
It’s part of the AIX - Grok / X - API suite.
The Ask Vision command sends a chat completion request to the Grok API, including a text prompt and an optional Base64-encoded image.
Grok processes the image and text together, returning a response based on both inputs, stored in AIX_GrokContent.
This command is essential for:
•Image Analysis: Ask questions about image content (e.g., "What’s in this picture?").
•Contextual Understanding: Combine visual and textual data for richer responses.
•Automation: Integrate vision capabilities into your workflows.
Provide a text prompt and a Base64-encoded image string, optionally enabling clipboard output.
The response is stored in AIX_GrokContent and can be retrieved with AIX.Get Content.
Example Usage
AIX.SetAPI_Key|your_api_key_here
AIX.Ask Vision|What’s in this image?|1|Base64ImageString
DBP.Response: $$AIX_GrokContent
The response might describe the image content, copied to the clipboard if enabled.
Illustration
┌───────────────┐
│ Prompt + Image│
├───────────────┤
│ Grok Response │
└───────────────┘
Sending a prompt and image to Grok for analysis.
Syntax
AIX.AskVision|P1|P2|P3
AIX.Ask Vision|P1|P2|P3
Parameter Explanation
P1 - The text prompt or question to send to Grok (required).
P2 - (Optional) Clipboard flag: 1 to copy the response to the clipboard, 0 otherwise (default: uses AIX_ClipboardOutput).
P3 - (Required) Base64-encoded image data for vision support.
Example
AIX.Ask Vision|Describe this image|1|Base64EncodedImage
DBP.Grok says: $$AIX_GrokContent
ENR.
Remarks
- Requires a valid API key set via AIX.Set Key.
- Image data must be Base64-encoded; response is text-based (e.g., descriptions).
Limitations
- Clipboard output is limited to 1MB (%MAX_CLIPBOARD_SIZE).
- Vision support depends on the model (e.g., grok-2); check AIX.Set Model.
See also:
• AIX.Ask