IGenerativeAICreateGenerativeModel Method

Creates and initializes a generative model capable of producing AI-generated content. The model is configured with the specified parameters to customize its behavior and ensure safety compliance when generating content.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
GenerativeModel CreateGenerativeModel(
	string modelName,
	GenerationConfig? config = null,
	ICollection<SafetySetting>? safetyRatings = null,
	string? systemInstruction = null
)

Parameters

modelName  String
The name of the generative model to initialize, used to identify the specific AI model for content generation.
config  GenerationConfig  (Optional)
Optional parameter specifying the generation configuration, such as temperature, max tokens, or other customization options.
safetyRatings  ICollectionSafetySetting  (Optional)
Optional collection of safety settings used to enforce content safety thresholds during generation.
systemInstruction  String  (Optional)
Optional system-level instruction guiding the behavior of the generative model.

Return Value

GenerativeModel
An instance of GenerativeModel configured with the specified parameters for generative tasks.

See Also