generativeModel method

GenerativeModel generativeModel({
  1. required String model,
  2. List<SafetySetting>? safetySettings,
  3. GenerationConfig? generationConfig,
  4. Content? systemInstruction,
  5. List<Tool>? tools,
  6. ToolConfig? toolConfig,
})

Create a GenerativeModel backed by the generative model named model.

The model argument can be a model name (such as 'gemini-pro') or a model code (such as 'models/gemini-pro'). There is no creation time check for whether the model string identifies a known and supported model. If not, attempts to generate content will fail.

The optional safetySettings and generationConfig can be used to control and guide the generation. See SafetySetting and GenerationConfig for details.

Implementation

GenerativeModel generativeModel(
    {required String model,
    List<SafetySetting>? safetySettings,
    GenerationConfig? generationConfig,
    Content? systemInstruction,
    List<Tool>? tools,
    ToolConfig? toolConfig}) {
  return createGenerativeModel(
      model: model,
      app: app,
      appCheck: appCheck,
      auth: auth,
      location: location,
      safetySettings: safetySettings,
      generationConfig: generationConfig,
      systemInstruction: systemInstruction,
      tools: tools,
      toolConfig: toolConfig);
}