UGemini 2.0.1
A C# wrapper for the Google Gemini API.
|
Generates a grounded answer from the model. More...
Public Member Functions | |||
string | GetEndpointUri (GeminiRequestMetadata metadata) | ||
Gets the URI to the API endpoint.
| |||
GeminiAnswerRequest (GeminiModelId model, bool useBetaApi=true) | |||
Creates a new GeminiAnswerRequest. | |||
string | GetUtf8EncodedData () | ||
Converts the request object to a UTF-8 encoded string.
| |||
Public Attributes | |
GeminiContent[] | Contents |
The content of the current conversation with the model. | |
GeminiAnswerStyle | AnswerStyle |
Style in which answers should be returned. | |
GeminiSafetySettings[] | SafetySettings = null |
A list of unique GeminiSafetySettings instances for blocking unsafe content. | |
GeminiGroundingPassages | InlinePassages = null |
Passages provided inline with the request. | |
GeminiSemanticRetrieverConfig | SemanticRetriever = null |
Content retrieved from resources created via the Semantic Retriever API. | |
float | Temperature = -1f |
Controls the randomness of the output. | |
GeminiModelId | Model |
The model to use. | |
string | ApiVersion |
The API version to use. | |
Properties | |
string | ContentType [get] |
The MIME type of the request content. | |
Properties inherited from Uralstech.UGemini.IGeminiPostRequest |
Generates a grounded answer from the model.
Only available in the beta API.
Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.GeminiAnswerRequest | ( | GeminiModelId | model, |
bool | useBetaApi = true ) |
Creates a new GeminiAnswerRequest.
Only available in the beta API.
model | The model to use. |
useBetaApi | Should the request use the Beta API? |
string Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.GetEndpointUri | ( | GeminiRequestMetadata | metadata | ) |
Gets the URI to the API endpoint.
metadata | The metadata of the request to be carried out on the URI. |
Implements Uralstech.UGemini.IGeminiRequest.
string Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.GetUtf8EncodedData | ( | ) |
Converts the request object to a UTF-8 encoded string.
Implements Uralstech.UGemini.IGeminiPostRequest.
GeminiContent [] Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.Contents |
The content of the current conversation with the model.
For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
generateAnswer currently only supports queries in English.
GeminiGroundingPassages Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.InlinePassages = null |
Passages provided inline with the request.
This or SemanticRetriever are must be provided at a time.
GeminiSafetySettings [] Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.SafetySettings = null |
A list of unique GeminiSafetySettings instances for blocking unsafe content.
This will be enforced on Contents and GeminiAnswerResponse.Answer.
There should not be more than one setting for each GeminiSafetyHarmCategory type. The API will block any
contents and responses that fail to meet the thresholds set by these settings. This list overrides the default
settings for each GeminiSafetyHarmCategory specified in the SafetySettings. If there is
no GeminiSafetySettings for a given GeminiSafetyHarmCategory provided in the list, the API will use the
default safety setting for that category. Harm categories GeminiSafetyHarmCategory.HateSpeech,
GeminiSafetyHarmCategory.SexuallyExplicit, GeminiSafetyHarmCategory.DangerousContent and
GeminiSafetyHarmCategory.Harassment are supported.
GeminiSemanticRetrieverConfig Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.SemanticRetriever = null |
Content retrieved from resources created via the Semantic Retriever API.
This or InlinePassages are must be provided at a time.
float Uralstech.UGemini.Models.Generation.QuestionAnswering.GeminiAnswerRequest.Temperature = -1f |
Controls the randomness of the output.
Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and
creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low
temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.
|
get |
The MIME type of the request content.
Implements Uralstech.UGemini.IGeminiPostRequest.