---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/bedrock_converse/helpers/functions/extractConverseGeneration.md
---

# Function: extractConverseGeneration()

```ts
function extractConverseGeneration(
  response: ConverseResponseLike | undefined,
): {
  reasoning: string;
  stopReason: string | undefined;
  text: string;
  toolUses: {
    input: Record<string, unknown>;
    name: string;
    toolUseId: string;
  }[];
};
```

Defined in: [src/batteries/llm/bedrock\_converse/helpers.ts:469](https://github.com/NHTIO/ADK/blob/master/src/src/batteries/llm/bedrock_converse/helpers.ts#L469)

Extract text, reasoning, and tool uses from a Converse response.

## Parameters

| Parameter  | Type                                  |
| ---------- | ------------------------------------- |
| `response` | `ConverseResponseLike` | `undefined` |

## Returns

```ts
{
  reasoning: string;
  stopReason: string | undefined;
  text: string;
  toolUses: {
    input: Record<string, unknown>;
    name: string;
    toolUseId: string;
  }
  [];
}
```

| Name         | Type                                                                                                                                                                          | Defined in                                                                                                                                           |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reasoning`  | `string`                                                                                                                                                                      | [src/batteries/llm/bedrock\_converse/helpers.ts:473](https://github.com/NHTIO/ADK/blob/master/src/src/batteries/llm/bedrock_converse/helpers.ts#L473) |
| `stopReason` | `string` | `undefined`                                                                                                                                                       | [src/batteries/llm/bedrock\_converse/helpers.ts:475](https://github.com/NHTIO/ADK/blob/master/src/src/batteries/llm/bedrock_converse/helpers.ts#L475) |
| `text`       | `string`                                                                                                                                                                      | [src/batteries/llm/bedrock\_converse/helpers.ts:472](https://github.com/NHTIO/ADK/blob/master/src/src/batteries/llm/bedrock_converse/helpers.ts#L472) |
| `toolUses`   | { `input`: [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)<`string`, `unknown`>; `name`: `string`; `toolUseId`: `string`; }\[] | [src/batteries/llm/bedrock\_converse/helpers.ts:474](https://github.com/NHTIO/ADK/blob/master/src/src/batteries/llm/bedrock_converse/helpers.ts#L474) |

## Remarks

`reasoningContent` blocks are NOT concatenated into visible text — doing so leaks the model's
scratchpad into the answer.
