Ask My Image
The quick-start guide illustrates how to write a GenAIScript that takes input from an image file.
-
Place your image in a directory visible in VS Code Explorer
-
Use the
> GenAIScript: Create new script...
command in the command palette to create a new script. -
Update the model in the script header to refer to a model that understands images:
script({title: "Apply a script to an image",model: "openai:gpt-4o",}) -
Use defImages to ingest the image file into the model context:
defImages(env.files, { detail: "low" }) -
Replace the text
"TELL THE LLM WHAT TO DO..."
with what you want it to do with your image file.$`You are a helpful assistant.Your goal is to look at the image of a chart providedand extract the data it is presented in a tabular format.` -
Right click on the image file in VS Code Explorer. Select Run GenAIScript. Select the script you just wrote.
-
The Output will be displayed in a new document tab.