Skip to content

v2.2.0

Latest

Choose a tag to compare

@arikusi arikusi released this 05 Jul 19:38
361db56

Additive feature release for deepseek_chat, plus a security hardening.

Added

  • response_schema: server-side JSON Schema validation with bounded repair retries (default 2, RESPONSE_SCHEMA_MAX_RETRIES to tune, 0 disables). Returns the first schema-valid object, or the last attempt flagged schema.valid=false instead of silently coercing a wrong shape. Implies JSON output.
  • Self-contained per-request usage/cost in structuredContent.request (token counts, cache hit/miss, cost_usd), aggregated across repair attempts.
  • Audit fields: effective and a top-level fallback object so a silent model fallback is visible to callers.

Fixed

  • json_mode + thinking: content that arrived fenced or wrapped in chain-of-thought is now deterministically recovered as clean JSON (no extra API call); unrecoverable output sets json_parse_error.

Security

  • ReDoS guard on response_schema regex patterns: an unsafe pattern such as ^(a+)+$ is now rejected up front instead of blocking the event loop. Screened with redos-detector before compilation.

Thanks to @timbrigham for the feature work in #32. No worker changes; the hosted endpoint is unaffected.