feat: make openAICompatibleProvider work with Infomaniak out of the box (0.3.0)
- response_format is omitted by default (Infomaniak rejects the legacy
json_object → HTTP 422); opt in via the new `responseFormat` option
({type:'json_object'} or a json_schema object). BREAKING for endpoints
that relied on the forced json_object.
- parse LLM JSON leniently (tolerate markdown fences / surrounding prose)
- fold strict-coherence rules into DEFAULT_SYSTEM_PROMPT (exact
placeholder<->mapping-key identity, values are originals, strict format,
mask value not adjacent label) → reliable output across models
Verified live against Gemma 4 (google/gemma-4-31B-it, Infomaniak v2): all
demo phrases anonymize with clean round-trips, no custom provider needed.
36 tests passing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,11 @@ giving up; 4xx and malformed responses are not retried. Tune with `timeoutMs` (p
|
||||
`retries` (default 1 → 2 attempts), and `retryDelayMs` (linear backoff, default 250). Worst-case latency
|
||||
is `(retries + 1) × timeoutMs`, so keep `retries` low on latency-sensitive paths.
|
||||
|
||||
It works with **Infomaniak** and other open-model endpoints out of the box: `response_format` is **omitted
|
||||
by default** (Infomaniak rejects the legacy `{ type: 'json_object' }`), and responses are parsed leniently
|
||||
(a fenced JSON code block or surrounding prose is tolerated). For endpoints that support it, opt in with
|
||||
`responseFormat` — e.g. `{ type: 'json_object' }` or a `json_schema` object.
|
||||
|
||||
### Streaming de-anonymization
|
||||
|
||||
When you stream an LLM answer back to a user, restore real values without ever emitting a half-written
|
||||
|
||||
Reference in New Issue
Block a user