Skip to content

Latest commit

 

History

History
95 lines (62 loc) · 1.63 KB

File metadata and controls

95 lines (62 loc) · 1.63 KB

google.generativeai.get_model

View source on GitHub

Calls the API to fetch a model by name.

google.generativeai.get_model(
    name: model_types.AnyModelNameOptions,
    *,
    client=None,
    request_options: (helper_types.RequestOptionsType | None) = None
) -> (model_types.Model | model_types.TunedModel)
import pprint
model = genai.get_model('models/gemini-1.5-flash')
pprint.pprint(model)

Args

name

The name of the model to fetch. Should start with models/

client

The client to use.

request_options

Options for the request.

Returns

A types.Model