diff --git a/src/tabpfn_client/api_models.py b/src/tabpfn_client/api_models.py index cf1a5a8..941e0d8 100644 --- a/src/tabpfn_client/api_models.py +++ b/src/tabpfn_client/api_models.py @@ -108,7 +108,7 @@ class FitRequest(BaseModel): # Budget for the fit (seconds). Only consulted when `thinking_effort` is set. thinking_timeout_s: Optional[float] = None # Optimization metric for the fit. Only consulted when `thinking_effort` is set. - thinking_metric: Optional[str] = None + thinking_effort_metric: Optional[str] = None class FitResponse(BaseModel): diff --git a/src/tabpfn_client/client.py b/src/tabpfn_client/client.py index 8ab3a4c..170ed4c 100644 --- a/src/tabpfn_client/client.py +++ b/src/tabpfn_client/client.py @@ -407,6 +407,8 @@ def fit( # The client-side `thinking_*` knobs forward 1:1 to the server's # top-level FitRequest fields. When the user enabled thinking via # `thinking_mode=True` without picking a level, default to "medium". + # The user-facing kwarg is `thinking_metric`; on the wire it is sent + # as `thinking_effort_metric` (matching the server's FitRequest schema). if thinking_enabled and tabpfn_config: thinking_effort = tabpfn_config.get("thinking_effort") or "medium" thinking_timeout_s = tabpfn_config.get("thinking_timeout_s") @@ -444,7 +446,7 @@ def fit( tabpfn_config=server_tabpfn_config, thinking_effort=thinking_effort, thinking_timeout_s=thinking_timeout_s, - thinking_metric=thinking_metric, + thinking_effort_metric=thinking_metric, ), timeout=client_options.timeout, headers=client_options.headers,