GenerateContentRequest class final

Request to generate a completion from the model.

Constructors

GenerateContentRequest({required String model, Content? systemInstruction, required List<Content> contents, List<Tool> tools = const [], ToolConfig? toolConfig, List<SafetySetting> safetySettings = const [], GenerationConfig? generationConfig, String? cachedContent})
GenerateContentRequest.fromJson(Object? j)
factory

Properties

cachedContent → String?
Optional. The name of the content cached to use as context to serve the prediction. Format: cachedContents/{cachedContent}
final
contents → List<Content>
Required. The content of the current conversation with the model.
final
generationConfig → GenerationConfig?
Optional. Configuration options for model generation and outputs.
final
hashCode → int
The hash code for this object.
no setterinherited
model → String
Required. The name of the Model to use for generating the completion.
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
systemInstruction → Content?
Optional. Developer set system instruction(s). Currently, text only.
final
toolConfig → ToolConfig?
Optional. Tool configuration for any Tool specified in the request. Refer to the Function calling guide for a usage example.
final
tools → List<Tool>
Optional. A list of Tools the Model may use to generate the next response.
final

Methods

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

Operators

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

Constants

fullyQualifiedName → const String