Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

reasoning.ts

14 lines458 Bytes

1import type { ResolvedReasoning } from '@tanstack/ai/adapter-internals'
2​
3/**
4 * The OpenRouter `reasoning.effort` for a resolved `chat({ reasoning })`.
5 * `off` is always `none` on OpenRouter, whatever the model's own off value
6 * is (pi's rule).
7 */
8export function openRouterEffort(
9 resolved: ResolvedReasoning | undefined,
10): string | undefined {
11 if (!resolved) return undefined
12 if (resolved.level === 'off') return 'none'
13 return resolved.value