If the images for a multimodal evaluation aren’t available to be externally hosted, users can utilize the file upload API to upload the image onto the SGP platform.
The following example shows how a user would upload an image and use it in a test case.
Copy
Ask AI
# set up your clientimport SGPClient from 'sgp';const client = new SGPClient({ apiKey: process.env['SGP_API_KEY'],});# upload the imageimage = 'contents of your image'file = client.beta.files.create( file=image,)# assume input_data is the rest of your inputs for the test case. # In order to include the image as data in the input, add the following objectinput_data = { **input_data, "image": { "file_id": file.id, "file_type": "image" }}