Through the API

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.

Example

The following example shows how a user would upload an image and use it in a test case.

# set up your client
import SGPClient from 'sgp';
const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'],
});

# upload the image
image = '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 object
input_data = {
    **input_data,
    "image": {
        "file_id": file.id,
        "file_type": "image"
    }

}

Application Setup