Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 1.95 KB

list_models.md

File metadata and controls

87 lines (67 loc) · 1.95 KB

description: Calls the API to list all available models.

google.generativeai.list_models

View source on GitHub

Calls the API to list all available models.

google.generativeai.list_models(
    *,
    page_size: (int | None) = 50,
    client: (glm.ModelServiceClient | None) = None,
    request_options: (helper_types.RequestOptionsType | None) = None
) -> model_types.ModelsIterable
import pprint
for model in genai.list_models():
    pprint.pprint(model)

Args

`page_size` How many `types.Models` to fetch per page (api call).
`client` You may pass a `glm.ModelServiceClient` instead of using the default client.
`request_options` Options for the request.

Yields

types.Model objects.