Generate content with multimodal inputs in express mode.
Endpoint
posthttps://aiplatform.googleapis.com/v1/{model}:generateContent
Path parameters
model
string
Required. The fully qualified name of the publisher model to use.
Publisher model format: publishers/google/models/*
Request body
The request body contains data with the following structure:
Required. 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.
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.
Optional. Tool config. This config is shared for all tools provided in the request.
labels
map (key: string, value: string)
Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.
label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. label values are optional. label keys must start with a letter.
Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
Optional. Generation config.
Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
Response body
If successful, the response body contains an instance of GenerateContentResponse
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-04 UTC.