nttp 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/README.md +20 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -34,7 +34,9 @@ const nttp = new NTTP({
34
34
  client: 'pg',
35
35
  connection: process.env.DATABASE_URL
36
36
  },
37
- anthropic: {
37
+ llm: {
38
+ provider: 'anthropic',
39
+ model: 'claude-sonnet-4-5-20250929',
38
40
  apiKey: process.env.ANTHROPIC_API_KEY
39
41
  }
40
42
  });
@@ -63,11 +65,26 @@ Create a new NTTP instance.
63
65
  client: 'pg' | 'mysql2' | 'better-sqlite3' | 'mssql',
64
66
  connection: string | object // Knex connection config
65
67
  },
66
- anthropic: {
68
+ llm: {
69
+ provider: 'anthropic' | 'openai' | 'cohere' | 'mistral' | 'google',
70
+ model: string, // e.g., 'claude-sonnet-4-5-20250929', 'gpt-4o'
67
71
  apiKey: string,
68
- model?: string, // Default: 'claude-sonnet-4-5-20250929'
69
72
  maxTokens?: number // Default: 2048
70
73
  },
74
+ cache?: {
75
+ l1?: {
76
+ enabled?: boolean, // Default: true
77
+ maxSize?: number // Default: 1000
78
+ },
79
+ l2?: {
80
+ enabled?: boolean, // Default: false
81
+ provider?: 'openai',
82
+ model?: string, // e.g., 'text-embedding-3-small'
83
+ apiKey?: string,
84
+ maxSize?: number, // Default: 500
85
+ similarityThreshold?: number // Default: 0.85
86
+ }
87
+ },
71
88
  limits?: {
72
89
  maxQueryLength?: number, // Default: 500
73
90
  defaultLimit?: number, // Default: 100
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nttp",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "natural text to query - Query databases with natural language",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",