Table of Contents

Class GenerativeAIService

Namespace
GenerativeAI.Web
Assembly
GenerativeAI.Web.dll

Service implementation for GenerativeAI that provides access to AI models.

public class GenerativeAIService : IGenerativeAiService
Inheritance
GenerativeAIService
Implements
Inherited Members
Extension Methods

Constructors

GenerativeAIService(IOptions<GenerativeAIOptions>)

Initializes a new instance of the GenerativeAIService class.

public GenerativeAIService(IOptions<GenerativeAIOptions> options)

Parameters

options IOptions<GenerativeAIOptions>

The configuration options for GenerativeAI.

Properties

Logger

Gets or sets the logger instance.

public ILogger? Logger { get; set; }

Property Value

ILogger

Platform

Gets the underlying GenerativeAI platform instance.

public IGenerativeAI Platform { get; }

Property Value

IGenerativeAI

Methods

CreateInstance(string?)

Creates a generative model instance.

public IGenerativeModel CreateInstance(string? modelName = null)

Parameters

modelName string

The name of the model to create. When omitted, Model is used, falling back to DefaultGeminiModel.

Returns

IGenerativeModel

A generative model instance.