Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Response object wrapped with helper methods.
Signature:
export interface EnhancedGenerateContentResponse extends GenerateContentResponse Extends: GenerateContentResponse
| Property | Type | Description |
|---|---|---|
| functionCalls | () => FunctionCall[] | undefined | Aggregates and returns every FunctionCall from the first candidate of GenerateContentResponse. |
| inferenceSource | InferenceSource | (Public Preview) Indicates whether inference happened on-device or in-cloud. |
| inlineDataParts | () => InlineDataPart[] | undefined | Aggregates and returns every InlineDataPart from the first candidate of GenerateContentResponse. |
| text | () => string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. |
| thoughtSummary | () => string | undefined | Aggregates and returns every TextPart with their thought property set to true from the first candidate of GenerateContentResponse. |
Aggregates and returns every FunctionCall from the first candidate of GenerateContentResponse.
Signature:
functionCalls: () => FunctionCall[] | undefined;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;Aggregates and returns every InlineDataPart from the first candidate of GenerateContentResponse.
Signature:
inlineDataParts: () => InlineDataPart[] | undefined;Returns the text string from the response, if available. Throws if the prompt or candidate was blocked.
Signature:
text: () => string;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;