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.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
GenerativeModel CreateGenerativeModel(
string modelName,
GenerationConfig? config = null,
ICollection<SafetySetting>? safetyRatings = null,
string? systemInstruction = null
)
- 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.
GenerativeModelAn instance of
GenerativeModel configured with the specified parameters for generative tasks.