Skip to content

Commit 2a82810

Browse files
committed
Address PR comments
1 parent eb6d43a commit 2a82810

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

docs-devsite/ai.enhancedgeneratecontentresponse.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export interface EnhancedGenerateContentResponse extends GenerateContentResponse
2323
2424
| Property | Type | Description |
2525
| --- | --- | --- |
26-
| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () =&gt; [FunctionCall](./ai.functioncall.md#functioncall_interface)<!-- -->\[\] \| undefined | Aggregates and returns all [FunctionCall](./ai.functioncall.md#functioncall_interface)<!-- -->s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
27-
| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () =&gt; [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)<!-- -->\[\] \| undefined | Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)<!-- -->s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
26+
| [functionCalls](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsefunctioncalls) | () =&gt; [FunctionCall](./ai.functioncall.md#functioncall_interface)<!-- -->\[\] \| undefined | Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
27+
| [inlineDataParts](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponseinlinedataparts) | () =&gt; [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)<!-- -->\[\] \| undefined | Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
2828
| [text](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsetext) | () =&gt; string | Returns the text string from the response, if available. Throws if the prompt or candidate was blocked. |
29-
| [thoughtSummary](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsethoughtsummary) | () =&gt; string \| undefined | Aggregates and returns all [TextPart](./ai.textpart.md#textpart_interface)<!-- -->s with their <code>thought</code> property set to <code>true</code> from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
29+
| [thoughtSummary](./ai.enhancedgeneratecontentresponse.md#enhancedgeneratecontentresponsethoughtsummary) | () =&gt; string \| undefined | Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their <code>thought</code> property set to <code>true</code> from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate. |
3030
3131
## EnhancedGenerateContentResponse.functionCalls
3232
33-
Aggregates and returns all [FunctionCall](./ai.functioncall.md#functioncall_interface)<!-- -->s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
33+
Aggregates and returns every [FunctionCall](./ai.functioncall.md#functioncall_interface) from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
3434
3535
<b>Signature:</b>
3636
@@ -40,7 +40,7 @@ functionCalls: () => FunctionCall[] | undefined;
4040
4141
## EnhancedGenerateContentResponse.inlineDataParts
4242
43-
Aggregates and returns all [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface)<!-- -->s from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
43+
Aggregates and returns every [InlineDataPart](./ai.inlinedatapart.md#inlinedatapart_interface) from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
4444
4545
<b>Signature:</b>
4646
@@ -60,7 +60,7 @@ text: () => string;
6060
6161
## EnhancedGenerateContentResponse.thoughtSummary
6262
63-
Aggregates and returns all [TextPart](./ai.textpart.md#textpart_interface)<!-- -->s with their `thought` property set to `true` from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
63+
Aggregates and returns every [TextPart](./ai.textpart.md#textpart_interface) with their `thought` property set to `true` from the [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->'s first candidate.
6464
6565
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.
6666

packages/ai/src/requests/response-helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export function addHelpers(
152152
}
153153

154154
/**
155-
* Returns all text from the first candidate's parts, filtering by whether they
156-
* are part of the model's 'thought' process.
155+
* Returns all text from the first candidate's parts, filtering by whether
156+
* `partFilter()` returns true.
157157
*
158158
* @param response - The `GenerateContentResponse` from which to extract text.
159159
* @param partFilter - Only return `Part`s for which this returns true
@@ -178,7 +178,7 @@ export function getText(
178178
}
179179

180180
/**
181-
* Returns {@link FunctionCall}s associated with first candidate.
181+
* Returns every {@link FunctionCall} associated with first candidate.
182182
*/
183183
export function getFunctionCalls(
184184
response: GenerateContentResponse
@@ -199,7 +199,7 @@ export function getFunctionCalls(
199199
}
200200

201201
/**
202-
* Returns {@link InlineDataPart}s in the first candidate if present.
202+
* Returns every {@link InlineDataPart} in the first candidate if present.
203203
*
204204
* @internal
205205
*/

packages/ai/src/types/responses.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,21 @@ export interface EnhancedGenerateContentResponse
6060
*/
6161
text: () => string;
6262
/**
63-
* Aggregates and returns all {@link InlineDataPart}s from the {@link GenerateContentResponse}'s
63+
* Aggregates and returns every {@link InlineDataPart} from the {@link GenerateContentResponse}'s
6464
* first candidate.
6565
*
66-
* @returns An array of {@link InlineDataPart}s containing data from the response, if available.
67-
*
6866
* @throws If the prompt or candidate was blocked.
6967
*/
7068
inlineDataParts: () => InlineDataPart[] | undefined;
7169
/**
72-
* Aggregates and returns all {@link FunctionCall}s from the {@link GenerateContentResponse}'s
70+
* Aggregates and returns every {@link FunctionCall} from the {@link GenerateContentResponse}'s
7371
* first candidate.
7472
*
7573
* @throws If the prompt or candidate was blocked.
7674
*/
7775
functionCalls: () => FunctionCall[] | undefined;
7876
/**
79-
* Aggregates and returns all {@link TextPart}s with their `thought` property set
77+
* Aggregates and returns every {@link TextPart} with their `thought` property set
8078
* to `true` from the {@link GenerateContentResponse}'s first candidate.
8179
*
8280
* @throws If the prompt or candidate was blocked.

0 commit comments

Comments
 (0)