![]() |
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
|