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

Configuration options for model generation and outputs. Not all parameters may be configurable for every model. More...

Public Attributes

string[] StopSequences = null
 The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.
 
GeminiResponseType ResponseMimeType = GeminiResponseType.Unspecified
 Output response type of the generated candidate text.
 
GeminiSchema ResponseSchema = null
 Output response schema of the generated candidate text when response mime type can have schema.
 
int CandidateCount = 1
 Number of generated responses to return.
 
int MaxOutputTokens = -1
 The maximum number of tokens to include in a candidate.
 
float Temperature = -1f
 Controls the randomness of the output. Values can range from 0.0 - 2.0.
 
float TopP = -1f
 The maximum cumulative probability of tokens to consider when sampling.
 
int TopK = -1
 The maximum number of tokens to consider when sampling.
 

Detailed Description

Configuration options for model generation and outputs. Not all parameters may be configurable for every model.

Member Data Documentation

◆ CandidateCount

int Uralstech.UGemini.Models.Generation.GeminiGenerationConfiguration.CandidateCount = 1

Number of generated responses to return.

Currently, this value can only be set to 1. If unset, this will default to 1.

◆ ResponseMimeType

GeminiResponseType Uralstech.UGemini.Models.Generation.GeminiGenerationConfiguration.ResponseMimeType = GeminiResponseType.Unspecified

Output response type of the generated candidate text.

Only available in the beta API.

◆ ResponseSchema

GeminiSchema Uralstech.UGemini.Models.Generation.GeminiGenerationConfiguration.ResponseSchema = null

Output response schema of the generated candidate text when response mime type can have schema.

If set, a compatible GeminiResponseType must also be set. Compatible types: GeminiResponseType.Json: Schema for JSON response.

Only available in the beta API.

◆ TopK

int Uralstech.UGemini.Models.Generation.GeminiGenerationConfiguration.TopK = -1

The maximum number of tokens to consider when sampling.

Models use nucleus sampling or combined Top-k and nucleus sampling. Top-k sampling considers the set of topK most
probable tokens. Models running with nucleus sampling don't allow topK setting.

◆ TopP

float Uralstech.UGemini.Models.Generation.GeminiGenerationConfiguration.TopP = -1f

The maximum cumulative probability of tokens to consider when sampling.

The model uses combined Top-k and nucleus sampling.

Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered.
Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits
number of tokens based on the cumulative probability.


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