@twelvehart/supermemory-runtime 1.0.0-next.0
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/.env.example +57 -0
- package/README.md +374 -0
- package/dist/index.js +189 -0
- package/dist/mcp/index.js +1132 -0
- package/docker-compose.prod.yml +91 -0
- package/docker-compose.yml +358 -0
- package/drizzle/0000_dapper_the_professor.sql +159 -0
- package/drizzle/0001_api_keys.sql +51 -0
- package/drizzle/meta/0000_snapshot.json +1532 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +20 -0
- package/package.json +114 -0
- package/scripts/add-extraction-job.ts +122 -0
- package/scripts/benchmark-pgvector.ts +122 -0
- package/scripts/bootstrap.sh +209 -0
- package/scripts/check-runtime-pack.ts +111 -0
- package/scripts/claude-mcp-config.ts +336 -0
- package/scripts/docker-entrypoint.sh +183 -0
- package/scripts/doctor.ts +377 -0
- package/scripts/init-db.sql +33 -0
- package/scripts/install.sh +1110 -0
- package/scripts/mcp-setup.ts +271 -0
- package/scripts/migrations/001_create_pgvector_extension.sql +31 -0
- package/scripts/migrations/002_create_memory_embeddings_table.sql +75 -0
- package/scripts/migrations/003_create_hnsw_index.sql +94 -0
- package/scripts/migrations/004_create_memory_embeddings_standalone.sql +70 -0
- package/scripts/migrations/005_create_chunks_table.sql +95 -0
- package/scripts/migrations/006_create_processing_queue.sql +45 -0
- package/scripts/migrations/generate_test_data.sql +42 -0
- package/scripts/migrations/phase1_comprehensive_test.sql +204 -0
- package/scripts/migrations/run_migrations.sh +286 -0
- package/scripts/migrations/test_hnsw_index.sql +255 -0
- package/scripts/pre-commit-secrets +282 -0
- package/scripts/run-extraction-worker.ts +46 -0
- package/scripts/run-phase1-tests.sh +291 -0
- package/scripts/setup.ts +222 -0
- package/scripts/smoke-install.sh +12 -0
- package/scripts/test-health-endpoint.sh +328 -0
- package/src/api/index.ts +2 -0
- package/src/api/middleware/auth.ts +80 -0
- package/src/api/middleware/csrf.ts +308 -0
- package/src/api/middleware/errorHandler.ts +166 -0
- package/src/api/middleware/rateLimit.ts +360 -0
- package/src/api/middleware/validation.ts +514 -0
- package/src/api/routes/documents.ts +286 -0
- package/src/api/routes/profiles.ts +237 -0
- package/src/api/routes/search.ts +71 -0
- package/src/api/stores/index.ts +58 -0
- package/src/config/bootstrap-env.ts +3 -0
- package/src/config/env.ts +71 -0
- package/src/config/feature-flags.ts +25 -0
- package/src/config/index.ts +140 -0
- package/src/config/secrets.config.ts +291 -0
- package/src/db/client.ts +92 -0
- package/src/db/index.ts +73 -0
- package/src/db/postgres.ts +72 -0
- package/src/db/schema/chunks.schema.ts +31 -0
- package/src/db/schema/containers.schema.ts +46 -0
- package/src/db/schema/documents.schema.ts +49 -0
- package/src/db/schema/embeddings.schema.ts +32 -0
- package/src/db/schema/index.ts +11 -0
- package/src/db/schema/memories.schema.ts +72 -0
- package/src/db/schema/profiles.schema.ts +34 -0
- package/src/db/schema/queue.schema.ts +59 -0
- package/src/db/schema/relationships.schema.ts +42 -0
- package/src/db/schema.ts +223 -0
- package/src/db/worker-connection.ts +47 -0
- package/src/index.ts +235 -0
- package/src/mcp/CLAUDE.md +1 -0
- package/src/mcp/index.ts +1380 -0
- package/src/mcp/legacyState.ts +22 -0
- package/src/mcp/rateLimit.ts +358 -0
- package/src/mcp/resources.ts +309 -0
- package/src/mcp/results.ts +104 -0
- package/src/mcp/tools.ts +401 -0
- package/src/queues/config.ts +119 -0
- package/src/queues/index.ts +289 -0
- package/src/sdk/client.ts +225 -0
- package/src/sdk/errors.ts +266 -0
- package/src/sdk/http.ts +560 -0
- package/src/sdk/index.ts +244 -0
- package/src/sdk/resources/base.ts +65 -0
- package/src/sdk/resources/connections.ts +204 -0
- package/src/sdk/resources/documents.ts +163 -0
- package/src/sdk/resources/index.ts +10 -0
- package/src/sdk/resources/memories.ts +150 -0
- package/src/sdk/resources/search.ts +60 -0
- package/src/sdk/resources/settings.ts +36 -0
- package/src/sdk/types.ts +674 -0
- package/src/services/chunking/index.ts +451 -0
- package/src/services/chunking.service.ts +650 -0
- package/src/services/csrf.service.ts +252 -0
- package/src/services/documents.repository.ts +219 -0
- package/src/services/documents.service.ts +191 -0
- package/src/services/embedding.service.ts +404 -0
- package/src/services/extraction.service.ts +300 -0
- package/src/services/extractors/code.extractor.ts +451 -0
- package/src/services/extractors/index.ts +9 -0
- package/src/services/extractors/markdown.extractor.ts +461 -0
- package/src/services/extractors/pdf.extractor.ts +315 -0
- package/src/services/extractors/text.extractor.ts +118 -0
- package/src/services/extractors/url.extractor.ts +243 -0
- package/src/services/index.ts +235 -0
- package/src/services/ingestion.service.ts +177 -0
- package/src/services/llm/anthropic.ts +400 -0
- package/src/services/llm/base.ts +460 -0
- package/src/services/llm/contradiction-detector.service.ts +526 -0
- package/src/services/llm/heuristics.ts +148 -0
- package/src/services/llm/index.ts +309 -0
- package/src/services/llm/memory-classifier.service.ts +383 -0
- package/src/services/llm/memory-extension-detector.service.ts +523 -0
- package/src/services/llm/mock.ts +470 -0
- package/src/services/llm/openai.ts +398 -0
- package/src/services/llm/prompts.ts +438 -0
- package/src/services/llm/types.ts +373 -0
- package/src/services/memory.repository.ts +1769 -0
- package/src/services/memory.service.ts +1338 -0
- package/src/services/memory.types.ts +234 -0
- package/src/services/persistence/index.ts +295 -0
- package/src/services/pipeline.service.ts +509 -0
- package/src/services/profile.repository.ts +436 -0
- package/src/services/profile.service.ts +560 -0
- package/src/services/profile.types.ts +270 -0
- package/src/services/relationships/detector.ts +1128 -0
- package/src/services/relationships/index.ts +268 -0
- package/src/services/relationships/memory-integration.ts +459 -0
- package/src/services/relationships/strategies.ts +132 -0
- package/src/services/relationships/types.ts +370 -0
- package/src/services/search.service.ts +761 -0
- package/src/services/search.types.ts +220 -0
- package/src/services/secrets.service.ts +384 -0
- package/src/services/vectorstore/base.ts +327 -0
- package/src/services/vectorstore/index.ts +444 -0
- package/src/services/vectorstore/memory.ts +286 -0
- package/src/services/vectorstore/migration.ts +295 -0
- package/src/services/vectorstore/mock.ts +403 -0
- package/src/services/vectorstore/pgvector.ts +695 -0
- package/src/services/vectorstore/types.ts +247 -0
- package/src/startup.ts +389 -0
- package/src/types/api.types.ts +193 -0
- package/src/types/document.types.ts +103 -0
- package/src/types/index.ts +241 -0
- package/src/types/profile.base.ts +133 -0
- package/src/utils/errors.ts +447 -0
- package/src/utils/id.ts +15 -0
- package/src/utils/index.ts +101 -0
- package/src/utils/logger.ts +313 -0
- package/src/utils/sanitization.ts +501 -0
- package/src/utils/secret-validation.ts +273 -0
- package/src/utils/synonyms.ts +188 -0
- package/src/utils/validation.ts +581 -0
- package/src/workers/chunking.worker.ts +242 -0
- package/src/workers/embedding.worker.ts +358 -0
- package/src/workers/extraction.worker.ts +346 -0
- package/src/workers/indexing.worker.ts +505 -0
- package/tsconfig.json +38 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Provider Types
|
|
3
|
+
*
|
|
4
|
+
* Defines interfaces and types for LLM-based memory extraction.
|
|
5
|
+
* Supports multiple providers (OpenAI, Anthropic) with a unified interface.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { MemoryType, Entity } from '../../types/index.js'
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Extracted Memory Types
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A memory extracted by an LLM from text content
|
|
16
|
+
*/
|
|
17
|
+
export interface ExtractedMemory {
|
|
18
|
+
/** The extracted memory content as a clear, standalone statement */
|
|
19
|
+
content: string
|
|
20
|
+
|
|
21
|
+
/** Classification of the memory type */
|
|
22
|
+
type: MemoryType
|
|
23
|
+
|
|
24
|
+
/** Confidence score for this extraction (0-1) */
|
|
25
|
+
confidence: number
|
|
26
|
+
|
|
27
|
+
/** Extracted entities mentioned in the memory */
|
|
28
|
+
entities: Entity[]
|
|
29
|
+
|
|
30
|
+
/** Keywords extracted from the memory */
|
|
31
|
+
keywords: string[]
|
|
32
|
+
|
|
33
|
+
/** Optional reasoning from the LLM about why this was extracted */
|
|
34
|
+
reasoning?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Result of LLM memory extraction
|
|
39
|
+
*/
|
|
40
|
+
export interface LLMExtractionResult {
|
|
41
|
+
/** Successfully extracted memories */
|
|
42
|
+
memories: ExtractedMemory[]
|
|
43
|
+
|
|
44
|
+
/** Raw LLM response for debugging */
|
|
45
|
+
rawResponse?: string
|
|
46
|
+
|
|
47
|
+
/** Tokens used for this extraction */
|
|
48
|
+
tokensUsed?: {
|
|
49
|
+
prompt: number
|
|
50
|
+
completion: number
|
|
51
|
+
total: number
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Processing time in milliseconds */
|
|
55
|
+
processingTimeMs: number
|
|
56
|
+
|
|
57
|
+
/** Whether the extraction used cache */
|
|
58
|
+
cached: boolean
|
|
59
|
+
|
|
60
|
+
/** Provider used for this extraction */
|
|
61
|
+
provider: LLMProviderType
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// Relationship Detection Types
|
|
66
|
+
// ============================================================================
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Relationship type detected by LLM
|
|
70
|
+
*/
|
|
71
|
+
export type LLMRelationshipType = 'updates' | 'extends' | 'derives' | 'contradicts' | 'related' | 'supersedes'
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A relationship between memories detected by an LLM
|
|
75
|
+
*/
|
|
76
|
+
export interface DetectedRelationship {
|
|
77
|
+
/** Source memory ID */
|
|
78
|
+
sourceMemoryId: string
|
|
79
|
+
|
|
80
|
+
/** Target memory ID */
|
|
81
|
+
targetMemoryId: string
|
|
82
|
+
|
|
83
|
+
/** Type of relationship */
|
|
84
|
+
type: LLMRelationshipType
|
|
85
|
+
|
|
86
|
+
/** Confidence score for this relationship (0-1) */
|
|
87
|
+
confidence: number
|
|
88
|
+
|
|
89
|
+
/** Explanation of why this relationship was detected */
|
|
90
|
+
reason: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Result of LLM relationship detection
|
|
95
|
+
*/
|
|
96
|
+
export interface LLMRelationshipResult {
|
|
97
|
+
/** Detected relationships */
|
|
98
|
+
relationships: DetectedRelationship[]
|
|
99
|
+
|
|
100
|
+
/** Memories that should be marked as superseded */
|
|
101
|
+
supersededMemoryIds: string[]
|
|
102
|
+
|
|
103
|
+
/** Processing time in milliseconds */
|
|
104
|
+
processingTimeMs: number
|
|
105
|
+
|
|
106
|
+
/** Provider used for this detection */
|
|
107
|
+
provider: LLMProviderType
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// Provider Configuration
|
|
112
|
+
// ============================================================================
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Supported LLM providers
|
|
116
|
+
*/
|
|
117
|
+
export type LLMProviderType = 'openai' | 'anthropic' | 'mock'
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Base configuration for all LLM providers
|
|
121
|
+
*/
|
|
122
|
+
export interface BaseLLMConfig {
|
|
123
|
+
/** Maximum tokens for responses */
|
|
124
|
+
maxTokens?: number
|
|
125
|
+
|
|
126
|
+
/** Temperature for generation (0-2) */
|
|
127
|
+
temperature?: number
|
|
128
|
+
|
|
129
|
+
/** Timeout in milliseconds */
|
|
130
|
+
timeoutMs?: number
|
|
131
|
+
|
|
132
|
+
/** Maximum retries on failure */
|
|
133
|
+
maxRetries?: number
|
|
134
|
+
|
|
135
|
+
/** Initial delay between retries in milliseconds */
|
|
136
|
+
retryDelayMs?: number
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* OpenAI-specific configuration
|
|
141
|
+
*/
|
|
142
|
+
export interface OpenAILLMConfig extends BaseLLMConfig {
|
|
143
|
+
/** API key for OpenAI */
|
|
144
|
+
apiKey: string
|
|
145
|
+
|
|
146
|
+
/** Model to use (default: gpt-4o-mini) */
|
|
147
|
+
model?: string
|
|
148
|
+
|
|
149
|
+
/** Base URL for API (for proxies/custom endpoints) */
|
|
150
|
+
baseUrl?: string
|
|
151
|
+
|
|
152
|
+
/** Organization ID */
|
|
153
|
+
organization?: string
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Anthropic-specific configuration
|
|
158
|
+
*/
|
|
159
|
+
export interface AnthropicLLMConfig extends BaseLLMConfig {
|
|
160
|
+
/** API key for Anthropic */
|
|
161
|
+
apiKey: string
|
|
162
|
+
|
|
163
|
+
/** Model to use (default: claude-3-haiku-20240307) */
|
|
164
|
+
model?: string
|
|
165
|
+
|
|
166
|
+
/** Base URL for API */
|
|
167
|
+
baseUrl?: string
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Mock provider configuration (for testing)
|
|
172
|
+
*/
|
|
173
|
+
export interface MockLLMConfig extends BaseLLMConfig {
|
|
174
|
+
/** Predefined responses for testing */
|
|
175
|
+
mockResponses?: ExtractedMemory[][]
|
|
176
|
+
/** Predefined JSON responses for task-specific prompts */
|
|
177
|
+
mockJsonResponses?: Array<string | Record<string, unknown>>
|
|
178
|
+
|
|
179
|
+
/** Simulate latency in milliseconds */
|
|
180
|
+
simulatedLatencyMs?: number
|
|
181
|
+
|
|
182
|
+
/** Simulate errors */
|
|
183
|
+
simulateErrors?: boolean
|
|
184
|
+
|
|
185
|
+
/** Error rate (0-1) when simulateErrors is true */
|
|
186
|
+
errorRate?: number
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Combined configuration type
|
|
191
|
+
*/
|
|
192
|
+
export type LLMConfig = OpenAILLMConfig | AnthropicLLMConfig | MockLLMConfig
|
|
193
|
+
|
|
194
|
+
// ============================================================================
|
|
195
|
+
// Provider Interface
|
|
196
|
+
// ============================================================================
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Interface that all LLM providers must implement
|
|
200
|
+
*/
|
|
201
|
+
export interface LLMProvider {
|
|
202
|
+
/** Provider type identifier */
|
|
203
|
+
readonly type: LLMProviderType
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Extract memories from text content
|
|
207
|
+
*
|
|
208
|
+
* @param text - Text content to extract memories from
|
|
209
|
+
* @param options - Optional extraction options
|
|
210
|
+
* @returns Promise resolving to extraction result
|
|
211
|
+
*/
|
|
212
|
+
extractMemories(text: string, options?: ExtractionOptions): Promise<LLMExtractionResult>
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Detect relationships between memories
|
|
216
|
+
*
|
|
217
|
+
* @param newMemory - The new memory being added
|
|
218
|
+
* @param existingMemories - Existing memories to compare against
|
|
219
|
+
* @param options - Optional detection options
|
|
220
|
+
* @returns Promise resolving to relationship detection result
|
|
221
|
+
*/
|
|
222
|
+
detectRelationships(
|
|
223
|
+
newMemory: { id: string; content: string; type: MemoryType },
|
|
224
|
+
existingMemories: Array<{ id: string; content: string; type: MemoryType }>,
|
|
225
|
+
options?: RelationshipDetectionOptions
|
|
226
|
+
): Promise<LLMRelationshipResult>
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Check if the provider is available and configured
|
|
230
|
+
*/
|
|
231
|
+
isAvailable(): boolean
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get provider health status
|
|
235
|
+
*/
|
|
236
|
+
getHealthStatus(): Promise<ProviderHealthStatus>
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Run a JSON-only prompt task with custom system/user prompts.
|
|
240
|
+
*/
|
|
241
|
+
generateJson(
|
|
242
|
+
systemPrompt: string,
|
|
243
|
+
userPrompt: string
|
|
244
|
+
): Promise<{
|
|
245
|
+
rawResponse: string
|
|
246
|
+
tokensUsed?: { prompt: number; completion: number; total: number }
|
|
247
|
+
provider: LLMProviderType
|
|
248
|
+
}>
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Options for memory extraction
|
|
253
|
+
*/
|
|
254
|
+
export interface ExtractionOptions {
|
|
255
|
+
/** Container tag for context */
|
|
256
|
+
containerTag?: string
|
|
257
|
+
|
|
258
|
+
/** Minimum confidence threshold (0-1) */
|
|
259
|
+
minConfidence?: number
|
|
260
|
+
|
|
261
|
+
/** Maximum memories to extract */
|
|
262
|
+
maxMemories?: number
|
|
263
|
+
|
|
264
|
+
/** Whether to include entity extraction */
|
|
265
|
+
extractEntities?: boolean
|
|
266
|
+
|
|
267
|
+
/** Whether to include keyword extraction */
|
|
268
|
+
extractKeywords?: boolean
|
|
269
|
+
|
|
270
|
+
/** Additional context for extraction */
|
|
271
|
+
context?: string
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Options for relationship detection
|
|
276
|
+
*/
|
|
277
|
+
export interface RelationshipDetectionOptions {
|
|
278
|
+
/** Maximum relationships to return */
|
|
279
|
+
maxRelationships?: number
|
|
280
|
+
|
|
281
|
+
/** Minimum confidence threshold */
|
|
282
|
+
minConfidence?: number
|
|
283
|
+
|
|
284
|
+
/** Container tag filter */
|
|
285
|
+
containerTag?: string
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Provider health status
|
|
290
|
+
*/
|
|
291
|
+
export interface ProviderHealthStatus {
|
|
292
|
+
/** Whether the provider is healthy */
|
|
293
|
+
healthy: boolean
|
|
294
|
+
|
|
295
|
+
/** Provider type */
|
|
296
|
+
provider: LLMProviderType
|
|
297
|
+
|
|
298
|
+
/** Latency of last request in ms */
|
|
299
|
+
latencyMs?: number
|
|
300
|
+
|
|
301
|
+
/** Error message if unhealthy */
|
|
302
|
+
error?: string
|
|
303
|
+
|
|
304
|
+
/** Last successful request timestamp */
|
|
305
|
+
lastSuccess?: Date
|
|
306
|
+
|
|
307
|
+
/** Rate limit info if available */
|
|
308
|
+
rateLimit?: {
|
|
309
|
+
remaining: number
|
|
310
|
+
reset: Date
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ============================================================================
|
|
315
|
+
// Cache Types
|
|
316
|
+
// ============================================================================
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Cache entry for LLM responses
|
|
320
|
+
*/
|
|
321
|
+
export interface CacheEntry<T> {
|
|
322
|
+
/** Cached value */
|
|
323
|
+
value: T
|
|
324
|
+
|
|
325
|
+
/** When this entry was created */
|
|
326
|
+
createdAt: Date
|
|
327
|
+
|
|
328
|
+
/** When this entry expires */
|
|
329
|
+
expiresAt: Date
|
|
330
|
+
|
|
331
|
+
/** Hash of the input that generated this entry */
|
|
332
|
+
inputHash: string
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Cache configuration
|
|
337
|
+
*/
|
|
338
|
+
export interface CacheConfig {
|
|
339
|
+
/** Whether caching is enabled */
|
|
340
|
+
enabled: boolean
|
|
341
|
+
|
|
342
|
+
/** Time-to-live in milliseconds */
|
|
343
|
+
ttlMs: number
|
|
344
|
+
|
|
345
|
+
/** Maximum cache size */
|
|
346
|
+
maxSize: number
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// ============================================================================
|
|
350
|
+
// Error Types
|
|
351
|
+
// ============================================================================
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* LLM-specific error codes
|
|
355
|
+
*/
|
|
356
|
+
export const LLMErrorCode = {
|
|
357
|
+
/** Provider is not available */
|
|
358
|
+
PROVIDER_UNAVAILABLE: 'LLM_PROVIDER_UNAVAILABLE',
|
|
359
|
+
/** Rate limit exceeded */
|
|
360
|
+
RATE_LIMITED: 'LLM_RATE_LIMITED',
|
|
361
|
+
/** Invalid API key */
|
|
362
|
+
INVALID_API_KEY: 'LLM_INVALID_API_KEY',
|
|
363
|
+
/** Timeout */
|
|
364
|
+
TIMEOUT: 'LLM_TIMEOUT',
|
|
365
|
+
/** Invalid response format */
|
|
366
|
+
INVALID_RESPONSE: 'LLM_INVALID_RESPONSE',
|
|
367
|
+
/** Content filtered */
|
|
368
|
+
CONTENT_FILTERED: 'LLM_CONTENT_FILTERED',
|
|
369
|
+
/** Token limit exceeded */
|
|
370
|
+
TOKEN_LIMIT_EXCEEDED: 'LLM_TOKEN_LIMIT_EXCEEDED',
|
|
371
|
+
} as const
|
|
372
|
+
|
|
373
|
+
export type LLMErrorCodeType = (typeof LLMErrorCode)[keyof typeof LLMErrorCode]
|