GenAICreateGenerativeModel Method
Creates and initializes a generative model for use with Google's generative AI platform.
This method allows the specification of model configuration, safety settings,
and system-level instructions for controlling model behavior.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
public virtual GenerativeModel CreateGenerativeModel(
string modelName,
GenerationConfig? config = null,
ICollection<SafetySetting>? safetyRatings = null,
string? systemInstruction = null
)
- modelName String
- The name of the generative model to initialize.
- config GenerationConfig (Optional)
- Optional configuration settings for generation,
such as temperature, max tokens, or other generation parameters.
- safetyRatings ICollectionSafetySetting (Optional)
- Optional safety settings to define behavior
constraints or safety parameters for the generative model.
- systemInstruction String (Optional)
- Optional system-wide instruction to apply
when the model processes requests or generates responses.
GenerativeModelAn instance of
GenerativeModel configured with the specified parameters.