GoogleAi Class

The GoogleAI class serves as the main entry point for interacting with Google's AI models. It provides methods to create generative and embedding models, as well as manage and retrieve model details. This class integrates Google's AI platform capabilities by utilizing appropriate models and configurations to handle generative AI tasks, embeddings, and other related operations.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class GoogleAi : GenAI, IGenerativeAI
Inheritance
Object    GenAI    GoogleAi
Implements
IGenerativeAI

Constructors

GoogleAi(IPlatformAdapter, HttpClient, ILogger) Represents a specific implementation of the GenAI base class designed for Google's AI platform. Offers functionality to interact with Google's generative AI and machine learning models. Provides support for initialization with various parameters such as API keys, access tokens, HTTP client, and logging.
GoogleAi(String, String, HttpClient, ILogger) Implements a client adapter for Google's AI platform to facilitate integration with its generative AI services. Provides configuration and methods for managing credentials, setting API versions, creating task URLs, and authorizing requests for secure access to Google's AI APIs.

Properties

HttpClient Gets the underlying HttpClient instance used to perform HTTP requests to Google's AI platform. This property allows for custom configuration of network communication, including request headers, timeouts, and other HTTP-specific settings, enabling seamless interaction with Google's generative and embedding models.
(Inherited from GenAI)
Logger Gets the logger instance used by the GoogleAi class for logging diagnostic messages, errors, and other runtime information. This property provides a mechanism to track and debug the internal operations of the class and its related components.
(Inherited from GenAI)
ModelClient Gets the instance of the ModelClient class associated with the GoogleAi instance. This property allows access to functionality for interacting with the Gemini API Models endpoint, enabling operations such as retrieving and listing AI models.
(Inherited from GenAI)
Platform Gets the underlying platform adapter instance utilized by the GoogleAi class. This property provides essential platform-specific functionality, such as URL generation, authorization handling, and API versioning, enabling seamless communication with Google's generative AI services.
(Inherited from GenAI)

Methods

CreateEmbeddingModel Creates and initializes an embedding model for use in embedding-related AI tasks. The created model is configured with the provided model name and integrates with the underlying platform adapter.
(Inherited from GenAI)
CreateGeminiModel 
CreateGenerativeModel
(Overrides GenAICreateGenerativeModel(String, GenerationConfig, ICollectionSafetySetting, String))
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetModelAsync Retrieves a specific AI model by its name asynchronously from the Google's AI platform.
(Inherited from GenAI)
GetPlatformAdapter Retrieves the platform adapter associated with this instance. The platform adapter provides core functionalities, such as authorization, URL creation, and API version management, for interacting with the underlying platform.
(Inherited from GenAI)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ListModelsAsync Asynchronously retrieves a list of AI models available in Google's AI platform. This method supports pagination to fetch models in batches using the specified page size and page token, enabling efficient handling of large model datasets.
(Inherited from GenAI)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also