llm-output-guard 1.11.2 → 1.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -90,9 +90,15 @@ a boolean** — you pick the line.
90
90
  import OpenAI from 'openai';
91
91
  import { withOutputGuard } from 'llm-output-guard/openai';
92
92
 
93
- const client = withOutputGuard(new OpenAI(), { ...presets.chat, onDegenerate: 'abort' });
93
+ const client = withOutputGuard(new OpenAI(), { ...presets.chat, onDegenerate: 'throw' });
94
94
  ```
95
95
 
96
+ `onDegenerate` decides what a failed check does: **`'throw'`** (the default)
97
+ fails the call, and on a stream also cancels the request. `'abort'` is the
98
+ streaming-only alternative — it ends the stream and keeps what arrived, and on a
99
+ non-streaming call it stops nothing. `'ignore'` reports and changes nothing,
100
+ which is how to roll out.
101
+
96
102
  Adapters for the **OpenAI SDK** (both `chat.completions` and `responses`),
97
103
  **Anthropic**, **Google Gemini** and the **Vercel AI SDK** — plus anything
98
104
  speaking OpenAI's protocol: Groq, Together, OpenRouter, Fireworks, vLLM,
@@ -207,7 +213,9 @@ withOutputGuard(new OpenAI(), { ...presets.chat, checkPromptEcho: true });
207
213
  ```
208
214
 
209
215
  Not for rewrite, translate or summarise endpoints, where copying the input is
210
- the job. [More →](docs/detectors.md#returning-the-prompt-instead-of-an-answer)
216
+ the job. Abstains under 40 words, so a one-line prompt echoed perfectly still
217
+ scores 0.000.
218
+ [More →](docs/detectors.md#returning-the-prompt-instead-of-an-answer)
211
219
 
212
220
  ## The verdict
213
221