is-it-spam 0.1.0 → 0.1.2

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
@@ -1,41 +1,40 @@
1
- # isSpamLLM
1
+ # is-it-spam
2
2
 
3
- Simple LLM-based spam classifier. Works with any OpenAI-compatible API.
3
+ LLM-based spam classifier. Works with any OpenAI-compatible API.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install spam-classifier
8
+ npm i is-it-spam
9
9
  ```
10
10
 
11
11
  ## Usage
12
12
 
13
13
  ```typescript
14
- import { createClassifier } from "spam-classifier";
14
+ import { createClassifier } from "is-it-spam";
15
15
 
16
- // Set up once
17
16
  const isSpam = createClassifier({
18
17
  apiKey: process.env.OPENROUTER_API_KEY!,
18
+ zdr: true
19
19
  });
20
20
 
21
- // Use anywhere - returns true/false
22
21
  if (await isSpam("Need a quote for your services")) {
23
- // spam - ignore it
22
+ // spam
24
23
  }
25
24
 
26
- // Or get details
25
+ // or get details
27
26
  const result = await isSpam.details("Need a quote");
28
- // { isSpam: false, confidence: 0.95, reason: "Customer requesting quote" }
27
+ // { isSpam: false, confidence: 0.95, reason: "..." }
29
28
  ```
30
29
 
31
30
  ## Options
32
31
 
33
32
  | Option | Type | Default | Description |
34
33
  |--------|------|---------|-------------|
35
- | `apiKey` | string | **required** | API key |
36
- | `model` | string | `"openai/gpt-4o-mini"` | Model to use |
34
+ | `apiKey` | string | required | API key |
35
+ | `model` | string | `openai/gpt-5.4-nano` | Model to use |
37
36
  | `baseUrl` | string | OpenRouter | API endpoint |
38
- | `zdr` | boolean | `false` | Enable Zero Data Retention |
37
+ | `zdr` | boolean | `false` | Zero Data Retention |
39
38
 
40
39
  ## Providers
41
40
 
@@ -45,7 +44,7 @@ Works with any OpenAI-compatible API:
45
44
  // OpenRouter (default)
46
45
  const isSpam = createClassifier({ apiKey: process.env.OPENROUTER_API_KEY! });
47
46
 
48
- // OpenAI directly
47
+ // OpenAI
49
48
  const isSpam = createClassifier({
50
49
  apiKey: process.env.OPENAI_API_KEY!,
51
50
  baseUrl: "https://api.openai.com/v1/chat/completions",
@@ -66,7 +65,7 @@ Returns `false` (legitimate) if the API fails, so you never block real customers
66
65
 
67
66
  ## Cost
68
67
 
69
- ~$0.0002 per classification. 10,000 submissions = ~$2.
68
+ ~$0.0002 per check. 10,000 checks = ~$2.
70
69
 
71
70
  ## License
72
71
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * isSpamLLM
2
+ * is-it-spam
3
3
  *
4
- * Simple LLM-based spam classifier.
4
+ * LLM-based spam classifier.
5
5
  * Works with any OpenAI-compatible API.
6
6
  */
7
7
  export interface ClassifierOptions {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * isSpamLLM
2
+ * is-it-spam
3
3
  *
4
- * Simple LLM-based spam classifier.
4
+ * LLM-based spam classifier.
5
5
  * Works with any OpenAI-compatible API.
6
6
  */
7
7
  const DEFAULT_BASE_URL = "https://openrouter.ai/api/v1/chat/completions";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "is-it-spam",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "LLM-based spam classifier. Works with any OpenAI-compatible API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",