UGemini 2.0.1
A C# wrapper for the Google Gemini API.
Loading...
Searching...
No Matches
Uralstech.UGemini.GeminiManager Class Reference

The class for accessing the Gemini API! More...

Inheritance diagram for Uralstech.UGemini.GeminiManager:
Uralstech.UGemini.Utils.Singleton.Singleton< GeminiManager >

Public Member Functions

void SetApiKey (string apiKey)
 Sets the Gemini API key.
 
async Task< TResponse > Request< TResponse > (IGeminiPostRequest request)
 Computes a POST request on the Gemini API.
 
async Task< TResponse > Request< TResponse > (IGeminiMultiPartPostRequest request)
 Computes a multi-part POST request on the Gemini API.
 
async Task< TResponse > Request< TResponse > (IGeminiGetRequest request)
 Computes a GET request on the Gemini API.
 
async Task Request (IGeminiDeleteRequest request)
 Computes a DELETE request on the Gemini API.
 
async Task< TResponse > Request< TResponse > (IGeminiPatchRequest request)
 Computes a PATCH request on the Gemini API.
 
async Task< TResponse > StreamRequest< TResponse > (IGeminiStreamablePostRequest< TResponse > request)
 Computes a streaming POST request on the Gemini API.
 

Additional Inherited Members

- Properties inherited from Uralstech.UGemini.Utils.Singleton.Singleton< GeminiManager >
static T Instance [get]
 The active instance of type T .
 

Detailed Description

The class for accessing the Gemini API!

Member Function Documentation

◆ Request()

async Task Uralstech.UGemini.GeminiManager.Request ( IGeminiDeleteRequest request)

Computes a DELETE request on the Gemini API.

Parameters
requestThe request object.
Exceptions
GeminiRequestExceptionThrown when the API request fails.

◆ Request< TResponse >() [1/4]

async Task< TResponse > Uralstech.UGemini.GeminiManager.Request< TResponse > ( IGeminiGetRequest request)

Computes a GET request on the Gemini API.

Template Parameters
TResponseThe response type. For example, a request of type Models.Generation.Chat.GeminiChatRequest corresponds to a response type of Models.Generation.Chat.GeminiChatResponse, and a request of type Models.CountTokens.GeminiTokenCountRequest corresponds to a response of type Models.CountTokens.GeminiTokenCountResponse.
Parameters
requestThe request object.
Returns
The computed response.
Exceptions
GeminiRequestExceptionThrown when the API request fails.

◆ Request< TResponse >() [2/4]

async Task< TResponse > Uralstech.UGemini.GeminiManager.Request< TResponse > ( IGeminiMultiPartPostRequest request)

Computes a multi-part POST request on the Gemini API.

Template Parameters
TResponseThe response type. For example, a request of type Models.Generation.Chat.GeminiChatRequest corresponds to a response type of Models.Generation.Chat.GeminiChatResponse, and a request of type Models.CountTokens.GeminiTokenCountRequest corresponds to a response of type Models.CountTokens.GeminiTokenCountResponse.
Parameters
requestThe request object.
Returns
The computed response.
Exceptions
GeminiRequestExceptionThrown when the API request fails.

◆ Request< TResponse >() [3/4]

async Task< TResponse > Uralstech.UGemini.GeminiManager.Request< TResponse > ( IGeminiPatchRequest request)

Computes a PATCH request on the Gemini API.

Template Parameters
TResponseThe response type. For example, a request of type Models.Generation.Chat.GeminiChatRequest corresponds to a response type of Models.Generation.Chat.GeminiChatResponse, and a request of type Models.CountTokens.GeminiTokenCountRequest corresponds to a response of type Models.CountTokens.GeminiTokenCountResponse.
Parameters
requestThe request object.
Returns
The computed response.
Exceptions
GeminiRequestExceptionThrown when the API request fails.

◆ Request< TResponse >() [4/4]

async Task< TResponse > Uralstech.UGemini.GeminiManager.Request< TResponse > ( IGeminiPostRequest request)

Computes a POST request on the Gemini API.

Template Parameters
TResponseThe response type. For example, a request of type Models.Generation.Chat.GeminiChatRequest corresponds to a response type of Models.Generation.Chat.GeminiChatResponse, and a request of type Models.CountTokens.GeminiTokenCountRequest corresponds to a response of type Models.CountTokens.GeminiTokenCountResponse.
Parameters
requestThe request object.
Returns
The computed response.
Exceptions
GeminiRequestExceptionThrown when the API request fails.

◆ SetApiKey()

void Uralstech.UGemini.GeminiManager.SetApiKey ( string apiKey)

Sets the Gemini API key.

Parameters
apiKeyThe new API key.

◆ StreamRequest< TResponse >()

async Task< TResponse > Uralstech.UGemini.GeminiManager.StreamRequest< TResponse > ( IGeminiStreamablePostRequest< TResponse > request)

Computes a streaming POST request on the Gemini API.

Use callbacks in the request object to receive the streamed data.

Template Parameters
TResponseThe response type. For example, a request of type Models.Generation.Chat.GeminiChatRequest corresponds to a response type of Models.Generation.Chat.GeminiChatResponse, and a request of type Models.CountTokens.GeminiTokenCountRequest corresponds to a response of type Models.CountTokens.GeminiTokenCountResponse.
Parameters
requestThe request object.
Returns
The computed response.
Exceptions
GeminiRequestExceptionThrown when the API request fails.
Type Constraints
TResponse :IAppendableData<TResponse> 

The documentation for this class was generated from the following file: