Generate content with multimodal inputs.
HTTP request
POST https://{service-endpoint}/v1/{model}:generateContent
Where {service-endpoint}
is one of the supported service endpoints.
Path parameters
Parameters | |
---|---|
model |
Required. The name of the publisher model requested to serve the prediction. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "contents": [ { object ( |
Fields | |
---|---|
contents[] |
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. |
tools[] |
Optional. A list of A |
toolConfig |
Optional. Tool config. This config is shared for all tools provided in the request. |
safetySettings[] |
Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates. |
generationConfig |
Optional. Generation config. |
systemInstruction |
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
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-platform.read-only
https://www.googleapis.com/auth/cloud-vertex-ai.firstparty.predict
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the model
resource:
aiplatform.endpoints.predict
For more information, see the IAM documentation.