GenerativeModel(String, String, GenerationConfig, ICollectionSafetySetting, String, HttpClient, ILogger) Constructor
Represents a generative AI model designed for text generation and related tasks.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
public GenerativeModel(
string apiKey,
string? model,
GenerationConfig config = null,
ICollection<SafetySetting>? safetySettings = null,
string? systemInstruction = null,
HttpClient? httpClient = null,
ILogger? logger = null
)
Parameters
- apiKey String
- API key for authenticating with the AI platform when a specific adapter is not provided explicitly.
- model String
- The name or identifier of the AI model to be utilized.
- config GenerationConfig (Optional)
- Optional configuration defining text generation parameters such as temperature and token limits.
- safetySettings ICollectionSafetySetting (Optional)
- Optional collection of safety settings to ensure generated content adheres to specific guidelines.
- systemInstruction String (Optional)
- Optional instruction specifying the initial guidance or context for the model's behavior.
- httpClient HttpClient (Optional)
- Optional HTTP client for facilitating API communication with the AI platform.
- logger ILogger (Optional)
- Optional logger for capturing diagnostic messages and runtime events.
The class provides constructors with various initialization parameters for customization, including platform integration, model configuration,
and safety settings. It supports additional features like function calling, automatic function management, and caching of generated content.