GenerateContentResponse interface
Stay organized with collections
Save and categorize content based on your preferences.
Individual response from GenerativeModel.generateContent() and GenerativeModel.generateContentStream(). generateContentStream()
will return one in each chunk until the stream is done.
Signature:
export interface GenerateContentResponse
Properties
GenerateContentResponse.candidates
Signature:
candidates?: GenerateContentCandidate[];
GenerateContentResponse.promptFeedback
Signature:
promptFeedback?: PromptFeedback;
GenerateContentResponse.usageMetadata
Signature:
usageMetadata?: UsageMetadata;
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 2025-05-20 UTC.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["Individual response from [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) and [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream). `generateContentStream()` will return one in each chunk until the stream is done.\n\n**Signature:** \n\n export interface GenerateContentResponse \n\nProperties\n\nGenerateContentResponse.candidates\n\n**Signature:** \n\n candidates?: GenerateContentCandidate[];\n\nGenerateContentResponse.promptFeedback\n\n**Signature:** \n\n promptFeedback?: PromptFeedback;\n\nGenerateContentResponse.usageMetadata\n\n**Signature:** \n\n usageMetadata?: UsageMetadata;"]]