EnhancedGenerateContentResponse interface
Stay organized with collections
Save and categorize content based on your preferences.
Response object wrapped with helper methods.
Signature:
export interface EnhancedGenerateContentResponse extends GenerateContentResponse
Extends: GenerateContentResponse
Properties
EnhancedGenerateContentResponse.functionCalls
Aggregates and returns every FunctionCall from the first candidate of GenerateContentResponse.
Signature:
functionCalls: () => FunctionCall[] | undefined;
EnhancedGenerateContentResponse.inlineDataParts
Aggregates and returns every InlineDataPart from the first candidate of GenerateContentResponse.
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 every TextPart with their thought
property set to true
from the first candidate of GenerateContentResponse.
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 if ThinkingConfig.includeThoughts is set to true
.
Signature:
thoughtSummary: () => string | undefined;
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-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[],[],null,["Response object wrapped with helper methods.\n\n**Signature:** \n\n export interface EnhancedGenerateContentResponse extends GenerateContentResponse \n\n**Extends:** [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)\n\nProperties\n\n| Property | Type | Description |\n|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () =\\\u003e [FunctionCall](./ai.functioncall.md#functioncall_interface)\\[\\] \\| undefined | Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). |\n| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () =\\\u003e [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)\\[\\] \\| undefined | Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). |\n| [text](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () =\\\u003e string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. |\n| [thoughtSummary](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsethoughtsummary) | () =\\\u003e string \\| undefined | Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their `thought` property set to `true` from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface). |\n\nEnhancedGenerateContentResponse.functionCalls\n\nAggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).\n\n**Signature:** \n\n functionCalls: () =\u003e FunctionCall[] | undefined;\n\nEnhancedGenerateContentResponse.inlineDataParts\n\nAggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).\n\n**Signature:** \n\n inlineDataParts: () =\u003e InlineDataPart[] | undefined;\n\nEnhancedGenerateContentResponse.text\n\nReturns the text string from the response, if available. Throws if the prompt or candidate was blocked.\n\n**Signature:** \n\n text: () =\u003e string;\n\nEnhancedGenerateContentResponse.thoughtSummary\n\nAggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their `thought` property set to `true` from the first candidate of [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface).\n\nThought 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.\n\nThoughts will only be included if [ThinkingConfig.includeThoughts](./ai.thinkingconfig.md#thinkingconfigincludethoughts) is set to `true`.\n\n**Signature:** \n\n thoughtSummary: () =\u003e string | undefined;"]]