MCPcopy Create free account
hub / github.com/TanStack/ai / stripModelSuffix

Function stripModelSuffix

examples/ts-react-chat/src/routes/api.structured-output.ts:131–135  ·  view source on GitHub ↗

* Synthetic suffixes the dropdown uses to opt the route into reasoning * modes that aren't first-class on the wire (e.g. "Opus 4.7 with max * adaptive thinking"). The suffix is stripped before reaching the * adapter. Currently `:thinking-max` is the only one defined.

(model: string | undefined)

Source from the content-addressed store, hash-verified

129 * adapter. Currently `:thinking-max` is the only one defined.
130 */
131function stripModelSuffix(model: string | undefined): string | undefined {
132 if (!model) return model
133 const colonIdx = model.indexOf(':')
134 return colonIdx === -1 ? model : model.slice(0, colonIdx)
135}
136
137function adapterFor(provider: Provider, model?: string): AnyTextAdapter {
138 const baseModel = stripModelSuffix(model)

Callers 2

adapterForFunction · 0.85
reasoningOptionsForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected