@@ -18,7 +18,7 @@ import {
1818} from '../viz/src/lib/caso.ts'
1919import { limpiarGuia , type Guia , type PedidoGuia } from '../viz/src/lib/guia.ts'
2020
21- export const MODELO = 'claude-opus -5-5'
21+ export const MODELO = 'claude-sonnet -5-5'
2222/** On a policy decline the API re-runs the request on a fallback model inside the same call. */
2323const FALLBACK = { betas : [ 'server-side-fallback-2026-07-01' ] , fallbacks : 'default' as const }
2424
@@ -57,7 +57,7 @@ function texto(r: { content: { type: string; text?: string }[] }): string {
5757export async function interpretarCaso ( cliente : ClienteClaude , pedido : PedidoCaso , signal ?: AbortSignal ) : Promise < Interpretacion | null > {
5858 const r = await cliente . beta . messages . create ( {
5959 model : MODELO ,
60- max_tokens : 4000 ,
60+ max_tokens : 16000 , // adaptive thinking also spends from this cap; only used tokens are billed
6161 ...FALLBACK ,
6262 // A classification: low effort is enough, and the schema keeps the output in the catalog.
6363 output_config : { effort : 'low' , format : { type : 'json_schema' , schema : ESQUEMA_INTERPRETACION } } ,
@@ -105,7 +105,7 @@ export function validarPedidoGuia(raw: unknown): PedidoGuia | null {
105105export async function redactarGuia ( cliente : ClienteClaude , pedido : PedidoGuia , signal ?: AbortSignal ) : Promise < Guia | null > {
106106 const r = await cliente . beta . messages . create ( {
107107 model : MODELO ,
108- max_tokens : 2000 ,
108+ max_tokens : 16000 ,
109109 ...FALLBACK ,
110110 output_config : { effort : 'low' } ,
111111 system : [ { type : 'text' , text : INSTRUCCIONES_GUIA , cache_control : { type : 'ephemeral' } } ] ,
0 commit comments