GoogleAICredentials Class

Represents the credentials required to authenticate with Google AI Generative APIs. This class encapsulates the API key and an optional access token necessary for making authorized API calls.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public class GoogleAICredentials : ICredentials
Inheritance
Object    GoogleAICredentials
Implements
ICredentials

Constructors

GoogleAICredentials Represents the credentials required to authenticate with Google AI Generative APIs. Manages the API Key and optional Access Token necessary for making API requests.

Properties

ApiKey Gets the API Key used to authenticate requests to Google AI Generative APIs. The API Key provides an easy way to access public resources or perform authorized operations without requiring OAuth2 tokens.
AuthToken Gets the Access Token for authenticating with Google AI APIs. This token is used for OAuth2-based authentication and is typically required when an API Key alone is insufficient for certain protected resources.

Methods

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)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)
ValidateCredentials Validates the API credentials for the GoogleAICredentials instance. Ensures that either an API Key or an Access Token is provided. Throws an exception if both are null or empty.

See Also