EnhancedGenerateContentResponse interface

Response object wrapped with helper methods.

Signature:

exportinterfaceEnhancedGenerateContentResponseextendsGenerateContentResponse

Extends:GenerateContentResponse

Properties

PropertyTypeDescription
functionCalls() =>FunctionCall[] | undefinedAggregates and returns everyFunctionCall from the first candidate ofGenerateContentResponse.
inferenceSourceInferenceSource(Public Preview) Indicates whether inference happened on-device or in-cloud.
inlineDataParts() =>InlineDataPart[] | undefinedAggregates and returns everyInlineDataPart from the first candidate ofGenerateContentResponse.
text() => stringReturns the text string from the response, if available. Throws if the prompt or candidate was blocked.
thoughtSummary() => string | undefinedAggregates and returns everyTextPart with theirthought property set totrue from the first candidate ofGenerateContentResponse.

EnhancedGenerateContentResponse.functionCalls

Aggregates and returns everyFunctionCall from the first candidate ofGenerateContentResponse.

Signature:

functionCalls:()=>FunctionCall[]|undefined;

EnhancedGenerateContentResponse.inferenceSource

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Indicates whether inference happened on-device or in-cloud.

Signature:

inferenceSource?:InferenceSource;

EnhancedGenerateContentResponse.inlineDataParts

Aggregates and returns everyInlineDataPart from the first candidate ofGenerateContentResponse.

Signature:

inlineDataParts:()=>InlineDataPart[]|undefined;

EnhancedGenerateContentResponse.text

Returns the text string from the response, if available. Throws if the prompt or candidate was blocked.

Signature:

text:()=>string;

EnhancedGenerateContentResponse.thoughtSummary

Aggregates and returns everyTextPart with theirthought property set totrue from the first candidate ofGenerateContentResponse.

Thought summaries provide a brief overview of the model's internal thinking process, offering insight into how it arrived at the final answer. This can be useful for debugging, understanding the model's reasoning, and verifying its accuracy.

Thoughts will only be included ifThinkingConfig.includeThoughts is set totrue.

Signature:

thoughtSummary:()=>string|undefined;

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.