GenerateTextRequest class final

Request to generate a text completion response from the model.

Inheritance
  • Object
  • ProtoMessage
  • GenerateTextRequest

Constructors

GenerateTextRequest({required String model, required TextPrompt? prompt, double? temperature, int? candidateCount, int? maxOutputTokens, double? topP, int? topK, List<SafetySetting> safetySettings = const [], List<String> stopSequences = const []})
GenerateTextRequest.fromJson(Map<String, dynamic> json)
factory

Properties

candidateCount int?
Optional. Number of generated responses to return.
final
hashCode int
The hash code for this object.
no setterinherited
maxOutputTokens int?
Optional. The maximum number of tokens to include in a candidate.
final
model String
Required. The name of the Model or TunedModel to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m
final
prompt TextPrompt?
Required. The free-form input text given to the model as a prompt.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safetySettings List<SafetySetting>
Optional. A list of unique SafetySetting instances for blocking unsafe content.
final
stopSequences List<String>
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.
final
temperature double?
Optional. Controls the randomness of the output. Note: The default value varies by model, see the Model.temperature attribute of the Model returned the getModel function.
final
topK int?
Optional. The maximum number of tokens to consider when sampling.
final
topP double?
Optional. The maximum cumulative probability of tokens to consider when sampling.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

fullyQualifiedName → const String