modzyClient.getModels

Get some models

modzyClient.getModels(ModelSearchParams searchParams)

Returns a list of models. The list includes each model’s modelId, versions, and latestVersion.

Parameters

Parameter

Type

Description

Example

searchParams

com.modzy.sdk.dto.ModelSearchParams

Search params object with pagination options

        sp.setAuthor("Open Source");```

Returns

List<com.modzy.sdk.model.Model> A list of models with the identifiers and versions populated.

Examples

ModelSearchParams searchParams = new ModelSearchParams();
searchParams.setAuthor("Open Source");
List<Model> models = modzyClient.getModels(searchParams);
System.out.println(String.format("Open source models: %s", models.size()));

Active models

ModelSearchParams searchParams = new ModelSearchParams();
searchParams.setActive(true);
List<Model> models = modzyClient.getModels(searchParams);
System.out.println(String.format("Active models: %s", models.size()));

Name and pagination

ModelSearchParams searchParams = new ModelSearchParams();
searchParams.setName("Image");
searchParams.setPerPage(5);
List<Model> models = modzyClient.getModels(searchParams);
System.out.println(String.format("Models with name start with 'Image': %s", models.size()));

Combined search

ModelSearchParams searchParams = new ModelSearchParams();
searchParams.setName("Image");
searchParams.setAuthor("Open Source");
searchParams.setActive(true);
List<Model> models = modzyClient.getModels(searchParams);
System.out.println(String.format("Active open source models which name starts with 'Image': %s", models.size()));

Did this page help you?