public class GenerateContentRequest : IContentsRequest
GenerateContentRequest | Represents a request to generate content. This class contains parameters required to define the specifics of content generation, including inputs, tools, configurations, and safety constraints. |
GenerateContentRequest(Content) | Represents a request to generate content. This class enables the definition of content generation specifics through properties such as the content details, tools, tool configurations, safety settings, and system instructions. Optional configurations allow customization and adaptation of the generation process. |
GenerateContentRequest(ListContent, ListTool, ToolConfig, ListSafetySetting, Content, GenerationConfig, String) | Represents a request used to generate content. This class includes properties like content, tools, configurations, safety settings, and instructions required for the content generation process. |
CachedContent | Optional. The name of the content cached to use as context to serve the prediction. Format: cachedContents/{cachedContent} |
Contents | Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like chat, this is a repeated field that contains the conversation history and the latest request. |
GenerationConfig | Optional. Configuration options for model generation and outputs. |
SafetySettings | Optional. A list of unique SafetySetting instances for blocking unsafe content. This will be enforced on the GenerateContentRequest.Contents and GenerateContentResponse.Candidates. There should not be more than one setting for each SafetyCategory 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 SafetyCategory specified in the SafetySettings. If there is no SafetySetting for a given SafetyCategory provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the guide for detailed information on available safety settings. Also refer to the Safety guidance to learn how to incorporate safety considerations in your AI applications. |
SystemInstruction | Optional. Developer set system instruction(s). Currently, text only. |
ToolConfig | Optional. Tool configuration for any Tool specified in the request. Refer to the Function calling guide for a usage example. |
Tools | Optional. A list of Tools the Model may use to generate the next response. A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the Model. Supported Tools are Function and codeExecution. Refer to the Function calling and the Code execution guides to learn more. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
AddContent |
Adds a new Content object to the IContentsRequest.
(Defined by IContentRequest_Extensions) |
AddInlineData |
Adds inline data such as an image or audio file into the latest Content in the IContentsRequest and associates it with the specified role.
(Defined by IContentRequest_Extensions) |
AddInlineFile |
Adds a new Content that includes an inline file as a Part to the IContentsRequest.
(Defined by IContentRequest_Extensions) |
AddPart |
Adds a specific Part to the latest Content in the IContentsRequest.
If no Content exists, a new one is created with the provided Part.
(Defined by IContentRequest_Extensions) |
AddParts |
Adds a collection of Part objects to the latest Content in the IContentsRequest with the specified role.
If no Content exists, a new one is created with the provided Part collection.
(Defined by IContentRequest_Extensions) |
AddRemoteFile |
Adds a remote file to the IContentsRequest using a RemoteFile object.
(Defined by IContentRequest_Extensions) |
AddRemoteFile |
Adds a remote file to the IContentsRequest using a RemoteFile object.
(Defined by IContentRequest_Extensions) |
AddRemoteFile |
Adds a remote file to the IContentsRequest using a URL and MIME type.
(Defined by IContentRequest_Extensions) |
AddText |
Adds a single text Part to the IContentsRequest with the specified role.
(Defined by IContentRequest_Extensions) |
AddTool |
Adds a Tool to the GenerateContentRequest with an optional ToolConfig.
(Defined by GenerateContentRequestExtensions) |
UseJsonModeT |
Configures the GenerateContentRequest to use JSON mode for responses of the specified type T.
(Defined by GenerateContentRequestExtensions) |