Simplify the URL produced by extract.custom while preserving its input/output, batching and endpoint behavior.
wrangles/extract.py currently always adds responseFormat, boolean flags and sort to the query. For a backend whose defaults have been verified, the default request should be:
POST /wrangles/extract/custom?model_id=<model_id>
An override remains explicit, for example:
POST /wrangles/extract/custom?model_id=<model_id>&use_labels=True&sort=input_order
The input stays in the existing JSON request body. This is URL cleanup, not a fix for server memory pressure or an API body redesign.
Proposed contract
For the built-in pattern extractor, verify and explicitly encode these server defaults: responseFormat=array, use_labels=false, caseSensitive=false, extract_raw=false, use_spellcheck=false, sort=training_order.
- Normalize known parameter types deliberately, then omit only values proven equivalent to that backend's default.
- Preserve explicit non-default options and existing keyword-argument precedence. Never generically remove falsy values, zero, blank strings or unknown parameters; invalid inputs must not silently become defaults.
- Preserve the distinction between transport
responseFormat and local output-shaping options such as output_format, first_element and include_empty_labels.
- Use the metadata already obtained by the caller to scope the optimization. Validate AI/custom/bespoke contracts independently and preserve existing explicit parameters where equivalence is unverified.
- Keep model ID, authentication, configured API base, JSON payload, batching and returned values unchanged.
- Document that meaningful diagnostic context comes from effective options and a request ID, not a long exception URL. Retain server error/request identifiers when exposed, without including credentials or input content.
Acceptance criteria
Use mocked request assertions and small synthetic response fixtures; this change does not require production model data.
Simplify the URL produced by
extract.customwhile preserving its input/output, batching and endpoint behavior.wrangles/extract.py currently always adds responseFormat, boolean flags and sort to the query. For a backend whose defaults have been verified, the default request should be:
An override remains explicit, for example:
The input stays in the existing JSON request body. This is URL cleanup, not a fix for server memory pressure or an API body redesign.
Proposed contract
For the built-in pattern extractor, verify and explicitly encode these server defaults:
responseFormat=array,use_labels=false,caseSensitive=false,extract_raw=false,use_spellcheck=false,sort=training_order.responseFormatand local output-shaping options such asoutput_format,first_elementandinclude_empty_labels.Acceptance criteria
Use mocked request assertions and small synthetic response fixtures; this change does not require production model data.