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

# Function: createAutoReasoningParser()

```ts
function createAutoReasoningParser(
  parsers?: Partial<
    Record<Exclude<ReasoningParserName, "auto" | "none">, ReasoningParserFn>
  >,
  order?: readonly ("think_tag" | "harmony_analysis" | "gemma_channel")[],
): ReasoningParserFn;
```

Defined in: [src/batteries/llm/chat\_common/reasoning\_parsers.ts:301](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/chat_common/reasoning_parsers.ts#L301)

Compose an `'auto'` reasoning parser: run each parser in `order` until one returns a non-empty
`reasoning` array; that result wins. Returns no-match if none claim the text.

## Parameters

| Parameter | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Default value                    |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `parsers` | [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)<[`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)<[`Exclude`](https://www.typescriptlang.org/docs/handbook/utility-types.html#excludetype-excludedunion)<[`ReasoningParserName`](../type-aliases/ReasoningParserName.md), `"auto"` | `"none"`>, [`ReasoningParserFn`](../type-aliases/ReasoningParserFn.md)>> | `BUNDLED_REASONING_PARSERS`      |
| `order`   | readonly (`"think_tag"` | `"harmony_analysis"` | `"gemma_channel"`)\[]                                                                                                                                                                                                                                                                                                                                                                                 | `DEFAULT_REASONING_PARSER_ORDER` |

## Returns

[`ReasoningParserFn`](../type-aliases/ReasoningParserFn.md)
